Skip to content

Commit

Permalink
do not use previous cstats if NaN is present
Browse files Browse the repository at this point in the history
  • Loading branch information
jluebeck committed Jul 22, 2022
1 parent d0db133 commit 568626a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/AmpliconArchitect.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@

from time import time
TSTART = time()
import numpy as np
import pysam
import argparse
import sys
Expand Down Expand Up @@ -178,7 +179,7 @@ def process(self, msg, kwargs):
cstats = tuple(map(float, ll[1:]))
if len(cstats) < 15 or int(round(cstats[11])) < args.pair_support_min:
cstats = None
elif cstats[13] != args.insert_sdevs or bamfile_filesize != int(cstats[14]):
elif cstats[13] != args.insert_sdevs or bamfile_filesize != int(cstats[14]) or any(np.isnan(cstats)):
cstats = None

coverage_stats_file.close()
Expand Down
2 changes: 1 addition & 1 deletion src/amplified_intervals.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@
bamfile_filesize = os.path.getsize(bamfile_pathname)
if ll[0] == os.path.abspath(bamfile_pathname):
cstats = tuple(map(float, ll[1:]))
if len(cstats) < 15 or cstats[13] != 3 or bamfile_filesize != int(cstats[14]):
if len(cstats) < 15 or cstats[13] != 3 or bamfile_filesize != int(cstats[14]) or any(np.isnan(cstats)):
cstats = None

coverage_stats_file.close()
Expand Down

0 comments on commit 568626a

Please sign in to comment.