diff --git a/neat/models/mutation_model.py b/neat/models/mutation_model.py index 9c7a3074..ffc6ddcf 100644 --- a/neat/models/mutation_model.py +++ b/neat/models/mutation_model.py @@ -75,8 +75,6 @@ def __init__(self, self.variant_probs = variant_probs self.transition_matrix = transition_matrix self.is_cancer = is_cancer - self.all_dels = [] - self.all_ins = [] def get_mutation_type(self, rng: Generator) -> VariantTypes: """ @@ -125,7 +123,6 @@ def generate_snv(self, trinucleotide: Seq, reference_location: int, rng: Generat # Now pick a random alternate, weighted by the probabilities alt = rng.choice(ALLOWED_NUCL, p=transition_probs) temp_snv = SingleNucleotideVariant(reference_location, alt=alt) - self.all_ins.append(temp_snv) return temp_snv def generate_insertion(self, location: int, ref: Seq, rng: Generator) -> Insertion: @@ -158,5 +155,4 @@ def generate_deletion(self, location: int, rng: Generator) -> Deletion: # Plus one so we make sure to grab the first base too. # Note: if we happen to go past the end of the sequence, it will just be shorter. temp_del = Deletion(location, length) - self.all_dels.append(temp_del) return temp_del diff --git a/neat/read_simulator/utils/generate_variants.py b/neat/read_simulator/utils/generate_variants.py index 4a29962b..6f3a5af6 100644 --- a/neat/read_simulator/utils/generate_variants.py +++ b/neat/read_simulator/utils/generate_variants.py @@ -238,6 +238,8 @@ def generate_variants( location = local_location + ref_start # relative to overall contig if local_location == 0: continue + # local_location is the center (mutated) base returned by sample_trinucs; + # shift slice left by 1 so trinuc[0]=5' flank, trinuc[1]=ref base, trinuc[2]=3' flank trinuc = reference[local_location-1: local_location+2].seq.upper() disallowed_chars = False for letter in trinuc: