Dear Bioconductor support community,
I have ribosome profiling/RNA-seq data that I want to analyze using DESeq2, but I am having some trouble with the design and how to compare selected samples. I'd really appreciate your help!
I have 4 different conditions: 2 strains grown at 2 temperatures, each condition has ribo-seq and RNA-seq data, and two replicates for each. From what I've read so far on this site, it seems like it's more sensible for me to keep the strain and temperature combined as one condition, instead of having them in separate columns? Here is what I have:
> sample_type condition type MA25_RPF M25 RPF MA37_RPF M37 RPF MB25_RPF M25 RPF MB37_RPF M37 RPF WA25_RPF W25 RPF WA37_RPF W37 RPF WB25_RPF W25 RPF WB37_RPF W37 RPF MA25_RNA M25 RNA MA37_RNA M37 RNA MB25_RNA M25 RNA MB37_RNA M37 RNA WA25_RNA W25 RNA WA37_RNA W37 RNA WB25_RNA W25 RNA WB37_RNA W37 RNA
> all.ds <- DESeqDataSetFromMatrix(countData = count_table, colData = sample_type, design = ~type + condition + type:condition) > all.DGE <- DESeq(all.ds)
I'd like to compare Mutant vs WT for each temperature, and also 25C vs 37C for each strain, after normalization of ribo- to RNA-seq. I set "W25" as the reference. Is this design ok for what I want to do?
If this design makes sense, then I have a follow-up question. From what I understand of the results based on the resultsNames (please correct me if I'm wrong), "typeRPF.conditionM25"
would mean comparing RPF/RNA of M25 to RPF/RNA of W25. But for "condition_M25_vs_W25"
, it does not include the interaction term and is only comparing the RPF. If I want to compare the RPF/RNA of one sample to another sample that is not the reference, I would need to use list()
in contrast
, is that right? I'm not sure which of these terms I should use to go into list()
for, say, if I want to compare RPF/RNA of M37 to RPF/RNA of W37?
> resultsNames(all.DGE) [1] "Intercept" "type_RPF_vs_RNA" "condition_W37_vs_W25" "condition_M25_vs_W25" "condition_M37_vs_W25" [6] "typeRPF.conditionW37" "typeRPF.conditionM25" "typeRPF.conditionM37"
Thank you in advance for your help!
Kotcha
Session info:
> sessionInfo() R version 3.5.0 (2018-04-23) Platform: x86_64-apple-darwin15.6.0 (64-bit) Running under: macOS High Sierra 10.13.5 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] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8 attached base packages: [1] parallel stats4 stats graphics grDevices utils datasets methods base other attached packages: [1] DESeq2_1.20.0 SummarizedExperiment_1.10.1 DelayedArray_0.6.1 BiocParallel_1.14.1 [5] matrixStats_0.53.1 Biobase_2.40.0 GenomicRanges_1.32.3 GenomeInfoDb_1.16.0 [9] IRanges_2.14.10 S4Vectors_0.18.3 BiocGenerics_0.26.0 loaded via a namespace (and not attached): [1] genefilter_1.62.0 locfit_1.5-9.1 splines_3.5.0 lattice_0.20-35 colorspace_1.3-2 [6] htmltools_0.3.6 base64enc_0.1-3 blob_1.1.1 survival_2.42-4 XML_3.98-1.11 [11] rlang_0.2.1 pillar_1.2.3 DBI_1.0.0 foreign_0.8-70 bit64_0.9-7 [16] RColorBrewer_1.1-2 GenomeInfoDbData_1.1.0 plyr_1.8.4 stringr_1.3.1 zlibbioc_1.26.0 [21] munsell_0.5.0 gtable_0.2.0 htmlwidgets_1.2 memoise_1.1.0 latticeExtra_0.6-28 [26] knitr_1.20 geneplotter_1.58.0 AnnotationDbi_1.42.1 htmlTable_1.12 Rcpp_0.12.17 [31] acepack_1.4.1 xtable_1.8-2 scales_0.5.0 backports_1.1.2 checkmate_1.8.5 [36] Hmisc_4.1-1 annotate_1.58.0 XVector_0.20.0 bit_1.1-14 gridExtra_2.3 [41] ggplot2_2.2.1 digest_0.6.15 stringi_1.2.3 grid_3.5.0 tools_3.5.0 [46] bitops_1.0-6 magrittr_1.5 RSQLite_2.1.1 lazyeval_0.2.1 RCurl_1.95-4.10 [51] tibble_1.4.2 Formula_1.2-3 cluster_2.0.7-1 Matrix_1.2-14 data.table_1.11.4 [56] rstudioapi_0.7 rpart_4.1-13 nnet_7.3-12 compiler_3.5.0
Update:
I just found another post that addressed almost the same questions: DESeq2 for Ribosomal profiling analysis [two-factor designs]
It seems that I got the design backwards? So, I changed it to
design = ~condition + condition:type
. (Side question, is~condition + condition:type
the same as~condition + type + condition:type
?)And the results become:
At this point, can I directly use these terms in
contrast
to compare them? For example, to compare M37 to W37:Thank you!