bam2fastx(1) tophat component converting bam directly into fastx


bam2fastx v2.1.1 () usage:

bam2fastx [--fasta|-a] [-C|--color] [-P|--paired] [-N] [-A|--all|-M|--mapped-only] [-Q] [--sam|-s|-t] [-o <outfname>] <in.bam>

By default, bam2fastx only converts the unmapped reads from the input file,

discarding those unmapped reads flagged as QC failed. The input BAM/SAM file MUST be sorted by read name (-n option for samtools sort). If the input file name is "-", stdin will be used instead.


convert all reads (mapped and unmapped) (but discarding those flagged as QC failed, unless -Q)
paired reads are expected and converted into two output files (see <outfname> comments below)
convert unmapped reads even when flagged as QC failed
convert only mapped reads
for -P, append ,/1/ and ,/2/ suffixes to read names
ignore the original quality values (OQ tag) and write the current quality values (default is to use OQ data if found)
reads are in ABI SOLiD color format
input is a SAM text file (default: BAM input expected)
output FASTA records, not FASTQ (discard quality values)
-o <outfname>
output file name or template (see below)
<outfname> serves as a name template when -P option is provided, as suffixes .1 and .2 will be automatically inserted before the file extension in <outfname>, such that two file names will be created. If <outfname> ends in .gz or .bz2 then bam2fastx will write the output compressed by gzip or bzip2 respectively.
Example of converting all paired reads from a BAM file to FASTQ format:
bam2fastx -PANQ -o sample.fq.gz sample.sortedbyname.bam
In this example the output will be written in two files:
sample.1.fq.gz and sample.2.fq.gz