DESeq: Error in model.matrix.formula(design(object), data = colData(object)) : data must be a data.frame
6
1
Entering edit mode
mdelrgg ▴ 10
@mdelrgg-9973
Last seen 8.1 years ago

Hello

1) I have two imput files: countData (counts of reads per gene, RNAseq type of data) and colData as .csv.

> colData<-read.csv("Pine_ColData.csv", sep=";", header=TRUE, check.names=FALSE,row.names=1)
> countData<-read.csv("Pine_RNAseq_no outliers.csv", sep=";", header=TRUE, check.names=FALSE, row.names=1)> 

2) I created the dds<-DESeqDataSetFromMatrix

> dds<-DESeqDataSetFromMatrix(countData=countData,colData=colData,design=~TREAT+LAT)
> head(dds)
class: DESeqDataSet
dim: 6 16
metadata(0):
assays(1): counts
rownames(6): 1A_I11_NT_comp41909_c0_seq1|m.4335.path1.0 1A_I11_NT_comp41909_c0_seq1|m.4335.path2.0 ...
  1A_I11_NT_comp45669_c0_seq3|m.4374.path2.0 1A_I11_NT_comp46081_c0_seq2|m.4378.path1.0
rowRanges metadata column names(0):
colnames(16): A-P56-1 A-P56-3 ... B-P67-4 D-P56-4
colData names(2): TREAT LAT

3) when I try to run DEseq(dds) I got this error;

estimating size factors
estimating dispersions
gene-wise dispersion estimates
Error in model.matrix.formula(design(object), data = colData(object)) :
  data must be a data.frame

4) I checked with is.data.frame(colData) and it returns [TRUE].

is.data.frame(colData)
[1] TRUE
> is.data.frame(countData)
[1] TRUE

5) In that case, what is the problem?

I appreciate your help. (I could send you the original csv files if you want)

Maria

deseq2 • 3.7k views
ADD COMMENT
0
Entering edit mode
@mikelove
Last seen 29 minutes ago
United States

Can you show colData? Also what is your sessionInfo()

Update [8/7/2016] I've updated the code in DESeq2 v1.12.4 which should fix this conflict:

> packageVersion("DESeq2")
[1] ‘1.12.4’
ADD COMMENT
0
Entering edit mode
mdelrgg ▴ 10
@mdelrgg-9973
Last seen 8.1 years ago

Hello

colData

  TREAT LAT
A-P56-1 A 56N
A-P56-3 A 56N
A-P67-1 A 67N
A-P67-2 A 67N
A-P67-3 A 67N
B-P56-1 B 56N
B-P56-2 B 56N
B-P56-3 B 56N
B-P67-1 B 67N
B-P67-2 B 67N
D-P56-2 D 56N
D-P56-3 D 56N
D-P67-2 D 67N
D-P67-3 D 67N
B-P67-4 B 67N
D-P56-4 D 56N

 

Sorry, I am not familiar with sessionInfo(), I checked and it is a function under package Utils. What exactly are you after? The input files, or the functions that I am using?

Regards

Maria

ADD COMMENT
0
Entering edit mode

I mean, can you copy in the information that is printed when you type:

> sessionInfo() [enter]

 

ADD REPLY
0
Entering edit mode

strange. I can't see what would be causing this. Can you email me the dds object:

save(dds, file="dds.rda")

my email is:

maintainer("DESeq2")

ADD REPLY
0
Entering edit mode
mdelrgg ▴ 10
@mdelrgg-9973
Last seen 8.1 years ago

Here

> sessionInfo()

R version 3.2.3 (2015-12-10)
Platform: x86_64-apple-darwin13.4.0 (64-bit)
Running under: OS X 10.10.5 (Yosemite)

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] stats4    parallel  grid      stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
 [1] DESeq_1.22.1               lattice_0.20-33            locfit_1.5-9.1             pasilla_0.10.0            
 [5] DESeq2_1.10.1              RcppArmadillo_0.6.600.4.0  Rcpp_0.12.3                airway_0.104.0            
 [9] SummarizedExperiment_1.0.2 Biobase_2.30.0             GenomicRanges_1.22.4       GenomeInfoDb_1.6.3        
[13] IRanges_2.4.8              S4Vectors_0.8.11           BiocGenerics_0.16.1        BiocInstaller_1.20.1      
[17] glm2_1.1.2                 lme4_1.1-11                Matrix_1.2-4               agricolae_1.2-3           
[21] ggbiplot_0.55              scales_0.4.0               plyr_1.8.3                 ggplot2_2.1.0             
[25] devtools_1.10.0            gridExtra_2.2.1           

loaded via a namespace (and not attached):
 [1] deldir_0.1-12        digest_0.6.9         R6_2.1.2             AlgDesign_1.1-7.3    futile.options_1.0.0
 [6] acepack_1.3-3.3      RSQLite_1.0.0        coda_0.18-1          httr_1.1.0           zlibbioc_1.16.0     
[11] spdep_0.5-92         curl_0.9.6           minqa_1.2.4          annotate_1.48.0      nloptr_1.0.4        
[16] rpart_4.1-10         combinat_0.0-8       labeling_0.3         splines_3.2.3        BiocParallel_1.4.3  
[21] geneplotter_1.48.0   foreign_0.8-66       munsell_0.4.3        nnet_7.3-12          Hmisc_3.17-2        
[26] XML_3.98-1.4         MASS_7.3-45          nlme_3.1-126         xtable_1.8-2         gtable_0.2.0        
[31] DBI_0.3.1            git2r_0.14.0         XVector_0.10.0       genefilter_1.52.1    LearnBayes_2.15     
[36] sp_1.2-2             latticeExtra_0.6-28  futile.logger_1.4.1  boot_1.3-18          Formula_1.2-1       
[41] klaR_0.6-12          lambda.r_1.1.7       RColorBrewer_1.1-2   tools_3.2.3          survival_2.38-3     
[46] AnnotationDbi_1.32.3 colorspace_1.2-6     cluster_2.0.3        memoise_1.0.0       

ADD COMMENT
0
Entering edit mode
poshf8 • 0
@poshf8-11021
Last seen 7.8 years ago

Hi,

Was this resolved?  I have a similar problem.

Thanks.

ADD COMMENT
0
Entering edit mode

I couldn't reproduce the problem, and asked for the data but never heard back.

If you are seeing the same error, can you also post your as.data.frame(colData), the design and the session info?

ADD REPLY
0
Entering edit mode
Simon Anders ★ 3.7k
@simon-anders-3855
Last seen 3.7 years ago
Zentrum für Molekularbiologie, Universi…

Two random suggestions

- "colData" is the name of the Bioconductor function used to access the column data of a SummerizedExperiment object (and hence also of a DESeqDataSet). As you named your sample data the same, you may have accidentally overwritten the function, and so caused random errors. (This shouldn't happen because R keeps variable and function names separate, but who knows.)

Just try again, using another name than "colData".

- Why do you have only 6 rows? Maybe something is wrong there, too. If you really have only 16 genes, DESeq2 might not be the right tool for the job.

ADD COMMENT
0
Entering edit mode
@thindamarinder-23829
Last seen 2.1 years ago
Australia

I faced a similar problem, but restarting r-season helped. seems some variables from other scripts were interfering

ADD COMMENT

Login before adding your answer.

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