#bioinformatics #parallel #sequence #order #matter #speed #fasta-fastq

nightly bin+lib rust-parallelfastx

Parallel iteration of FASTA/FASTQ files, for when sequence order doesn't matter but speed does

2 releases

0.1.1 Oct 6, 2022
0.1.0 Oct 6, 2022

#213 in Biology

Download history 10/week @ 2024-02-23 13/week @ 2024-03-01 40/week @ 2024-03-08

63 downloads per month

MIT/Apache

9KB
64 lines

Rust-parallelfastx

A truly parallel parser for FASTA/FASTQ files.

Principle

The input file is memory-mapped then virtually split into N chunks. Each chunk is fed to a regular FASTA/FASTQ parser (here, the excellent https://github.com/markschl/seq_io library).

Rationale

Virtually all other "multithreaded" FASTA/FASTQ parsers typically use only one thread to parse the file, then they feed the parsed sequences to threads. If your disk is fast enough (> 2 GB/s) that parsing the file becomes a CPU bottleneck, then you might benefit from this library as the parsing is truly multithreaded.

How to use

see src/main.rs, should be self explanatory.

Inspiration

Inspiration for this repository is the amazing fastlwc-mt tool from https://github.com/expr-fi/fastlwc which does multi-threaded line counting.

Caveat

Input file needs to be seekable, which rules out all compression methods except blocked ones, which currently aren't supported by this library, but could be in principle.

Author

Rayan Chikhi, 2022

Dependencies

~1.2–2.2MB
~41K SLoC