spatiAlign API

class spatialign.spatialign.trainer.Spatialign(*data_path: str, min_genes: int = 20, min_cells: int = 20, batch_key: str = 'batch', is_norm_log: bool = True, is_scale: bool = False, is_hvg: bool = False, is_reduce: bool = False, n_pcs: int = 100, n_hvg: int = 2000, n_neigh: int = 15, is_undirected: bool = True, latent_dims: int = 100, tau1: float = 0.2, tau2: float = 1.0, tau3: float = 0.5, is_verbose: bool = True, seed: int = 42, gpu: int | str | None = None, save_path: str | None = None)

spatialign Model

Parameters:
  • data_path – Input dataset path.

  • min_genes – Minimum number of genes expressed required for a cell to pass filtering, default 20.

  • min_cells – Minimum number of cells expressed required for a gene to pass filtering, default 20.

  • batch_key – The batch annotation to obs using this key, default, ‘batch’.

  • is_norm_log – Whether to perform ‘sc.pp.normalize_total’ and ‘sc.pp.log1p’ processing, default, True.

  • is_scale – Whether to perform ‘sc.pp.scale’ processing, default, False.

  • is_hvg – Whether to perform ‘sc.pp.highly_variable_genes’ processing, default, False.

  • is_reduce – Whether to perform PCA reduce dimensional processing, default, False.

  • n_pcs – PCA dimension reduction parameter, valid when ‘is_reduce’ is True, default, 100.

  • n_hvg – ‘sc.pp.highly_variable_genes’ parameter, valid when ‘is_reduce’ is True, default, 2000.

  • n_neigh – The number of neighbors selected when constructing a spatial neighbor graph. default, 15.

  • is_undirected – Whether the constructed spatial neighbor graph is undirected graph, default, True.

  • latent_dims – The number of embedding dimensions, default, 100.

  • tau1 – Instance level and pseudo prototypical cluster level contrastive learning parameters, default, 0.2

  • tau2 – Pseudo prototypical cluster entropy parameter, default, 1.

  • tau3 – Cross-batch instance self-supervised learning parameter, default, 0.5

  • is_verbose – Whether the detail information is print, default, True.

  • seed – Random seed.

  • gpu – Whether the GPU device is using to train spatialign.

  • save_path – The path of alignment dataset and saved spatialign.

train(**kwargs)
alignment(**kwargs)