diff --git a/gene_splicer/outcome_summary.py b/gene_splicer/outcome_summary.py index e8d9026..aed394f 100644 --- a/gene_splicer/outcome_summary.py +++ b/gene_splicer/outcome_summary.py @@ -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 diff --git a/gene_splicer/primer_finder.py b/gene_splicer/primer_finder.py index 94782a3..ec2225d 100644 --- a/gene_splicer/primer_finder.py +++ b/gene_splicer/primer_finder.py @@ -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 @@ -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'])