Fastq Filter
Problem Description
Build a CLI tool fastq_filter
that filters a gzipped fastq file based on length and gc content. The output should be a filtered and gzipped fastq file.
Expected command:
fastq_filter --fastq <file.fastq.gz> --outfile <filtered.fastq.gz> --min_len <usize> --max_len <usize> --min_gc <f32> --max_gc <f32>
Checklist
-
Figure out how to read a gzipped file using
Flate2
. -
Figure out out how write a needletail
SequenceRecord
to a targetoutput.fastq.gz
file.
Suggested Rust Crates
- Clap - argument parsing.
- Needletail - reading fastq files.
- Flate2 - compression/decompression.
Code Examples
Extra Credit
- Add functionality to also filter on mean error rate.
-
Handle only files with extensions
.fastq.gz
,.fq.gz
. - Graceful error handling.