Closed hspitzer closed 3 years ago
I will start working on this next week, still have to think about this how best to approach this.
@michalk8, spatialpandas may be a good project to look into for this.
Right now, I can't find a clean solution to this:
scipy
sparse matrices are 2D only, so I can't have a tensor of shape n_obs, max_segments, 2
(the last is for x, y coordinates
sparse.{COO,DOK}
can have 3 dims and I can pass a custom class if I want, but there are 2 issues
anndata
doesn't have a registered dispatcher (minor issue)spatialpandas
: way too heavy dependencies (e.g. pyarrow
), not really worth itn_obs, max_segments
As far as I'm concerned, at least for centroid positions, what we current have is sufficiently flexible and efficient. As for other sub-spot info, I think it will most likely be just scalars (no 2D coordinates), so a sparse pandas
dataframe would be they easiest way to go (although cluster info e.g. from Tangram might require more work, as far as the sparse values go).
In any case, I'd close this for now and revisit it in the future, if needed (feel free to re-open if you disagree).
Type of the feature
sqduipy.im
?squidpy.gr
?squidpy.pl
?Description
We can extract the centroids of each segmented object in a visium spot. This results in a variable length list of coordinates for each spot, currently saved in
.obsm
using a pandas data frame containing lists. This representation could be improved using a sparse matrix withobs x segmented objects
.This representation can then be generalised to everywhere where we have sub-spot or sub-cellular information that we'd like to store and access.