Error with matrix input: select_genes() expects genes in rows, psupertime() requires genes in columns
Closed this issue · 1 comments
Hey @wmacnair--fantastic tool! I started experimenting with it a bit yesterday and it's been working really well with my data.
I noticed some issues when using a simple expression matrix as an input. It seems that the main function wants genes to be in the columns of a matrix input (make_x_data()
transposes SCE input, but not plain matrix), but then everything wrapped in with select_genes()
uses a matrix with genes in the rows (eg. calc_expressed_genes()
summarizes expression with rowMeans()
).
Easiest fix may be simply to require a matrix input to have genes in rows and then change make_x_data()
to x_data = t(x)
. This is probably more intuitive for single-cell analysis in R, as most tools (Seurat, SCE) keep genes in the rows anyway.
David
Hey @dpcook - exciting that people are using it! Thanks so much for trying it out, and raising the issues.
I think my original motivation for this choice was that cells * genes makes most sense in terms of the maths. But I think you're right - the inconsistency is unhelpful, and the matrices would most likely arrive in genes * cells format anyway. I'll change the expression matrix input requirements.
In case you're interested, my roadmap for future psupertime
work includes some stuff which would help address this:
- implement a
psupertime
object as an extension to aSingleCellExperiment
object - add unit tests...
- include all the manuscript analyses in the
psupplementary
Will