R-package: How to load a matrix from file to Limma for ebays ??
Jose de las Heras
(by josenet from tiscali.co.uk)
Tue Jul 17 05:18:53 EST 2007
<polen.t2006 from freenet.de> wrote in message
news:1184594807.844241.40020 from d55g2000hsg.googlegroups.com...
> Hi all,
> I need a little help in R for determination of differentially
> expressed genes using limma.
> Example: I have a simple tab-delimeted text-file containg normalized
> red/green-Ratio-values of three independent repetitions. In this file
> first row contains the names of the experiments and first columns the
> names of the probes. Sometimes there are missing values.
> I tried to load the text-file into an object to handle it with limma
> for some statistics to determine differentially expressed genes.
> However, somehow there is a problem to bring the matrix from the file
> to the right limma-object:
> 1.) data <- read.delim("R_test_matrix.dat ", header = TRUE, sep ="\t",
> quote="\"", dec=".", fill = TRUE)
> 2.) fit <- lmFit(data, design=c(1,1,1))
> Error: (subscript) boolean Index to long
> 3.) fit <- eBayes(fit)
> 4.) write.fit(fit, file="fit.txt")
> Actually, there is no problem when starting from the 3 gpr-files using
> another R-script. But in special cases there are pre-processed data of
> which the ratio values are already in the text-file mentioned above
> for further statistics.
> Any Idea?
> Thanks a lot for help!
I encourage you to join the BioConductor forum, where you'll find a lot of
people familiar with limma (and R in general). In fact, Limma's creator,
Gordon Smyth, is a regular there.
I don't have time right now to look into this, and I don't even have R on
this computer... but if you ask in the BioC forum you might get an answer
I have been using Limma for a while, but always starting from the raw data.
By the time I get to the linear modelling fit section I have a "MAList"
object. I know that 'lmFit' will take a matrix with M values as well as a
The first thing I'd do is to check that what you're feeding to the 'lmFit'
function is actually a matrix. I suspect that 'read.delim' produces a
dataframe object, not a matrix... and I am not sure that 'lmFit' works with
dataframes (but it might! I just can't check right now).
So... first things to check:
read the help screen. Does it state whether it can take as input anything
other than objects of class MAList or matrix? I think not, but I could be
if I am right... then try:
if it says anything other than "matrix" then you are feeding the wrong input
to 'lmFit'. It'll be a data frame, and you'll have to convert it to a
will convert a dataframe to a matrix, as long as it has a matrix-compatible
I really can't offer you anything else without having an R session in front
of me. Do try the BioC forum, there's probably a simple solution. Usually
most of the errors I get are for silly things like this... having a list
rather than a vector, a factor instead of a vector... etc etc... the
function 'class' tells you what sort of data object you're dealing with, if
you're not sure... and it's your best friend :-)
More information about the Methods