Package picard.sam

# Class BuildBamIndex

java.lang.Object
picard.cmdline.CommandLineProgram
picard.sam.BuildBamIndex

@DocumentedFeature public class BuildBamIndex extends CommandLineProgram
Command line program to generate a BAM index (.bai) file from a BAM (.bam) file

## Field Summary

Fields
Modifier and Type
Field
Description
`PicardHtsPath`
`INPUT`
`File`
`OUTPUT`

### Fields inherited from class picard.cmdline.CommandLineProgram

`COMPRESSION_LEVEL, CREATE_INDEX, CREATE_MD5_FILE, MAX_ALLOWABLE_ONE_LINE_SUMMARY_LENGTH, MAX_RECORDS_IN_RAM, QUIET, REFERENCE_SEQUENCE, referenceSequence, specialArgumentsCollection, SYNTAX_TRANSITION_URL, TMP_DIR, USE_JDK_DEFLATER, USE_JDK_INFLATER, VALIDATION_STRINGENCY, VERBOSITY`

## Constructor Summary

Constructors
Constructor
Description
`BuildBamIndex()`

## Method Summary

Modifier and Type
Method
Description
`protected int`
`doWork()`
Main method for the program.

### Methods inherited from class picard.cmdline.CommandLineProgram

`checkRInstallation, customCommandLineValidation, getCommandLine, getCommandLineParser, getCommandLineParserForArgs, getDefaultHeaders, getFaqLink, getMetricsFile, getPGRecord, getStandardUsagePreamble, getStandardUsagePreamble, getVersion, hasWebDocumentation, instanceMain, instanceMainWithExit, makeReferenceArgumentCollection, parseArgs, requiresReference, setDefaultHeaders, useLegacyParser`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### INPUT

@Argument(shortName="I", doc="A BAM file or GA4GH URL to process. Must be sorted in coordinate order.") public PicardHtsPath INPUT

### OUTPUT

@Argument(shortName="O", doc="The BAM index file. Defaults to x.bai if INPUT is x.bam, otherwise INPUT.bai.\nIf INPUT is a URL and OUTPUT is unspecified, defaults to a file in the current directory.", optional=true) public File OUTPUT

## Constructor Details

### BuildBamIndex

public BuildBamIndex()

## Method Details

### doWork

protected int doWork()
Main method for the program. Checks that all input files are present and readable and that the output file can be written to. Then iterates through all the records generating a BAM Index, then writes the bai file.

Specified by:
  `doWork` in class `CommandLineProgram`
Returns:
  program exit status.