BamUtil: readIndexedBam

From Genome Analysis Wiki
Jump to navigationJump to search


Overview of the readIndexedBam function of bamUtil

The readIndexedBam option on the bamUtil executable reads an indexed BAM file reference id by reference id, from -1 to the max reference id and writes it out as a SAM/BAM file.

For more flexibility of writing specific regions, see BamUtil: writeRegion.

Usage

./bam readIndexedBam <inputFilename> <outputFile.sam/bam> <bamIndexFile>

Parameters

	Required Parameters:
		inputFilename      - path/name of the input BAM file
		outputFile.sam/bam - path/name of the output file
		bamIndexFile       - path/name of the BAM index file
    PhoneHome:
	--noPhoneHome       : disable PhoneHome (default enabled)

Required Parameters

Input File (1st argument)

The 1st argument is the name of the input SAM/BAM file.

The program automatically determines if your input file is SAM/BAM/uncompressed BAM without any input other than a filename from the user, unless your input file is stdin.

A - is used to indicate to read from stdin and the extension is used to determine the file type (no extension indicates SAM).

SAM/BAM/Uncompressed BAM from file yourFileName
SAM from stdin -
BAM from stdin -.bam
Uncompressed BAM from stdin -.ubam


Note: Uncompressed BAM is compressed using compression level-0 (so it is not an entirely uncompressed file). This matches the samtools implementation so pipes between our tools and samtools are supported.

Output File (2nd argument)

The 2nd argument is the name of the output SAM/BAM file.

The file extension is used to determine whether to write SAM/BAM/uncompressed BAM. A - is used to indicate stdout and the extension for file type (no extension is SAM).

SAM to file yourFileName.sam
BAM to file yourFileName.bam
Uncompressed BAM to file yourFileName.ubam
SAM to stdout -
BAM to stdout -.bam
Uncompressed BAM to stdout -.ubam


Note: Uncompressed BAM is compressed using compression level-0 (so it is not an entirely uncompressed file). This matches the samtools implementation so pipes between our tools and samtools are supported.

Bam Index File (3rd argument)

The 3rd argument is the name of the BAM index file to use for reading the BAM file.


Phone Home Parameters

See PhoneHome for more information on how PhoneHome works and what it does.

Turn off PhoneHome (--noPhoneHome)

Use the --noPhoneHome option to completely disable PhoneHome. PhoneHome is enabled by default based on the default thinning parameter.

Return Value

  • 0