Package picard.sam

## Class GatherBamFiles

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

-     @DocumentedFeature
      public class GatherBamFiles
      extends CommandLineProgram

  Concatenate efficiently BAM files that resulted from a scattered parallel analysis.

  This tool performs a rapid "gather" or concatenation on BAM files. This is often needed in operations that have been run in parallel across genomics regions by scattering their execution across computing nodes and cores thus resulting in smaller BAM files.

  This tool does not support SAM files.

  ### Inputs

  A list of BAM files to combine using the `INPUT` argument. These files must be provided in the order that they should be concatenated.

  ### Output

  A single BAM file. The header is copied from the first input file.

  ### Usage example:

       java -jar picard.jar GatherBamFiles \
            I=input1.bam \
            I=input2.bam \
            O=gathered_files.bam

  ### Notes

  Operates via copying of the gzip blocks directly for speed but also supports generation of an MD5 on the output and indexing of the output BAM file.

- - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `List<File>` | `INPUT` |
    `File` | `OUTPUT` |

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

      `COMPRESSION_LEVEL, CREATE_INDEX, CREATE_MD5_FILE, GA4GH_CLIENT_SECRETS, MAX_RECORDS_IN_RAM, QUIET, REFERENCE_SEQUENCE, referenceSequence, specialArgumentsCollection, TMP_DIR, USE_JDK_DEFLATER, USE_JDK_INFLATER, VALIDATION_STRINGENCY, VERBOSITY`

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `GatherBamFiles()` |

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `protected int` | `doWork()` | Do the work after command line has been parsed.
    `static void` | `main​(String[] args)` |

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

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

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

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

- - ### Field Detail

    - #### INPUT

          @Argument(shortName="I",
                    doc="Two or more BAM files or text files containing lists of BAM files (one per line).")
          public List<File> INPUT

    - #### OUTPUT

          @Argument(shortName="O",
                    doc="The output BAM file to write to.")
          public File OUTPUT

  - ### Constructor Detail

    - #### GatherBamFiles

          public GatherBamFiles()

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