SPACEL.Spoint.model.init_model

SPACEL.Spoint.model.init_model(sc_ad, st_ad, celltype_key, sc_genes=None, st_genes=None, used_genes=None, deg_method='wilcoxon', n_top_markers=200, n_top_hvg=None, log2fc_min=0.5, pval_cutoff=0.01, pct_diff=None, pct_min=0.1, use_rep='scvi', st_batch_key=None, sm_size=500000, cell_counts=None, clusters_mean=None, cells_mean=10, cells_min=1, cells_max=20, cell_sample_counts=None, cluster_sample_counts=None, ncell_sample_list=None, cluster_sample_list=None, scvi_layers=2, scvi_latent=128, scvi_gene_likelihood='zinb', scvi_dispersion='gene-batch', latent_dims=128, hidden_dims=512, infer_losses=['kl', 'cos'], n_threads=4, seed=42, use_gpu=None)

Initialize Spoint model.

Given specific data and parameters to initialize Spoint model.

Parameters:
  • sc_ad – An AnnData object representing single cell reference.

  • st_ad – An AnnData object representing spatial transcriptomic data.

  • celltype_key – A string representing cell types annotation columns in obs of single cell reference.

  • sc_genes – A sequence of strings containing genes of single cell reference used in Spoint model. Only used when used_genes is None.

  • st_genes – A sequence of strings containing genes of spatial transcriptomic data used in Spoint model. Only used when used_genes is None.

  • used_genes – A sequence of strings containing genes used in Spoint model.

  • deg_method (str) – A string passed to method parameter of scanpy.tl.rank_genes_groups.

  • n_top_markers (int) – The number of differential expressed genes in each cell type of single cell reference used in Spoint model.

  • n_top_hvg (Optional[int]) – The number of highly variable genes of spatial transcriptomic data used in Spoint model.

  • log2fc_min – The threshold of log2 fold-change used for filtering differential expressed genes of single cell reference.

  • pval_cutoff – The threshold of p-value used for filtering differential expressed genes of single cell reference.

  • pct_min – The threshold of precentage of expressed cells used for filtering differential expressed genes of single cell reference.

  • st_batch_key – A column name in obs of spatial transcriptomic data representing batch groups of spatial transcriptomic data.

  • sm_size (int) – The number of simulated spots.

  • hiddem_dims – The number of nodes of hidden layers in Spoint model.

  • n_threads – The number of cpu core used for parallel.

Returns:

A SpointModel object.