scmorph.tl.get_ks

Contents

scmorph.tl.get_ks#

scmorph.tl.get_ks(adata, treatment_key='Treatment', well_key='Well', control='DMSO', control_wells=None, batch_key=None, 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_control or neg_wells must 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.

progress bool (default: False)

Whether to display a progress bar.

Return type:

tuple[DataFrame, DataFrame]

Returns:

A tuple containing the reference KS results and the treatment KS results.