Package picard.sam

# Class SetNmMdAndUqTags

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

Direct Known Subclasses:
  `SetNmAndUqTags`

@DocumentedFeature public class SetNmMdAndUqTags extends CommandLineProgram
Fixes the NM, MD, and UQ tags in a SAM or BAM file.

This tool takes in a coordinate-sorted SAM or BAM file and calculates the NM, MD, and UQ tags by comparing with the reference.

This may be needed when MergeBamAlignment was run with SORT_ORDER other than 'coordinate' and thus could not fix these tags then. The input must be coordinate sorted in order to run. If specified, the MD and NM tags can be ignored and only the UQ tag be set.

### Inputs

- The BAM or SAM file to fix
- A reference sequence

### Output

A BAM or SAM output file with recalculated NM, MD, and UQ tags

#### Usage example:

### Fix the tags in a BAM file:

         java -jar picard.jar SetNmMdAndUqTags \
              R=reference_sequence.fasta \
              I=sorted.bam \
              O=fixed.bam

## Field Summary

Fields
Modifier and Type
Field
Description
`File`
`INPUT`
`boolean`
`IS_BISULFITE_SEQUENCE`
`File`
`OUTPUT`
`boolean`
`SET_ONLY_UQ`

### 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
`SetNmMdAndUqTags()`

## Method Summary

Modifier and Type
Method
Description
`protected int`
`doWork()`
Do the work after command line has been parsed.
`protected boolean`
`requiresReference()`

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

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

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

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

## Field Details

### INPUT

@Argument(doc="The SAM/BAM/CRAM file to fix.", shortName="I") public File INPUT

### OUTPUT

@Argument(doc="The fixed SAM/BAM/CRAM output file. ", shortName="O") public File OUTPUT

### IS_BISULFITE_SEQUENCE

@Argument(doc="Whether the file contains bisulfite sequence (used when calculating the NM tag).") public boolean IS_BISULFITE_SEQUENCE

### SET_ONLY_UQ

@Argument(doc="Only set the UQ tag, ignore MD and NM.") public boolean SET_ONLY_UQ

## Constructor Details

### SetNmMdAndUqTags

public SetNmMdAndUqTags()

## Method Details

### requiresReference

protected boolean requiresReference()

Overrides:
  `requiresReference` in class `CommandLineProgram`

### doWork

protected int doWork()
Description copied from class: `CommandLineProgram`
Do the work after command line has been parsed. RuntimeException may be thrown by this method, and are reported appropriately.

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