I am running DESeq2 v 1.10.1 and I am encountering an error when trying to retrieve information from the the results function. After creating res <- results(dds), I tried looking at the first part of res using head(res) and I am getting the following error: Error in .classEnv(classDef) : trying to get slot "package" from an object of a basic class ("NULL") with no slots
However it does not appear to be a problem with DESeq2 because I am able to retrieve the summary of the results with summary(res). I can also send it to a file and it looks fine.
Does anyone no why I would get this error? My code is listed below as well as my sessionInfo().
Thanks in advance for your help.
Here is my code:
CountTable <- read.table("/usr/local/projects/RNASEQ/SEQC/all_counts_noZero", header=TRUE, row.names=1)
> samples <- data.frame(row.names=c("HumA1","HumA2", "HumA3", "HumA4", "HumA5", "HumB1","HumB2","HumB3", "HumB4", "HumB5"),
+ condition=as.factor(c(rep("HumA",5),rep("HumB",5))))
> samples$condition <- relevel(samples$condition, "HumB")
> dds_counts <- DESeqDataSetFromMatrix(countData = CountTable, colData=samples, design=~condition)
> head(dds_counts)
class: DESeqDataSet
dim: 6 10
metadata(0):
assays(1): counts
rownames(6): ENSG00000000003 ENSG00000000005 ... ENSG00000000460
ENSG00000000938
rowRanges metadata column names(0):
colnames(10): HumA1 HumA2 ... HumB4 HumB5
colData names(1): condition
> colData(dds_counts)
DataFrame with 10 rows and 1 column
condition
<factor>
HumA1 HumA
HumA2 HumA
HumA3 HumA
HumA4 HumA
HumA5 HumA
HumB1 HumB
HumB2 HumB
HumB3 HumB
HumB4 HumB
HumB5 HumB
> dds <- DESeq(dds_counts)
estimating size factors
estimating dispersions
gene-wise dispersion estimates
mean-dispersion relationship
final dispersion estimates
fitting model and testing
> res <- results( dds )
> head(res)
Error in .classEnv(classDef) :
trying to get slot "package" from an object of a basic class ("NULL") with no slots
> summary(res)
out of 48285 with nonzero total read count
adjusted p-value < 0.1
LFC > 0 (up) : 14501, 30%
LFC < 0 (down) : 14396, 30%
outliers [1] : 137, 0.28%
low counts [2] : 4647, 9.6%
(mean count < 0)
[1] see 'cooksCutoff' argument of ?results
[2] see 'independentFiltering' argument of ?results
> mcols(res, use.names = T)
DataFrame with 6 rows and 2 columns
type description
<character> <character>
baseMean intermediate mean of normalized counts for all samples
log2FoldChange results log2 fold change (MAP): condition HumA vs HumB
lfcSE results standard error: condition HumA vs HumB
stat results Wald statistic: condition HumA vs HumB
pvalue results Wald test p-value: condition HumA vs HumB
padj results BH adjusted p-values
> write.table(as.data.frame(mcols(res, use.name = T)), file="DESeq2_test_conditions.txt", sep="\t", quote = FALSE)
> baseMeanA <- rowMeans(counts(dds,normalized=TRUE)[,dds$condition ==
+ "HumA"])
> baseMeanB <- rowMeans(counts(dds,normalized=TRUE)[,dds$condition ==
+ "HumB"])
> resdata = cbind(baseMeanB, baseMeanA, as.data.frame(res))
> resdata = cbind(genes=rownames(resdata), as.data.frame(resdata))
> colnames(resdata) <- c("Feature.ID", "Read.Count.HumB", "Read.Count.HumA", "Read.Count.All", "LFC(HumA/HumB)", "lfcSE", "stat", "p.Value", "FDR")
> head(resdata)
Feature.ID Read.Count.HumB Read.Count.HumA Read.Count.All
ENSG00000000003 ENSG00000000003 541.443644 2978.216838 1759.83024
ENSG00000000005 ENSG00000000005 3.889081 65.064465 34.47677
ENSG00000000419 ENSG00000000419 1215.477030 3387.617677 2301.54735
ENSG00000000457 ENSG00000000457 625.644312 643.834339 634.73933
ENSG00000000460 ENSG00000000460 213.804595 1389.163218 801.48391
ENSG00000000938 ENSG00000000938 386.272083 4.730482 195.50128
LFC(HumA/HumB) lfcSE stat p.Value
ENSG00000000003 2.4639211 0.06452195 38.1873325 0.000000e+00
ENSG00000000005 4.0612412 0.37382795 10.8639313 1.712160e-27
ENSG00000000419 1.4813177 0.07392107 20.0391803 2.508647e-89
ENSG00000000457 0.0468363 0.06783085 0.6904867 4.898882e-01
ENSG00000000460 2.6854049 0.07039042 38.1501457 0.000000e+00
ENSG00000000938 -6.2936782 0.28867804 -21.8017211 2.234550e-105
FDR
ENSG00000000003 0.000000e+00
ENSG00000000005 7.134847e-27
ENSG00000000419 1.914202e-88
ENSG00000000457 5.638179e-01
ENSG00000000460 0.000000e+00
> write.table(resdata[,c("Feature.ID","Read.Count.All", "Read.Count.HumB", "Read.Count.HumA", "LFC(HumA/HumB)", "p.Value", "FDR")], file="HumA_vs_HumB.de_genes.txt", quote=F, row.names=F, sep="\t")
Here is my SessionInfo():
> sessionInfo()
R version 3.2.4 Revised (2016-03-16 r70336)
Platform: x86_64-pc-linux-gnu (64-bit)
locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
[3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8
[5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8
[7] LC_PAPER=en_US.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
attached base packages:
[1] parallel stats4 stats graphics grDevices utils datasets
[8] methods base
other attached packages:
[1] ggplot2_2.1.0 RColorBrewer_1.1-2
[3] gplots_3.0.1 DESeq2_1.10.1
[5] RcppArmadillo_0.7.100.3.1 Rcpp_0.12.5
[7] SummarizedExperiment_1.0.2 Biobase_2.30.0
[9] GenomicRanges_1.22.4 GenomeInfoDb_1.6.3
[11] IRanges_2.4.8 S4Vectors_0.8.11
[13] BiocGenerics_0.16.1
loaded via a namespace (and not attached):
[1] futile.logger_1.4.1 plyr_1.8.4 XVector_0.10.0
[4] bitops_1.0-6 futile.options_1.0.0 zlibbioc_1.16.0
[7] rpart_4.1-10 RSQLite_1.0.0 annotate_1.48.0
[10] gtable_0.2.0 lattice_0.20-33 Matrix_1.2-6
[13] DBI_0.4-1 gridExtra_2.2.1 genefilter_1.52.1
[16] cluster_2.0.4 caTools_1.17.1 gtools_3.5.0
[19] locfit_1.5-9.1 grid_3.2.4 nnet_7.3-12
[22] data.table_1.9.6 AnnotationDbi_1.32.3 XML_3.98-1.4
[25] survival_2.39-4 BiocParallel_1.4.3 foreign_0.8-66
[28] gdata_2.17.0 latticeExtra_0.6-28 Formula_1.2-1
[31] geneplotter_1.48.0 lambda.r_1.1.7 Hmisc_3.17-4
[34] scales_0.4.0 splines_3.2.4 xtable_1.8-2
[37] colorspace_1.2-6 KernSmooth_2.23-15 acepack_1.3-3.3
[40] munsell_0.4.3 chron_2.3-47