scmorph.tl.get_ks#
- scmorph.tl.get_ks(adata, treatment_key='Treatment', well_key='Well', control='DMSO', control_wells=None, batch_key=None, n_pcs=10, scale_by_var=True, progress=False)[source]#
Performs the KS test for all treatments and establishes a KS cutoff based on control wells FDR.
- Parameters:
- adata
AnnData The AnnData object containing the data.
- treatment_key
str(default:'Treatment') The column name for treatments.
- well_key
str(default:'Well') The column name for wells, by default “Well”. Used for building background distribution.
- control
str(default:'DMSO') The negative control treatment, by default “DMSO”. Either
neg_controlorneg_wellsmust be provided.- control_wells
list|None(default:None) The negative control wells.
- batch_key
str|None(default:None) Additional grouping column, usually empty (single plate) or plate identifier.
- n_pcs
int(default:10) How many principal components to compute Mahalanobis distance on
- scale_by_var
bool(default:True) Whether to scale principal components by variance explained (recommended)
- progress
bool(default:False) Whether to display a progress bar.
- adata
- Return type:
- Returns:
A tuple containing the reference KS results and the treatment KS results.