STOmics / Stereopy

A toolkit of spatial transcriptomic analysis.
MIT License
179 stars 59 forks source link

Subsampling #277

Closed BioRB closed 1 month ago

BioRB commented 1 month ago

hello, do you know if would be possible to obtain a subsample (randomly) from the original gef?

tanliwei-genomics-cn commented 1 month ago

you can sample the data.cells.cell_name randomly to get a cell_name_subset, and then run data_subset = data.tl.filter_cells(cell_list=cell_name_subset, inplace=False) to get a subsample data, this is done on cells/bins, similarly, you can do on genes through data.genes.gene_name and data.tl.filter_genes().