smurf.itering_arragement¶
- smurf.itering_arragement(adata_sc, adata_raw, adata, so, resolution=2, regress_out=True, save_folder='results_example/', show=True, keep_previous=False)¶
Performs iterative cell arrangement for spatial transcriptomics analysis.
This function iteratively refines cell type assignments and spatial arrangements by expanding cells, updating weights, and recalculating clustering assignments. It aims to optimize cell type assignments based on mutual information scores between iterations.
- Parameters:
adata_sc (anndata.AnnData) – An AnnData object containing single-cell gene expression data with initial clustering results.
adata_raw (anndata.AnnData) – An AnnData object containing the raw (unprocessed) single-cell gene expression data.
adata (anndata.AnnData) – An AnnData object containing spatial gene expression data.
so (spatial_object) – A spatial object containing spatial mappings, spot data, and other necessary attributes.
resolution (float, optional) – The resolution parameter for clustering during iterative analysis. Controls the granularity of clusters. Defaults to 2.
regress_out (bool, optional) – Whether to regress out effects of total counts and mitochondrial percentage during preprocessing. Defaults to True.
save_folder (str, optional) – The directory path where intermediate and final results will be saved. Defaults to ‘results_example/’.
show (bool, optional) – Whether to print progress messages and show plots during the iterative process. Defaults to True.
keep_previous (bool, optional) – Whether to keep intermediate files from previous iterations. If False, old files will be deleted to save space. Defaults to False.
- Returns:
None. The function saves intermediate and final results to the specified folder.
- Return type:
None