This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Remove multiple samples from a VCF file using bcftools

Dear all,

That's a naive question, but I am struggling to find the right answer.

I have a text file of 10 sample ids that I want to remove from the a VCF file. Which command from bcftools or vcftools or plink2.0 do you suggest for removing sample ids?

Thank you for your time

vcf bcftools vcftools

1 answer

https://samtools.github.io/bcftools/bcftools.html

-s, --samples [^]LIST

Comma-separated list of samples to include or exclude if prefixed with "^." (Note that when multiple samples are to be excluded, the "^" prefix is still present only once, e.g. "^SAMPLE1,SAMPLE2".)

-S, --samples-file [^]FILE

File of sample names to include or exclude if prefixed with "^". One sample per line.

Log in to answer this question.