[BioC] question about limma2annaffy
James W. MacDonald
jmacdon at med.umich.edu
Tue Mar 27 03:19:50 CEST 2007
Hi Jenny,
Jenny Drnevich wrote:
> Hi Jim,
>
> I'm learning to use your limma2annaffy function, and I have a few
> questions. In the affycoretools vignette (Feb 6, 2007), you call
> limma2annaffy this way:
>
> > limma2annaffy(eset, fit2, design, annotation(eset), pfilt = 0.05)
>
> I think there's a typo in this, because you've left out the contrast
> matrix. When I try the same on my data:
Yeah, that's a typo. It never came up in a build/check cycle because it
never really gets called in the Sweave() document. Thanks for pointing
it out though.
>
> > limma2annaffy(gcrma.pres, fit2, design, annotation(gcrma.pres),pfilt=0.05)
> Error in vector("list", dim(contrast)[2]) :
> negative length vectors are not allowed
>
> When I try naming the annotation(gcrma.pres) argument, I get this:
>
> > limma2annaffy(gcrma.pres, fit2, design,
> lib=annotation(gcrma.pres),pfilt=0.05)
> Error in vector("list", dim(contrast)[2]) :
> argument "contrast" is missing, with no default
>
> It does work when I add the contrast matrix:
>
> > limma2annaffy(gcrma.pres, fit2, design,
> cont.matrix,annotation(gcrma.pres),pfilt=0.05)
>
>
> So, besides pointing out an apparent error in the vignette, I had a
> question as to what you would do if you didn't use a contrast matrix? Now,
> most all the time that I analyze affy data I do use a contrast matrix, but
> you don't always have to use one. I have some other questions/suggestions
> to improve the ease of use of affycoretools, but they are too complicated
> to put in this e-mail...
You can _always_ use a contrasts matrix, even if you don't need one. The
thing about limma2annaffy() is I use the colnames of the contrasts
matrix to name the output files, so there has to be one. So there are
two things you can do.
Say you fit a factor effects model with a set of tumor/normal samples,
three of each:
> design <- model.matrix(~ factor(rep(1:2, each=3)))
> design
(Intercept) factor(rep(1:2, each = 3))2
1 1 0
2 1 0
3 1 0
4 1 1
5 1 1
6 1 1
attr(,"assign")
[1] 0 1
attr(,"contrasts")
attr(,"contrasts")$`factor(rep(1:2, each = 3))`
[1] "contr.treatment"
Now the second column of the design matrix specifies the tumor - normal
contrast, so a contrasts matrix is superfluous. However, this contrast
will work with limma2annaffy():
> contrast <- matrix(c(0,1), dimnames=list(c("normal", "tumor"), "tumor
vs normal"))
> contrast
tumor vs normal
normal 0
tumor 1
Or you can just specify a cell means model in the first place.
Alternatively, you could just select the probesets that are significant
and use probes2table(). But that would be more work if you want t-stats,
p-values, etc.
If you want to send me an email offline, I would be happy to hear your
suggestions. I am always up for improving things.
Best,
Jim
--
James W. MacDonald
University of Michigan
Affymetrix and cDNA Microarray Core
1500 E Medical Center Drive
Ann Arbor MI 48109
734-647-5623
**********************************************************
Electronic Mail is not secure, may not be read every day, and should not be used for urgent or sensitive issues.
More information about the Bioconductor
mailing list