grassp.tl.qsep_score#
- qsep_score(data, gt_col, use_rep='X', distance_key='full_distances', inplace=True)[source]#
QSep cluster-separation metric for spatial proteomics.
Implements the QSep statistic from Gatto et al. (2014) which measures within- vs between-cluster distances.
- Parameters:
- data
AnnData AnnData object.
- gt_col
str Observation column with ground-truth cluster labels.
- use_rep
str(default:'X') Representation used for distance computation –
"X"or a key indata.obsm.- distance_key
str(default:'full_distances') Column name to store per-protein mean distances (only when
inplaceisTrue).- inplace
bool(default:True) Control write-back vs return behaviour.
- data
- Return type:
- Returns:
- If
inplaceisTrue: None- If
inplaceisFalse: cluster_distances
- If