Question: DeSeq2 Question - Reading Sample Table to DESeqDataSet
0
16 months ago by
Marc0
Marc0 wrote:

I am trying to read in a Sample Table into DeSeq2, where the first column is all my gene names and the row names are my individual samples and their corresponding counts. Can anyone tell me the best way to build the DESeqDataSet?

deseq2 • 278 views
modified 16 months ago by Michael Love25k • written 16 months ago by Marc0
0
16 months ago by
Michael Love25k
United States
Michael Love25k wrote:

Take a look at ?DESeqDataSetFromMatrix.

This function takes as input a matrix of counts, where the gene names can be rownames of the matrix (or you can add them to the metadata columns afterward, using e.g. mcols(dds)\$genenames <- ...).

I have done that, however, when I run the DESeqDataSetfromMatrix with my counts as part of matrix (row=gene names, columns=samples) and colData as metadata. I get back an Error - some values in assay are not integers. The count numbers are XX.XXX (example format). Suggestions?

Try using round() first. I should say, if these are estimated counts from e.g. RSEM, this makes sense.

If these are normalized counts, it's best to provide DESeq2 with the original scale counts. We perform normalization internally using offsets, and so only raw counts or estimated counts should be used as input.

If you are working with e.g. RSEM or another such quantifier, consider using tximport to take care of all of this for you, removing the chance for bugs and error.

> ddsFullCountTable <- DESeqDataSetFromMatrix(countData = sampleTable3, colData = colData2, design = ~ Treatment)
Error in if (assays_nrow != rowData_nrow) { : argument is of length zero

I have never seen this error before, colData columns match sampleTable rows. The only column in colData is Treatment specifically 2 different ones. (A and B)

Suggestions?

What are the dimensions of the two objects?

> dim(colData2)
[1] 6 1
> dim(sampleTable3)
[1] 205342      6