[BioC] edgeR: Contrast selection

Gordon K Smyth smyth at wehi.EDU.AU
Sat Dec 19 04:07:07 CET 2009


Dear Anders,

Thanks for the bug report and the reproducible example.  The problem is 
fixed in edgeR 1.5.4.

Note that you could also specify the contrast by pair=c(1,3) instead of 
c("A","C").

Best wishes
Gordon

> library(edgeR)
> library( edgeR )
> counts <- matrix( rnbinom( 600, 5, .1 ), ncol=6 )
> conds <- c( "A", "A", "B", "B", "C", "C" )
> dgl <- DGEList( counts=counts, group=conds )
Warning message:
In DGEList(counts = counts, group = conds) :
   Calculating library sizes from total number of reads for each library.
> dgl <- estimateCommonDisp( dgl )
> res <- exactTest( dgl, c( "A", "C" ) )
Comparison of groups:  C - A
> sessionInfo()
R version 2.11.0 Under development (unstable) (2009-12-17 r50765)
i386-pc-mingw32

locale:
[1] LC_COLLATE=English_Australia.1252  LC_CTYPE=English_Australia.1252 
LC_MONETARY=English_Australia.1252
[4] LC_NUMERIC=C                       LC_TIME=English_Australia.1252

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base

other attached packages:
[1] edgeR_1.5.4

loaded via a namespace (and not attached):
[1] limma_3.3.4



> Date: Wed, 16 Dec 2009 19:03:10 +0100
> From: Simon Anders <anders at embl.de>
> Subject: [BioC] edgeR: Contrast selection
> To: Mark Robinson <mrobinson at wehi.edu.au>,	BioC list
> 	<bioconductor at stat.math.ethz.ch>
> Message-ID: <4B2920DE.4020504 at embl.de>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
> Dear Mark
>
> I cannot figure out how to specify which conditions to contrast against
> each other in an edgeR exactTest.
>
> I do the following:
>
> > library( edgeR )
> > counts <- matrix( rnbinom( 600, 5, .1 ), ncol=6 )
> > conds <- c( "A", "A", "B", "B", "C", "C" )
> > dgl <- DGEList( counts=counts, group=conds )
> Warning message:
> In DGEList(counts = counts, group = conds) :
>   Calculating library sizes from total number of reads for each library.
> > dgl <- estimateCommonDisp( dgl )
>
> Now I have a DGEList with 6 samples in 3 conditions. If I want to
> contrast 'C' vs 'A', I assume I should do
>
> > res <- exactTest( dgl, c( "A", "C" ) )
>
> However, I get this error here:
>
> Comparison of groups:  C - A
> Error in Ops.factor(pair[1], group) : level sets of factors are different
>
>
> Have I misunderstood the syntax, or is this a bug? I've tried around a
> bit with passing a factor instead, even with all three levels, but this
> did not help.
>
> Thanks in advance for any help.
>
> Cheers
>   Simon
>
>
> > sessionInfo()
> R version 2.11.0 Under development (unstable) (--)
> x86_64-unknown-linux-gnu
>
> locale:
>  [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C
>  [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8
>  [5] LC_MONETARY=C              LC_MESSAGES=en_US.UTF-8
>  [7] LC_PAPER=en_US.UTF-8       LC_NAME=C
>  [9] LC_ADDRESS=C               LC_TELEPHONE=C
> [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
>
> attached base packages:
> [1] stats     graphics  grDevices utils     datasets  methods   base
>
> other attached packages:
> [1] edgeR_1.5.3
>
> loaded via a namespace (and not attached):
> [1] limma_3.3.1
>
>
>
> +---
> | Dr. Simon Anders, Dipl.-Phys.
> | European Molecular Biology Laboratory (EMBL), Heidelberg
> | office phone +49-6221-387-8632
> | preferred (permanent) e-mail: sanders at fs.tum.de

______________________________________________________________________
The information in this email is confidential and intend...{{dropped:4}}



More information about the Bioconductor mailing list