Package picard.sam
Class AddOrReplaceReadGroups
java.lang.Object
picard.cmdline.CommandLineProgram
picard.sam.AddOrReplaceReadGroups
Assigns all the reads in a file to a single new read-group.
This tool accepts as INPUT BAM and SAM files or URLs from the Global Alliance for Genomics and Health (GA4GH).
The program enables only the wholesale assignment of all the reads in the
Summary
Many tools (Picard and GATK for example) require or assume the presence of at least oneRG
tag, defining a "read-group"
to which each read can be assigned (as specified in the RG
tag in the SAM record).
This tool enables the user to assign all the reads in the INPUT
to a single new read-group.
For more information about read-groups, see the
GATK Dictionary entry.
This tool accepts as INPUT BAM and SAM files or URLs from the Global Alliance for Genomics and Health (GA4GH).
Usage example:
java -jar picard.jar AddOrReplaceReadGroups \ I=input.bam \ O=output.bam \ RGID=4 \ RGLB=lib1 \ RGPL=ILLUMINA \ RGPU=unit1 \ RGSM=20
Caveats
The value of the tags must adhere (according to the SAM-spec) with the regex"^[ -~]+$"(one or more characters from the ASCII range 32 through 126). In particular
<Space>
is the only non-printing character allowed.
The program enables only the wholesale assignment of all the reads in the
INPUT
to a single read-group. If your file
already has reads assigned to multiple read-groups, the original RG
value will be lost.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
htsjdk.samtools.util.Iso8601Date
htsjdk.samtools.SAMFileHeader.SortOrder
Fields inherited from class picard.cmdline.CommandLineProgram
COMPRESSION_LEVEL, CREATE_INDEX, CREATE_MD5_FILE, MAX_ALLOWABLE_ONE_LINE_SUMMARY_LENGTH, MAX_RECORDS_IN_RAM, QUIET, REFERENCE_SEQUENCE, referenceSequence, specialArgumentsCollection, SYNTAX_TRANSITION_URL, TMP_DIR, USE_JDK_DEFLATER, USE_JDK_INFLATER, VALIDATION_STRINGENCY, VERBOSITY
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class picard.cmdline.CommandLineProgram
checkRInstallation, getCommandLine, getCommandLineParser, getCommandLineParserForArgs, getDefaultHeaders, getFaqLink, getMetricsFile, getPGRecord, getStandardUsagePreamble, getStandardUsagePreamble, getVersion, hasWebDocumentation, instanceMain, instanceMainWithExit, makeReferenceArgumentCollection, parseArgs, requiresReference, setDefaultHeaders, useLegacyParser
-
Field Details
-
READGROUP_ID_REGEX
- See Also:
-
INPUT
-
OUTPUT
-
SORT_ORDER
@Argument(shortName="SO", optional=true, doc="Optional sort order to output in. If not supplied OUTPUT is in the same order as INPUT.") public htsjdk.samtools.SAMFileHeader.SortOrder SORT_ORDER -
RGID
-
RGLB
-
RGPL
-
RGPU
-
RGSM
-
RGCN
@Argument(shortName="CN", doc="Read-Group sequencing center name", optional=true) public String RGCN -
RGDS
-
RGDT
@Argument(shortName="DT", doc="Read-Group run date", optional=true) public htsjdk.samtools.util.Iso8601Date RGDT -
RGKS
-
RGFO
-
RGPI
@Argument(shortName="PI", doc="Read-Group predicted insert size", optional=true) public Integer RGPI -
RGPG
-
RGPM
-
-
Constructor Details
-
AddOrReplaceReadGroups
public AddOrReplaceReadGroups()
-
-
Method Details
-
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 classCommandLineProgram
- Returns:
- program exit status.
-
customCommandLineValidation
Description copied from class:CommandLineProgram
Put any custom command-line validation in an override of this method. clp is initialized at this point and can be used to print usage and access argv. Any options set by command-line parser can be validated.- Overrides:
customCommandLineValidation
in classCommandLineProgram
- Returns:
- null if command line is valid. If command line is invalid, returns an array of error message to be written to the appropriate place.
-