Skip to content

Commit

Permalink
Merge pull request #2 from peterk87/patch/fix-div-by-zero-variants-dp
Browse files Browse the repository at this point in the history
Patch to fix division by zero error due to variants with DP values of 0
  • Loading branch information
peterk87 authored Mar 29, 2021
2 parents 5988ecc + b85c29a commit aeed190
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 0.2.0
current_version = 0.2.1
commit = True
tag = True

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,6 @@
test_suite='tests',
tests_require=test_requirements,
url='https://github.com/peterk87/xlavir',
version='0.2.0',
version='0.2.1',
zip_safe=False,
)
2 changes: 1 addition & 1 deletion xlavir/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

__author__ = """Peter Kruczkiewicz"""
__email__ = 'peter.kruczkiewicz@gmail.com'
__version__ = '0.2.0'
__version__ = '0.2.1'
1 change: 1 addition & 0 deletions xlavir/tools/variants.py
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,7 @@ def parse_longshot_vcf(df: pd.DataFrame, sample_name: str = None) -> Optional[pd
df_longshot_info.reset_index(inplace=True)
df_merge = pd.merge(df, df_longshot_info, on='POS')
df_merge['sample'] = sample_name
df_merge = df_merge[df_merge.DP > 0]
df_merge['ALT_FREQ'] = df_merge.ALT_DP / df_merge.DP
cols_to_keep = list({col for col, _, _ in variants_cols} & set(df_merge.columns))
return df_merge.loc[:, cols_to_keep]
Expand Down

0 comments on commit aeed190

Please sign in to comment.