Package picard.vcf
Class RenameSampleInVcf
java.lang.Object
picard.cmdline.CommandLineProgram
picard.vcf.RenameSampleInVcf
Renames a sample within a VCF or BCF.
Summary
This tool enables the user to rename a sample in either a VCF or BCF file. It is intended to change the name of a sample in a VCF prior to merging with VCF files in which one or more samples have similar names. Note that the input VCF file must be single-sample VCF and that the NEW_SAMPLE_NAME argument is required.Inputs
- Input single-sample VCF or BCF file.
- Output single-sample VCF or BCF file.
- New name to give sample in output VCF.
- [Optional] Existing name of sample in VCF; if provided, asserts that that is the name of the extant sample name.
Usage example:
java -jar picard.jar RenameSampleInVcf \ INPUT=input_variants.vcf \ OUTPUT=output_variants.vcf \ NEW_SAMPLE_NAME=sample
Notes
The input VCF (or BCF) must be single-sample.-
Field Summary
FieldsModifier and TypeFieldDescriptionFields inherited from class picard.cmdline.CommandLineProgram
COMPRESSION_LEVEL, CREATE_INDEX, CREATE_MD5_FILE, GA4GH_CLIENT_SECRETS, 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
Modifier and TypeMethodDescriptionprotected int
doWork()
Do the work after command line has been parsed.Methods inherited from class picard.cmdline.CommandLineProgram
checkRInstallation, customCommandLineValidation, getCommandLine, getCommandLineParser, getCommandLineParserForArgs, getDefaultHeaders, getFaqLink, getMetricsFile, getPGRecord, getStandardUsagePreamble, getStandardUsagePreamble, getVersion, hasWebDocumentation, instanceMain, instanceMainWithExit, makeReferenceArgumentCollection, parseArgs, requiresReference, setDefaultHeaders, useLegacyParser
-
Field Details
-
INPUT
-
OUTPUT
-
OLD_SAMPLE_NAME
@Argument(doc="Existing name of sample in VCF; if provided, asserts that that is the name of the extant sample name", optional=true) public String OLD_SAMPLE_NAME -
NEW_SAMPLE_NAME
-
-
Constructor Details
-
RenameSampleInVcf
public RenameSampleInVcf()
-
-
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.
-