Nanostring-Biostats / SpatialDecon

The SpatialDecon library implements the SpatialDecon algorithm for mixed cell deconvolution in spatial gene expression datasets. (This algorithm also works in bulk expression profiling data.)
MIT License
33 stars 8 forks source link

Confusing details in create_profile_matrix documentation #44

Closed oospina closed 1 year ago

oospina commented 1 year ago

Hello! While reading the documentation for the create_profile_matrix function, I notice it asks for a cell x gene matrix (which I understand as cells in rows). However, when looking at the tutorial ("Use of SpatialDecon in a large GeoMx dataset with GeomxTools") it looks like it uses a gene x cell matrix (genes in rows). I went and transposed my data and passed that as input, since it looks like your function makes an attempt to check that genes and cells are in the correct position in this part:

if(!any(names(cellTypes) %in% colnames(mtx)) & 
   any(names(cellTypes) %in% rownames(mtx))){
      print("Transposing Matrix")
      mtx<- t(mtx)
}

But the function crashes in that part:

[1] "Transposing Matrix"
Error in t.default(mtx) : argument is not a matrix

Is it possible that what the function actually uses is a gene x cell matrix (genes in rows) as opposed to what the documentation says?

Thank you!

Oscar

maddygriz commented 1 year ago

Hi Oscar,

It is indeed a gene x cell (genes in rows) matrix that is expected. I will update the documentation.

Thanks, Maddy

oospina commented 1 year ago

Thanks for the clarification!