Reference Code backup Executable files
Extract FASTQ records from sequence alignments in BAM format.
bedtools bamtofastq [OPTIONS] -i <BAM> -fq <FASTQ>
This tool is part of the bedtools
suite.
samtools sort
) is creating paired FASTQ.Note: The two commands bedtools bamtofastq
and bamToFastq
are identical.
If your BAM alignments are from paired-end sequence data, one can use the -fq2 option to create two distinct FASTQ output files: one for end/read 1 and one for end/read 2.
$ bedtools bamtofastq-i x.bam
-fq read1.fq
-fq2 read2.fq
If you want to create a single, interleaved FASTQ file for paired-end data, you can just write both to /dev/stdout
:
$ bedtools bamtofastq-i x.bam
-fq /dev/stdout
-fq2 /dev/stdout
> x.ilv.fq
Also, the samtools fastq
command has more fucntionality and is a useful alternative.