Entering edit mode
2.8 years ago
raalsuwaidi
▴
100
hi all,
I am trying to remove entries in the VCF file based on rs_id. I tried to use bcftools view but for some reason preparing a list of the positions I need to be excluded did not work.
A sample of the file looked like this:
22 rs165886
22 rs165608
22 rs1541529
22 rs4819925
22 rs5992604
and the bcftools command is the following:
bcftools view -T ^tlist.txt input.vcf
which always give an error Could not parse the file
so I tried to change the value in the plink map file to -1 like the below, and then I recoded it again using plink to vcf. even after all of that, the positions are still in the vcf file.
22 rs165886 -1 17339003
22 rs165608 -1 17339404
Can you please tell me how to fix this?
Do an inverse grep
You mean an inverse grep on the VCF file? I am no expert in that, can you please give me an example? Will it remove the whole line?
with example vcf and example file with one rsid:
If vcf is gzipped, you can use zgrep instead of regular grep.
You can also try this and I haven't tested it's performance:
Thanks. That worked