Plink: Getting IDs of Individuals in a BED File
1
0
Entering edit mode
2.2 years ago

Hello,

I am currently working with a bed file that I filtered for individuals and variants matching a preselected list (CHR:POS:REF:ALT). I am presently having difficulty getting the individual IDs of the remaining individuals in the dataset, i.e. those who have the preselected variants. My FAM file lists all individuals in the original cohort. I know for a fact that all individuals do not harbor these variants (rare variants). Any advice? I need the IDs to link to clinical data.

plink plink2 bed • 761 views
ADD COMMENT
1
Entering edit mode
2.2 years ago

I was able to answer my own question. The key is to use the "recode" function with plink. So

./plink --bfile PLINK_FILE --extract VARIANTS.txt --make-bed --out OUT --recodeAD

You can then read the ".raw" file outputted by recode in R, isolate rows where is at least one "1" for the allele columns, and you then have the IIDs and FIDs for individuals hosting your variant alleles of interest.

ADD COMMENT

Login before adding your answer.

Traffic: 2579 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6