[BioC] Limma contrasts question

Daniel Brewer daniel.brewer at icr.ac.uk
Mon Oct 20 17:19:57 CEST 2008



James W. MacDonald wrote:
> Daniel Brewer wrote:
>> Hello,
>>
>> Apologies for not providing enough information.  It is a two colour
>> Agilent array.  I was trying to keep the post short, but here is the
>> full information (note I didn't design the experiment).
>>
>> Targets file:
>> SlideNumber    ArrayNumber    FileName    Name    Cy3    Cy5
>> 1    1    Input/1_1.txt    1_1    Scramble    Knockdown
>> 1    2    Input/1_2.txt    1_2    Knockdown    PC3M
>> 1    3    Input/1_3.txt    1_3    PNT2    PC3M
>> 1    4    Input/1_4.txt    1_4    Pooled    PNT2
>> 2    2    Input/2_2.txt    2_2    PC3M    Scramble
>> 2    3    Input/2_3.txt    2_3    PNT2    Scramble
>> 3    1    Input/3_1.txt    3_1    PC3M    Pooled
>> 3    2    Input/3_2.txt    3_2    Pooled    Knockdown
>> 3    3    Input/3_3.txt    3_3    Scramble    Pooled
>> 3    4    Input/3_4.txt    3_4    Knockdown    PNT2
>>
>> PC3M = the control cell line
>> Knockdown = PC3M with an siRNA knockdown vector
>> Scramble = PC3M with a vector with a scrambled sequence
>> PNT2 = Another cell line (not of interest here)
>> Pooled = poll of knockdowns before you get specific clone, intermediate
>> between PCM3 and knockdown - a hetrogenious group (not considered here)
>>
>> Here is the relevant code (before this the standard steps were used to
>> give normalised data without any controls):
>>
>> #Differential analysis
>> design <- modelMatrix(targets,ref="PC3M")
>> fit <- lmFit(normNoC, design)
>> contrast.matrix <- makeContrasts("Knockdown vs Controls"=(2*Knockdown -
>> Scramble)/2, levels=design)
>> fit2 <- contrasts.fit(fit, contrast.matrix)
>> fit3 <- eBayes(fit2))
>>
>>> design
>>       Knockdown PNT2 Pooled Scramble
>>  [1,]         1    0      0       -1
>>  [2,]        -1    0      0        0
>>  [3,]         0   -1      0        0
>>  [4,]         0    1     -1        0
>>  [5,]         0    0      0        1
>>  [6,]         0   -1      0        1
>>  [7,]         0    0      1        0
>>  [8,]         1    0     -1        0
>>  [9,]         0    0      1       -1
>> [10,]        -1    1      0        0
>>
>>> sessionInfo()
>> R version 2.7.2 (2008-08-25)
>> x86_64-pc-linux-gnu
>>
>> locale:
>> LC_CTYPE=en_GB.UTF-8;LC_NUMERIC=C;LC_TIME=en_GB.UTF-8;LC_COLLATE=en_GB.UTF-8;LC_MONETARY=C;LC_MESSAGES=en_GB.UTF-8;LC_PAPER=en_GB.UTF-8;LC_NAME=C;LC_ADDRESS=C;LC_TELEPHONE=C;LC_MEASUREMENT=en_GB.UTF-8;LC_IDENTIFICATION=C
>>
>>
>> attached base packages:
>> [1] stats     graphics  grDevices utils     datasets  methods   base
>>
>> other attached packages:
>> [1] limma_2.14.7
>>
>> So I would like to compare the two controls (scramble and PNT2) with the
>> knockdown, but I am not sure how to compare one variable in the model
>> with two.
> 
> I assume you mean PC3M rather than PNT2. Now it depends on whether or
> not you want to assume (or maybe check) that the two controls are
> essentially the same, and hence want to pool, or if you want to do
> knockdown to each control separately.
> 
> For the former, this should suffice:
> 
> contrast.matrix <- makeContrasts("KvC" = Knockdown - (Scramble +
> PC3M)/2, levels = design)
> 
> So what we are asking for is the difference between the knockdown and
> the average of the two control samples.
> 
> An implicit assumption here is that the scramble and PC3M samples have
> similar expression values, so you might want to check by adding an
> additional term:
> 
> contrast.matrix <- makeContrasts("KvC" = Knockdown - (Scramble +
> PC3M)/2, "SvP" = Scramble - PC3M, levels = design)
> 
> If there are loads of significantly different genes in the SvP contrast,
> you might want to rethink the control status of these samples.
> 
> For the latter:
> 
> contrast.matrix <- makeContrasts("KvS" = Knockdown - Scramble
>             "KvsC" = Knockdown - PC3M, levels = design)
> 
> Here we don't assume the scramble and PC3M samples are similar, and
> simply make comparisons individually. If you then wanted to see if the
> two control samples seemed similar, you could use decideTests() followed
> by vennCounts() and vennDiagram() to make a Venn diagram.
> 
> Best,
> 
> Jim
> 
> 
>>
>> I would really appreciate your help with this.
>>
>> Many thanks
>>
>> Dan
>>
> 

Thanks for that information.  Yes I did mean PC3M as a contol ... doh.

Unfortunately I am still having problems.
> contrast.matrix <- makeContrasts("KvC" = Knockdown - (Scramble +
PC3M)/2, levels = design)
Error in eval(expr, envir, enclos) : object "PC3M" not found

I believe this is because PC3M is not in the design matrix as I am using
it as the reference.  As a structure for this I have been using the
direct 2-color design example of the "Limma User guide" (Section 7.4).
There is a discrepancy between the straight comparisons that you have
given me and the example in the guide.

Your suggestion:
contrast.matrix <- makeContrasts("KvsC" = Knockdown - PC3M, levels = design)
Their suggestion:
contrast.matrix <- makeContrasts("KvsC" = Knockdown, levels = design)

I think this will have something to do with PC3M being described as the
reference (the intercept in the linear model???) in their approach but
maybe you use a different reference.  Not sure.

Many thanks for your time.  I really would like to get an understanding
of this.

Thanks

Dan

-- 
**************************************************************

Daniel Brewer

Institute of Cancer Research
Molecular Carcinogenesis
MUCRC
15 Cotswold Road
Sutton, Surrey SM2 5NG
United Kingdom

Tel: +44 (0) 20 8722 4109
Fax: +44 (0) 20 8722 4141

Email: daniel.brewer at icr.ac.uk

**************************************************************

The Institute of Cancer Research: Royal Cancer Hospital, a charitable Company Limited by Guarantee, Registered in England under Company No. 534147 with its Registered Office at 123 Old Brompton Road, London SW7 3RP.

This e-mail message is confidential and for use by the a...{{dropped:2}}



More information about the Bioconductor mailing list