Hi,
I'm trying to use DeSeq2 to calculate gene expression levels.

My count table (all_counts) looks like this

    gene cell1 cell2
    1 ENSMUST00000000001 712   1613
    2 ENSMUST00000000003   0      0
    3 ENSMUST00000000010   2      3
    4 ENSMUST00000000028   0      0
    5 ENSMUST00000000033   0      0

I'm call DESeqDataSetFromMatrix

    dds <- DESeqDataSetFromMatrix(countData = all_counts,
                                  colData = data.frame(c('gene', 'cell1', 'cell2')))

But I'm always getting this error

    Error in DESeqDataSet(se, design = design, ignoreRank) : 
    some values in assay are negative

But there are no negative values. I verified this by

    > any (!is.integer(all_counts[,2]))
    [1] FALSE
    > any (!is.integer(all_counts[,3]))
    [1] FALSE 
    > any (all_counts[,2] < 0)
    [1] FALSE
    > any (all_counts[,3] < 0)
    [1] FALSE


Any ideas what I'm doing wrong?
From the manuals the **countData** must be a numeric *matrix*, from your example **all_counts**, it looks like a *dataframe*.

Try to convert it to matrix:

    countDataMatrix <- as.matrix(all_counts[ , -1])

And keep the names of the genes in the rownames (as suggested by  @DevonRyan in the comments):

    rownames(countDataMatrix) <- all_counts[ , 1]


