This is a test version of Biostars. For the public version, visit https://www.biostars.org.
bcftools merge single-sample vcf files

Hi. I'm trying to merge .vcf files from TCGA. Each of these files is from a single sample, which is indicated by the file name. However, the vcf file header contains the following for each sample:

#CHROM  POS ID  REF ALT QUAL    FILTER  INFO    FORMAT  NORMAL  TUMOR

When I try to merge, I get the error:

Error: Duplicate sample names (NORMAL), use --force-samples to proceed anyway.

I could replace NORMAL with the file name so that I can associate each annotation with the correct ID, but I'm wondering if I have to do this. Will --force-samples remove information?

bcftools vcf snp

1 answer

I would suggest doing bcftools reheader to change all sample names per file to ID-N and ID-T before merging. If not you won't be able to query which Tumor and Normal belong to the same individual.

Log in to answer this question.