Skip to content

Commit

Permalink
fixed cov error (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
jonas-fuchs authored Aug 22, 2023
1 parent 9698f2b commit 28f47bb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion virheat/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
"""plot vcf data as a heatmap mapped to a virus genome"""
_program = "virheat"
__version__ = "0.5"
__version__ = "0.5.1"
2 changes: 1 addition & 1 deletion virheat/scripts/data_prep.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ def annotate_non_covered_regions(coverage_dir, min_coverage, frequency_array, fi
coverage = pd.read_csv(tsv_file, sep="\t")
for j, (mutation, frequency) in enumerate(zip(unique_mutations, array)):
mut_pos = int(mutation.split("_")[0])
if all([frequency == 0, coverage[coverage["pos"] == mut_pos]["coverage"].iloc[0] <= min_coverage]):
if coverage[coverage["pos"] == mut_pos].empty or all([frequency == 0, coverage[coverage["pos"] == mut_pos]["coverage"].iloc[0] <= min_coverage]):
frequency_array[i][j] = np.NAN

return np.ma.array(frequency_array, mask=np.isnan(frequency_array))
Expand Down

0 comments on commit 28f47bb

Please sign in to comment.