fastx_read
from mappy
I realize (27/08/2020) that I hadn't added a benchmark for fastx_read
from mappy which I regularly use since quite some time already:
$ time python3 -c "from mappy import fastx_read; print(sum(seq.count('A') for (_, seq, _) in fastx_read('genome.fa')))"
32371810
real 0m0.731s
user 0m0.648s
sys 0m0.080s
$ time python3 -c "from pyfastx import Fastq; print(sum(seq.count('N') for (_, seq, _) in Fastq('SRR077487_2.filt.fastq.gz', build_index=False)))"
306072
real 0m51.140s
user 0m50.784s
sys 0m0.352s
fastx_read
from mappy (added 27/08/2020)
$ time python3 -c "from mappy import fastx_read; print(sum(seq.count('N') for (_, seq, _) in fastx_read('SRR077487_2.filt.fastq.gz')))"
306072
real 0m52.336s
user 0m52.024s
sys 0m0.300s
(Update 27/08/2020) pyfastx seemsand mappy seem quite convenient too, and are only slightly slower than pyGATB.