harreman.tools.compute_ct_interacting_cell_scores

harreman.tools.compute_ct_interacting_cell_scores#

harreman.tools.compute_ct_interacting_cell_scores(adata, center_counts_for_np_test=False, test='both', restrict_significance='both', device=device(type='cpu'), verbose=False)[source]#

Compute cell-type–aware interacting cell scores for gene pairs and metabolites.

Parameters:
  • adata (AnnData or str) – Must contain: - uns['model'], uns['mean'] - uns['cell_type_key'] and obs[cell_type_key] for cell types - uns['gene_pairs'], uns['gene_pairs_per_ct_pair'] - uns['gene_pairs_per_metabolite'] - uns['ct_ccc_results'] with significance information - obsp['weights'] (spatial proximity matrix)

  • center_counts_for_np_test (bool, default False) – Whether to standardize counts before the non-parametric test.

  • test ({"parametric", "non-parametric", "both"}) – Which statistical test(s) to run.

  • restrict_significance ({"gene pairs", "metabolites", "both"}) – Only use cell-type-pair interactions that were significant in cell-type-aware CCC results.

  • device (torch.device) – CPU or GPU device for PyTorch computations.

  • verbose (bool, default False) – Print detailed progress messages.