c2v.tl.project_clone2vec#
- c2v.tl.project_clone2vec(clones_query, clones_ref, obsm_key_query='ref_gex_adjacency', uns_key_query='clone2vec', uns_key_ref='clone2vec', obsm_key='clone2vec', mask_key=None, random_state=42, batch_size=128, device=None, learning_rate=0.001, early_stopping_patience=5, early_stopping_min_delta=0.0001, progress_bar=True, max_iter=500)#
Fitting of new clones to the reference clone2vec embeddings using kNN between query and reference datasets. The function is using output embedding from the reference clone2vec model and optimizes only input embedding matrix, therefore has much faster convergence than training the whole model.
- Parameters:
- clones_query sc.AnnData
The query clone-level AnnData object, typically from create_clone_adata.
- clones_ref sc.AnnData
The reference clone-level AnnData object, typically from create_clone_adata.
- obsm_key_query str, optional
Key in clones_query.obsm for the graph to use, by default “ref_gex_adjacency”.
- uns_key_query str, optional
Key in clones_query.uns to store the model parameters, by default “clone2vec”.
- uns_key_ref str, optional
Key in clones_ref.uns to store the model parameters, by default “clone2vec”.
- obsm_key str, optional
Key in clones_query.obsm to store the embeddings, by default “clone2vec”.
- random_state None | int, optional
Random state for reproducibility, by default 42.
- batch_size int, optional
Batch size for optimization, by default 128.
- device str | None, optional
Device to use for optimization, by default None.
- learning_rate float, optional
Learning rate for optimization, by default 0.001.
- early_stopping_patience int, optional
Number of iterations with no improvement to wait before stopping, by default 5.
- early_stopping_min_delta float, optional
Minimum change in the loss to be considered as an improvement, by default 1e-4.
- progress_bar bool, optional
Whether to show a progress bar, by default True.
- max_iter int, optional
Maximum number of iterations, by default 500.
- mask_key str | None
- Return type: