Class GetSampleName
java.lang.Object
org.broadinstitute.hellbender.cmdline.CommandLineProgram
org.broadinstitute.hellbender.engine.GATKTool
org.broadinstitute.hellbender.tools.GetSampleName
- All Implemented Interfaces:
org.broadinstitute.barclay.argparser.CommandLinePluginProvider
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
-
Nested Class Summary
Nested classes/interfaces inherited from class org.broadinstitute.hellbender.cmdline.CommandLineProgram
CommandLineProgram.AutoCloseableNoCheckedExceptions
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected GATKPath
static final String
static final String
static final String
protected boolean
Fields inherited from class org.broadinstitute.hellbender.engine.GATKTool
addOutputSAMProgramRecord, addOutputVCFCommandLine, cloudIndexPrefetchBuffer, cloudPrefetchBuffer, createOutputBamIndex, createOutputBamMD5, createOutputVariantIndex, createOutputVariantMD5, disableBamIndexCaching, features, intervalArgumentCollection, lenientVCFProcessing, outputSitesOnlyVCFs, progressMeter, readArguments, referenceArguments, SECONDS_BETWEEN_PROGRESS_UPDATES_NAME, seqValidationArguments
Fields inherited from class org.broadinstitute.hellbender.cmdline.CommandLineProgram
GATK_CONFIG_FILE, logger, NIO_MAX_REOPENS, NIO_PROJECT_FOR_REQUESTER_PAYS, QUIET, specialArgumentsCollection, tmpDir, useJdkDeflater, useJdkInflater, VERBOSITY
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Operations performed just prior to the start of traversal.boolean
Does this tool require reads? Traversals types and/or tools that do should override to return true.void
traverse()
A complete traversal from start to finish.Methods inherited from class org.broadinstitute.hellbender.engine.GATKTool
addFeatureInputsAfterInitialization, bamIndexCachingShouldBeEnabled, closeTool, createSAMWriter, createVCFWriter, createVCFWriter, createVCFWriter, directlyAccessEngineFeatureManager, directlyAccessEngineReadsDataSource, directlyAccessEngineReferenceDataSource, disableProgressMeter, doWork, getBestAvailableSequenceDictionary, getDefaultCloudIndexPrefetchBufferSize, getDefaultCloudPrefetchBufferSize, getDefaultReadFilters, getDefaultToolVCFHeaderLines, getDefaultVariantAnnotationGroups, getDefaultVariantAnnotations, getGenomicsDBOptions, getHeaderForFeatures, getHeaderForReads, getHeaderForSAMWriter, getMasterSequenceDictionary, getPluginDescriptors, getProgressMeterRecordLabel, getReferenceDictionary, getSequenceDictionaryValidationArgumentCollection, getToolName, getTransformedReadStream, getTraversalIntervals, getUserSuppliedIntervals, hasFeatures, hasReads, hasReference, hasUserSuppliedIntervals, initializeProgressMeter, makePostReadFilterTransformer, makePreReadFilterTransformer, makeReadFilter, makeSamReaderFactory, makeVariantAnnotations, onShutdown, onStartup, onTraversalSuccess, requiresFeatures, requiresIntervals, requiresReference, transformTraversalIntervals, useVariantAnnotations
Methods inherited from class org.broadinstitute.hellbender.cmdline.CommandLineProgram
customCommandLineValidation, getCommandLine, getCommandLineParser, getDefaultHeaders, getMetricsFile, getSupportInformation, getToolkitName, getToolkitShortName, getToolStatusWarning, getUsage, getVersion, instanceMain, instanceMainPostParseArgs, isBetaFeature, isExperimentalFeature, parseArgs, printLibraryVersions, printSettings, printStartupMessage, runTool, setDefaultHeaders, warnOnToolStatus
-
Field Details
-
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
- See Also:
-
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. -
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 classGATKTool
- 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 classGATKTool
-