STOmics / Stereopy

A toolkit of spatial transcriptomic analysis.
MIT License
184 stars 64 forks source link

Extract cellbin assignments of individual DNBs #157

Closed bmill3r closed 1 year ago

bmill3r commented 1 year ago

Hello,

Is there a way to get the labels of the cellbins and the IDs or coordinates of the DNBs that were assigned to each cellbin in a cellbin GEF file? For example, in previous example data I have looked at (in this case, a GEM_CellBin.tsv.gz file), the matrix was something like:

A data.frame: 6 × 5
geneID  x   y   UMICount    label
<chr>   <int>   <int>   <int>   <dbl>
1   Gm26825 13476   11944   1   27298
2   Gm42418 13476   11944   1   27298
3   Pja1    8758    13656   1   37442
4   Cx3cl1  8758    13656   1   37442
5   Mgat3   11661   11611   1   25246
6   Gng3    5630    14950   1   44380

Where x and y are coordinates of the individual DNBs, and label is the cellbin each DNB was assigned to. Is it possible to extract something like this from the cellbin.gef file?

My goal is essentially to visualize the DNBs with respect to the different cellbins (ie, "cells") they were assigned to. Perhaps getting something like this:

image

Thanks, Brendan

tanliwei-coder commented 1 year ago

There are no DNBs infomation in cellbin GEF because it has already aggregated all DNBs to corresponding cellbins.

bmill3r commented 1 year ago

Hi @tanliwei-coder,

Ok thanks for letting me know!

Brendan