SpatialQuery.spatial_query_multi.find_fp_dist

spatial_query_multi.find_fp_dist(ct, dataset=None, max_dist=20, min_size=0, min_support=0.5)[source]

Find frequent patterns within the radius of certain cell type in multiple fields of view.

Parameters:
  • ct (str) – Cell type name.

  • dataset (str or List[str], optional) – Datasets for searching for frequent patterns. Use all datasets if dataset=None.

  • max_dist (float, default=20) – Maximum distance for considering a cell as a neighbor.

  • min_size (int, default=0) – Minimum neighborhood size for each point to consider.

  • min_support (float, default=0.5) – Threshold of frequency to consider a pattern as a frequent pattern.

Returns:

DataFrame with frequent pattern results. Columns include:
  • support: frequency of the pattern (proportion of transactions with this pattern)

  • itemsets: list of cell types in the frequent pattern

Return type:

pd.DataFrame