omicverse.single.cellphonedb_v5¶
- omicverse.single.cellphonedb_v5(adata, celltype_key='celltype', min_cell_fraction=0.005, min_genes=200, min_cells=3, cpdb_file_path=None, iterations=1000, threshold=0.1, pvalue=0.05, threads=10, output_dir=None, temp_dir=None, cleanup_temp=True, debug=False, separator='|', **kwargs)[source]¶
Run CellPhoneDB statistical analysis with proper file handling
- Parameters:
adata (AnnData) – Annotated data matrix
celltype_key (str) – Column name in adata.obs containing cell type annotations
min_cell_fraction (float) – Minimum fraction of total cells required for a cell type to be included
min_genes (int) – Minimum number of genes required per cell
min_cells (int) – Minimum number of cells required per gene
cpdb_file_path (str or None) – Path to CellPhoneDB database zip file. If None, will try to find automatically
iterations (int) – Number of shufflings performed in the analysis
threshold (float) – Min % of cells expressing a gene for this to be employed in the analysis
pvalue (float) – P-value threshold to employ for significance
threads (int) – Number of threads to use in the analysis
output_dir (str or None) – Directory to save results. If None, creates temporary directory
temp_dir (str or None) – Directory for temporary files. If None, uses system temp
cleanup_temp (bool) – Whether to clean up temporary files after analysis
debug (bool) – Saves all intermediate tables employed during the analysis
separator (str) – String to employ to separate cells in the results dataframes
**kwargs (dict) – Additional parameters forwarded to
cpdb_statistical_analysis_method.call.
- Returns:
Raw CellPhoneDB result dict and formatted AnnData for visualization.
- Return type:
Tuple[dict,anndata.AnnData]