STOmics / Stereopy

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

Table outputs #257

Closed eisascience closed 5 months ago

eisascience commented 6 months ago

There are a few summary figures like violin plots to visualize spot/cell level data but need a way to summarize as a table. is there a function in stereopy that does this?

tanliwei-coder commented 6 months ago

Did you mean download the figures? If so, you can specify the path(contains file name) to save figures by parameter out_path.

eisascience commented 6 months ago

No, I dont mean download the figures. What are the functions that produce tables that summarize information. Not figures, tables. For example provide a table of spot/bin summary. e.g. mean/max/min/95CI of gene n count per spot. or other useful QC measures. thanks

tanliwei-coder commented 6 months ago

We have two dataframe that contain some indicators about cells/bins and genes, one is data.cells and another is data.genes.

In data.cells, which is about cells/bins, one row represents one cell/bin, there are three primary indicators:

total_counts: the total expression count of all genes in one cell/bin.

n_genes_by_counts: the count of genes whoes expression count greater than 0 in one cell/bin.

pct_counts_mt: the percentage of mitochondrial genes expression in total expression.

In data.genes, which is about genes, one row represents one gene, there are also three primary indicators:

n_cells: the count of cells/bins that express this gene.

n_counts: the total expression count of this gene in all cells/bins.

mean_umi: n_counts / n_cells

You need to run data.tl.cal_qc() before any normalization methods to get these indicators, if you want to export these to files, you can run data.cells.to_df().to_csv('cells.csv') and data.genes.to_df().to_csv('genes.csv').

Whether it can cover your needs?