picard.sam

## Class FixMateInformation

- java.lang.Object
- - picard.cmdline.CommandLineProgram
  - - picard.sam.FixMateInformation

-     public class FixMateInformation
      extends CommandLineProgram

  Class to fix mate pair information for all reads in a SAM file. Will run in fairly limited memory unless there are lots of mate pairs that are far apart from each other in the file.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `Boolean` | `ADD_MATE_CIGAR`
    `boolean` | `ASSUME_SORTED`
    `Boolean` | `IGNORE_MISSING_MATES`
    `List<File>` | `INPUT`
    `protected htsjdk.samtools.SAMFileWriter` | `out`
    `File` | `OUTPUT`
    `htsjdk.samtools.SAMFileHeader.SortOrder` | `SORT_ORDER`

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

      `COMPRESSION_LEVEL, CREATE_INDEX, CREATE_MD5_FILE, GA4GH_CLIENT_SECRETS, MAX_RECORDS_IN_RAM, QUIET, REFERENCE_SEQUENCE, TMP_DIR, VALIDATION_STRINGENCY, VERBOSITY`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `FixMateInformation()`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected void` | `closeWriter()`
    `protected void` | `createSamFileWriter(htsjdk.samtools.SAMFileHeader header)`
    `protected int` | `doWork()` Do the work after command line has been parsed.
    `static void` | `main(String[] args)`
    `protected void` | `writeAlignment(htsjdk.samtools.SAMRecord sam)`

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

      `customCommandLineValidation, getCommandLine, getCommandLineParser, getDefaultHeaders, getMetricsFile, getNestedOptions, getNestedOptionsForHelp, getStandardUsagePreamble, getVersion, instanceMain, instanceMainWithExit, parseArgs, setDefaultHeaders`

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

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

- - ### Field Detail

    - #### INPUT

          @Option(shortName="I",
                  doc="The input file to check and fix.")
          public List<File> INPUT

    - #### OUTPUT

          @Option(shortName="O",
                  optional=true,
                  doc="The output file to write to. If no output file is supplied, the input file is overwritten.")
          public File OUTPUT

    - #### SORT_ORDER

          @Option(shortName="SO",
                  optional=true,
                  doc="Optional sort order if the OUTPUT file should be sorted differently than the INPUT file.")
          public htsjdk.samtools.SAMFileHeader.SortOrder SORT_ORDER

    - #### ASSUME_SORTED

          @Option(doc="If true, assume that the input file is queryname sorted, even if the header says otherwise.",
                  shortName="AS")
          public boolean ASSUME_SORTED

    - #### ADD_MATE_CIGAR

          @Option(shortName="MC",
                  optional=true,
                  doc="Adds the mate CIGAR tag (MC) if true, does not if false.")
          public Boolean ADD_MATE_CIGAR

    - #### IGNORE_MISSING_MATES

          @Option(doc="If true, ignore missing mates, otherwise will throw an exception when missing mates are found.",
                  optional=true)
          public Boolean IGNORE_MISSING_MATES

    - #### out

          protected htsjdk.samtools.SAMFileWriter out

  - ### Constructor Detail

    - #### FixMateInformation

          public FixMateInformation()

  - ### Method Detail

    - #### main

          public static void main(String[] args)

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

    - #### createSamFileWriter

          protected void createSamFileWriter(htsjdk.samtools.SAMFileHeader header)

    - #### writeAlignment

          protected void writeAlignment(htsjdk.samtools.SAMRecord sam)

    - #### closeWriter

          protected void closeWriter()