add linked sequence formats, type, tests#388
Conversation
|
@ebolyen I added |
| with ff.open() as fh: | ||
| for id_, seq in data.items(): | ||
| sequence = skbio.Sequence( | ||
| str(seq), metadata={'id': id_}, lowercase=False | ||
| ) | ||
| skbio.io.write(sequence, format='fasta', into=fh) |
There was a problem hiding this comment.
One nitpick I guess, is it beneficial to optimize this so we aren't calling write for every line? Idk how clever skbio.io.write is, but generally it seems wasteful to write each line individually instead of one big write.
There was a problem hiding this comment.
it should write it as fast as any other loop, there's an internal C buffer in Python that is actually queuing up ~8kb blocks and dumping those at once (this is why .flush() exists and .tell() is mostly useless)
No description provided.