troutpy.tl.colocalization_proportion#
- troutpy.tl.colocalization_proportion(sdata, outpath, threshold_colocalized=1, filename='proportion_of_grouped_exRNA.parquet', save=True)#
Calculate the proportion of colocalized transcripts for each gene.
- Parameters:
sdata (spatialdata.SpatialData) – SpatialData object with an
"extracellular_transcripts_enriched"points layer (feature_name,bin_idcolumns) and a"segmentation_free_table"table whose.Xholds per-bin transcript counts per gene.outpath (str) – Directory path where the output file should be saved.
threshold_colocalized (int, optional) – Minimum per-bin count for a transcript to be considered colocalized. Defaults to
1.filename (str, optional) – Name of the output Parquet file. Defaults to
"proportion_of_grouped_exRNA.parquet".save (bool, optional) – If
True, writecoloctooutpath/filenameas a Parquet file. Defaults toTrue.
- Returns:
pandas.DataFrame DataFrame indexed by gene with a single
"proportion_of_colocalized"column.