Reference Documentation Comprehensive reference materials for ChatSpatial users and developers.
Table of contents Quick References π Quick Reference Guides π§ API Documentation π Data and Configuration π οΈ Troubleshooting Analysis Methods Reference Core Analysis Tools Advanced Analysis Tools Integration and Utilities Data Format Specifications Supported Input Formats H5AD (AnnData) - Recommended 10X Visium Format H5 (HDF5) Format Output Formats Analysis Results Metadata Structure Method Parameters Reference Spatial Domain Identification SpaGCN Parameters STAGATE Parameters Cell Communication Analysis LIANA Parameters CellPhoneDB Parameters Trajectory Analysis CellRank Parameters Error Codes Reference Common Error Types Method-Specific Errors Performance Guidelines Memory Requirements Processing Time Estimates Optimization Tips Version Compatibility Python Version Support Key Dependencies This section provides detailed reference information for all aspects of ChatSpatial, from API documentation to troubleshooting guides.
Quick References Essential information at your fingertips:
Technical documentation for developers:
Format specifications and setup guides:
Problem-solving resources:
Analysis Methods Reference Tool Description Key Parameters load_dataLoad spatial transcriptomics data data_path, data_typepreprocess_dataQuality control and normalization normalization_method, n_top_genesvisualize_dataCreate spatial visualizations plot_type, feature, colormapannotate_cell_typesCell type annotation method, reference_data_idanalyze_spatial_dataSpatial pattern analysis analysis_type, n_neighbors
Tool Description Requirements identify_spatial_domainsSpatial domain identification SpaGCN, STAGATE, Leiden/Louvain analyze_cell_communicationCell-cell interaction analysis LIANA or CellPhoneDB analyze_trajectory_dataRNA velocity and pseudotime CellRank or Palantir deconvolve_dataSpatial deconvolution Cell2location or RCTD find_spatial_genesSpatially variable genes SPARK-X or SpatialDE
Integration and Utilities Tool Description Use Cases integrate_samplesMulti-sample integration Batch effect correction register_spatial_dataSpatial alignment Multi-section studies analyze_enrichmentPathway enrichment Functional interpretation find_markersDifferential expression Cluster characterization
H5AD (AnnData) - Recommended # Expected structure
adata . X # Gene expression matrix (cells x genes)
adata . obs # Cell metadata
adata . var # Gene metadata
adata . obsm [ ' spatial ' ] # Spatial coordinates (cells x 2)
adata . uns # Unstructured metadata
sample_folder/
βββ filtered_feature_bc_matrix.h5
βββ spatial/
βββ tissue_positions_list.csv
βββ scalefactors_json.json
βββ tissue_hires_image.png
βββ tissue_lowres_image.png
# Gene expression matrix
/ matrix / # Sparse matrix data
/ matrix / barcodes # Cell barcodes
/ matrix / features # Gene information
Analysis Results Tabular data : CSV files with statistics and annotationsVisualizations : PNG/PDF plots and interactive HTMLProcessed data : H5AD files with analysis results# Analysis metadata stored in adata.uns
adata . uns [ ' spatial_domains ' ] # Domain assignments
adata . uns [ ' cell_communication ' ] # Interaction results
adata . uns [ ' trajectory ' ] # Pseudotime results
adata . uns [ ' deconvolution ' ] # Cell type proportions
Method Parameters Reference Spatial Domain Identification SpaGCN Parameters params = {
" method " : " spagcn " ,
" n_domains " : 7 , # Number of domains
" spagcn_p " : 0.5 , # Smoothing parameter
" spagcn_s " : 1 , # Scaling factor
" spagcn_b " : 49 , # Bandwidth
" resolution " : 0.5 # Clustering resolution
}
STAGATE Parameters params = {
" method " : " stagate " ,
" stagate_epochs " : 1000 , # Training epochs
" stagate_learning_rate " : 0.001 , # Learning rate
" stagate_dim_output " : 512 , # Output dimensions
" n_domains " : 7 # Target domains
}
Cell Communication Analysis LIANA Parameters params = {
" method " : " liana " ,
" liana_resource " : " consensus " , # Database
" liana_local_metric " : " cosine " , # Local metric
" liana_global_metric " : " morans " , # Global metric
" perform_spatial_analysis " : True
}
CellPhoneDB Parameters params = {
" method " : " cellphonedb " ,
" cellphonedb_iterations " : 1000 , # Permutations
" cellphonedb_pvalue " : 0.05 , # P-value threshold
" cellphonedb_use_microenvironments " : True
}
Trajectory Analysis CellRank Parameters params = {
" method " : " cellrank " ,
" cellrank_n_states " : 5 , # Terminal states
" cellrank_kernel_weights " : [ 0.8 , 0.2 ], # Velocity/connectivity weights
" spatial_weight " : 0.5 # Spatial constraint
}
Error Codes Reference Common Error Types Error Code Description Solution DATA_LOAD_ERRORFailed to load data Check file path and format MISSING_SPATIALNo spatial coordinates Ensure spatial coordinates in obsm[βspatialβ] DEPENDENCY_ERRORMissing required package Install missing dependencies MEMORY_ERRORInsufficient memory Reduce dataset size or increase memory PARAMETER_ERRORInvalid parameters Check parameter types and ranges
Method-Specific Errors Method Error Cause Solution SpaGCN HISTOLOGY_ERRORMissing histology image Provide tissue image or disable histology Cell2location GPU_ERRORCUDA issues Use CPU or fix GPU setup RCTD R_ERRORR/rpy2 problems Check R installation LIANA DATABASE_ERRORMissing interaction database Install LIANA databases
Memory Requirements Dataset Size Minimal Advanced Experimental < 5K cells 2GB RAM 4GB RAM 8GB RAM 5K-20K cells 4GB RAM 8GB RAM 16GB RAM 20K-100K cells 8GB RAM 16GB RAM 32GB RAM > 100K cells 16GB RAM 32GB RAM 64GB RAM
Processing Time Estimates Analysis Type Small Dataset Large Dataset Basic preprocessing < 1 min 5-15 min Spatial domains (SpaGCN) 2-5 min 15-30 min Cell communication 5-10 min 30-60 min Trajectory analysis 10-20 min 1-2 hours Deep learning methods 15-30 min 2-4 hours
Optimization Tips Use appropriate data types - Sparse matrices for large datasetsChunk processing - Process data in batches for memory efficiencyGPU acceleration - Use CUDA for compatible methodsParallel processing - Set n_jobs parameter for multi-core usage Version Compatibility Python Version Support Python Version Minimal Advanced Experimental 3.10 β
β
β
3.11 β
β
β
3.12 β
β
β οΈ
Key Dependencies Package Minimal Version Recommended Notes scanpy 1.9.0+ 1.10.0+ Core single-cell analysis squidpy 1.2.0+ 1.4.0+ Spatial analysis tools torch 2.0.0+ 2.1.0+ Deep learning (advanced) scvi-tools 1.0.0+ 1.1.0+ Variational inference
Need help finding something? Try the search function or browse the troubleshooting guides .
Table of contents