Question: Obtaining annotated results from rnbeads
0
4 months ago by
Mark Dunning1.1k
Sheffield, Uk
Mark Dunning1.1k wrote:

I'm trying to use rnbeads to analyse some EPIC methylation arrays. I'm calling the functions individually, rather than running the single report script, so that I have more control over the differential analysis.

I use this code to perform differential methylation and export tables

rnb.set <- rnb.execute.import(data.source = "idats", data.type = "idat.dir")
rnb.set.unfiltered <- rnb.set
result <- rnb.run.preprocessing(rnb.set.unfiltered, dir.reports=report.dir)
rnb.set <- result\$rnb.set

# Specify the sample annotation table columns for which
# differential methylation is to be computed
cmp.cols <- "Sample_Group"
# Specify the region types
reg.types <- c("genes", "promoters")
# Conduct the analysis
diffmeth <- rnb.execute.computeDiffMeth(rnb.set, cmp.cols,
region.types=reg.types)

comparison <- get.comparisons(diffmeth)[1]
tab.genes <- get.table(diffmeth, comparison, "genes", return.data.frame=TRUE)
tab.prom <- get.table(diffmeth, comparison, "promoters", return.data.frame=TRUE)
write.csv(tab.genes, file="Genes_Sample_Group.csv",row.names=FALSE)
write.csv(tab.prom, file="Promoters_Sample_Group.csv",row.names=FALSE)


However, the resulting tables don't contain any useful identifiers (e.g. gene symbol) only a row number. How can I add annotation to these tables? There must be a function somewhere because the tables generated by the report (which I did run once) had annotation

Thanks,

modified 4 months ago by mscherer10 • written 4 months ago by Mark Dunning1.1k
1
4 months ago by
mscherer10
mscherer10 wrote:

Dear Mark,

That is easily solved. The obtained results have the same dimension as the methylation and annotation matrices stored in the rnb.set object. You can access this information using:

anno.genes <- annotation(rnb.set,"genes")
anno.proms <- annotation(rnb.set,"promoters")


This includes all the information you need, like gene symbol, genomic location or Ensembl/Entrez ID. You can obtain the methylation matrix using:

meth.matrix <- meth(rnb.set,"genes/promoters")


Hope that helps!

Thanks a lot. That does indeed work.