FASTQ helpers¶
FASTQ helpers provide utilities for format conversion, read-length filtering and summarization, quality-score checking, trimming, splitting, and simulation.
Command summary¶
| Command | Function | Main output |
|---|---|---|
fq2fa |
Convert FASTQ to FASTA. | FASTA file. |
fq2txt |
Extract read sequences from FASTQ. | Plain-text sequence file. |
fq_len_flt |
Filter FASTQ reads by length. | Kept FASTQ and dropped FASTQ. |
fq_len_sum |
Summarize read-length distribution for one FASTQ file. | Length-count table. |
fq_length |
Summarize read lengths for one or more FASTQ/FASTQ.GZ files. | Multi-sample length-count table. |
fq_split |
Split an interleaved FASTQ file into paired FASTQ files. | R1/R2 FASTQ files. |
fq_trim |
Trim FASTQ reads to a fixed length. | Trimmed FASTQ file. |
phred_quality |
Infer quality-score encoding from FASTQ quality characters. | Quality format report printed to stdout. |
simulate_fastq |
Generate simulated FASTQ reads. | Simulated FASTQ file. |
fq2fa¶
Function¶
Convert FASTQ records to FASTA format. By default, the original FASTQ read names are preserved. With -n, records are renamed sequentially as t1, t2, and so on.
Parameters¶
| Parameter | Meaning |
|---|---|
-i |
Input FASTQ file. |
-o |
Output FASTA file. |
-n |
Assign new sequential read IDs. |
-v, --version |
Print script version. |
Examples¶
fq2txt¶
Function¶
Extract only the sequence line from each FASTQ record and write one sequence per line.
Parameters¶
| Parameter | Meaning |
|---|---|
-i |
Input FASTQ file. |
-o |
Output TXT file. |
-v, --version |
Print script version. |
Example¶
fq_len_flt¶
Function¶
Filter FASTQ reads by sequence length. Reads within the specified length range are written to the output FASTQ file; reads outside the range are written to an additional dropped-read file named <output>.drop.
Parameters¶
| Parameter | Meaning |
|---|---|
-i |
Input FASTQ file. |
-o |
Output FASTQ file for retained reads. |
-m |
Minimum read length. |
-M |
Maximum read length. |
-v, --version |
Print script version. |
Example¶
Output files:
fq_len_sum¶
Function¶
Summarize read-length distribution for a single FASTQ file.
Parameters¶
| Parameter | Meaning |
|---|---|
-i |
Input FASTQ file. |
-o |
Output TXT/TSV file. |
-v, --version |
Print script version. |
Example¶
Output format:
fq_length¶
Function¶
Count read lengths for one or more FASTQ or FASTQ.GZ files and merge the results into one table.
Parameters¶
| Parameter | Meaning |
|---|---|
-i, --input |
One or more FASTQ/FASTQ.GZ files. |
-o, --output |
Output file name. Default: fq_length_distr.txt. |
Example¶
Output columns:
fq_split¶
Function¶
Intended to split an interleaved FASTQ file into paired FASTQ files.
Parameters¶
| Parameter | Meaning |
|---|---|
-i |
Input FASTQ or FASTQ.GZ file. |
-a |
Adapter table file. The current implementation accepts this parameter but does not use it internally. |
-o |
Output prefix. |
-v, --version |
Print script version. |
Example¶
Expected output naming:
fq_trim¶
Function¶
Trim each FASTQ read to a fixed nucleotide length. Reads shorter than the target length are skipped.
Parameters¶
| Parameter | Meaning |
|---|---|
-i |
Input FASTQ file. |
-o |
Output trimmed FASTQ file. |
-l |
Target trim length. Default: 30. |
-d |
Declared as “discard reads shorter than minimum length”; in the current implementation, short reads are skipped regardless of this flag. |
Example¶
phred_quality¶
Function¶
Infer the likely FASTQ quality-score encoding by inspecting quality-score characters from the first N reads.
Parameters¶
| Parameter | Meaning |
|---|---|
-i, --input |
Input FASTQ or FASTQ.GZ file. |
-n, --number |
Number of sequences to inspect. Default: 40000. |
Example¶
Example output categories include:
Sanger | Phred+33
Solexa | Solexa+64
Illumina1.3 | Phred+64
Illumina1.5 | Phred+64
Illumina1.8 | Phred+33
simulate_fastq¶
Function¶
Generate a simulated FASTQ file with random DNA sequences and random Phred+33 quality strings.
Parameters¶
| Parameter | Meaning |
|---|---|
-q, --qmin |
Minimum quality score. |
-Q, --qmax |
Maximum quality score. |
-m, --minlen |
Minimum read length. |
-M, --maxlen |
Maximum read length. |
-n, --number |
Number of reads to generate. |
-o, --output |
Output FASTQ file. Default: simulated.fq. |
Example¶
Notes¶
fq_lengthsupports multiple input files and.gzinput;fq_len_sumis designed for a single plain FASTQ file.fq_len_fltwrites both retained and dropped reads, which is useful for checking whether read-length filtering is too strict.- For production pipelines, prefer testing each helper with a small FASTQ subset before running on full sequencing files.