Package picard.sam
Class SetNmMdAndUqTags
java.lang.Object
picard.cmdline.CommandLineProgram
picard.sam.SetNmMdAndUqTags
- Direct Known Subclasses:
SetNmAndUqTags
Fixes the NM, MD, and UQ tags in a SAM or BAM file.
The BAM or SAM file to fix
A reference sequence
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
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
FieldsModifier and TypeFieldDescriptionboolean
boolean
Fields inherited from class picard.cmdline.CommandLineProgram
COMPRESSION_LEVEL, CREATE_INDEX, CREATE_MD5_FILE, GA4GH_CLIENT_SECRETS, 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 -
Method Summary
Modifier and TypeMethodDescriptionprotected int
doWork()
Do the work after command line has been parsed.protected boolean
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
-
Field Details
-
INPUT
-
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 classCommandLineProgram
-
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 classCommandLineProgram
- Returns:
- program exit status.
-