Open emH-20 opened 4 years ago
Hello emH-20!
This is because in Seurat the columns represent cells, whereas in dyno the rows represent cells. To solve your problem, you need to transpose your input matrix:
object_counts <- Matrix::t(as(as.matrix(object@assays$RNA@counts), 'sparseMatrix'))
object_expression <- Matrix::t(as(as.matrix(object@assays$RNA@data), 'sparseMatrix'))
object_dyn<- wrap_expression(
counts = object_counts,
expression = object_expression
)
We'll work on adding a Seurat wrapper to dyno in the future.
Robrecht
Hi Robrecht!
Just to follow up on this issue, this has worked great for smaller number of cells. I have a bigger patch of data that contains 48000 cells. Unfortunately as.matrix doesnt work with such a big matrix and gives the 'problem too large' error.
> as(as.matrix(seuratobj@assays$RNA@counts), 'sparseMatrix')
Error in asMethod(object) :
Cholmod error 'problem too large' at file ../Core/cholmod_dense.c, line 102
However I was able to transpose the count matrices, etc. with t_sp() from Baynorm package. I then run into a 'Error: !is.null(feature_ids) is not TRUE' error. I am still working on this and will update if I solve. In the meantime lmk if you have any new suggestions on this!
I created the dynwrap using the wrap_expression and the counts and expression matrix.
However, I found that the cell_ids and feature_ids were swapped. All of the cell_ids were in the feature_ids column and vice-versa. I swapped them manually. However, when I created the model, everything went back again to how they were, all the labels were mixed up. Not sure if the model is now accurate or not, and how to fix this.![image](https://user-images.githubusercontent.com/53575732/68092598-ac8cc680-fe95-11e9-981a-5f531bcbb649.png)