DESeq help for comparing contrasts
1
0
Entering edit mode
muc345 • 0
@muc345-20390
Last seen 4.5 years ago

Hello there,

My issue is that DESeq no longer works and does not give me the correct contrast options. This was working before I updated to DESeq2 1.22.2

Here is my code:

> line.ds <- phyloseq_to_deseq2(ps.phyla, ~ Line)
> diagdds <- DESeq(line.ds, test="Wald", fitType="parametric")
using pre-existing size factors
estimating dispersions
found already estimated dispersions, replacing these
gene-wise dispersion estimates
mean-dispersion relationship
final dispersion estimates
fitting model and testing

> resultsNames(diagdds)
[1] "Intercept" "Line1"     "Line2"     "Line3"     "Line4"   

I'll also show some of the data included in my DESeq object

> line.ds@design
~Line
> line.ds@colData
DataFrame with 40 rows and 9 columns
            X  Genotype     Block     Line Wavelength     Time
     <factor> <integer> <integer> <factor>  <numeric> <factor>
1           1         4         1     N321      0.169    After
10         10         2         2     N326      0.114    After
11         11         2         3     N326      0.137    After
12         12         2         4     N326      0.092    After
13         13         5         1     N336      0.423    After

Now, what I would see before I updated was something like this: N331, N326, N337 etc. that matched the 5 factor levels in "Line".

I can perform the above analysis using a continuous variable with no trouble but do have issues when I group the samples into categories.

platform       x86_64-apple-darwin15.6.0   
arch           x86_64                      
os             darwin15.6.0                
system         x86_64, darwin15.6.0        
status                                     
major          3                           
minor          5.1                         
year           2018                        
month          07                          
day            02                          
svn rev        74947                       
language       R                           
version.string R version 3.5.1 (2018-07-02)
nickname       Feather Spray 

I have found that other people have posted similar questions regarding a change to the most up-to-date DESeq package but I have not been able to fix my problem based on the responses to others posts. Hence, why I am posting here.

Any help would be greatly appreciated! Thanks!

deseq2 • 658 views
ADD COMMENT
0
Entering edit mode
@mikelove
Last seen 1 hour ago
United States

From your posted code, I'd guess that when you get the resultsNames(dds) of Line1, Line2, ..., that dds$Line will have levels 0,1,2 ... DESeq2 doesn't do any magical renaming of factor levels, it's just pulling straight from dds$Line.

Can you run your code again, and check resultsNames(dds) and dds$Line in the same session?

ADD COMMENT
0
Entering edit mode

Hi Michael,

Thanks for the response.

Here is what I'm seeing:

diagdds <- DESeq(line.ds, test="Wald", fitType="parametric") estimating size factors estimating dispersions gene-wise dispersion estimates mean-dispersion relationship final dispersion estimates fitting model and testing resultsNames(diagdds) [1] "Intercept" "Line1" "Line2" "Line3" "Line4"
diagdds$Line [1] N321 N326 N326 N326 N336 N336 N336 N336 N337 N337 N337 N321 [13] N337 N321 N321 N334 N334 N334 N334 N326 N337 N326 N334 N321 [25] N336 N337 N326 N334 N321 N336 N337 N326 N334 N321 N336 N337 [37] N326 N334 N321 N336 Levels: N321 N326 N334 N336 N337

Thanks!

ADD REPLY
0
Entering edit mode

Can you update all packages on your machine and then run BiocManager::valid()

ADD REPLY
0
Entering edit mode

Here is my output:

BiocManager::valid()

  • sessionInfo()

R version 3.5.1 (2018-07-02) Platform: x86_64-apple-darwin15.6.0 (64-bit) Running under: macOS High Sierra 10.13.6

Matrix products: default BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib LAPACK: /Library/Frameworks/R.framework/Versions/3.5/Resources/lib/libRlapack.dylib

locale: [1] enUS.UTF-8/enUS.UTF-8/enUS.UTF-8/C/enUS.UTF-8/en_US.UTF-8

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

other attached packages: [1] metagMisc0.0.4 emmeans1.3.3 FSA0.8.22
[4] dunn.test
1.3.5 factoextra1.0.5.999 FactoMineR1.41
[7] usethis1.4.0 devtools2.0.1 ggfortify0.4.6
[10] visNetwork
2.0.6 igraph1.2.4 microbiomeSeq0.1
[13] naniar0.4.2 tidyr0.8.3 bindrcpp0.2.2
[16] vegan
2.5-4 lattice0.20-38 permute0.9-5
[19] RVAideMemoire0.9-73 cowplot0.9.4 DESeq21.22.2
[22] SummarizedExperiment
1.12.0 DelayedArray0.8.0 BiocParallel1.16.5
[25] matrixStats0.54.0 Biobase2.42.0 GenomicRanges1.34.0
[28] GenomeInfoDb
1.18.1 IRanges2.16.0 S4Vectors0.20.1
[31] BiocGenerics0.28.0 adespatial0.3-4 lmerTest3.1-0
[34] lme4
1.1-21 Matrix1.2-15 microbiome1.4.2
[37] ggplot23.1.0 phyloseq1.26.1 tibble_2.1.1

loaded via a namespace (and not attached): [1] tidyselect0.2.5 robust0.4-18 RSQLite2.1.1
[4] AnnotationDbi
1.44.0 htmlwidgets1.3 grid3.5.1
[7] RNeXML2.3.0 munsell0.5.0 codetools0.2-16
[10] preprocessCore
1.44.0 withr2.1.2 colorspace1.4-1
[13] knitr1.22 uuid0.1-2 leaps3.0
[16] rstudioapi
0.10 robustbase0.93-4 labeling0.3
[19] GenomeInfoDbData1.2.0 bit640.9-7 rhdf52.26.2
[22] rprojroot
1.3-2 TH.data1.0-10 coda0.19-2
[25] LearnBayes2.15.1 xfun0.6 ggthemes4.1.0
[28] adegenet
2.1.1 fastcluster1.1.25 adephylo1.1-11
[31] R62.4.0 doParallel1.0.14 locfit1.5-9.1
[34] bitops
1.0-6 assertthat0.2.1 promises1.0.1
[37] scales1.0.0 multcomp1.4-10 nnet7.3-12
[40] gtable
0.3.0 phylobase0.8.6 KMDA1.0
[43] processx3.3.0 WGCNA1.66 sandwich2.5-0
[46] rlang
0.3.3 genefilter1.64.0 scatterplot3d0.3-41
[49] splines3.5.1 lazyeval0.2.2 acepack1.4.1
[52] impute
1.56.0 checkmate1.9.1 BiocManager1.30.4
[55] yaml2.2.0 reshape21.4.3 backports1.1.3
[58] httpuv
1.5.0 Hmisc4.2-0 tools3.5.1
[61] spData0.3.0 biomformat1.10.1 RColorBrewer1.1-2
[64] dynamicTreeCut
1.63-1 sessioninfo1.1.1 Rcpp1.0.1
[67] plyr1.8.4 base64enc0.1-3 progress1.2.0
[70] zlibbioc
1.28.0 purrr0.3.2 RCurl1.95-4.12
[73] ps1.3.0 prettyunits1.0.2 ggpubr0.2
[76] rpart
4.1-13 deldir0.1-16 zoo1.8-5
[79] ggrepel0.8.0 cluster2.0.7-1 fs_1.2.7
...

ADD REPLY
0
Entering edit mode

[82] magrittr1.5 data.table1.12.0 gmodels2.18.1
[85] mvtnorm
1.0-10 pkgload1.0.2 hms0.4.2
[88] mime0.6 xtable1.8-3 pbkrtest0.4-7
[91] XML
3.98-1.19 gridExtra2.3 compiler3.5.1
[94] KernSmooth2.23-15 crayon1.3.4 minqa1.2.4
[97] htmltools
0.3.6 mgcv1.8-26 pcaPP1.9-73
[100] later0.8.0 spdep1.0-2 Formula1.2-3
[103] geneplotter
1.60.0 visdat0.5.3 rrcov1.4-7
[106] expm0.999-3 DBI1.0.0 MASS7.3-51.3
[109] boot
1.3-20 ade41.7-13 cli1.1.0
[112] adegraphics1.0-15 gdata2.18.0 bindr0.1.1
[115] pkgconfig
2.0.2 fit.models0.5-14 flashClust1.01-2
[118] rncl0.8.3 numDeriv2016.8-1 foreign0.8-71
[121] sp
1.3-1 xml21.2.0 foreach1.4.4
[124] annotate1.60.0 multtest2.38.0 XVector0.22.0
[127] estimability
1.3 stringr1.4.0 callr3.2.0
[130] digest0.6.18 Biostrings2.50.2 htmlTable1.13.1
[133] curl
3.3 shiny1.2.0 gtools3.8.1
[136] nloptr1.2.1 nlme3.1-137 jsonlite1.6
[139] Rhdf5lib
1.4.2 seqinr3.4-5 desc1.2.0
[142] pillar1.3.1 httr1.4.0 DEoptimR1.0-8
[145] pkgbuild
1.0.3 survival2.44-1.1 GO.db3.7.0
[148] glue1.3.1 remotes2.0.2 iterators1.0.10
[151] bit
1.1-14 stringi1.4.3 blob1.1.1
[154] latticeExtra0.6-28 memoise1.1.0 dplyr0.8.0.1
[157] ape
5.3

Bioconductor version '3.8'

  • 10 packages out-of-date
  • 2 packages too new

create a valid installation with

BiocManager::install(c( "annotate", "BiocParallel", "dada2", "DECIPHER", "expm", "factoextra", "GenomeInfoDb", "mixOmics", "phangorn", "RcppArmadillo", "Rhdf5lib", "Rsamtools" ), update = TRUE, ask = FALSE)

more details: BiocManager::valid()$toonew, BiocManager::valid()$outof_date

Warning message: 10 packages out-of-date; 2 packages too new

ADD REPLY
0
Entering edit mode

This could be the problem, can you address this first until valid() doesn’t complain.

ADD REPLY
0
Entering edit mode

Michael,

I'm working on this now. I keep running into this issue: BiocManager::install(c( "expm", "phangorn", "RcppArmadillo" ), update = TRUE, ask = FALSE)

more details: BiocManager::valid()$toonew, BiocManager::valid()$outof_date

Warning message: 3 packages out-of-date; 0 packages too new

So I'm trying to trouble shoot. Be in touch shortly. Thanks!

ADD REPLY
0
Entering edit mode

I wonder if at this point, if you re-run the script, where you generate DESeq2 objects from scratch, if you still have the Line1, ... error above.

ADD REPLY
0
Entering edit mode

I was hoping that would work, too. But I still get the Line1/2/3 issue. :(

ADD REPLY
0
Entering edit mode

Michael,

I finally got around the fixing all of my packages. Once I had updated versions and the output from BiocManager::valid() was "TRUE", the code worked!

Thank you for your help!

ADD REPLY

Login before adding your answer.

Traffic: 964 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6