Skip to content

What Skopia writes to AnnData

Skopia keeps its results in the AnnData object, so a saved .h5ad holds them and other tools (scanpy, squidpy, your own scripts) can read them. This page lists the keys Skopia reads and writes, grouped by feature. <name>, <key> and <column> stand for names you choose in the app.

Conventions

  • uns keys Skopia owns start with skopia_. Scanpy-standard keys (uns['neighbors'], uns['pca'], uns['<column>_colors']) keep their usual names so scanpy reads them.
  • Registries and results with nested structure are stored as JSON strings in uns, because h5ad handles deeply nested mixed dictionaries poorly. Read them with json.loads(adata.uns['skopia_figures']['fig_1']).
  • .obs columns are prefixed by the tool that wrote them: UCell_, LR_, SCN_, contour_, subset_, territory_, cnv, leiden, dpt_. The .obs manager groups columns by these prefixes.
  • A cells × features matrix goes to .obsm[<name>] plus an entry uns['skopia_score_matrices'][<name>] = {'columns': [...]}. .obsm arrays have no column names, so that registry is what lets the app label the columns. An .obsm stored as a labeled DataFrame supplies its own names instead.
  • Category colors go to uns['<column>_colors'] as hex strings, scanpy's convention. Skopia's palette uses them when present.
  • Results scoped to a cell subset leave the other cells empty: NaN in .obsm and numeric .obs, unassigned in label columns.

Reading older files

Files from before the rename. The app was called xcell before v0.6. Files it saved carry xcell_* keys in uns. When such a file is opened, every xcell_* key is renamed to skopia_* once, before anything reads uns; if both exist, the skopia_* one wins. Saving the file then writes only skopia_* keys. A script that reads the old names needs updating.

String columns. anndata converts every string .obs column to a categorical when it writes an .h5ad. To undo that, a save records the names of the string-kind columns in uns['skopia_string_columns']; on load, Skopia turns those columns back into strings and drops the record. A file written some other way (for example adata.write_h5ad from your own script) has no record, and its string columns come back as categoricals.

Session, provenance and figures

Where What Guide
uns['skopia_analysis_record'] The analysis record (steps, notes, report start) as a JSON string, without attached PNGs. Written on save. Analysis record
uns['skopia_provenance'] version, build, exported_at and, when known, commit of the Skopia that saved the file. Analysis record
uns['skopia_figures'] One JSON string per figure id: kind, inputs, params, provenance. Figures tab
uns['skopia_figures_seq'] Counter for figure ids (fig_<n>); survives deletion. Figures tab
uns['skopia_string_columns'] Names of string .obs columns, written on save and removed on load. above

Drawings

Where What Guide
uns['skopia_lines_json'] Drawn shapes and lines as JSON, each with its embeddingName and dimX / dimY. Shapes and text labels
uns['skopia_text_annotations_json'] Text labels placed on embeddings, as JSON. Shapes and text labels
obsm['X_<line>_projection'] Per drawn line, written on save: each cell's position along the line and distance from it (two columns). Lines and trajectories

Cells, labels and subsets

Where What Guide
obs['subset_<name>'] Boolean membership of a named cell subset. Named subsets
uns['skopia_cell_subsets'] Registry of named subsets: parent, origin, and the keys derived from each. Named subsets
obs[<column>], uns['<column>_colors'] Label columns you create, rename or merge. Labels and annotations

Preprocessing and the clustering chain

These are scanpy's own keys, written by scanpy's functions.

Where What Guide
layers['counts'] Copy of .X made on load when .X looks like integer counts and no counts layer exists. Preprocess
layers['smoothed'] (default name) Graph-smoothed expression. Preprocess
var['highly_variable'] and scanpy's HVG columns Highly variable genes. Cell analysis
obsm['X_pca'], varm['PCs'], uns['pca'] PCA. Cell analysis
obsm['X_pca_<suffix>'], varm['PCs_<suffix>'] A PC subset with chosen PCs left out; recorded in uns['pca']['subsets']. Cell analysis
obsp['connectivities'], obsp['distances'], uns['neighbors'] The default kNN graph. A named graph is obsp['<key>_connectivities'] / obsp['<key>_distances'] with uns['<key>']. Cell analysis
obsm['X_umap'] UMAP; on another graph, X_umap_<graph>. Cell analysis
obs['leiden'] Leiden clusters (name chosen with key_added). Cell analysis

Scoped to a named subset <name>, the same steps write only suffixed keys and never the dataset's own: var['highly_variable__<name>'], obsm['X_pca_<name>'] with varm['PCs_<name>'] and uns['pca_<name>'], obsp['<name>_connectivities'] / obsp['<name>_distances'] with uns['<name>'], obsm['X_umap_<name>'], and obs['leiden_<name>']. For this reason the names spatial, neighbors, pca, umap, leiden and hvg are refused as subset names.

Tight clusters and metacells

Where What Guide
obs['tight'], obs['tight_stability'] Tight cluster labels (C1, C2, …, unassigned) and the stability score they were called from; tight_<subset> on a named subset. Tight clusters
uns['skopia_tight_clusters'][<column>] The run as a JSON string: parameters, per-cluster and per-threshold tables. Tight clusters
obs['metacell'] In the source dataset: each cell's metacell id. Metacells
obs['metacell_id'], obs['n_cells'], obs['<column>_purity'], uns['skopia_metacells'] In a metacell dataset: the id, the number of member cells, the purity of chosen label columns, and the run that made it. Metacells

Diffusion and differentiation

Where What Guide
obsm['X_diffmap'] Diffusion map on the default graph; X_diffmap_<graph> or X_diffmap_<subset> otherwise. Diffusion maps
uns['skopia_diffmaps'] Registry of the diffusion maps Skopia made: graph, number of components, eigenvalues, subset. Diffusion maps
obs['dpt_pseudotime'] Diffusion pseudotime; on another map, dpt_pseudotime_<suffix>. Diffusion maps
uns['skopia_dpt'] Registry of pseudotime runs. Diffusion maps
obs['stemfinder'], obs['stemfinder_raw'], obs['diffometer'], obs['cc_mean'], obs['n_tfs'] Differentiation scores, by the metrics chosen; an optional suffix is appended. Differentiation

Markers, cell typing and copy number

Where What Guide
uns['skopia_marker_genes']['markers_<column>'] A marker run: JSON string with the top genes per group (genes, score, log2fc, pct_in, pct_out, pval, pval_adj) and a uid that changes when the run is re-made. Differential expression and markers
obs['SCN_class_argmax'], obs['SCN_class_score'], obs['SCN_class_type'] PySingleCellNet call, confidence, and optional quality category (default key SCN). Colors in uns['<column>_colors']. Cell typing
obsm['SCN_score'] Cells × cell types score matrix. Cell typing
obsm['X_<key>'] CNV: cells × genome windows, NaN outside the analyzed cells (default key cnv). Copy-number inference
obsm['X_<key>_chrom'] CNV: cells × chromosomes, a registered score matrix. Copy-number inference
obs['<key>_score'], obs['<key>_clone'] CNV score per cell and clone call (unassigned outside the analyzed cells). Copy-number inference
uns['skopia_cnv'][<key>] CNV run record as a JSON string: windows, chromosomes, clone summary. Copy-number inference

Genes and gene sets

Where What Guide
obs['UCell_<set>'] UCell score of a gene set. Analyze a gene set
obsm['geneset_scores'] (default name) Several gene-set scores as one score matrix. Analyze a gene set
var[<name>] A gene set saved as a boolean .var column, or a gene flag you set. Gene sets
var['gene_symbol'] (default name) Official symbols looked up for Ensembl ids. The Genes panel
var['gene_type'], var['gene_class'], set columns GENCODE gene type, coarse class and named-set membership, written by Exclude Genes → Mark. Preprocess
uns['skopia_gene_types'] Records that Skopia wrote those columns from its tables. Preprocess
var['mt'] Read, not written: a boolean mitochondrial flag, preferred over the mt- name pattern. Preprocess
var['gene_cluster'] (default), uns['gene_modules'] Gene clustering. Gene programs and modules
varm['X_gene_pca'], uns['gene_pca'] Gene PCA. Gene programs and modules
obsm[<key>], varm['<key>_loadings'], uns['skopia_gene_nmf'][<key>] Gene NMF programs (default key NMF): usage per cell, loadings, program gene sets. Gene programs and modules
obsm[<key>], uns['skopia_gene_nmf_meta'][<key>] Meta-programs (default key MP). Gene programs and modules
obsm[<key>], varm['<key>_loadings'], uns['skopia_gene_set_decomposition'][<key>] A gene set decomposed into programs. Analyze a gene set
uns['skopia_gene_maps'][<key>] A gene map with its similarity matrix. Analyze a gene set
obsm['X_pca_<key>'], obsp['<key>_connectivities'], uns['<key>'], obs['leiden_<key>'], obsm['X_umap_<key>'], uns['skopia_gene_set_clusterings'] Clustering cells on a gene set, kept apart from the dataset's own PCA, graph and clusters. Analyze a gene set
uns['skopia_enrichment'][<key>] An enrichment result (ORA or GSEA) as a JSON string. Enrichment

Spatial

Where What Guide
uns['skopia_spatial_key'] Which .obsm array holds the spatial coordinates. Spatial neighbors
uns['skopia_spatial_scale'] The micrometers-per-unit scale for the scale bar. Display settings
obsp['spatial_connectivities'], obsp['spatial_distances'] Spatial neighbor graph (squidpy's keys). Spatial neighbors
obs['contour_<first gene>_<n genes>'] A single-gene-set contour, unless you name the column. Contour
obs['tissue'] (default), obs['tissue_status'], obs['<module>_high'] Multi-contour tissue annotation; the last two only with QC output on. Contour
obs['territory_<type>'], uns['skopia_territories_json'] One territory label column per territory type, and the cuts that define them. Sections and territories
obsm['neighborhood_composition'], uns['skopia_neighborhood'] Cell-type neighborhood composition and the types × types result. Cell-type neighborhoods
obs['LR_<ligand>_to_<receptor>'], obsm['lrscore'], uns['lrscore'] Ligand-receptor signaling scores. Ligand-receptor signaling
obsm['X_spatial_pred'] (default), obs['X_spatial_pred_confidence'], obs['X_spatial_pred_similarity'], obs['X_spatial_pred_section'] Localize: predicted positions and the two confidence scores; the section column only with a sectioned reference. Localize
obs['merge_group'], layers['counts'], uns['skopia_spot_merge'] In the new dataset Merge Spots creates: which spots were merged, summed counts, and the parameters. Merge spots

Combined datasets

Where What Guide
obs['sample'] Which input dataset each cell came from. Combine datasets
uns['skopia_combine'] The combine mode, the dataset labels, and the .obs / .var column policies used. Combine datasets

Registries

Where What
uns['skopia_score_matrices'] Column names for every registered .obsm score matrix.
uns['skopia_cell_subsets'] Named subsets and their derived keys.
uns['skopia_diffmaps'], uns['skopia_dpt'] Diffusion maps and pseudotime runs.
uns['skopia_marker_genes'], uns['skopia_enrichment'], uns['skopia_cnv'] Stored runs that figures read.