[Biopython] FASTQ to qual+fasta

Peter Cock p.j.a.cock at googlemail.com
Mon Jan 17 07:30:44 EST 2011


On Sun, Jan 16, 2011 at 10:58 PM, Peter wrote:
>>> Using SeqIO.convert(...) in this case does use optimised code for FASTQ
>>> to FASTA, but currently we don't have a similar fast FASTQ to QUAL
>>> function. See Bio/SeqIO/_convert.py if you want to know how this is
>>> implemented. I can see several tricks for FASTQ to QUAL which should
>>> work... do you fancy trying this yourself?
>>
>> I wish I had the time.... :(
>
> I can picture how I'd solve this - it shouldn't take me too long.

Done:

https://github.com/biopython/biopython/commit/e26030a290b6acdf5a5fc431056593cccc5d892a

This makes FASTQ to QUAL about three times faster. There is
probably scope for speeding up how we do the line wrapping in
QUAL output - both in the the normal SeqRecord based code
called by Bio.SeqIO.write() and in the new optimised code for
Bio.SeqIO.convert().

I'd still like to see your itertools.tee solution and your timings of it
against calling Bio.SeqIO.convert twice.

Peter


More information about the Biopython mailing list