Renames a sample within a VCF or BCF. 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 is required.
java -jar picard.jar RenameSampleInVcf I=input.vcf O=renamed.vcf NEW_SAMPLE_NAME=sample123
INPUT (File) Input single sample VCF. Required.
OUTPUT (File) Output single sample VCF. Required.
OLD_SAMPLE_NAME (String) Existing name of sample in VCF; if provided, asserts that that is the name of the extant sample name Default value: null.
NEW_SAMPLE_NAME (String) New name to give sample in output VCF. Required.