#compression #parser #gz #fastq #read #hash #line

fastxgz

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

3 releases (breaking)

0.3.0 Nov 14, 2023
0.2.0 Sep 26, 2023
0.1.0 Sep 18, 2023

#192 in Biology

Download history 3/week @ 2024-02-13 17/week @ 2024-02-20 8/week @ 2024-02-27 1/week @ 2024-03-05 1/week @ 2024-03-12 10/week @ 2024-03-26 45/week @ 2024-04-02

55 downloads per month

AGPL-3.0

17KB
398 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

~400KB