hi Leonardo,

(side note: we recommend to put the variable of interest always at the end
of the design formula, so the defaults for results() and plotMA() give you
the contrast of interest)


On Tue, Mar 4, 2014 at 11:44 AM, Leonardo Pitombo [guest] <
guest@bioconductor.org> wrote:

>
> Dear Dr. Michael,
>
> I’m using DESeq2 to compare data from different treatments to find
> possible bioindicators. I applied the DESeq function by two ways:
>
> A) treatmentdeseq <- phyloseq_to_deseq2(biom_otu_tax, ~treatment)
>
> B) treatmentdeseq2<- phyloseq_to_deseq2(biom_otu_tax, ~treatment +
> condition x)
>
> The intercept in both is the same, but the comparisons among treatments
> are (a bit) different when I call A and B. In B, does the condition exert
> some influence on analysis comparing treatments?
> Could you explain why?
>

​The treatment effect is different in (B) because we say the condition
effect has been "accounted for".​ Try to find a reference on linear
modeling, as the change in estimated coefficients after "accounting for"
other variables is a general property of linear models.

For example, compare the estimate for x in these two linear models:

> x <- rep(0:1, each=20)
> z <- c(rep(0:1,c(15,5)),rep(0:1,c(5,15)))

say x is our variable of interest, and we have an unbalanced batch variable
z:

> z
 [1] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1
1 1 1
[39] 1 1



> y <- rnorm(40, x + 2*z)
> coef(summary(lm(y ~ x)))
             Estimate Std. Error  t value     Pr(>|t|)
(Intercept) 0.4343922  0.2601761 1.669608 1.032160e-01
x           2.0148582  0.3679446 5.475982 2.978237e-06


> coef(summary(lm(y ~ z + x)))
               Estimate Std. Error    t value     Pr(>|t|)
(Intercept) -0.06667297  0.1833274 -0.3636824 7.181651e-01
z            2.00426063  0.2771650  7.2312893 1.397230e-08
x            1.01272784  0.2771650  3.6538801 7.959908e-04
>

​
​



>
> Thanks,
> Leonardo M. Pitombo
>
>
>  -- output of sessionInfo():
>
> > sessionInfo("DESeq2")
> R version 3.0.1 (2013-05-16)
> Platform: x86_64-w64-mingw32/x64 (64-bit)
>
> locale:
> [1] LC_COLLATE=Dutch_Netherlands.1252  LC_CTYPE=Dutch_Netherlands.1252
>  LC_MONETARY=Dutch_Netherlands.1252
> [4] LC_NUMERIC=C                       LC_TIME=Dutch_Netherlands.1252
>
> attached base packages:
> character(0)
>
> other attached packages:
> [1] DESeq2_1.2.10
>
> loaded via a namespace (and not attached):
>  [1] ade4_1.6-2              annotate_1.40.0         AnnotationDbi_1.24.0
>    ape_3.0-11
>  [5] base_3.0.1              Biobase_2.22.0          BiocGenerics_0.8.0
>    biom_0.3.11
>  [9] Biostrings_2.30.1       cluster_1.14.4          codetools_0.2-8
>   colorspace_1.2-4
> [13] datasets_3.0.1          DBI_0.2-7               dichromat_2.0-0
>   digest_0.6.4
> [17] foreach_1.4.1           genefilter_1.44.0       GenomicRanges_1.14.4
>    ggplot2_0.9.3.1
> [21] glmmADMB_0.7.7          graphics_3.0.1          grDevices_3.0.1
>   grid_3.0.1
> [25] gtable_0.1.2            igraph_0.7.0            IRanges_1.20.6
>    iterators_1.0.6
> [29] labeling_0.2            lattice_0.20-24         locfit_1.5-9.1
>    MASS_7.3-29
> [33] Matrix_1.1-2            methods_3.0.1           multtest_2.18.0
>   MuMIn_1.9.13
> [37] munsell_0.4.2           nlme_3.1-113            parallel_3.0.1
>    permute_0.8-3
> [41] phyloseq_1.7.12         plyr_1.8                proto_0.3-10
>    R2admb_0.7.10
> [45] RColorBrewer_1.0-5      Rcpp_0.11.0
> RcppArmadillo_0.4.000.2 reshape2_1.2.2
> [49] RJSONIO_1.0-3           RSQLite_0.11.4          scales_0.2.3
>    splines_3.0.1
> [53] stats_3.0.1             stats4_3.0.1            stringr_0.6.2
>   survival_2.37-7
> [57] tools_3.0.1             utils_3.0.1             vegan_2.0-10
>    XML_3.98-1.1
> [61] xtable_1.7-1            XVector_0.2.0
>
> --
> Sent via the guest posting facility at bioconductor.org

	[[alternative HTML version deleted]]

