Overlapping SNPs in R
0
0
Entering edit mode
6.0 years ago

Hello, I need help in my Bioinformatics Project which is due in 4 days. I'm trying to see the overlapping SNPs of Alzheimer's Disease and Sex Hormones in R. But I can't seem to find a code that can show it. Anyone who knows how to do it and the codes for that? THANK YOU SO MUCH!!!

SNP R homework • 2.0k views
ADD COMMENT
1
Entering edit mode

Try findOverlaps function from GenomicRanges package in R.

ADD REPLY
0
Entering edit mode

Hello, thanks for your response.

I had this data from AD patients that is in .txt format which includes the Chromosome Number, Position, Marker Name, Affected Allele, Non-Affected Allele, Beta, Standard Error, and Pvalue.

I apologize because I'm just a beginner in using R so I am clueless on what files and other stuff I would be needing.

ADD REPLY
0
Entering edit mode

Well, it is a real shame that you have this deadline. However, by providing absolutely no information on the format of your input data, how can any of us help you in any great way? Nicolas has made a reasonable attempt.

ADD REPLY
0
Entering edit mode

Hello, thanks for your response.

I had this data from AD patients that is in .txt format which includes the Chromosome Number, Position, Marker Name, Affected Allele, Non-Affected Allele, Beta, Standard Error, and Pvalue.

I apologize because I'm just a beginner in using R so I am clueless on what files and other stuff I would be needing.

ADD REPLY
1
Entering edit mode

Cool, but what is the part about 'sex hormones'? Do you have genomic co-ordinates (Chromosome, Start position, End position) for genes that encode the sex hormones?

ADD REPLY
0
Entering edit mode

Hello, yes I also have the file now for the testosterone and estradiol with Chromosome Number, Position, Marker Name, Major Allele, Minor Allele and Pvalue .

ADD REPLY
1
Entering edit mode

Okay, cool, then GenomicRanges is indeed the correct approach.

Create 2 separate GenomicRanges objects and then overlap them with the findOverlaps() function.

If you even take a look at the example here, it may help: GRanges : setdiff and keep extra columns

ADD REPLY
0
Entering edit mode

Hello, I've tried doing it but I don't understand the IRanges. Is that the position number? Because the position number only gives 1 numerical value.

Thank you so much!

ADD REPLY
0
Entering edit mode

Try to think it through... what do you need to overlap with what? Try to visualise the regions.

If you only have a single co-ordinate, why not use that for both the start and end co-ordinate?

ADD REPLY
0
Entering edit mode

Assuming you have variants loaded into a dataframe in R in the format of Chrom Pos Ref Alt, I typically do this by making a new column in the dataframe where I concatenate those fields into a single text string. Then I make a new list out of such columns for all the datasets I am overlapping, and run it through R's Venn.Diagram package. You can get the exact overlaps with calculate.overlaps I believe, which is also used by the main venn.diagram function. This assumes that the same SNP in multiple datasets will be represented by the exact same character string of "Chrom Pos Ref Alt" in each dataset; in real life this may not be the case so you should double check, its common for one set or the other to be/not be left-normalized, notation may be slightly different if you're looking at .vcf vs annotation tables, or for anything >1bp, etc. etc.

ADD REPLY

Login before adding your answer.

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