In all fairness, BioPython may be slow for parsing FASTQ records because it decodes the FASTQ qualities into a list of integers.
To the best of my understanding, your library does not decode the FASTQ qualities
If all one needs is to read in four-line records from FASTQ format, then the fastest and simplest Python implementation I can think of would be something like:
import sys
stream = sys.stdin
for name in stream:
name = name.strip()[1:]
seq = next(stream).strip()
tmp = next(stream).strip()
qual = next(stream).strip()
print(name, len(seq))
An iterator requires no installation, has no memory overhead, and is likely very fast, since it uses well-optimized internal implementations.
You should benchmark your solution relative to comparable solutions, rather than against a solution that performs a much more difficult task.
Do you want to say a little bit about _why_ they should try out this library, rather than something like kseq, kseqpp, etc.?
Here are a few reasons why I recommend using it:
1. No macro definition required
You only need to include the header file to use it, without the need for macro definitions, as shown below
2. No need to manually release memory
SeqioRead will automatically release memory, so you don't need to manually release memory to avoid memory leaks.
3. Intuitive API
Using it is like using a regular file, only opening, reading, and closing are required, without the need for internal implementation of relationships.
4. Support read and write of compressed files
Support reading and writing compressed files, you don't need to worry about whether the file is compressed or uncompressed, just set the parameters.
5. Both C and C++ can use it
I would recommend you provide Python binding.
Great suggestion, I will try to implement it.
Hi, I have implemented this python library.
Hello, everyone. I built a python library named
fastseqioon top ofseqio. It supports to write and read fasta/fastq files. Very fast parse tool.Now fastseqio's python package supports windows/macos/linux.
https://pypi.org/project/fastseqio/#description