Gordon,

Thank you for your thoughtful reply. I apologize for not having provided a
more thorough accounting of my R session. To save space, I have left out the
output of the initial steps (reading in the files, kooperberg correcting
them, and quantile normalizing), but would be happy to provide them if you
think they would be of use. I have, nonetheless, included the code I
inputted to generate the data object RGAn that I pass to the lmFit function.


targetsA <- readTargets("targetsA.txt")
spottypes <- readSpotTypes()

# create filter for bad spots

filters <- function(x) {
okred <- x[,"F635 Mean"] < 65534
okgreen <- x[,"F532 Mean"] < 65534
fat <- x[,"Dia."] > 50
skinny <- x[,"Dia."] < 150
present <- x[,"Normalize"] < 1
good <- x[,"Flags"] > -50.5
as.numeric(okred & okgreen & fat & skinny & present & good)
}

#read in data and gal file

RGA = read.maimages(targetsA$FileName, source="genepix", wt.fun=filters,
other.columns=c("F635 SD",
"B635 SD", "F532 SD", "B532 SD", "F Pixels", "B Pixels", "B532 Mean","B635
Mean"))

## kooperberg correction

RGAkoop <- kooperberg(RGA)
RGAmodel <- normalizeWithinArrays(RGAkoop)

#quantile normalization
RGAn <- normalizeBetweenArrays(RGAmodel, method="quantile")

#Now, here is where I begin logging both input and output

> targetsA
                    SlideNumber Name                FileName Cy3 Cy5
2005-11-18_A130high           1 A130 2005-11-18_A130high.gpr   A   B
2005-11-16_A121high           2 A121 2005-11-16_A121high.gpr   B   C
2005-11-15_A117high           3 A117 2005-11-15_A117high.gpr   C   D
2005-11-16_A119high           4 A119 2005-11-16_A119high.gpr   D   E
2005-11-17_A127high           5 A127 2005-11-17_A127high.gpr   E  RC
2005-11-17_A128high           6 A128 2005-11-17_A128high.gpr  RC   A
2005-11-17_A129high           7 A129 2005-11-17_A129high.gpr   A   C
2005-11-18_A131high           8 A131 2005-11-18_A131high.gpr   B   D
2005-11-16_A120high           9 A120 2005-11-16_A120high.gpr   C   E
2005-11-15_A118high          10 A118 2005-11-15_A118high.gpr   D  RC
2005-11-22_A137high          11 A137 2005-11-22_A137high.gpr   E   A
2005-11-18_A136high          12 A136 2005-11-18_A136high.gpr  RC   B
> designmatrix <- modelMatrix(targetsA, ref="RC")
Found unique target names:
 A B C D E RC
> designmatrix
                     A  B  C  D  E
2005-11-18_A130high -1  1  0  0  0
2005-11-16_A121high  0 -1  1  0  0
2005-11-15_A117high  0  0 -1  1  0
2005-11-16_A119high  0  0  0 -1  1
2005-11-17_A127high  0  0  0  0 -1
2005-11-17_A128high  1  0  0  0  0
2005-11-17_A129high -1  0  1  0  0
2005-11-18_A131high  0 -1  0  1  0
2005-11-16_A120high  0  0 -1  0  1
2005-11-15_A118high  0  0  0 -1  0
2005-11-22_A137high  1  0  0  0 -1
2005-11-18_A136high  0  1  0  0  0
> designfitA <- lmFit(RGAn, design=designmatrix, method="ls")
> designfitA <- eBayes(designfitA)

#And here's a look at a subset of the data object with the warning that I am
asking about

> designfitA[2,1]
An object of class "MArrayLM"
$coefficients
              A
[1,] 0.07587446

$stdev.unscaled
             A
[1,] 0.7007649

$sigma
[1] 2.338142

$df.residual
[1] 6

$cov.coefficients
          [,1]
[1,] 0.4166667

$pivot
[1] 1 2 3 4 5

$method
[1] "ls"

$design
                     A B C D E
2005-11-18_A130high -1 1 0 0 0

$genes
  Block Row Column         ID     Name
2     1   1      2 MZ00040730 TC245883

$Amean
[1] 6.35853

$df.prior
[1] 3.102594

$s2.prior
[1] 0.5266471

$var.prior
[1] 0.5289733

$proportion
[1] 0.01

$s2.post
[1] 3.783035

$t
              A
[1,] 0.05566768

$p.value
             A
[1,] 0.9568093

$lods
             A
[1,] -4.959734

$F
[1] 0.3347732

$F.p.value
[1] 0.879682

Warning message:
design matrix is singular

Thanks again,

Matt


On 1/12/06, Gordon K Smyth <smyth@wehi.edu.au> wrote:
>
> On Fri, January 13, 2006 2:22 am, Matthew Scholz wrote:
> >On 1/12/06, Gordon K Smyth <smyth@wehi.edu.au> wrote:
> >> > Date: Wed, 11 Jan 2006 10:50:16 -0700
> >> > From: Matthew Scholz <schmatthew@gmail.com>
> >> > Subject: [BioC] loop design matrix
> >> > To: bioconductor@stat.math.ethz.ch
> >> >
> >> > I'm confused about my design matrix for a loop design experiment.
> This
> >> is a
> >> > six-membered direct design that can be drawn as a hexagram inscribed
> in
> >> a
> >> > hexagon (where the corners are treatments, obviously).
> >> >
> >> > Here is what my targets look like:
> >> >
> >> > Cy3 Cy5
> >> > A   B
> >> > B   C
> >> > C   D
> >> > D   E
> >> > E  RC
> >> > RC   A
> >> > A   C
> >> > B   D
> >> > C   E
> >> > D  RC
> >> > E   A
> >> > RC   B
> >> >
> >> > There are three ways I can conceive of constructing my design matrix
> for
> >> > this. The first is to use the modelMatrix function with the
> parameters
> >> > argument, but I don't really understand how this should be done, and
> >> this
> >> > might be my problem. The second is to declare an arbitrary reference
> and
> >> use
> >> > the modelMatrix function, as described in the user's manual:
> >> >
> >> > designmatrix <- modelMatrix(targets, ref="RC")
> >> >
> >> > When I do this I get the following design matrix
> >> >
> >> > A  B  C  D  E
> >> > -1  1  0  0  0
> >> > 0 -1  1  0  0
> >> > 0  0 -1  1  0
> >> > 0  0  0 -1  1
> >> > 0  0  0  0 -1
> >> > 1  0  0  0  0
> >> > -1  0  1  0  0
> >> > 0 -1  0  1  0
> >> > 0  0 -1  0  1
> >> > 0  0  0 -1  0
> >> > 1  0  0  0 -1
> >> > 0  1  0  0  0
> >>
> >> This design matrix is perfectly correct.
> >>
> >> > Which is fine, except when I use this to fit my data:
> >> >
> >> > designfit <- lmFit(RG, design=designmatrix, method="ls")
> >> >
> >> > I see the following annotation in the generated data:
> >> >
> >> > Warning message:
> >> > design matrix is singular
> >>
> >> The warning message you report cannot be produced by the command that
> you
> >> give.  This particular
> >> warning can only be produced by subsetting your data object to reduce
> the
> >> number of arrays, which
> >> you must have done elsewhere during your R session.  Your confusion
> seems
> >> to be simply that you
> >> are not keeping track correctly of which commands produce which output.
> >
> >The confusion is not *simply* that I am not keeping track of output. As
> I've
> >already stated, this message appears in the generated data (the data
> >object), not in the output.
>
> I'm sorry that you're finding the design matrix confusing.  This is a
> difficult topic, but I've
> tried hard to make the process as smooth as possible in the limma package
> and in the
> documentation.
>
> Your particular question here remains very hard to understand.  You say
> that you've found this
> warning message in a data object, but limma commands do not imbed warning
> messages in data
> objects.  And the particular limma command that you give doesn't generate
> this particular warning
> message either at the screen or in a data object.
>
> Is it possible that you are not using limma directly, but are using it
> through a third-party
> interface of some sort?  If so, please tell us what software you are using
> and how you are using
> it.  Perhaps you are using R functions written by someone else.  Is it
> possible that there are R
> functions being used, other than those in limma and publicly available
> packages, that you don't
> see?
>
> If you are writing all your own R code, you need to give us the actual
> code that produced the
> warning message.  You need to tell us what the data object was and in what
> part of it you found
> the warning message.  Give us the R commands which created the object, and
> the commands which you
> used to extract the warning message.  In other words, cut and paste a
> session from your computer
> which produces the warning message, without editing anything out.  If the
> session output is very
> long, it might be a good idea to try create a session with produces less
> output but still gives
> the same warning message.  But the important thing is not to edit anything
> out.
>
> Best wishes
> Gordon
>
>
>


--
Matt Scholz
Senior Research Specialist
Department of Plant Sciences
University of Arizona
(520) 621-1695

	[[alternative HTML version deleted]]

