Comments (6)
Thank you for your posting. Pyfastx aims to enable random access to reads from FASTQ files which depends on an index file. If index file does not exists, pyfastx will build an index file when the FASTQ file is first opened. This step may consume much more time. When you open file again and read sequences, it will be very fast to iterate sequences and comparable to iteration without index. For gzipped file, in addition to positional index, it also will build seek point index for accelerating gzip seek operation.
from pyfastx.
Thanks for the quick reply.
When nothing is done with the reads except adding them to a list, pyfastx performs as expected. However, when the read attributes are accessed while processing the file (e.g. to filter based on quality) performance is very poor.
In my testing, the uncompressed file took 1m 5s wall time to build the index and process the full file, but the gzip-compressed version reliably failed to complete in less than an hour. This seemed to be the case whether or not a new index was built.
from pyfastx.
Thank you for reporting this hidden performance problem!
For iteration of reads from gzipped FASTQ file, each read was read by seeking to the start position and then read content using zran_read in zran.c. However, zran_read has a low performance for IO intensive operation which I didn't notice before. In later version, I will add a buffer reader to improve the performance. Thanks again!
from pyfastx.
No problem! Let me know when this is implemented and I'll happily update the examples in my package documentation.
from pyfastx.
We have improved the speed of reading sequence from gzipped FASTQ file in new version 0.6.10
from pyfastx.
@lmdu Just wanted to let you know that I've re-run the benchmarks for my package as part of a new release and pyfastx performance is greatly improved!
from pyfastx.
Related Issues (20)
- Does current pyfastx support py2.7 version? HOT 2
- [Feature Request] Get barcodes from Fastx function HOT 1
- Import Error HOT 3
- Fastx parser vs Fasta/Fastq parsers HOT 2
- Unable to index gzipped fasta file by name: KeyError: 'chrY does not exist in fasta file' HOT 1
- SystemError: <class 'Fasta'> returned a result with an error set; on loading gzipped fasta HOT 2
- Support Python 3.11 on conda? HOT 3
- Unicode error reading large fastq with index? HOT 2
- Cannot read input file with Chinese text in filename HOT 2
- Segmentation fault using .composition on each contig HOT 2
- How to get antisense sequence from any strings ? HOT 1
- Memory leak in Fastq read (probalby .quali) HOT 2
- Pointer being freed was not allocated error with `memory_index=True` HOT 2
- Full Fasta info object without index building HOT 1
- Building/installing `pyfastx` from source is not possible due to zlib upgrade
- Pyfastx.read.raw mangling reads HOT 8
- Making invalid slices return an empty string instead of None HOT 1
- Sequence compostion HOT 2
- read.seq end with read.name when using pyfastx.Fastq in parsing long read FASTQ file HOT 4
- Fetch function can't identify numpy int HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pyfastx.