Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

fastq

Category: ALIGNMENT

Convert BAM to FASTQ format

Description

Convert a BAM file to interleaved FASTQ format.

Reads BAM records and outputs FASTQ to stdout for piping to aligners. Input should be queryname-sorted or template-coordinate sorted.

EXAMPLES:

Pipe to bwa mem for alignment

fgumi fastq -i unmapped.bam | bwa mem -t 16 -p -K 150000000 -Y ref.fa -

With multi-threaded BAM decompression

fgumi fastq -i unmapped.bam -@ 4 | bwa mem -t 16 -p ref.fa -

Exclude secondary and supplementary alignments (default)

fgumi fastq -i aligned.bam -F 0x900 | bwa mem …

Arguments

FlagDescriptionDefault
-i, --input <INPUT>Input BAM filerequired
-o, --output <OUTPUT>Output FASTQ file. If omitted, the FASTQ stream is written to stdout (the default, intended for piping straight to an aligner)
-n, --no-read-suffix <NO_SUFFIX>Don’t append /1 and /2 to read namesfalse
-F, --exclude-flags <EXCLUDE_FLAGS>Exclude reads with any of these flags present [0x900 = secondary|supplementary]2304
-f, --require-flags <REQUIRE_FLAGS>Only include reads with all of these flags present0
-@, --threads <THREADS>Number of threads for BAM decompression1
-K, --bwa-chunk-size <BWA_CHUNK_SIZE>BWA -K parameter value (bases per batch). Sizes output buffer to match bwa’s batch size for optimal pipe throughput. Default matches common bwa mem usage150000000