cycombinepy.create_som¶
- cycombinepy.create_som(adata, markers=None, xdim=8, ydim=8, n_clusters=None, seed=473, rlen=10, layer=None, label_key='cycombine_som', copy=False)[source]¶
Train a FlowSOM on the marker columns of
adataand store cluster labels.Cells are mapped to either the raw SOM node (default) or a metacluster if
n_clustersis supplied. The resulting 1-indexed integer labels are written toadata.obs[label_key]as acategory.- Parameters:
adata (
AnnData) – AnnData to cluster.markers (
Optional[Iterable[str]]) – Var names used for clustering. Defaults tocycombinepy.get_markers().xdim (
int) – SOM grid dimensions. Default 8x8 matches cyCombine.ydim (
int) – SOM grid dimensions. Default 8x8 matches cyCombine.n_clusters (
int|None) – If set, consensus-metacluster the SOM nodes into this many clusters.seed (
int) – Random seed passed to FlowSOM.rlen (
int) – Number of training passes. (Kept for parity with R; forwarded if the installed FlowSOM version accepts it.)layer (
str|None) – Read features from this layer rather thanadata.X.label_key (
str) – Name of theadata.obscolumn to write labels into.copy (
bool) – If True, return a modified copy rather than mutating in place.
- Return type: