troutpy.pp.get_transcript_categories#
- troutpy.pp.get_transcript_categories(sdata, layer='transcripts', struct_table_key='structure_table', metadata_key='xrna_metadata')#
Classify transcripts into a hierarchy of intracellular/extracellular categories.
Transcripts are split, in order, into: intracellular; cell-like (
extracellularisFalsedespite being outside a cell), split by structural connectivity; high-density extracellular structures, split by connectivity; noise-spectrum genes (highfdr_noiseinmetadata_key); and the remaining diffuse extracellular transcripts, split into diffusion-compatible and -incompatible genes based on the Kolmogorov-Smirnov p-value (ks_pval) inmetadata_key.- Parameters:
sdata (spatialdata.SpatialData) – SpatialData object containing the
layerpoints layer, thestruct_table_keytable with anis_physically_connectedcolumn indexed by"struct_<id>", and themetadata_keytable whose.varholds thefdr_noiseandks_pvalcolumns.layer (str, optional) – Points layer with
overlaps_cell,extracellular,enrichment_class,structure_id, andgenecolumns. Defaults to"transcripts".struct_table_key (str, optional) – Key of the table in
sdatadescribing extracellular structures. Defaults to"structure_table".metadata_key (str, optional) – Key of the table in
sdataholding per-gene uRNA metadata. Defaults to"xrna_metadata".
- Returns:
pandas.Series Transcript counts per category:
"Intracellular","Cell-Like Connected","Cell-Like Unconnected","High-Density Connected","High-Density Unconnected","Noise Spectrum","Diffusion Compatible", and"Diffusion Incompatible".