DESeqDataSet design issue
1
0
Entering edit mode
@c7f4960a
Last seen 6 months ago
Japan

I used to run DESeq2/edgeR a lot a few years back (as late as last year), but I have been working on other projects and haven't had need of them of late. I am just starting on a project and was wanting to do some differential expression analysis, so opened up my old scripts and started running them. However, I encounter an error when trying to specify the design of the experiment.

dds <- DESeqDataSet(RSE,  design =~ type)
Error in DESeqDataSet(RSE, design = ~type) : 
  design has a single variable, with all samples having the same value.
  use instead a design of '~ 1'. estimateSizeFactors, rlog and the VST can then be used

This is the column data for RSE. I am trying to use type, which has three different groupings, but I get the same error regardless of what I try and use.

DataFrame with 6 rows and 6 columns
                            fwd                    rev         name        class         type
                    <character>            <character> <data.frame> <data.frame> <data.frame>
0h-rep1  /Users/matthew/mount.. /Users/matthew/mount..      0h-rep1           Ct           Ct
0h-rep2  /Users/matthew/mount.. /Users/matthew/mount..      0h-rep2           Ct           Ct
24h-rep1 /Users/matthew/mount.. /Users/matthew/mount..     24h-rep1          Exp         Exp1
24h-rep2 /Users/matthew/mount.. /Users/matthew/mount..     24h-rep2          Exp         Exp1
96h-rep1 /Users/matthew/mount.. /Users/matthew/mount..     96h-rep1          Exp         Exp2
96h-rep2 /Users/matthew/mount.. /Users/matthew/mount..     96h-rep2          Exp         Exp2
                  rep
         <data.frame>
0h-rep1          rep1
0h-rep2          rep2
24h-rep1         rep1
24h-rep2         rep2
96h-rep1         rep1
96h-rep2         rep2

I tried this on my old laptop where I originally ran the scripts, as I thought maybe it was a problem with using the latest version of R, but I am for some reason getting the same error there. If you have any tips/advice for where I might be going wrong that would be great!

sessionInfo( )
R version 4.1.2 (2021-11-01)
Platform: x86_64-apple-darwin17.0 (64-bit)
Running under: macOS Big Sur 11.5.2

Matrix products: default
LAPACK: /Library/Frameworks/R.framework/Versions/4.1/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] grid      stats4    stats     graphics  grDevices utils     datasets 
[8] methods   base     

other attached packages:
 [1] ggrepel_0.9.1                           
 [2] org.Hs.eg.db_3.14.0                     
 [3] TxDb.Hsapiens.UCSC.hg38.knownGene_3.14.0
 [4] BSgenome.Hsapiens.UCSC.hg38_1.4.4       
 [5] BSgenome_1.62.0                         
 [6] Biostrings_2.62.0                       
 [7] XVector_0.34.0                          
 [8] JASPAR2016_1.22.0                       
 [9] sva_3.42.0                              
[10] genefilter_1.76.0                       
[11] mgcv_1.8-38                             
[12] nlme_3.1-153                            
[13] edgeR_3.36.0                            
[14] limma_3.50.0                            
[15] DESeq2_1.34.0                           
[16] Gviz_1.38.0                             
[17] InteractionSet_1.22.0                   
[18] BiocParallel_1.28.3                     
[19] GenomicFeatures_1.46.1                  
[20] AnnotationDbi_1.56.2                    
[21] reshape2_1.4.4                          
[22] BiasedUrn_1.07                          
[23] statmod_1.4.36                          
[24] forcats_0.5.1                           
[25] stringr_1.4.0                           
[26] dplyr_1.0.7                             
[27] purrr_0.3.4                             
[28] readr_2.1.1                             
[29] tidyr_1.1.4                             
[30] tibble_3.1.6                            
[31] tidyverse_1.3.1                         
[32] ggthemes_4.2.4                          
[33] ggforce_0.3.3                           
[34] ggplot2_3.3.5                           
[35] magrittr_2.0.1                          
[36] viridis_0.6.2                           
[37] viridisLite_0.4.0                       
[38] ggseqlogo_0.1                           
[39] pheatmap_1.0.12                         
[40] kableExtra_1.3.4                        
[41] knitr_1.36                              
[42] CAGEfightR_1.14.0                       
[43] SummarizedExperiment_1.24.0             
[44] Biobase_2.54.0                          
[45] MatrixGenerics_1.6.0                    
[46] matrixStats_0.61.0                      
[47] rtracklayer_1.54.0                      
[48] GenomicRanges_1.46.1                    
[49] GenomeInfoDb_1.30.0                     
[50] IRanges_2.28.0                          
[51] S4Vectors_0.32.3                        
[52] BiocGenerics_0.40.0                     
[53] session_1.0.3                           

loaded via a namespace (and not attached):
  [1] utf8_1.2.2                 tidyselect_1.1.1          
  [3] RSQLite_2.2.9              htmlwidgets_1.5.4         
  [5] munsell_0.5.0              codetools_0.2-18          
  [7] withr_2.4.3                colorspace_2.0-2          
  [9] filelock_1.0.2             highr_0.9                 
 [11] rstudioapi_0.13            labeling_0.4.2            
 [13] GenomeInfoDbData_1.2.7     polyclip_1.10-0           
 [15] bit64_4.0.5                farver_2.1.0              
 [17] vctrs_0.3.8                generics_0.1.1            
 [19] xfun_0.28                  biovizBase_1.42.0         
 [21] BiocFileCache_2.2.0        R6_2.5.1                  
 [23] locfit_1.5-9.4             AnnotationFilter_1.18.0   
 [25] bitops_1.0-7               cachem_1.0.6              
 [27] DelayedArray_0.20.0        assertthat_0.2.1          
 [29] BiocIO_1.4.0               scales_1.1.1              
 [31] nnet_7.3-16                gtable_0.3.0              
 [33] ensembldb_2.18.2           rlang_0.4.12              
 [35] systemfonts_1.0.2          splines_4.1.2             
 [37] lazyeval_0.2.2             dichromat_2.0-0           
 [39] broom_0.7.10               checkmate_2.0.0           
 [41] BiocManager_1.30.16        yaml_2.2.1                
 [43] modelr_0.1.8               backports_1.4.0           
 [45] Hmisc_4.6-0                tools_4.1.2               
 [47] ellipsis_0.3.2             RColorBrewer_1.1-2        
 [49] Rcpp_1.0.7                 plyr_1.8.6                
 [51] base64enc_0.1-3            progress_1.2.2            
 [53] zlibbioc_1.40.0            RCurl_1.98-1.5            
 [55] prettyunits_1.1.1          rpart_4.1-15              
 [57] GenomicFiles_1.30.0        haven_2.4.3               
 [59] cluster_2.1.2              fs_1.5.2                  
 [61] data.table_1.14.2          reprex_2.0.1              
 [63] ProtGenerics_1.26.0        hms_1.1.1                 
 [65] evaluate_0.14              xtable_1.8-4              
 [67] XML_3.99-0.8               jpeg_0.1-9                
 [69] readxl_1.3.1               gridExtra_2.3             
 [71] compiler_4.1.2             biomaRt_2.50.1            
 [73] crayon_1.4.2               htmltools_0.5.2           
 [75] tzdb_0.2.0                 Formula_1.2-4             
 [77] geneplotter_1.72.0         lubridate_1.8.0           
 [79] DBI_1.1.1                  lobstr_1.1.1              
 [81] tweenr_1.0.2               dbplyr_2.1.1              
 [83] GenomicInteractions_1.28.0 MASS_7.3-54               
 [85] rappdirs_0.3.3             Matrix_1.4-0              
 [87] cli_3.1.0                  pryr_0.1.5                
 [89] igraph_1.2.9               parallel_4.1.2            
 [91] pkgconfig_2.0.3            GenomicAlignments_1.30.0  
 [93] foreign_0.8-81             xml2_1.3.3                
 [95] svglite_2.0.0              annotate_1.72.0           
 [97] webshot_0.5.2              rvest_1.0.2               
 [99] VariantAnnotation_1.40.0   digest_0.6.29             
[101] rmarkdown_2.11             cellranger_1.1.0          
[103] htmlTable_2.3.0            restfulr_0.0.13           
[105] curl_4.3.2                 Rsamtools_2.10.0          
[107] rjson_0.2.20               lifecycle_1.0.1           
[109] jsonlite_1.7.2             fansi_0.5.0               
[111] pillar_1.6.4               lattice_0.20-45           
[113] KEGGREST_1.34.0            fastmap_1.1.0             
[115] httr_1.4.2                 survival_3.2-13           
[117] glue_1.5.1                 png_0.1-7                 
[119] bit_4.0.4                  stringi_1.7.6             
[121] blob_1.2.2                 latticeExtra_0.6-29       
[123] memoise_2.0.1
DESeq DESeq2 • 267 views
ADD COMMENT
0
Entering edit mode
@mikelove
Last seen 12 hours ago
United States

Something looks wrong with the type column in your colData. It says "data.frame" instead of "factor".

Maybe try to rebuild this colData.

ADD COMMENT
0
Entering edit mode

Oh yes, I changed how I built the design table this time round and was reading in the metadata from a file rather than explicitly writing it out myself. I guess I needed to convert the type to factor before adding to the design table.

Thanks for the assist!

ADD REPLY

Login before adding your answer.

Traffic: 439 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