MatthewRalston / kmerdb

Python bioinformatics CLI for k-mer counts and de Bruijn graphs
https://matthewralston.github.io/kmerdb
Apache License 2.0
12 stars 1 forks source link

__init__.py has duplicate storage of kmerid [smell] #114

Open MatthewRalston opened 9 months ago

MatthewRalston commented 9 months ago

idx from enumerate loop is also the k-mer id. No need for kmer_ids[i] OR kmer_ids[idx]. Hesitating to fix until more info or refactoring proceeds.

See init.py#L1241

                        print("{0}\t{1}\t{2}\t{3}".format(i, kmer_ids[idx], counts[idx], frequencies[idx]))
                    kdb_out.write("{0}\t{1}\t{2}\t{3}\t{4}\n".format(i, kmer_ids[idx], counts[idx], frequencies[idx], json.dumps(kmer_metadata)))

kmer_ids[idx] == idx

Please fix.