Filtering BIM, BED, and FAM files
1
1
Entering edit mode
4.7 years ago
Mazza ▴ 40

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.

genotyping BED Files Filtering bfiles Plink • 3.2k views
3
Entering edit mode
4.7 years ago
cpc5 ▴ 50

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

0
Entering edit mode

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

1
Entering edit mode

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

0
Entering edit mode

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