0
$\begingroup$

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 <- 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 <- c(cell_names, cell_names_cyt)
groups <- c(rep("NE", times=length(cell_names)), rep("EX", 
times=length(cell_names_cyt)))

colData <- data.frame(
  Cells <- cells,
  Groups <- groups
)

dds <- 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 <- as.data.frame(as.matrix(seurat_object@raw.data))
df <- df[,colnames(df) %in% cells]

But then the following:

dds <- 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

$\endgroup$
  • 2
    $\begingroup$ Don't input normalized counts, use raw counts. $\endgroup$ – Devon Ryan May 8 '18 at 7:46
  • $\begingroup$ Yeah, I used raw counts retrieved from Seurat, but then got another error. $\endgroup$ – Nikita Vlasenko May 8 '18 at 13:59
1
$\begingroup$

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?

> cells <- c("1","2","3")
> groups <- c("a", "b", "c")
> test <- data.frame(Cells <- cells, Groups <- groups)
> test
  Cells....cells Groups....groups
1              1                a
2              2                b
3              3                c
> colnames(test)
[1] "Cells....cells"   "Groups....groups"
|improve this answer|||||
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.