Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions neat/models/mutation_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
"""
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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
2 changes: 2 additions & 0 deletions neat/read_simulator/utils/generate_variants.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Loading