This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Filtering BIM, BED, and FAM files

Hi all,

I am very new in this filed and really appriciate whoever can help me with this question. I was wondering if you how I can filter my bfiles( BIM, BED, FAM) for a subset of my SNPs. I have my BIM , BED, FAM files. But I do not need all SNPs available so I filterd my BIM file by AWK commands but I do not know how to match my BED file with the new BIM file created. Please tell me how should I do it? thank you very much in advance.

bed genotyping plink

1 answer

you should create a list of your snps and use plink's filtering option. I believe it goes something like :

plink --bfile <yourfile> --remove [snps.txt] --out<newset>

this should also subset your BED file

Dear cpc5,

Thank you very much. That was a wonderful hint. I actually used the following script and it worked properly! plink --bfile <yourfile> --extract [snps.txt] --make-bed --out <newset>

I could not figure it out without your hint!

Many Thanks

If the question has been solved then accept @cpc5's answer (green check mark) to provide closure to the thread.

glad it helped. for the record: the bed file is tightly knit to the bim and fam file, so if you want to filter individuals you also have to make a list of family Id.s

Log in to answer this question.