This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Keeping A Set Of Data For Qc In Plink

I am using putty to run plink for this data analysis.

I have been asked to perform a QC on a subset of data from a given dataset. I have used the command to keep the data (plink --bfile data --keep mydata.txt) and it has saved the necessary files as a .txt file.

I have been told that for plink to read that the file I am reading in will not be a text file but a set of binary files.

When I enter (plink --file mydata --maf 0.05) it states that no mydata.ped file exists.

What am I missing?

plink data dataset qc

Here is the nice tutorial on how to do QC using plink. Yes, the more detail you give us the easier to answer...

I have already followed this protocol but could not see where it says to extract samples? My current task is: 1) to keep certain samples from a dataset 2) perform QC of this selected data (maf >0.05, call rate >0.97 and HW)

Do you need the commands too?

1 answer

This works for me:

Note: Below I used --bfile option for binary file sets (bim, fam, bed), if you have normal (ped, map) file use --file. If you need output as normal (ped, map) format then use --recode instead of --make-bed.

1) To subset samples, we need mySubsetSamplesFile.txt file, it has 2 columsn, FID and IID:

plink --noweb \
--bfile myBinaryFile \
--keep mySubsetSamplesFile.txt \
--make-bed \
--out myBinaryFile_SubsetSampleFile

2) Above command should create binary plink files myBinaryFile_SubsetSampleFile, we use them as input for 2nd step.

plink --noweb \
--bfile myBinaryFile_SubsetSampleFile \
--hwe 1e-05 \
--mind 0.03 \
--maf 0.05 \
--make-bed \
--out myBinaryFile_SubsetSampleFile_QC

If any of above gives out an error, then something is wrong with input files, check them compare the formats with plink manuals.

Log in to answer this question.