This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Plink extract SNPs from .ped file using ID

Hi,

I have a .ped file containing data from 3 groups of population. I have checked the documentation of the PLINK for extracting the subset of data from the PLINK files, but couldn't find the way to extract data based on ID(s). Could you please provide an idea on how to achieve this?

plink gwas snp

1 answer

--keep: https://www.cog-genomics.org/plink2/filter#indiv

I tried the below command but it didn't work. Did I miss anything?

plink --file combined_maternal --extract ../pop1_IDs.txt --make-bed --out ../pop1

You should use --keep, not --extract. From the linked page:

--keep accepts a space/tab-delimited text file with family IDs in the first column and within-family IDs in the second column, and removes all unlisted samples from the current analysis.

Log in to answer this question.