#fastq #gz #k-mer #read #hash #fastx

fastxgz

A fasta/fastq parser for both compressed and not compressed files

4 releases (breaking)

0.4.0 Aug 27, 2024
0.3.0 Nov 14, 2023
0.2.0 Sep 26, 2023
0.1.0 Sep 18, 2023

#6 in #gz

AGPL-3.0

17KB
373 lines

fastxgz

fastx parser for rust. Supports both Gz and not gz files.

Description

This parser can iterate over the reads of a fasta/fastq file, potentially compressed (gz). Compressed files should end in ".gz". This parser can also iterate over the k-mers of every read, or even the hash of these k-mers.

Please see the rust documentation for details and examples.

This parser is meant to be convenient to use. Though not meant to be fast, its speed for enumerating the lines of a fastq file from an SSD on a laptop is only 28% slower than wc -l.

How to use this

Simply add the following to your Cargo.toml file:

[dependencies]
fastxgz = "{X}.{Y}.{Z}"  # Please check and use the newest version

then:

use fastxgz::fasta_reads;

let reads = fasta_reads("data/tests/test.fa").expect("The file cannot be opened.");
for read in reads {
    println!("{}", read);
}

Dependencies

~420KB