Question: exporting limma log2 data
0
5.1 years ago by
Jahn Davik110
Jahn Davik110 wrote:

Dear all,

I am quite new to limma and need to ask how to export the normalized data. I want to use them in graphical data exploration and presenatation. So, I do something like this (following the Mattick Lab post):

library(limma)

x <- read.maimages(targets, path = 'mydirectory', source = 'agilent', green.only =T)

y <- backgroundCorrection(x,method = 'normexp')

y <- normalizeBetweenArrays(y, method = 'quantile')

So I guess 'y' now contains the log2 expression data.

Question: how can I get them out of R and into a, say, tab-delimited text file?

I would be much obliged.

Thank you.

jd

limma export log2 data agilent • 2.1k views
modified 5.1 years ago by James W. MacDonald52k • written 5.1 years ago by Jahn Davik110
2
5.1 years ago by
United States
James W. MacDonald52k wrote:

The object you are calling 'y' is an EList, and y$E contains the normalized data. So you could hypothetically use write.table() to output to a file. But I would recommend that you resist this temptation. There are any number of Bioconductor packages (one of which is limma, the package you are currently using) that are useful for exploration and presentation of your data. In fact I would argue that the easiest and most productive way for you to proceed from here is to keep your data in R and finish the analysis using limma. I can't imagine what you would do with those data that you couldn't do (probably more efficiently) with Bioconductor. If you say what exactly you are trying to do, I am sure we can come up with some pointers. ADD COMMENTlink written 5.1 years ago by James W. MacDonald52k Dear MacDonald, Thanks for the reply. I wanted to extract the data in order to do boxplots of probes of my interest. But if that is possible within limma, advice is greatly appreciated. jd ADD REPLYlink written 5.1 years ago by Jahn Davik110 I am not sure exactly what you mean by 'boxplots of probes'. I could interpret that to mean that you want to make boxplots for individual probes, across (some or all) samples. Or I could interpret that to mean that you want to make boxplots for each sample, restricted to a set of probes. There isn't any functionality in limma that I know of to make boxplots, but that's because it would be duplication of existing functionality elsewhere in R. Since I don't know exactly what you want, here are some suggestions. In these examples, I will use 'y' as the EList input object. Boxplot of individual probes, all samples: probevec <- <character vector of probe IDs of interest> boxplot(t(y$E[probevec,]), xaxt = "none")
axis(1, seq_len(length(probevec)), probevec, las = 2)

Boxplot of individual probes, separated by groups of samples:

library(lattice)
groupfac <- <factor of groups>
## this can be any vector that has the same value for each sample of a given type. As an example:
groupfac <- factor(c("Control","Control","Treated","Control","Treated","Treated"))
probes <- t(y$E[probevec,]) forlattice <- data.frame(groupfac = rep(groupfac, length(probevec), probes = colnames(probes)[col(probes)], vals = as.vector(probes)) bwplot(vals~probes|groupfac, forlattice) Boxplot of individual samples, subsetted by a set of probes: boxplot(y$E[probevec,])

Does that help?

It helps. Thank you so much for the feedback.

jd