DMR Plot
1
0
Entering edit mode
Julie • 0
@julie-24031
Last seen 3.1 years ago
Belgium

I tried to follow https://bioconductor.org/packages/devel/workflows/vignettes/methylationArrayAnalysis/inst/doc/methylationArrayAnalysis.html#normalisation for the visualization of the results for the probe-wise analysis of my dataset. Regions plotted with the DMR.plot function (DMRcate package). However, I keep getting this error:

Error in .local(GdObject, ...) : 'groups' must be a vector of similar length as the number of rows in the data matrix (19)

GRset <- preprocessFunnorm(methylset)
betavals <- getBeta(GRset)
typeof(betavals)
betavals <- data.matrix(betavals)    
disease <- c(UlcerativeColitis="magenta", Normal="forestgreen")
names(disease) <- levels(factor(met_annot$Characteristics.disease.))
cols <- disease[as.character(factor(met_annot$Characteristics.disease.))]
par(mfrow=c(1,1))
DMR.plot(ranges = results.ranges, dmr= 20, CpGs = GRset, phen.col = cols, what="Beta",
         arraytype = "EPIC" )

I don't see what is going wrong here..

Thank you in advance!

dmr MethylationArrayData DMRcatedata • 2.6k views
ADD COMMENT
1
Entering edit mode
@james-w-macdonald-5106
Last seen 17 minutes ago
United States

I would check the names of your cols object. Note that what you are doing is first creating a named vector called disease, where the names are "UlcerativeColitis" and "Normal". And then you are changing those names (in the very next line!) to the factor levels of met_annot$Characteristics.disease.

Anyway, your goal is to have a named vector, where the names match up with the sample names for your experiment and the values are some colors. It looks to me like the problem is likely to be with the names of your cols object. If that looks OK, then you can either re-run the function, and right after the error do

traceback()

and copy/paste that into a reply to this answer, or you could alternatively do

debug(DMR.plot)

And then re-run, stepping through the function until it errors. And then you can re-run, and once you get to the point where you know it's going to error, you can look over what is going to be fed into the next step of the function and try to figure out what the problem is.

I would generally opt for the second method, as I personally find it very instructive to figure out problems myself. And learning how to figure things out on your own is IMO an invaluable skill to have.

ADD COMMENT

Login before adding your answer.

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