I am checking RSCU() method and it seems to me that small performance improvement is possible in codon counting. It should be faster to once call upper() method for a sequence than for each of it's codons separately.
Lines ~80, adding line like sequences = [s.upper() for s in sequences] can improve perf.
Simple check shows ~30% improvements:
python3 -m timeit 'x = ("a"*300000); [x[i: i+3].upper() for i in range(0, len(x), 3)]'
10 loops, best of 3: 21.3 msec per loop
python3 -m timeit 'x = ("a"*300000).upper(); [x[i: i+3] for i in range(0, len(x), 3)]'
100 loops, best of 3: 14.5 msec per loop
I am checking RSCU() method and it seems to me that small performance improvement is possible in codon counting. It should be faster to once call upper() method for a sequence than for each of it's codons separately.
Lines ~80, adding line like
sequences = [s.upper() for s in sequences]can improve perf.Simple check shows ~30% improvements: