troutpy.pp.filter_urna

Contents

troutpy.pp.filter_urna#

troutpy.pp.filter_urna(sdata, min_counts=None, min_extracellular_proportion=None, control_probe=None, min_logfoldratio_over_noise=1, min_morani=None, gene_key='feature_name', filter_cellular=False, copy=False, genes_in_segmented=False, table_key='table')#

Filters xRNA based on specified criteria and updates the sdata object.

Parameters:
  • sdata (spatialdata.SpatialData) – Spatial data object containing xRNA metadata and transcript information.

  • min_counts (int) – Minimum count threshold for xRNA selection.

  • min_extracellular_proportion (float) – Minimum extracellular proportion threshold for xRNA selection.

  • control_probe (bool) – If False, filters out control probes.

  • min_logfoldratio_over_noise (float) – Minimum log fold-change over noise threshold for xRNA selection.

  • min_morani (float) – Minimum Moran’s I threshold for spatial autocorrelation.

  • gene_key (str) – Key for accessing gene names in transcript tables.

  • filter_cellular (bool) – If True, also filters the cellular table.

  • copy (bool) – If True, returns a filtered copy of sdata; otherwise, modifies in place.

  • genes_in_segmented (bool) – Whether to filter genes only present in segmented cells, which should be in sdata[table_key].var.index

  • table_key (str) – Name of the table included in sdata, containing an anndata of segmented cells.

Returns:

dict-like or None Filtered sdata if copy=True, else modifies sdata in place and returns None.