Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

FAQ

Who maintains CyteArc?

CyteArc is open source and maintained by Nygen. Bug reports and feature requests for the Python package belong on GitHub issues.

How does CyteArc compare to Scanpy?

See CyteArc for Scanpy users for a stage-by-stage workflow map and H5AD exchange notes.

How does CyteArc compare to Seurat?

See CyteArc for Seurat users for a stage-by-stage workflow map and RDS import. The measured differences between CyteArc and Seurat WNN are summarized below.

How do I run Harmony batch correction in CyteArc?

After PCA, call corrected = ds.reduction.harmony(pca, ["batch_column"]), then pass corrected explicitly to embeddings.initialization and graph.ann_index. Continue by passing the returned refs to graph.neighbors and graph.connectivity. A pipeline recipe does the same with ds.pipeline.rna(harmony={"batch_columns": ["batch_column"]}). See Harmony batch correction, and dataset merging to combine stores into one before correcting them.

How does CyteArc’s Harmony2 differ from its earlier Harmony?

CyteArc implements Harmony2, which builds on the original Harmony algorithm. CyteArc wrote this implementation from the two papers. Clusters start from k-means++ seeds, the diversity penalty takes a stabilized form that stays bounded when a batch is missing from a cluster, the ridge penalty of each batch level in each cluster scales with the level’s expected mass in the cluster, and levels with almost no cells in a cluster are left out of its regression.

Three harmony_params keys are renamed and one is removed. Each raises a ValueError that names the change, such as Unsupported Harmony parameter 'nclust': it was renamed to 'n_clusters':

max_iter_harmony must now be at least 1, and it defaults to 40: a fit stops as soon as it converges, so the limit only bounds fits that settle slowly. Rename the keys in the harmony settings of pipeline recipes too: a recipe checks them before it creates a run record.

By default the ridge penalty is dynamic: ridge_alpha (0.2) times each level’s expected mass in the cluster, its share of all cells times the cluster’s total assignment. Where a level has about its expected mass in a cluster, the correction removes about 1 / (1 + ridge_alpha), roughly 83%, of that level’s shift, while a fixed penalty of 1, the 2019 default, removes nearly all of it in large clusters. A level with far less than its expected mass gets almost no correction. Pass harmony_params={"ridge_penalty": 1.0} for the fixed penalty; the other Harmony2 changes stay.

Corrections saved by the earlier implementation stay listable and loadable, but they are not reused: they lack the per-cluster penalty arrays that reuse requires, so the next request computes a new correction and everything built on it again. See the integration API reference for every key and the stored arrays.

Which integration method should I choose?

CyteArc does not include Scanorama, BBKNN, scVI, ComBat, or other external integration packages. Export with to_anndata or to_h5ad when you need those tools.

How do I reduce log noise or disable progress?

Configure the two settings independently:

cytearc.configure_output(level="WARNING", progress=False)

For a batch log file, use set_verbosity(..., filepath=...). Enable timestamps with configure_output(timestamps=True). An application that configures the standard library’s logging can receive CyteArc’s records on the "cytearc" logger with configure_output(stdlib=True). See the utilities API reference for all output settings and their defaults. Tutorial pages show completed snapshots from their cached execution; live notebooks animate the same operations.

What is the difference between SNN and WNN integration?

Both use integration.modalities with two or more explicit source refs. WNN is the default. It consumes modality-specific neighbor artifacts, learns one weight per assay and cell, and ranks candidates by the resulting blended affinity. SNN requires method="snn"; it consumes modality-specific connectivity maps and combines shared edge support.

CyteArc WNN versus Seurat

CyteArc WNN follows the weighting equations from Hao et al. but does not reproduce Seurat’s default search exactly. It considers the union of the existing KNN rows, uses the distance span from each assay’s nearest to its k-th nonself neighbor as that assay’s bandwidth, and L2-normalizes rows only during scoring. For each cell and ordered pair of modalities, it compares within-modality and cross-modality prediction affinity. It then sums the exponentiated directed scores for each target modality and normalizes those grouped strengths across all modalities.

Seurat normally searches a wider knn.range=200 pool and uses SNN-far bandwidth. CyteArc instead reuses the candidates in the supplied neighbor artifacts. With two modalities, avoiding the wider search at ten million cells saves two additional index builds, 20 million queries, and 4 billion materialized candidate records.

Both differences are measured rather than assumed. Given the same candidate pool and bandwidth, CyteArc reproduces Seurat 5.5.1 to the float32 resolution of the stored graph in both two-modality and synthetic three-modality fixtures. Against Seurat’s shipped defaults on a two-modality CITE-seq subset, CyteArc selects 89 percent of the same neighbors and its per-cell RNA weight correlates at 0.76. The reference values ship with the test suite.

Scaling notes

The per-cell prediction work grows quadratically with the number of modalities, while scoring blended graph edges is linear in the union candidate pool. Stored neighbor rows, output edges, and modality weights remain linear in cell count.

How do I compute LISI in CyteArc?

Use integration.compute_ilisi for a single scIB-scaled batch-mixing score and integration.compute_clisi for a scIB-scaled biological-label conservation score. Each requires the exact neighbor artifact and reads matching metadata rows through its stored cell selection. Use cytearc.metrics.compute_lisi for raw per-cell LISI values from KNN arrays. See LISI metrics.

Should I use t-SNE, UMAP or LocalMAP?

t-SNE and UMAP are complementary visualization tools. t-SNE emphasizes local structure and can reveal fine-grained diversity. UMAP preserves more global structure, which helps when cluster relationships matter. CyteArc computes t-SNE with the optional sgtsnepi package (see Optional t-SNE), which runs on one thread, so time a subset before running it on an atlas-scale dataset. UMAP is part of every installation and can run in parallel. LocalMAP, also part of every installation, keeps more of each cell’s nearest neighbors than UMAP and separates nearby cell types more sharply, and it runs on every thread with the same layout on any number of them (details). In CyteArc, UMAP, LocalMAP and t-SNE all require an explicit graph and initialization. Pass the same refs when you want the layouts to share those inputs.

What is densMAP?

Enable density-preserving UMAP with embeddings.umap(graph_ref, initialization_ref, use_density_map=True). Useful when preserving local density structure matters alongside cluster separation.

Which clustering should we use, Paris or Leiden?

Leiden is faster than Paris, especially for large datasets. On small datasets we have tested, Leiden results are often more concordant with UMAP clusters. Paris provides a hierarchy that can show relationships between clusters. Both methods have low computational requirements, so you can run both and inspect the Paris hierarchy from its exact clustering artifact:

leiden = ds.clusters.leiden(graph_ref)
paris = ds.clusters.paris(graph_ref)
ds.plots.cluster_tree(
    graph=graph_ref,
    clusters=paris,
)

Use silhouette scores or domain knowledge to compare the candidates. The rna, atac, and adt pipeline recipes score Leiden resolutions automatically in graph space and expose the selected ref as run["clusters"]; they run Paris only with paris=True. That result is a reproducible baseline, not proof that the selected resolution is biologically correct. Granular evaluation APIs such as evaluate_cluster_separability can inspect partitions outside the pipeline.

Why do Leiden clusters differ from an earlier CyteArc release?

clusters.leiden and the pipeline recipes now use CyteArc’s own Leiden implementation, backend="cytearc", by default; earlier releases used the igraph package. Both optimize the same modularity objective, but their random choices differ, so their labels differ even for the same seed, and the new backend numbers clusters by size, with cluster 1 the largest. Compare partitions with clusters.compute_concordance, which ignores cluster numbers, rather than by number. The native backend gives the same labels for any number of threads, so nthreads does not change results. See Leiden clustering for the method.

The backend is part of each clustering’s identity, so a default call does not reuse a clustering that an earlier release stored. Pass backend="igraph" to reuse it, which needs no extra package, or to compute a new igraph clustering, which needs the igraph package installed separately (Optional GPL Leiden backends).

Why are the cells of my store in another order than my file?

Imports write the cells in a uniformly random order by default, so that any contiguous block of rows, such as a count shard or a training mini-batch, is a random sample of the cells rather than the cells of one sample. Each cell keeps its row in the file in the cell column sourceRow, and to_h5ad, to_mtx and to_anndata write the cells back in the file’s order. Attach values from other tools keyed by cell ID, such as ds.cells.insert("cell_type", adata.obs["cell_type"]), never by position. The order also changes the random choices of UMAP and Leiden, so a store imported again gives slightly different layouts and clusters than one an earlier release imported. Pass shuffle_cells=False to a writer to keep the file’s order. Why CyteArc shuffles cells gives the reasons and the costs.

Why does the first Leiden clustering take longer than later ones?

The first call of the default Leiden backend in a fresh environment compiles its Numba kernels once, which took about 26 seconds on a recent laptop. Later processes load the compiled kernels from Numba’s on-disk cache, about 0.4 seconds for their first call, and later calls in the same process add only a few milliseconds of overhead. The first run after an upgrade of CyteArc compiles the kernels it uses again, and a session that keeps running through an upgrade compiles them without the cache until it restarts. The cache needs a writable directory (NUMBA_CACHE_DIR sets one). Graph construction and UMAP use the same cache: CyteArc enables it for the umap-learn kernels they call, which umap-learn compiles without one, and for the kernels that importing umap-learn compiles, most of them pynndescent’s. A warm cache imports umap-learn in about a second instead of compiling those kernels again, which took 5 to 30 seconds in every new process, and processes that import it at once compile each kernel once and load it from the process that compiled it. A densMAP layout still compiles one kernel each time it runs, because umap-learn creates that kernel inside its layout function. To build the cache into a deployment image, run a small analysis with NUMBA_CACHE_DIR set while building it, and set NUMBA_CPU_NAME (for example x86-64-v3) and an empty NUMBA_CPU_FEATURES both then and at run time, so the cache does not depend on the build machine’s processor; the machines that run the image must support that processor level.

Where did ds.pipeline.run go?

DataStore.pipeline.run() and its params mapping are removed. This is a breaking change within the 1.x releases with no alias, so ds.pipeline.run raises AttributeError. Call ds.pipeline.rna(), which takes one keyword per stage: hvg={"top_n": 2000} replaces hvg_count=2000, pca={"dims": 30} replaces pca_dims=30, cells="x" replaces cell_key="x", and umap={...} replaces params={"umap": {...}}. Paris is off by default; pass paris=True to run it. ds.pipeline.atac() and ds.pipeline.adt() analyze other assays, and ds.pipeline.multimodal() integrates completed runs of the same cells. Runs that pipeline.run() saved still open and report. The analysis pipeline API reference lists every replacement.

Why will my existing RNA Zarr store not open?

Current CyteArc versions write RNA counts twice: cell-major counts and a gene-major countsT copy. Opening an RNA assay fails if that copy is missing, incomplete, still Zarr v2, or does not match counts. Every assay must also carry the current preparation record: finalized raw counts, summaries recomputed from those counts, and a dataset identity. Stores missing those records or containing the unsupported {assay}/state group fail on open. There is no silent rewrite, migration, or state-based result selection.

Re-import the source, or rebuild it into a fresh location:

python -m cytearc.tools.repack_zarr input.zarr output.zarr --data-only

The rebuild keeps raw counts, annotations, and selection columns, omits saved analyses and retired state, and prepares the new store from its own counts. Afterward, recompute HVG, normalization, PCA, graph, and marker results with the current release. A grouped assay is stored as counts, so the rebuild copies its values without recomputing them. Build grouped assays again with add_grouped_assay, under a new assay_label in a rebuilt store. Count matrices must hold finite values, so a store whose grouped assay holds NaN cannot be rebuilt; re-import its source and build the grouped assay there. Non-RNA assays do not use countsT. See Memory and execution.

How do I create a count matrix for my single-cell data?

Generating count matrices is the primary step of single-cell data analysis. For scRNA-Seq you can use tools like STARsolo, alevin-fry or kallisto|bustools. If your data was generated using 10x’s commercial solution then you can use Cell Ranger. For single-cell ATAC-Seq data, Cell Ranger ATAC can be used if your data was generated using 10x’s kit. Yan et al reviews ATAC-seq analysis approaches; Cusanovich et al describes an scATAC-seq experimental approach.

Can I use CyteArc from R?

Not yet. Please open a discussion on GitHub if an R API would be useful.

What Python version does CyteArc require?

Python 3.13 or newer (requires-python >=3.13). See installation.

References
  1. Patikas, N., Yao, H., Madhu, R., Raychaudhuri, S., Hemberg, M., & Korsunsky, I. (2026). Integration of large, complex single-cell datasets with Harmony2. bioRxiv. 10.64898/2026.03.16.711825
  2. Korsunsky, I., Millard, N., Fan, J., Slowikowski, K., Zhang, F., Wei, K., Baglaenko, Y., Brenner, M., Loh, P., & Raychaudhuri, S. (2019). Fast, sensitive and accurate integration of single-cell data with Harmony. Nature Methods, 16(12), 1289–1296. 10.1038/s41592-019-0619-0