Use plink to extract data using common SNPs and merge this into one file
1
0
Entering edit mode
6.2 years ago

I am using Plink 1.9 to merge two data sets, I have found out the common SNPs among them and now how do I separate out overlapping sample data, common in both the data set from any one of them?

SNP sequencing • 4.0k views
ADD COMMENT
1
Entering edit mode

The title of the post should be a clear, concise statement, not the exact duplicate of your actual post text. Read Rule #5 here: http://journals.plos.org/ploscompbiol/article?id=10.1371/journal.pcbi.1002202

ADD REPLY
0
Entering edit mode

Thank you, I should have read it earlier. Sorry for the inconvenience.

ADD REPLY
1
Entering edit mode

You can still edit your post and change the title to something more appropriate.

EDIT: I see you've changed the title, but it's not concise yet. I'll make a suggestion: "Use plink to extract data using common SNPs and merge this into one file"

ADD REPLY
0
Entering edit mode

Thank you for your kind suggestion Sir.

ADD REPLY
2
Entering edit mode
6.2 years ago

If you literally have the list of common SNPs in a text file, then you can do the following (assumes that the SNPs are listed in SNPsForFiltering.list) :

plink --noweb --bfile DataSetA --extract SNPsForFiltering.list --make-bed --out DataSetA.Common ;
plink --noweb --bfile DataSetB --extract SNPsForFiltering.list --make-bed --out DataSetB.Common ;

You can then attempt to merge these together if you have a merge file that lists the datasets to be merged:

cat ForMerge.list
DataSetA.Common
DataSetB.Common


plink --merge-list ForMerge.list --out AB.Merge ;
ADD COMMENT
0
Entering edit mode

Thank you very much for your kind answer. I have the common SNP file in .bim format. Maybe I have to figure out how to make text file from it containing the SNPs.

ADD REPLY
0
Entering edit mode

You should be able to just output and transpose that, and then you will have your SNP listing. How did you create it? Perhaps, you can re-create it but not specify binary format (BIM is similar to plain-text MAP format).

ADD REPLY
0
Entering edit mode

Thank you Sir! I have generated a SNP list text file from my previous common SNP file in bim format using awk. Using which I have hopefully separated out the unique individual samples from overlapping ngs data.

ADD REPLY
1
Entering edit mode

No problem kind Sir. Everything is okay now, in that case?

ADD REPLY
0
Entering edit mode

Yes Sir, it is okay now. I am an undergrad student, no need to address me as Sir. Thank you for your kind suggestion.

ADD REPLY
1
Entering edit mode

An undergrad student is the future of our society and the future of research. In that sense, you deserve more respect than Senior Professors.

ADD REPLY
1
Entering edit mode

I am humbled by your words, your encouragement means a lot to me. I'm quite excited about the future but equally confused and worried, whether I will really get to work in my areas of interests or not which is human evolutionary and population genetics, and also archaeogenetics. I am grateful to you for your kind guidance.

ADD REPLY
0
Entering edit mode

All I can say is to continue to work hard and then you will achieve your dreams over the course of time. You will face road blocks along the way, but do not give up hope.

ADD REPLY
0
Entering edit mode

Thank you Sir for your kind words, I'll surely work hard.

ADD REPLY

Login before adding your answer.

Traffic: 2286 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