nucgen
A fast and simple configurable nucleotide generator for testing bioinformatics tools with random fasta and fastq files.
All nucleotides {A,C,T,G} are generated randomly with equal probability.
Installation
Usage (CLI)
All the options are configurable via the command line.
You can see the available options by running:
Examples
Generate 10,000 reads of length 100bp in a FASTQ format and output to stdout:
Generate a paired-end dataset of 100 reads with R1 length 30 and R2 length 50. Output as FASTA format and write to files in gzip format.
Seed the random number generator with a specific value:
Usage (Library)
Add nucgen as a dependency in your Cargo.toml:
You can use the Sequence struct to generate random nucleotide sequences:
use ;
// Generate a cursor to write the output to
let mut out = new;
// Initialize the random number generator
let mut rng = thread_rng;
// Initialize the sequence struct
let mut seq = new;
// Generate 100 random nucleotides into the sequence
seq.fill_buffer;
// Write the sequence to the output cursor
write_fasta?;
// Generate another 100 random nucleotides
seq.fill_buffer;
// Write the second sequence to the output cursor
write_fasta?;