scviva.tools.vision.compute_obs_df_scores

scviva.tools.vision.compute_obs_df_scores#

scviva.tools.vision.compute_obs_df_scores(adata)[source]#

Compute Geary’s C (numerical) / Cramer’s V (categorical) for obs metadata.

For numerical columns of adata.obs, rank-transforms each column and computes Geary’s C against the cell-cell neighbor graph in adata.obsp["weights"], with permutation p-values (compute_num_var_pvals()). For categorical columns, computes Cramer’s V between the neighbor-graph-propagated one-hot encoding and the original one-hot encoding, with a chi-squared p-value.

Mirrors R VISION’s sigsVsProjection applied to observation metadata.

Parameters:

adata (AnnData) – Annotated data object. Must contain adata.obsp["weights"].

Returns:

Columns c_prime (Geary’s C-derived score or Cramer’s V), pvals, and fdr (BH-corrected within each of the numerical and categorical groups).

Return type:

pd.DataFrame indexed by adata.obs column name