0
$\begingroup$

I have a vcf file containing an ID field with a snps and a list of human SNPs from dbSNP.I want to remove whatever in dbSNP from vcf file. The text file is like this:

rs978760828
rs1008829651
rs1052373574
rs1326880612
rs768019142
rs892501864
rs1010989343
rs1489251879
rs1022805358
rs1322538365

How to remove the common snps from dbSNP and my vcf?

$\endgroup$

1 Answer 1

1
$\begingroup$

I'd advise against using grep, sed, awk for processing vcfs unless you really know what you're doing - there's almost always an easier way using bcftools.

bcftools view -i'ID=@snplist.txt' in.vcf

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.