Yasaman Taher
Yasaman Taher

Reputation: 1

Subset PLINK binary files (BED, BIM & FAM)

Hi everyone I am working on genotype data, I have bed, bim and fam files with the summary statistics of GWAS. Because the number of individuals are a lot, so I want to sample from my binary files in numbers of 3000 randomly . In other words, I want to subset the binary files. Do you know how can I do that by plink, R or python?

Upvotes: 0

Views: 1458

Answers (1)

DSTO
DSTO

Reputation: 285

you can achieve that using PLINK. First, create a list of individuals that you want to subset and name it say individuals.txt. Next, run the following command to create a separate binary file for individuals in the individuals.txt

plink --bfile toy --keep individuals.txt --make-bed --out toy_subset

Hope this helps.

Upvotes: 1

Related Questions