Data Storage Conventions
scHopfield follows standard AnnData conventions and stores results systematically throughout the analysis workflow.
Overview
Results are stored in different AnnData slots depending on their dimensionality:
adata.var- Gene-level data (per gene)adata.obs- Cell-level data (per cell)adata.varp- Gene-gene matricesadata.obsm- Cell embeddings and high-dimensional cell dataadata.varm- Gene-dimensional arraysadata.layers- Gene expression matricesadata.uns- Unstructured metadata and results
adata.var (Gene-level Data)
Sigmoid Parameters
Added by sch.pp.fit_all_sigmoids() and sch.pp.compute_sigmoid():
sigmoid_threshold- Fitted threshold parametersigmoid_exponent- Fitted exponent parametersigmoid_offset- Fitted offset parametersigmoid_mse- Mean squared error of fitscHopfield_used- Boolean mask of genes used in analysis
Network Parameters (per cluster)
Added by sch.inf.fit_interactions():
I_{cluster}- Bias vector for each clustergamma_{cluster}- Cluster-specific degradation rates (ifrefit_gamma=True)
Network Centrality (per cluster)
Added by sch.tl.compute_network_centrality():
degree_all_{cluster}- Total degree (in + out)degree_centrality_all_{cluster}- Normalized total degreedegree_in_{cluster}- In-degreedegree_out_{cluster}- Out-degreedegree_centrality_in_{cluster}- Normalized in-degreedegree_centrality_out_{cluster}- Normalized out-degreebetweenness_centrality_{cluster}- Betweenness centralityeigenvector_centrality_{cluster}- Eigenvector centrality
Correlations (per cluster)
Added by sch.tl.energy_gene_correlation():
correlation_energy_total_{cluster}- Total energy vs gene expressioncorrelation_energy_interaction_{cluster}- Interaction energy correlationcorrelation_energy_degradation_{cluster}- Degradation energy correlationcorrelation_energy_bias_{cluster}- Bias energy correlation
adata.obs (Cell-level Data)
Energy Values
Added by sch.tl.compute_energies() (shared across all cells):
energy_total- Total Hopfield energyenergy_interaction- Interaction componentenergy_degradation- Degradation componentenergy_bias- Bias component
Jacobian Statistics
Added by sch.tl.compute_jacobian_stats():
jacobian_eig1_real- Real part of leading eigenvaluejacobian_eig1_imag- Imaginary part of leading eigenvaluejacobian_positive_evals- Count of positive real eigenvaluesjacobian_negative_evals- Count of negative real eigenvaluesjacobian_trace- Trace of Jacobian matrix
Added by sch.tl.compute_rotational_part():
jacobian_rotational- Frobenius norm of antisymmetric part
Added by sch.tl.compute_jacobian_elements():
jacobian_df_{gene_i}_dx_{gene_j}- Specific partial derivatives
adata.varp (Gene-Gene Matrices)
Interaction Matrices (per cluster)
Added by sch.inf.fit_interactions():
W_{cluster}- Interaction matrix for each cluster (n_genes × n_genes, sparse)
# Access interaction matrix
W_hsc = adata.varp['W_HSC']
print(W_hsc.shape) # (n_genes, n_genes)
adata.obsm (Cell Embeddings)
Dimensionality Reduction
Added by sch.tl.compute_umap():
X_umap- UMAP coordinates (n_obs × 2)
Jacobian Eigenvalues
Added by sch.tl.compute_jacobians():
jacobian_eigenvalues- Jacobian eigenvalues for all cells (n_obs × n_genes, complex)
# Access Jacobian eigenvalues
evals = adata.obsm['jacobian_eigenvalues']
print(evals.shape) # (n_cells, n_genes)
print(evals.dtype) # complex128
adata.varm (Gene-Dimensional Arrays)
Energy Embedding
Added by sch.tl.energy_embedding():
highD_grid- High-dimensional grid points for energy landscape projection
adata.layers (Expression Matrices)
Transformed Expression
Added by sch.pp.compute_sigmoid():
sigmoid- Sigmoid-transformed expression (n_obs × n_genes)
Velocity
Added by sch.tl.compute_reconstructed_velocity():
velocity_reconstructed- Model-predicted velocity
adata.uns[‘scHopfield’] (Metadata)
Configuration
cluster_key- Name of cluster key usedgenes_used- Indices of genes used in analysis
Models & Embeddings
Added by sch.inf.fit_interactions():
models- Trained optimizer models (dictionary by cluster)
Added by sch.tl.compute_umap():
embedding- UMAP model object
Energy Grids (per cluster)
Added by sch.tl.energy_embedding():
grid_X_{cluster}- X coordinates of 2D gridgrid_Y_{cluster}- Y coordinates of 2D gridgrid_energy_{cluster}- Total energy on gridgrid_energy_interaction_{cluster}- Interaction energy on gridgrid_energy_degradation_{cluster}- Degradation energy on gridgrid_energy_bias_{cluster}- Bias energy on grid
Network Analysis
Added by sch.tl.network_correlations():
network_correlations- Dictionary of similarity metrics between clusters'jaccard'- Jaccard index'hamming'- Hamming distance'euclidean'- Euclidean distance'pearson'- Pearson correlation'pearson_bin'- Pearson correlation (binary)'mean_col_corr'- Mean column-wise correlation'singular'- Singular value distance
Added by sch.tl.celltype_correlation():
celltype_correlation- RV coefficient matrix
Added by sch.tl.future_celltype_correlation():
future_celltype_correlation- Future state correlation matrix
Eigenanalysis (per cluster)
Added by sch.tl.compute_eigenanalysis():
eigenanalysis[f'eigenvalues_{cluster}']- Eigenvalues of Weigenanalysis[f'eigenvectors_{cluster}']- Eigenvectors of W
Example: Accessing Results
import scHopfield as sch
# After running full analysis...
# Access energy values
total_energy = adata.obs['energy_total']
# Access interaction matrix for HSC
W_hsc = adata.varp['W_HSC']
# Access centrality for a specific cluster
degree_hsc = adata.var['degree_centrality_all_HSC']
# Access Jacobian eigenvalues
jacobian_evals = adata.obsm['jacobian_eigenvalues']
# Access network correlations
correlations = adata.uns['scHopfield']['network_correlations']
jaccard = correlations['jaccard']
# Get top genes by centrality
top_genes = sch.tl.get_top_genes_table(
adata,
cluster='HSC',
metric='degree_centrality_all',
n=20
)
See Also
Tools (sch.tl) - All functions that modify adata
Quick Start - Basic workflow
Tutorial - Detailed tutorial