How to include/keep only the samples in a list in VCF.gz file?

How to include/keep only the samples in a list in VCF.gz file?

3

Dear Friends,

I have a list of 8000 samples in a file “samples.txt”:

samples.txt:
TCGA..barcode..
TCGA..barcode..
.
.

I am using bcftools to only keep these samples in the vcf.gz file. The vcf.gz file has 10000 samples. Hence, I am trying to use bcftools to keep only the 8000 samples in the “samples.txt” file in the vcf.gz file and remove the remaining 2000 samples. I did:

bcftools -S samples.txt vcf.gz -o filtered-vcf.vcf

it gives me error:

[E::main] unrecognized command -S

Could you please suggest me what could be the issue here, and how you think I can do the above? Thanks much.


vcf


samples


bcftools

• 3.4k views

updated 47 minutes ago by

0

written 3.1 years ago by

▴

140

Read more here: Source link