diff --git a/strkit/call/call_locus.py b/strkit/call/call_locus.py index d81df97..14b163b 100644 --- a/strkit/call/call_locus.py +++ b/strkit/call/call_locus.py @@ -463,7 +463,7 @@ def call_alleles_with_incorporated_snvs( read_dict_extra: dict[str, dict], n_reads_in_dict: int, # We could derive this again, but we already have before... useful_snvs: list[tuple[int, int]], - candidate_snvs_dict: CandidateSNVs, + candidate_snvs: CandidateSNVs, # --- snv_quality_threshold: int, # --- @@ -656,7 +656,7 @@ def call_alleles_with_incorporated_snvs( n_alleles, read_dict, useful_snvs, - candidate_snvs_dict, + candidate_snvs, # --- snv_quality_threshold, # --- @@ -909,10 +909,10 @@ def call_locus( # Find candidate SNVs, if we're using SNV data - candidate_snvs_dict: Optional[CandidateSNVs] = None # Lookup dictionary for candidate SNVs by position + candidate_snvs: Optional[CandidateSNVs] = None # Lookup dictionary for candidate SNVs by position if n_overlapping_reads and should_incorporate_snvs and snv_vcf_file: # ^^ n_overlapping_reads check since otherwise we will have invalid left/right_most_coord - candidate_snvs_dict = snv_vcf_file.get_candidate_snvs( + candidate_snvs = snv_vcf_file.get_candidate_snvs( snv_vcf_contigs, snv_vcf_file_format, contig, left_most_coord, right_most_coord ) @@ -1309,7 +1309,7 @@ def call_locus( read_dict_extra, read_q_coords, read_r_coords, - candidate_snvs_dict, + candidate_snvs, params.min_allele_reads, significant_clip_snv_take_in, only_known_snvs, @@ -1329,7 +1329,7 @@ def call_locus( read_dict_extra=read_dict_extra, n_reads_in_dict=n_reads_in_dict, useful_snvs=useful_snvs, - candidate_snvs_dict=candidate_snvs_dict, + candidate_snvs=candidate_snvs, # --- snv_quality_threshold=snv_min_base_qual, # --- diff --git a/strkit/call/repeats.py b/strkit/call/repeats.py index 1c6e8f3..c737cde 100644 --- a/strkit/call/repeats.py +++ b/strkit/call/repeats.py @@ -40,15 +40,13 @@ def score_ref_boundaries(db_seq: str, tr_candidate: str, flank_left_seq: str, fl # Always assign parasail results to variables due to funky memory allocation behaviour ext_r_seq = f"{flank_left_seq}{tr_candidate}" - r_fwd = parasail.sg_de_scan_sat( - ext_r_seq, db_seq, indel_penalty, indel_penalty, dna_matrix) + r_fwd = parasail.sg_de_scan_sat(ext_r_seq, db_seq, indel_penalty, indel_penalty, dna_matrix) r_adj = r_fwd.end_ref + 1 - len(flank_left_seq) - ref_size # Amount to tweak boundary on the right side by db_seq_rev = db_seq[::-1] ext_l_seq = f"{tr_candidate}{flank_right_seq[max(r_adj, 0):]}"[::-1] # reverse - r_rev = parasail.sg_de_scan_sat( - ext_l_seq, db_seq_rev, indel_penalty, indel_penalty, dna_matrix) + r_rev = parasail.sg_de_scan_sat(ext_l_seq, db_seq_rev, indel_penalty, indel_penalty, dna_matrix) l_adj = r_rev.end_ref + 1 - len(flank_right_seq) - ref_size # Amount to tweak boundary on the left side by return (r_fwd.score, r_adj), (r_rev.score, l_adj) diff --git a/strkit/call/snvs.py b/strkit/call/snvs.py index 2ba9de5..2f21b0c 100644 --- a/strkit/call/snvs.py +++ b/strkit/call/snvs.py @@ -27,7 +27,7 @@ def call_and_filter_useful_snvs( n_alleles: int, read_dict: dict[str, ReadDict], useful_snvs: list[tuple[int, int]], - candidate_snvs_dict: CandidateSNVs, + candidate_snvs: CandidateSNVs, # --- snv_quality_threshold: int, # --- @@ -42,7 +42,7 @@ def call_and_filter_useful_snvs( :param n_alleles: The number of alleles called for this locus. :param read_dict: Dictionary of read data. Must already have peaks assigned. :param useful_snvs: List of tuples representing useful SNVs: (SNV index, reference position) - :param candidate_snvs_dict: A dictionary of useful SNVs, indexed by reference position. Used to look up IDs. + :param candidate_snvs: A dictionary of useful SNVs, indexed by reference position. Used to look up IDs. :param snv_quality_threshold: Minimum PHRED score needed to incorporate a read base into the genotype. :param snv_genotype_cache: Cache for SNV genotype/phase set information. :param locus_log_str: Locus string representation for logging purposes. @@ -134,7 +134,7 @@ def call_and_filter_useful_snvs( logger_.warning(f"{locus_log_str} - for SNV position {u_ref}: got degenerate call {call} from {peak_counts=}") skipped = True - snv_rec = candidate_snvs_dict.get(u_ref) + snv_rec = candidate_snvs.get(u_ref) if snv_rec is not None: snv_id = snv_rec["id"] if snv_id == ".":