DESeq2 DFrame error
1
0
Entering edit mode
Anna ▴ 20
@anna-24098
Last seen 4.0 years ago

Hi, I ran into an error with DESeq2, which I reproduced also with the vignette (see below). Since I have not found any posts regarding this problem, I suspect that this might be new. I am running OS.X Catalina with R 4. Below is the error, the code from the vignette until the error and the session info. I would be very grateful for pointers where the problem might be and which package might cause these issues.

Error in checkSlotAssignment(object, name, value) : assignment of an object of class "DFrame" is not valid for slot 'elementMetadata' in an object of class "DESeqResults"; is(value, "DataTable_OR_NULL") is not TRUE

## ----txiSetup-----------------------------------------------------------------
library("tximport")
library("readr")
library("tximportData")
dir <- system.file("extdata", package="tximportData")
samples <- read.table(file.path(dir,"samples.txt"), header=TRUE)
samples$condition <- factor(rep(c("A","B"),each=3))
rownames(samples) <- samples$run
samples[,c("pop","center","run","condition")]

## ----txiFiles-----------------------------------------------------------------
files <- file.path(dir,"salmon", samples$run, "quant.sf.gz")
names(files) <- samples$run
tx2gene <- read_csv(file.path(dir, "tx2gene.gencode.v27.csv"))

## ----tximport, results="hide"-------------------------------------------------
txi <- tximport(files, type="salmon", tx2gene=tx2gene)

## ----txi2dds, results="hide"--------------------------------------------------
library("DESeq2")
ddsTxi <- DESeqDataSetFromTximport(txi,
                                   colData = samples,
                                   design = ~ condition)

## -----------------------------------------------------------------------------
coldata <- samples
coldata$files <- files
coldata$names <- coldata$run

## ----echo=FALSE---------------------------------------------------------------
library("tximeta")
se <- tximeta(coldata, skipMeta=TRUE)
ddsTxi2 <- DESeqDataSet(se, design = ~condition)

## ----eval=FALSE---------------------------------------------------------------
#  library("tximeta")
#  se <- tximeta(coldata)
#  ddsTxi <- DESeqDataSet(se, design = ~ condition)

## ----loadPasilla--------------------------------------------------------------
library("pasilla")
pasCts <- system.file("extdata",
                      "pasilla_gene_counts.tsv",
                      package="pasilla", mustWork=TRUE)
pasAnno <- system.file("extdata",
                       "pasilla_sample_annotation.csv",
                       package="pasilla", mustWork=TRUE)
cts <- as.matrix(read.csv(pasCts,sep="\t",row.names="gene_id"))
coldata <- read.csv(pasAnno, row.names=1)
coldata <- coldata[,c("condition","type")]
coldata$condition <- factor(coldata$condition)
coldata$type <- factor(coldata$type)

## ----showPasilla--------------------------------------------------------------
head(cts,2)
coldata

## ----reorderPasila------------------------------------------------------------
rownames(coldata) <- sub("fb", "", rownames(coldata))
all(rownames(coldata) %in% colnames(cts))
all(rownames(coldata) == colnames(cts))
cts <- cts[, rownames(coldata)]
all(rownames(coldata) == colnames(cts))

## ----matrixInput--------------------------------------------------------------
library("DESeq2")
dds <- DESeqDataSetFromMatrix(countData = cts,
                              colData = coldata,
                              design = ~ condition)
dds

## ----addFeatureData-----------------------------------------------------------
featureData <- data.frame(gene=rownames(cts))
mcols(dds) <- DataFrame(mcols(dds), featureData)
mcols(dds)

## ----htseqDirI, eval=FALSE----------------------------------------------------
#  directory <- "/path/to/your/files/"

## ----htseqDirII---------------------------------------------------------------
directory <- system.file("extdata", package="pasilla",
                         mustWork=TRUE)

## ----htseqInput---------------------------------------------------------------
sampleFiles <- grep("treated",list.files(directory),value=TRUE)
sampleCondition <- sub("(.*treated).*","\\1",sampleFiles)
sampleTable <- data.frame(sampleName = sampleFiles,
                          fileName = sampleFiles,
                          condition = sampleCondition)
sampleTable$condition <- factor(sampleTable$condition)

## ----hsteqDds-----------------------------------------------------------------
library("DESeq2")
ddsHTSeq <- DESeqDataSetFromHTSeqCount(sampleTable = sampleTable,
                                       directory = directory,
                                       design= ~ condition)
ddsHTSeq

## ----loadSumExp---------------------------------------------------------------
library("airway")
data("airway")
se <- airway

## ----sumExpInput--------------------------------------------------------------
library("DESeq2")
ddsSE <- DESeqDataSet(se, design = ~ cell + dex)
ddsSE

## ----prefilter----------------------------------------------------------------
keep <- rowSums(counts(dds)) >= 10
dds <- dds[keep,]

## ----factorlvl----------------------------------------------------------------
dds$condition <- factor(dds$condition, levels = c("untreated","treated"))

## ----relevel------------------------------------------------------------------
dds$condition <- relevel(dds$condition, ref = "untreated")

## ----droplevels---------------------------------------------------------------
dds$condition <- droplevels(dds$condition)

## ----deseq--------------------------------------------------------------------
dds <- DESeq(dds)
res <- results(dds)

sessionInfo( )

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: /Library/Frameworks/R.framework/Versions/4.0/Resources/lib/libRblas.dylib LAPACK: /Library/Frameworks/R.framework/Versions/4.0/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 [8] methods base

other attached packages: [1] RColorBrewer_1.1-2 pheatmap_1.0.12
[3] ggplot2_3.3.2 airway_1.8.0
[5] pasilla_1.16.0 tximeta_1.6.3
[7] DESeq2_1.28.1 SummarizedExperiment_1.20.0 [9] Biobase_2.50.0 MatrixGenerics_1.2.0
[11] matrixStats_0.57.0 GenomicRanges_1.42.0
[13] GenomeInfoDb_1.26.0 IRanges_2.24.0
[15] S4Vectors_0.28.0 BiocGenerics_0.36.0
[17] tximportData_1.16.0 readr_1.4.0
[19] tximport_1.16.1

loaded via a namespace (and not attached): [1] ProtGenerics_1.22.0 bitops_1.0-6
[3] bit64_4.0.5 progress_1.2.2
[5] httr_1.4.2 tools_4.0.3
[7] R6_2.5.0 lazyeval_0.2.2
[9] DBI_1.1.0 colorspace_1.4-1
[11] withr_2.3.0 tidyselect_1.1.0
[13] prettyunits_1.1.1 bit_4.0.4
[15] curl_4.3 compiler_4.0.3
[17] cli_2.1.0 xml2_1.3.2
[19] DelayedArray_0.16.0 labeling_0.4.2
[21] rtracklayer_1.50.0 scales_1.1.1
[23] genefilter_1.70.0 askpass_1.1
[25] rappdirs_0.3.1 Rsamtools_2.6.0
[27] stringr_1.4.0 digest_0.6.27
[29] XVector_0.30.0 pkgconfig_2.0.3
[31] htmltools_0.5.0 ensembldb_2.14.0
[33] dbplyr_2.0.0 fastmap_1.0.1
[35] rlang_0.4.8 rstudioapi_0.11
[37] RSQLite_2.2.1 shiny_1.5.0
[39] farver_2.0.3 generics_0.1.0
[41] jsonlite_1.7.1 BiocParallel_1.24.0
[43] dplyr_1.0.2 RCurl_1.98-1.2
[45] magrittr_1.5 GenomeInfoDbData_1.2.4
[47] Matrix_1.2-18 Rcpp_1.0.5
[49] munsell_0.5.0 fansi_0.4.1
[51] lifecycle_0.2.0 stringi_1.5.3
[53] yaml_2.2.1 zlibbioc_1.36.0
[55] BiocFileCache_1.14.0 AnnotationHub_2.20.2
[57] grid_4.0.3 blob_1.2.1
[59] promises_1.1.1 crayon_1.3.4
[61] lattice_0.20-41 Biostrings_2.58.0
[63] splines_4.0.3 GenomicFeatures_1.42.0
[65] annotate_1.66.0 hms_0.5.3
[67] locfit_1.5-9.4 knitr_1.30
[69] ps_1.4.0 pillar_1.4.6
[71] geneplotter_1.66.0 biomaRt_2.46.0
[73] XML_3.99-0.5 glue_1.4.2
[75] BiocVersion_3.11.1 BiocManager_1.30.10
[77] vctrs_0.3.4 httpuv_1.5.4
[79] openssl_1.4.3 gtable_0.3.0
[81] purrr_0.3.4 assertthat_0.2.1
[83] xfun_0.19 mime_0.9
[85] xtable_1.8-4 AnnotationFilter_1.14.0
[87] later_1.1.0.1 survival_3.2-7
[89] tibble_3.0.4 GenomicAlignments_1.26.0
[91] AnnotationDbi_1.52.0 memoise_1.1.0
[93] ellipsis_0.3.1 interactiveDisplayBase_1.26.3

DESeq2 • 4.9k views
ADD COMMENT
0
Entering edit mode

Hello,

I am also having the same error which is brand new and appears with code which was previously working just a few days ago

OS.X Catalina with R 4 as well.

Thank you,

AL

ADD REPLY
1
Entering edit mode
@mikelove
Last seen 18 hours ago
United States

Bioconductor 3.12 is compatible with R 4.0.3:

http://bioconductor.org/news/bioc_3_12_release/

If you install this version of Bioconductor you will be using DESeq2 v1.30.

[Note: this was confirmed by OP as fixing the issue]

ADD COMMENT
2
Entering edit mode

Thank you, Michael! It worked :-)

ADD REPLY
0
Entering edit mode

I have encountered the same error. Try to update to v1.30. Failed.

BiocManager::install("DESeq2") Bioconductor version 3.12 (BiocManager 1.30.10), R 4.0.3 (2020-10-10) Installing package(s) 'DESeq2' trying URL 'https://bioconductor.org/packages/3.12/bioc/src/contrib/DESeq2_1.30.0.tar.gz'

Content type 'application/x-gzip' length 2066943 bytes (2.0 MB)

downloaded 2.0 MB

  • installing source package ‘DESeq2’ ... using staged installation libs clang++ -I"/usr/local/Cellar/r/4.0.3/lib/R/include" -DNDEBUG -I'/usr/local/lib/R/4.0/site-library/Rcpp/include' -I'/usr/local/lib/R/4.0/site-library/RcppArmadillo/include' -I/usr/local/opt/gettext/include -I/usr/local/opt/readline/include -I/usr/local/include -fPIC -g -O2 -c DESeq2.cpp -o DESeq2.o In file included from DESeq2.cpp:16: In file included from /usr/local/lib/R/4.0/site-library/RcppArmadillo/include/RcppArmadillo.h:31: In file included from /usr/local/lib/R/4.0/site-library/RcppArmadillo/include/RcppArmadilloForward.h:49: In file included from /usr/local/lib/R/4.0/site-library/RcppArmadillo/include/armadillo:21: /usr/local/lib/R/4.0/site-library/RcppArmadillo/include/armadillo_bits/compiler_check.hpp:50:4: error: "*** C++11 compiler required; enable C++11 mode in your
    compiler, or use an earlier version of Armadillo"
    
    #error "*** C++11 compiler required; enable C++11 mode in your compiler, or use an earlier version of Armadillo" ^ In file included from DESeq2.cpp:16: In file included from /usr/local/lib/R/4.0/site-library/RcppArmadillo/include/RcppArmadillo.h:31: In file included from /usr/local/lib/R/4.0/site-library/RcppArmadillo/include/RcppArmadilloForward.h:49: In file included from /usr/local/lib/R/4.0/site-library/RcppArmadillo/include/armadillo:85: /usr/local/lib/R/4.0/site-library/RcppArmadillo/include/armadillo_bits/arma_forward.hpp:149:12: error: unknown type name 'constexpr' static constexpr bool is_row = false;
         ^
    
    /usr/local/lib/R/4.0/site-library/RcppArmadillo/include/armadillo_bits/arma_forward.hpp:150:12: error: unknown type name 'constexpr' static constexpr bool is_col = false;
         ^
    
    /usr/local/lib/R/4.0/site-library/RcppArmadillo/include/armadillo_bits/arma_forward.hpp:151:12: error: unknown type name 'constexpr' static constexpr bool is_xvec = false;
         ^
    
    /usr/local/lib/R/4.0/site-library/RcppArmadillo/include/armadillo_bits/arma_forward.hpp:161:12: error: unknown type name 'constexpr' static constexpr bool is_row = false;
         ^
    
    /usr/local/lib/R/4.0/site-library/RcppArmadillo/include/armadillo_bits/arma_forward.hpp:162:12: error: unknown type name 'constexpr' static constexpr bool is_col = false;
         ^
    
    /usr/local/lib/R/4.0/site-library/RcppArmadillo/include/armadillo_bits/arma_forward.hpp:163:12: error: unknown type name 'constexpr' static constexpr bool is_xvec = true;
         ^
    
    /usr/local/lib/R/4.0/site-library/RcppArmadillo/include/armadillo_bits/arma_forward.hpp:173:12: error: unknown type name 'constexpr' static constexpr bool is_row = false;
         ^
    
    /usr/local/lib/R/4.0/site-library/RcppArmadillo/include/armadillo_bits/arma_forward.hpp:174:12: error: unknown type name 'constexpr' static constexpr bool is_col = true;
         ^
    
    /usr/local/lib/R/4.0/site-library/RcppArmadillo/include/armadillo_bits/arma_forward.hpp:175:12: error: unknown type name 'constexpr' static constexpr bool is_xvec = false;
         ^
    
    /usr/local/lib/R/4.0/site-library/RcppArmadillo/include/armadillo_bits/arma_forward.hpp:185:12: error: unknown type name 'constexpr' static constexpr bool is_row = true;
         ^
    
    /usr/local/lib/R/4.0/site-library/RcppArmadillo/include/armadillo_bits/arma_forward.hpp:186:12: error: unknown type name 'constexpr' static constexpr bool is_col = false;
         ^
    
    /usr/local/lib/R/4.0/site-library/RcppArmadillo/include/armadillo_bits/arma_forward.hpp:187:12: error: unknown type name 'constexpr' static constexpr bool is_xvec = false;
         ^
    
    /usr/local/lib/R/4.0/site-library/RcppArmadillo/include/armadillo_bits/arma_forward.hpp:197:12: error: unknown type name 'constexpr' static constexpr bool is_row = T1::is_row;
         ^
    
    /usr/local/lib/R/4.0/site-library/RcppArmadillo/include/armadillo_bits/arma_forward.hpp:198:12: error: unknown type name 'constexpr' static constexpr bool is_col = T1::is_col;
         ^
    
    /usr/local/lib/R/4.0/site-library/RcppArmadillo/include/armadillo_bits/arma_forward.hpp:199:12: error: unknown type name 'constexpr' static constexpr bool is_xvec = T1::is_xvec;
         ^
    
    /usr/local/lib/R/4.0/site-library/RcppArmadillo/include/armadillo_bits/arma_forward.hpp:209:12: error: unknown type name 'constexpr' static constexpr bool is_row = false;
         ^
    
    /usr/local/lib/R/4.0/site-library/RcppArmadillo/include/armadillo_bits/arma_forward.hpp:210:12: error: unknown type name 'constexpr' static constexpr bool is_col = false;
         ^
    
    /usr/local/lib/R/4.0/site-library/RcppArmadillo/include/armadillo_bits/arma_forward.hpp:211:12: error: unknown type name 'constexpr' static constexpr bool is_xvec = false;
         ^
    
    fatal error: too many errors emitted, stopping now [-ferror-limit=] 20 errors generated. make: *** [DESeq2.o] Error 1 ERROR: compilation failed for package ‘DESeq2’
  • removing ‘/usr/local/lib/R/4.0/site-library/DESeq2’
  • restoring previous ‘/usr/local/lib/R/4.0/site-library/DESeq2’

The downloaded source packages are in ‘/private/var/folders/h1/78b2tkd552ngjl6_ps_5sw7r0000gn/T/Rtmp16uIlM/downloaded_packages’

ADD REPLY
0
Entering edit mode

Hi, I ran into this Error too but I couldn't handle it, would you please help me. (I have updated Bioconductor too)

Error in checkSlotAssignment(object, name, value) : assignment of an object of class “DFrame” is not valid for slot ‘elementMetadata’ in an object of class “DESeqResults”; is(value, "DataTable_OR_NULL") is not TRUE

ADD REPLY
1
Entering edit mode

Can you make a new post with full details including sessionInfo().

Also run BiocManager::valid() as this is helpful for diagnosing issues locally.

ADD REPLY
0
Entering edit mode

Thank you so much. I ran BiocManager::valid() and It enabled me to solve the problem.

ADD REPLY

Login before adding your answer.

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