[BioC] edgeR: Contrast selection

Simon Anders anders at embl.de
Wed Dec 16 19:03:10 CET 2009


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



More information about the Bioconductor mailing list