Package picard.sam

Class 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 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.