Hi
I have two VCF and I want to find common rsids in those two files. For this purpose I have used grep command by taking list of rsids from one file and running it on other file, but it gave me some extra rsids as well which were not present in the list. I have also used bcftools isec command but it did not give me anything in intersected file. I have also used vcf-isec but it is giving me error of mixed vcf formats. I have checked my files, one file is in v4.1 and other is in v4.2.
Please tell me what should I do to find common rsids in both files?
Since you haven't showed what you did to extract
rs
ids but said you extracted withgrep
, following will work to find commonrs
ids in two filesprepare 2 files containing
rs
ids from 2 input filesgrep -Fwf file1_rs_ids.txt file2_rs_ids.txt
P.S: Please post what you have tried so it would be easy to direct you towards a solution.
How about bedtools intersect function?
http://bedtools.readthedocs.io/en/latest/content/tools/intersect.html