Skip to content

Commit

Permalink
Check sooner for HIV BLAST match, and fix low coverage check.
Browse files Browse the repository at this point in the history
  • Loading branch information
donkirkby committed Jun 7, 2021
1 parent 017929a commit 4bd76cc
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
3 changes: 1 addition & 2 deletions gene_splicer/outcome_summary.py
Original file line number Diff line number Diff line change
Expand Up @@ -292,8 +292,7 @@ def reduce(self):
error_row['fail_rev_err_0'] in primer_errors):
self.data[sample]['error'] = self.errors.primer_error
# Case 6
elif (error_row['fail_fwd_err_0'] == self.errors.low_internal_cov or
error_row['fail_rev_error_0'] == self.errors.low_internal_cov):
elif error_row['fail_error_0'] == self.errors.low_internal_cov:
self.data[sample]['error'] = self.errors.low_internal_cov
else:
# Case 7, 8, 9
Expand Down
18 changes: 9 additions & 9 deletions gene_splicer/primer_finder.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,15 @@ def find_primers(
contig_seq: str = row.get('contig') or row['sequence']
contig_seq = contig_seq.upper()

if 'HIV' in seed_name:
non_hiv_rows = None
elif non_hiv_rows is not None:
new_row['error'] = errors.non_hiv
non_hiv_rows.append(new_row)
continue
else:
continue

# If percent consensus cutoff is not max, skip
if conseq_cutoff and conseq_cutoff != 'MAX':
new_row['error'] = errors.not_max
Expand Down Expand Up @@ -208,15 +217,6 @@ def find_primers(
new_row['seqlen'] = len(contig_seq)
new_row['sequence'] = contig_seq

if 'HIV' in seed_name:
non_hiv_rows = None
elif non_hiv_rows is not None:
new_row['error'] = errors.non_hiv
non_hiv_rows.append(new_row)
continue
else:
continue

# Determine if sequence has non-tcga characters
found_non_tcga = re.findall(non_tcga, contig_seq)
mixtures = len([x for x in found_non_tcga if x[0].upper() != 'X'])
Expand Down

0 comments on commit 4bd76cc

Please sign in to comment.