scmorph.pp.aggregate_pc#
- scmorph.pp.aggregate_pc(adata, treatment_key='infer', control='DMSO', cum_var_explained=0.9, progress=True)[source]#
Measure distance between groups using principle components weighted by variance explained
- Parameters:
- adata
AnnData Annotated data matrix
- treatment_key
str(default:'infer') Name of column in metadata used to define treatments
- control
str(default:'DMSO') Name of control treatment. Must be valid value in
treatment_key.- cum_var_explained
float(default:0.9) This allows thresholding how many PCs to use during computation of distances. It will select the first n PCs until at least this sum of variance has been explained. Must be a value between 0 and 1.
- progress
bool(default:True) Whether to show a progress bar
- adata
- Return type:
- Returns:
dists Weighted principal component distances to control