[BioC] error when estimating Dispersions for count table data in DESeq
Simon Anders
anders at embl.de
Thu Jul 10 09:11:33 CEST 2014
Hi
On 08/07/14 07:45, 梁芳 wrote:
> [...] command "cds = estimateDispersions( cds )". The error message was:
>
> Error in if (nr < 2) stop("nrow(modelMatrix) must be >=2.") :
> argument is of length zero
> Following is the code:
> library("DESeq");
> CountTable = read.table("test.txt", header=TRUE, row.names=1);
> Design = data.frame(row.names = colnames(CountTable), condition = c("treated", "treated", "untreated", "untreated"));
> cds = newCountDataSet(CountTable, Design);
> cds = estimateSizeFactors(cds);
> cds = estimateDispersions(cds);
For simple two-group comparisons, you should pass a factor rather than a
data frame. Otherwise, you have to specify explicitly when calling
'estimateDispersion' which column of the data frame to use.
Try:
cds = newCountDataSet(CountTable, Design$condition)
instead of
cds = newCountDataSet(CountTable)
and it should work.
HOWEVER: Please consider starting over and using DESeq2, the successor
to DESeq. We have made considerable improvements there, compared to
DESeq, both in terms of usability (your problem would not have arisen
with DESeq2) and of inferential power.
Simon
More information about the Bioconductor
mailing list