Keeping A Set Of Data For Qc In Plink
1
0
Entering edit mode
7.8 years ago

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 • 2.9k views
0
Entering edit mode

Duplicate of Keeping a subset of data for QC , which is in turn duplicate of Creation of a .BED file from .txt ? I suggest you read the plink manual thoroughly, reposting the same question will not help, especially when we cannot see your files, plink commands, etc.

0
Entering edit mode

Do I need to post a command list of what I've done so far then?

0
Entering edit mode

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

0
Entering edit mode

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?

3
Entering edit mode
7.8 years ago
zx8754 10k

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.

0
Entering edit mode

Yes this works for me, thank you very much.