quickly filter fastq files by matching sequences to a set of regex patterns
Performance
grepq is fast
On a Mac Studio with 32GB RAM and Apple M1 max chip, grepq processed a 104GB fastq file against 30 regex patterns in 88 seconds, about 1.2GB of fastq data per second. For a 874MB fastq file, it was around 4.8 and 450 times faster than the general-purpose regex tools ripgrep and grep, respectively, on the same hardware.
grepq does not match false positives
grepq will only match regex patterns to the sequence part of the fastq file, which is the most common use case. Unlike ripgrep and grep, which will match the regex patterns to the entire fastq record, which includes the record ID, sequence, separator, and quality. This can lead to false positives and slow down the filtering process.
Usage
v0.1.5, ouput from -h option
<PATTERNS> Path )
<FILE> Path
)
)
)
Requirements
grepqhas been tested on Linux and macOS. It might work on Windows, but it has not been tested.- Ensure that Rust is installed on your system (https://www.rust-lang.org/tools/install)
Installation
-
From source
- Clone the repository and
cdinto thegrepqdirectory - Run
cargo build --release - Relative to the cloned parent directory, the executable will be located in
./target/release - Make sure the executable is in your
PATHor use the full path to the executable
- Clone the repository and
-
From Cargo.io (easiest method)
cargo install grepq
Checksums to verify grepq is working correctly, using the regex file regex.txt and the small fastq file small.fastq, both located in the test directory:
Update changes
see CHANGELOG
License
MIT