BCFTOOLS view -S not working
1
0
Entering edit mode
4.1 years ago

Hello, I'm trying to exclude some samples from my vcf. My command looks like this:

bcftools view -S file.txt vcf_file.vcf >new_vcf.vcf

file.txt looks like this (each sample in a new line): ^V01523 ^V02073 ^V02653 ^V02923 ^V06633 ^V06854 ^V08639 ^V09208

I'm getting this error:

Error: subset called for sample that does not exist in header: "^V01523". Use "--force-samples" to ignore this error.

I've "cleaned" file.txt with dos2unix so it does not contain hidden characters. If I'm removing V01523 from the list I get the same error for the next sample.

Any advice? Thanks Hila

bcftools samples • 1.8k views
ADD COMMENT
2
Entering edit mode
4.1 years ago

don't put all those '^' in the file and just use:

bcftools view -S ^file.txt vcf_file.vcf >new_vcf.vcf

see the manual:

-S, --samples-file [^]<file>  file of samples to include (or exclude with "^" prefix)
ADD COMMENT
0
Entering edit mode

working! thanks!!!!

ADD REPLY

Login before adding your answer.

Traffic: 2020 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