Class GetSampleName

All Implemented Interfaces:
org.broadinstitute.barclay.argparser.CommandLinePluginProvider

@DocumentedFeature public final class GetSampleName extends GATKTool
Emit a single sample name from the bam header into an output file. The sample name is that in the read group (RG) sample (SM) field

Note: If the bam has zero or more than one sample names in the header, this tool will error, by design. This tool has not been tested extensively. Most options supported by the GATK are irrelevant for this tool.

Input

  • A BAM file with a single sample name in the header

Output

  • A file with a single sample name in it

Example Usage

   gatk GetSampleName \
     -I input.bam \
     -O sample_name.txt
 
  • Field Details

    • STANDARD_ENCODING

      public static final String STANDARD_ENCODING
      See Also:
    • outputSampleNameFile

      @Argument(doc="Output file with only the sample name in it.", fullName="output", shortName="O") protected GATKPath outputSampleNameFile
    • URL_ENCODING_LONG_NAME

      public static final String URL_ENCODING_LONG_NAME
      See Also:
    • URL_ENCODING_SHORT_NAME

      public static final String URL_ENCODING_SHORT_NAME
      See Also:
    • urlEncode

      @Argument(doc="Apply URL encoding to convert spaces and other special characters in sample name.", fullName="use-url-encoding", shortName="encode") protected boolean urlEncode
  • Constructor Details

    • GetSampleName

      public GetSampleName()
  • Method Details

    • traverse

      public void traverse()
      Description copied from class: GATKTool
      A complete traversal from start to finish. Tool authors who wish to "roll their own" traversal from scratch can extend this class directly and implement this method. Walker authors should instead extend a Walker class and implement the Walker-appropriate apply() method, since the Walker base classes implement the various kinds of traversals for you.
      Specified by:
      traverse in class GATKTool
    • requiresReads

      public boolean requiresReads()
      Description copied from class: GATKTool
      Does this tool require reads? Traversals types and/or tools that do should override to return true.
      Overrides:
      requiresReads in class GATKTool
      Returns:
      true if this tool requires reads, otherwise false
    • onTraversalStart

      public void onTraversalStart()
      Description copied from class: GATKTool
      Operations performed just prior to the start of traversal. Should be overridden by tool authors who need to process arguments local to their tool or perform other kinds of local initialization. Default implementation does nothing.
      Overrides:
      onTraversalStart in class GATKTool