exporting limma log2 data
Entering edit mode
Jahn Davik ▴ 110
Last seen 9.2 years ago

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):


targets <- readTargets('targets.txt')

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.






limma export log2 data agilent • 2.9k views
Entering edit mode
Last seen 1 hour ago
United States

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.

Entering edit mode

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.




Entering edit mode

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:

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:


Does that help?

Entering edit mode

It helps. Thank you so much for the feedback.





Login before adding your answer.

Traffic: 713 users visited in the last hour
Help About
Access RSS

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6