[BioC] lumi - construct a design matrix

Moshe Olshansky olshansky at wehi.EDU.AU
Tue Jul 24 07:30:08 CEST 2012


Hi Paolo,

Your command:

colnames(design) <- c('CME','ES','CMA','CMN')

is wrong (i.e. this is not what model.matrix produces).

Do the two previous commands, i.e.

sampleType <-
c('CME','ES','CMA','CMN','CME','ES','CMA','CMN','CME','ES','CMA','CMN')
design <- model.matrix(~ factor(sampleType))

and then look at design (i.e. type design). You will see what you get.

You can also try
design <- model.matrix(~ 0 + factor(sampleType))
instead and again see what you get.

Best regards,
Moshe.

> Dear All,
> I am wondering about the construction of a design matrix for identify
> diff erentially expressed genes with Lumi package.
> I am asking this beacause I obtain strange results when i compare
> between groups.
>
> I have 4 sample, each one in triplicate.
> I substracted bkg, normalized and vst transformed.
>
>
> dataMatrix <- exprs(lumi.N.Q)
> presentCount <- detectionCall(x.lumi)
> selDataMatrix <- dataMatrix[presentCount > 1,]
> probeList <- rownames(selDataMatrix)
>
>
>
> sampleType <-
> c('CME','ES','CMA','CMN','CME','ES','CMA','CMN','CME','ES','CMA','CMN')
> design <- model.matrix(~ factor(sampleType))
> colnames(design) <- c('CME','ES','CMA','CMN')
>
>
> fit1 <- lmFit(selDataMatrix, design)
> constrast.matrix <- makeContrasts (ES-CMN,ES-CME,ES-CMA,levels=design)
> fit1_2 <- contrasts.fit(fit1,constrast.matrix)
> fit1_2 <- eBayes(fit1_2)
>
>
>
> If now I try to check how the matrix is designed:
>
> design()
>
> CME ES CMA CMN
> 1    1  1   0   0
> 2    1  0   0   1
> 3    1  0   0   0
> 4    1  0   1   0
> 5    1  1   0   0
> 6    1  0   0   1
> 7    1  0   0   0
> 8    1  0   1   0
> 9    1  1   0   0
> 10   1  0   0   1
> 11   1  0   0   0
> 12   1  0   1   0
> attr(,"assign")
> [1] 0 1 1 1
> attr(,"contrasts")
> attr(,"contrasts")$`factor(sampleType)`
> [1] "contr.treatment"
>
>
> and this seems not be the one I designed,  where am I wrong?
>
>
> Thanks,
> Paolo
>
>
> ssionInfo()
> R version 2.15.0 (2012-03-30)
> Platform: i386-pc-mingw32/i386 (32-bit)
>
> locale:
> [1] LC_COLLATE=Italian_Italy.1252  LC_CTYPE=Italian_Italy.1252
> LC_MONETARY=Italian_Italy.1252
> [4] LC_NUMERIC=C                   LC_TIME=Italian_Italy.1252
>
> attached base packages:
> [1] stats     graphics  grDevices utils     datasets  methods   base
>
> other attached packages:
>  [1] annotate_1.34.1           lumiMouseAll.db_1.18.0
> org.Mm.eg.db_2.7.1        limma_3.12.1
>  [5] lumiMouseIDMapping_1.10.0 RSQLite_0.11.1            DBI_0.2-5
>             AnnotationDbi_1.18.1
>  [9] lumi_2.8.0                nleqslv_1.9.3
> methylumi_2.2.0           ggplot2_0.9.1
> [13] reshape2_1.2.1            scales_0.2.1
> Biobase_2.16.0            BiocGenerics_0.2.0
>
> loaded via a namespace (and not attached):
>  [1] affy_1.34.0           affyio_1.24.0         bigmemory_4.2.11
> BiocInstaller_1.4.7
>  [5] Biostrings_2.24.1     bitops_1.0-4.1        BSgenome_1.24.0
> colorspace_1.1-1
>  [9] dichromat_1.2-4       digest_0.5.2          DNAcopy_1.30.0
> GenomicRanges_1.8.7
> [13] genoset_1.6.0         grid_2.15.0           hdrcde_2.16
> IRanges_1.14.4
> [17] KernSmooth_2.23-8     labeling_0.1          lattice_0.20-6
> MASS_7.3-19
> [21] Matrix_1.0-7          memoise_0.1           mgcv_1.7-18
> munsell_0.3
> [25] nlme_3.1-104          plyr_1.7.1            preprocessCore_1.18.0
> proto_0.3-9.2
> [29] RColorBrewer_1.0-5    RCurl_1.91-1.1        Rsamtools_1.8.5
> rtracklayer_1.16.2
> [33] stats4_2.15.0         stringr_0.6           tools_2.15.0
> XML_3.9-4.1
> [37] xtable_1.7-0          zlibbioc_1.2.0
>>
>
> _______________________________________________
> Bioconductor mailing list
> Bioconductor at r-project.org
> https://stat.ethz.ch/mailman/listinfo/bioconductor
> Search the archives:
> http://news.gmane.org/gmane.science.biology.informatics.conductor
>



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



More information about the Bioconductor mailing list