BamUtil: findCigars

From Genome Analysis Wiki
Jump to: navigation, search


Overview of the findCigars function of bamUtil

The findCigars option on the bamUtil executable outputs just the reads that contain any of the specified CIGAR operations.

Usage

./bam findCigars --in <inputFile> --out <outputFile.sam/bam/ubam (ubam is uncompressed bam)> [--cinsert] [--cdel] [--cpad] [--cskip] [--chardClip] [--csoftClip] [--nonM] [--noeof] [--params]

Parameters

	Required Parameters:
		--in         : the SAM/BAM file to be read
		--out        : the SAM/BAM file to be written
	Optional Parameters:
		--cinsert     : output reads that contain insertions ('I').
		--cdel        : output reads that contain deletions ('D').
		--cpad        : output reads that contain pads ('P').
		--cskip       : output reads that contain skips ('N').
		--chardClip   : output reads that contain hard clips ('H').
		--csoftClip   : output reads that contain soft clips ('S').
		--nonM       : output reads that contain any non match/mismatch (anything other than 'M', '=', 'X')
		--noeof      : do not expect an EOF block on a bam file.
		--params     : print the parameter settings
	PhoneHome:
		--noPhoneHome       : disable PhoneHome (default enabled)
		--phoneHomeThinning : adjust the PhoneHome thinning parameter (default 50)

Required Parameters

Input File (--in)

Use --in followed by your file name to specify the SAM/BAM input 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 --in yourFileName
SAM from stdin --in -
BAM from stdin --in -.bam
Uncompressed BAM from stdin --in -.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 (--out)

Use --out followed by your file name to specify the SAM/BAM output 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 --out yourFileName.sam
BAM to file --out yourFileName.bam
Uncompressed BAM to file --out yourFileName.ubam
SAM to stdout --out -
BAM to stdout --out -.bam
Uncompressed BAM to stdout --out -.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.

CIGAR Selection Parameters (--cinsert, --cdel, --cpad, --cskip, --chardClip, --csoftClip, --nonM)

Use these parameters to select which reads to keep based on the cigar. By default, none of these options are on, so no reads would be kept.

Keep any read with any of the specified cigar operators (multiple can be specified and a read that has any of them will be kept):

  • --cinsert : insertion
  • --cdel : deletion
  • --cpad : pad
  • --cskip : skip
  • --chardClip : hard clip
  • --csoftClip : soft clip

Use --nonM to keep any read that has a non M/X/= Cigar operator.

Optional General Parameters

Print the Program Parameters (--params)

Use --params to print the parameters for your program to stderr.

Do not require BGZF EOF block (--noeof)

Use --noeof if you do not expect a trailing eof block in your bgzf file.

By default, the trailing empty block is expected and checked for.

PhoneHome 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 thinning parameter.

Adjust the Frequency of PhoneHome (--phoneHomeThinning)

Use --phoneHomeThinning to modify the percentage of the time that PhoneHome will run (0-100).

  • By default, --phoneHomeThinning is set to 50, running 50% of the time.
  • PhoneHome will only occur if the run's random number modulo 100 is less than the --phoneHomeThinning value.
  • N/A if --noPhoneHome is set.

Return Value

Returns the SamStatus for the reads/writes (0 for success, non-0 for failure).

Example Output


Number of records read = 10
Number of records written = 1