Skip to content

Commit

Permalink
Merge branch 'medvir:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
MaryamZaheri authored Sep 19, 2023
2 parents 76ac932 + 06f7232 commit f0bc64d
Show file tree
Hide file tree
Showing 5 changed files with 223 additions and 137 deletions.
6 changes: 3 additions & 3 deletions src/minvar/annotate.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,10 @@
os.sys.path.insert(1, dn_dir)
mod = __import__('minvar')
sys.modules["minvar"] = mod
from common import h77_map, consensus_B_map, d2a, coverage_threshold
from common import h77_map, consensus_B_map, d2a, coverage_threshold, AMBIGUITY_THRESHOLD
from Alignment import needle_align, alignfile2dict
else:
from .common import h77_map, consensus_B_map, d2a, coverage_threshold
from .common import h77_map, consensus_B_map, d2a, coverage_threshold, AMBIGUITY_THRESHOLD
from .Alignment import needle_align, alignfile2dict


Expand Down Expand Up @@ -416,7 +416,7 @@ def df_2_ambiguous_sequence(df_in, cov_df=None):
"""
assert 'freq' in df_in.columns
# select calls with freq > 15%
df_in = df_in[df_in['freq'] >= 0.15]
df_in = df_in[df_in['freq'] >= AMBIGUITY_THRESHOLD]
# aggregate calls for the same position
all_nt = df_in.groupby(['pos']).agg({'mut': lambda x: ''.join(sorted(x))})
# create a columng of ambiguous bases * so insertion is not considered because only the first nc is returned
Expand Down
2 changes: 2 additions & 0 deletions src/minvar/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
MIN_FRACTION = 0.015
RAW_DEPTH_THRESHOLD = 50
coverage_threshold = 100
AMBIGUITY_THRESHOLD = 0.15
APD_THRESHOLD = 0.01

# This must be updated when new masterComments files are downloaded into src/minvar/db/HIV
mastercomments_version = 'HIVdb version 8.4 (last updated 2017-06-16)'
Expand Down
Loading

0 comments on commit f0bc64d

Please sign in to comment.