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
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