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