Transform and feed data into DESeq2 with DESeqDataSetFromMatrix There is a normalized expression matrix. I split it into two and want to do DE on the two cells' subsets. I am having trouble transforming it into the format that DESeq2 would accept. The function that I would think I need to use is the following:

dds &lt;- DESeqDataSetFromMatrix(countData = cts,
                          colData = coldata,
                          design= ~ batch + condition) 


It would be perfect if I could somehow feed two matrixes separately, but I can not find it. Any suggestions would be greatly appreciated.


  Update


I tried the following:

cells &lt;- c(cell_names, cell_names_cyt)
groups &lt;- c(rep("NE", times=length(cell_names)), rep("EX", 
times=length(cell_names_cyt)))

colData &lt;- data.frame(
  Cells &lt;- cells,
  Groups &lt;- groups
)

dds &lt;- DESeqDataSetFromMatrix(countData = df,
                          colData = colData,
                          design= ~ Groups)


But getting the error:


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


Of course, they are floats since I already normalized the matrices.


  Update


I did the following since I am using Seurat:

df &lt;- as.data.frame(as.matrix(seurat_object@raw.data))
df &lt;- df[,colnames(df) %in% cells]


But then the following:

dds &lt;- DESeqDataSetFromMatrix(countData = df,
                          colData = colData,
                          design= ~ Groups)


Gave me an error:


  Error in DESeqDataSet(se, design = design, ignoreRank) : all variables in design formula must be columns in colData
Error in DESeqDataSet(se, design = design, ignoreRank) : all variables
  in design formula must be columns in colData


I think that means just what it says...you don't have a "Groups" column in coldata.  Did you spotcheck your ColData data frame to make sure it looks the way it should?

&gt; cells &lt;- c("1","2","3")
&gt; groups &lt;- c("a", "b", "c")
&gt; test &lt;- data.frame(Cells &lt;- cells, Groups &lt;- groups)
&gt; test
  Cells....cells Groups....groups
1              1                a
2              2                b
3              3                c
&gt; colnames(test)
[1] "Cells....cells"   "Groups....groups"