cycombinepy.batch_correct¶
- cycombinepy.batch_correct(adata, markers=None, batch_key='batch', label_key='cycombine_som', xdim=8, ydim=8, rlen=10, seed=473, n_clusters=None, norm_method='scale', ties_method='average', covar=None, anchor=None, ref_batch=None, parametric=True, out_layer='cycombine_corrected', copy=False, error_policy='raise', confound_policy='raise', return_report=False, uns_key='cycombinepy_correction')[source]¶
Run normalization, SOM clustering, and per-cluster ComBat.
- Parameters:
adata (
AnnData) – Input AnnData.adata.Xis assumed to already be on an appropriate scale (e.g. post-asinh for cytometry).markers (
Optional[Iterable[str]]) – Var names to normalize/cluster/correct. Defaults tocycombinepy.get_markers().batch_key (
str) – Column inadata.obsholding batch assignments.label_key (
str) – Column inadata.obsto write cluster labels to.xdim (
Union[int,Sequence[int]]) – SOM grid dimensions. Sequences trigger iterative correction: for each(x, y)pair, re-normalize, re-cluster, and re-correct.ydim (
Union[int,Sequence[int]]) – SOM grid dimensions. Sequences trigger iterative correction: for each(x, y)pair, re-normalize, re-cluster, and re-correct.rlen (
int) – SOM training passes (forwarded to FlowSOM if supported).seed (
int) – FlowSOM random seed.n_clusters (
int|None) – If set, metacluster the SOM nodes into this many clusters.norm_method (
Literal['scale','rank','CLR','CLR_seu','CLR_med','qnorm','none']) – Normalization method used for clustering. Seecycombinepy.normalize().ties_method (
Literal['average','min','max','dense','ordinal']) – Tie-breaking rule fornorm_method="rank".covar (
str|None) – Forwarded tocycombinepy.correct_data().anchor (
str|None) – Forwarded tocycombinepy.correct_data().ref_batch – Forwarded to
cycombinepy.correct_data().parametric (
bool) – Forwarded tocycombinepy.correct_data().out_layer (
str) – Layer name to store the corrected matrix in.copy (
bool) – If True, return a corrected copy; otherwise mutate in place.error_policy (
Literal['raise','report','warn']) – Forwarded tocycombinepy.correct_data().confound_policy (
Literal['raise','skip','drop']) – Forwarded tocycombinepy.correct_data().return_report (
bool) – If True, return the aggregate batch orchestration report. Withcopy=True, returns(adata, report).uns_key (
str) – Key inadata.unswhere the aggregate batch report is stored.
- Return type: