#fastq #bioinformatics #generate #random #fasta #numbers #generator

no-std bin+lib fastq-generator

A fastq generator for generation of synthetic fastq files

3 releases

0.1.1 Feb 8, 2025
0.1.0 Feb 8, 2025

#92 in Biology

Download history 303/week @ 2025-02-04 31/week @ 2025-02-11

334 downloads per month

MIT license

41KB
624 lines

fastq-generator

Rust Version crates.io Documentation Dependency Status

A simple cli tool for generating fastq files.

Table of Contents

This project started at a time when I needed to generate a large number of fastq files quickly and with a large number of reads. I wanted a simple tool that could generate fastq files with a large number of reads quickly. I also wanted to learn more about Rust and how to write a simple CLI tool in Rust. This project is the result of that. As this is my first time writing in Rust, I am sure there are many things that could be done better. I am open to suggestions and PRs.

Installation

fastq-generator is a single binary that must be placed somewhere in your $PATH. One can either download 64-bit Linux binaries from the Release Page or one can also compile from source.

Compile from Source

Ensure you have a Rust toolchain installed. Some of the dependencies also require gcc to be installed.

$ git clone https://github.com/michaelbest55/fastq-generator
$ cd fastq-generator
$ cargo build --release
$ sudo cp target/release/fastq-generator /usr/local/bin/

Usage

# Reverse complement
fastq_generator reverse_complement --input path/to/input.fasta --output path/to/output.fasta

# Generate a FASTA file
fastq_generator generate_fasta --sequence-size 100 --nb-seq 10 --output path/to/output.fasta

# Generate random single-end FASTQ
fastq_generator generate_random_fastq_se --sequence-size 50 --nb-seq 5 --output path/to/output.fastq

# Generate random paired-end FASTQ
fastq_generator generate_random_fastq_pe --sequence-size 50 --nb-seq 5 --output path/to/output.fastq

# Generate mapped single-end FASTQ
fastq_generator generate_mapped_fastq_se --ref-fasta path/to/reference.fasta --sequence-size 75 --coverage 10 --output path/to/output.fastq

# Generate mapped paired-end FASTQ
fastq_generator generate_mapped_fastq_pe --ref-fasta path/to/reference.fasta --sequence-size 75 --coverage 10 --insertion-size 300 --output path/to/output.fastq

License

This crate is licensed under MIT license.

Dependencies

~4–12MB
~155K SLoC