Changing Sample Names in Merged VCF file
2
0
Entering edit mode
4.2 years ago
David_emir ▴ 490

Hi All,

I have merged about 36 .vcf tumor Files into one single merged .vcf file. Now the problem is the vendor has given the .vcf file name as the R1_XXX_T_1.vcf and sample Name in vcf as Tumor, Likewise, all sample Names in .vcf is given as Tumor. My question is, can I change the sample name in merged vcf? if yes how? Is it possible to retain file_name as sample names in the vcf?

Thanks for Help,

Dave

VCF Sample • 5.2k views
ADD COMMENT
2
Entering edit mode
4.2 years ago

Hello,

bcftools reaheder should help you here. To use it, you have to prepare a text file, where in each line you write the old and the new sample name. Or just the new sample name, but all names in the order they should appear in the vcf.

Then you can doing this

$ bcftools reheader -s names.txt in.vcf > out.vcf

fin swimmer

ADD COMMENT
1
Entering edit mode
4.2 years ago
tothepoint ▴ 800

Follow the post Rename sample name

ADD COMMENT

Login before adding your answer.

Traffic: 2678 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6