exporting limma log2 data
1
0
Entering edit mode
Jahn Davik ▴ 110
@jahn-davik-5747
Last seen 10.1 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):

library(limma)

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.

 

jd

 

 


 

limma export log2 data agilent • 3.3k views
ADD COMMENT
2
Entering edit mode
@james-w-macdonald-5106
Last seen 6 hours 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.

ADD COMMENT
0
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.

 

jd

 

ADD REPLY
0
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:

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?

ADD REPLY
0
Entering edit mode

It helps. Thank you so much for the feedback.

jd

 

 

ADD REPLY

Login before adding your answer.

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