atac_mapper.reference_mapping.mapping_atac.AtlasMapper#
- class atac_mapper.reference_mapping.mapping_atac.AtlasMapper(ref_model, layer=None)#
A class to map a query dataset to a reference dataset using scPoli
Methods table#
Methods#
- AtlasMapper.get_latent_representation()#
Get latent representation of query data after mapping
- Return type:
- Returns:
Array of latent representations
- classmethod AtlasMapper.load(input_dir)#
Load the mapper object from disk
- Args:
- input_dir: str
The directory to load the mapper object
- AtlasMapper.map_query(query_adata, retrain='partial', labeled_indices=None, query_layer=None, embed_key='X_scpoli', **kwargs)#
Map a query dataset to the reference
- Args:
query_adata: Query dataset to map retrain: How to train the query model:
‘partial’: freeze encoder weights and update other parameters
‘full’: retrain all parameters
‘none’: use reference model as is
batch_key: Key for batch information in query_adata.obs query_layer: Layer in query_adata to use. If None, uses the layer specified
during AtlasMapper initialization. This allows using different layers for reference and query data.
embed_key: name of obsm key to use for embedding. If None, uses ‘X_scpoli’ by default. **kwargs: Additional arguments passed to model.train()
- Return type:
- Returns:
AnnData object with query data mapped to reference
- AtlasMapper.save(output_dir)#
Save the mapper object to disk
- Args:
- output_dir: str
The directory to save the mapper object