DEseq2 complex design - 2 factors with more than 2 levels
Entering edit mode
Bio • 0
Last seen 2 days ago

Hi all!

Using DEseq2 (v 1.30.0) I try to analyze a "complex" data set with 2 factors (A and B) harboring different levels. Factor A (named hereafter "line") has two levels (infected/non-infected) and factor 2 (named hereafter "group") has 4 (non-infected, mono-infected with 1, mono-infected with 2 and bi-infected with 1 and 2 at the same time). According to phenotype data, what drives my phenotype is A:B interaction. Thereby, I try to find the genes that are explained by interaction A:B. I guess that the trick is to use contrasts methods, but I am positively lost between all the lists of genes to find the one I am interested in (if there is only one), in addition to the fact that DEseq2 asks for a "reference" level which does not make really sense in an interaction model. Do you have any clues to help me? When I use the #resultsNames function, where should I look? What would be the correct coding for contrasts?

Thanks a lot for your help. -Vincent

Code should be placed in three backticks as shown below

cts <- read.delim("Pupalcountstotal.txt", header=TRUE, row.names="GeneID")
coldata <- read.delim("design.txt", header=TRUE) #24 obs

coldata$group <- as.factor(coldata$group)
coldata$line <- as.factor(coldata$line)

dds <- DESeqDataSetFromMatrix(countData = cts,
                              colData = coldata,
                              design= ~ group+line+group:line)

#remove <100 counts total per transcript
dds <- dds[ rowSums(counts(dds)) > 100, ] #reste 13169

#relevel factors
dds$group <- relevel(dds$group, ref = "GF")
dds$line <- relevel(dds$line, ref = "wolb")

dds <- DESeq(dds)

[1] "Intercept"        "group_AP_vs_GF"   "group_BI_vs_GF"   "group_LP_vs_GF"   "line_tet_vs_wolb" "groupAP.linetet"  "groupBI.linetet" 
[8] "groupLP.linetet" 

sessionInfo( )
R version 4.0.3 (2020-10-10)
Platform: x86_64-apple-darwin17.0 (64-bit)
Running under: macOS Catalina 10.15.7

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

Random number generation:
 RNG:     Mersenne-Twister 
 Normal:  Inversion 
 Sample:  Rounding 

[1] fr_FR.UTF-8/fr_FR.UTF-8/fr_FR.UTF-8/C/fr_FR.UTF-8/fr_FR.UTF-8

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

other attached packages:
 [1] SARTools_1.7.3              kableExtra_1.3.1            emmeans_1.5.3               devtools_2.3.2              usethis_2.0.0              
 [6] edgeR_3.32.0                limma_3.46.0                DESeq2_1.30.0               SummarizedExperiment_1.20.0 Biobase_2.50.0             
[11] MatrixGenerics_1.2.0        matrixStats_0.57.0          GenomicRanges_1.42.0        GenomeInfoDb_1.26.2         IRanges_2.24.1             
[16] S4Vectors_0.28.1            BiocGenerics_0.36.0         gprofiler2_0.2.0            UpSetR_1.4.0                coxme_2.2-16               
[21] bdsmatrix_1.3-4             scales_1.1.1                viridis_0.5.1               viridisLite_0.3.0           car_3.0-10                 
[26] carData_3.0-4               GGally_2.1.0                survival_3.2-7              lme4_1.1-26                 Matrix_1.2-18              
[31] gplots_3.1.1                knitr_1.30                  reshape2_1.4.4              gridExtra_2.3               stringr_1.4.0              
[36] plyr_1.8.6                  ggplot2_3.3.3               MASS_7.3-53                

loaded via a namespace (and not attached):
  [1] readxl_1.3.1           lazyeval_0.2.2         splines_4.0.3          BiocParallel_1.24.1    TH.data_1.0-10         digest_0.6.27         
  [7] htmltools_0.5.0        fansi_0.4.1            magrittr_2.0.1         memoise_1.1.0          openxlsx_4.2.3         remotes_2.2.0         
 [13] annotate_1.68.0        sandwich_3.0-0         prettyunits_1.1.1      colorspace_2.0-0       ggrepel_0.9.0          rvest_0.3.6           
 [19] blob_1.2.1             haven_2.3.1            xfun_0.20              dplyr_1.0.2            callr_3.5.1            crayon_1.3.4          
 [25] RCurl_1.98-1.2         jsonlite_1.7.2         genefilter_1.72.0      zoo_1.8-8              glue_1.4.2             gtable_0.3.0          
 [31] zlibbioc_1.36.0        XVector_0.30.0         webshot_0.5.2          DelayedArray_0.16.0    pkgbuild_1.2.0         abind_1.4-5           
 [37] mvtnorm_1.1-1          DBI_1.1.0              Rcpp_1.0.5             xtable_1.8-4           foreign_0.8-81         bit_4.0.4             
 [43] htmlwidgets_1.5.3      httr_1.4.2             RColorBrewer_1.1-2     ellipsis_0.3.1         farver_2.0.3           pkgconfig_2.0.3       
 [49] reshape_0.8.8          XML_3.99-0.5           locfit_1.5-9.4         labeling_0.4.2         tidyselect_1.1.0       rlang_0.4.10          
 [55] AnnotationDbi_1.52.0   munsell_0.5.0          cellranger_1.1.0       tools_4.0.3            cli_2.2.0              generics_0.1.0        
 [61] RSQLite_2.2.1          ggdendro_0.1.22        evaluate_0.14          processx_3.4.5         bit64_4.0.5            fs_1.5.0              
 [67] zip_2.1.1              caTools_1.18.0         purrr_0.3.4            nlme_3.1-151           xml2_1.3.2             compiler_4.0.3        
 [73] rstudioapi_0.13        plotly_4.9.2.2         curl_4.3               testthat_3.0.1         tibble_3.0.4           statmod_1.4.35        
 [79] geneplotter_1.68.0     stringi_1.5.3          ps_1.5.0               desc_1.2.0             forcats_0.5.0          lattice_0.20-41       
 [85] nloptr_1.2.2.2         vctrs_0.3.6            pillar_1.4.7           lifecycle_0.2.0        estimability_1.3       data.table_1.13.6     
 [91] bitops_1.0-6           R6_2.5.0               KernSmooth_2.23-18     rio_0.5.16             sessioninfo_1.1.1      codetools_0.2-18      
 [97] boot_1.3-25            gtools_3.8.2           assertthat_0.2.1       pkgload_1.1.0          rprojroot_2.0.2        withr_2.3.0           
[103] multcomp_1.4-15        GenomeInfoDbData_1.2.4 hms_0.5.3              tidyr_1.1.2            coda_0.19-4            minqa_1.2.4           
[109] rmarkdown_2.6          tinytex_0.28
DESeq2 • 48 views
Entering edit mode
Last seen 2 days ago
United States

For questions about how to set up the statistical design for your problem, I recommend to work with a local statistician.

Unfortunately, I'm limited in the time I can spend on the support site, and have to restrict myself to software-related questions.


Login before adding your answer.

Similar Posts
Loading Similar Posts
Help About
Access RSS

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

Powered by the version 2.3.3