Closed DarianHole closed 5 years ago
Previous bugfix should probably be implemented before this one is
I currently have the kmer check before the automaton creation but isolated so it parses the scheme fasta twice. This is due to the way I have it keeping track of the number of kmers.
I assume I should try to put the check into the automaton creation instead to lower run times and a better code. I'll see if I can create a solution for this
I'll throw the code here, let me know which way is wanted. This method can check in automaton so we don't have to parse the scheme twice. however the tradeoff is that we make the kmers as we go and then cut off if we get to too high a number. I'm not sure which way is faster.
def check_total_kmers(kmer, total):
kmer_number = 1
for char in kmer:
length_key = len(d[char])
kmer_number = kmer_number * length_key
total = total + kmer_number
if total > 150:
return logging.error('Did it work?')
return total
total = 0
for kmer in kmers:
total = check_total_kmers(kmer, total)
Addressing Issue #60:
Added: