minfi bumphunter - probe IDs
1
0
Entering edit mode
@565e9996
Last seen 13 months ago
Spain

Hi, I am doing some DNA methylation analysis with minfi package. I am a biologist and only starting with R, learning as I go and I often struggle with the basics.

I have a list of dmrs called from Illumina 450k microarray, GenomicRatioSet with the bumphunter method.

Code should be placed in three backticks as shown below

head(dmrs2$table, n=3)

     chr    start      end      value     area cluster indexStart indexEnd  L clusterL
4223 chr6 28828946 28829674 -0.4097562 6.556100  141235     132125   132140 16       70
4279 chr6 32120773 32121130 -0.4054765 5.676670  141949     138162   138175 14       77
4290 chr6 32847527 32847845 -0.3150502 5.040804  142088     139180   139195 16       19
     p.value fwer p.valueArea fwerArea
4223       0    0           0        0
4279       0    0           0        0
4290       0    0           0        0
# include your problematic code here with any corresponding output 
# please also include the results of running the following in an R session 

sessionInfo( )

As you can see, the DMR are expressed as location in the genome, with chr start and end, but not as the probes anymore. I assume I can add them somehow intersecting dmrs$table results with original GRset used to call the bumps, but I have no idea how to do that.

Could someone please help me with that? I tried few wariants, but it didn't work and now am quite desperated..

minfi bumphunter • 980 views
ADD COMMENT
0
Entering edit mode
Basti ▴ 780
@7d45153c
Last seen 1 day ago
France

I can give you some hints but you will need to adapt this frame to your own analysis (currently we do not know if coordinates are from hg19 or hg38 genome or another)

1) Load and format array annotation

Some packages with pre-existing annotation exist, but you could use one you want by adapting following code.

library(minfi)
library(IlluminaHumanMethylation450kanno.ilmn12.hg19)
library(GenomicRanges)

data("IlluminaHumanMethylation450kanno.ilmn12.hg19")
ann450k=data.frame(getAnnotation(IlluminaHumanMethylation450kanno.ilmn12.hg19))

#Select interesting columns in the annotation : chromosome, position in hg19 coordinates and probe ID
ann450k=ann450k[,c("chr","pos","Name)]
#Create an index of probes ranked from 1 to the number of total probes annotated
ann450k$Index=1:dim(ann450k)[[1]]

#Create a GRanges object from the annotation data
Annotated_ALL <- GRanges(as.character(ann450k$chr), 
                         IRanges(start=c(ann450k$pos),end=c(ann450k$pos+1)),
                         probe=rownames(ann450k))

2)Overlap your DMRs coordinates with annotation

#I create here a fake DMR table looking like your example
DMRs=data.frame(chr=c("chr6","chr6"),start=c(28828946,32120773),end=c(28829674,32121130))

#Create corresponding GRanges object from your DMR table
DMR_ranges = GRanges(as.character(DMRs$chr), 
                      IRanges(start=c(DMRs$start),end=c(DMRs$end)))

#Use the function findOverlaps from GenomicRanges package, which is able to find interval overlaps between two range-based objects (as GRanges objects are)
Overlap=findOverlaps(Annotated_ALL,DMR_ranges)

#Obtain DMR probes
DMR_probes=merge(data.frame(Overlap),ann450k,by.x="queryHits",by.y="Index")

> DMR_probes
   queryHits subjectHits  chr      pos       Name
1      44268           2 chr6 32120901 cg02956248
2      44355           1 chr6 28829378 cg03188580
3      45375           2 chr6 32120863 cg06025456
4      46906           2 chr6 32120933 cg10551329
5      47715           2 chr6 32120773 cg12883279
6      48113           2 chr6 32120878 cg13934406
7      49364           1 chr6 28829328 cg17571919
8      50136           1 chr6 28829321 cg19772114
9      50691           1 chr6 28829332 cg21572914

Here you have for each DMR (subjectHits 1 is DMR ranked 1 in the table, 2 is for DMR ranked 2 in the table, etc ...) corresponding probes in the DMR.

This is a custom code I developed for my own use, so adaptations may be necessary for your own analysis (notably if you want to go further a create a table with probes per DMR on a single line, etc...)

ADD COMMENT
0
Entering edit mode

It worked!

Thank you so much. There is for sure special place with lots of fluffy puppies to hug in heaven, for people that answer bioconductor support questions!

All the best, Dorota

ADD REPLY
0
Entering edit mode

No worries ! I saw your issue and it made me remind I had almost the same question few months ago, so I am happy to share it

ADD REPLY

Login before adding your answer.

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