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.

CyteArc for Seurat users

Find the CyteArc call for each step of a Seurat analysis, the settings where the two give different results, and how to bring a saved Seurat object into CyteArc without an R session. Where Seurat keeps assays, metadata and results in a SeuratObject, CyteArc keeps them in a Zarr store that a DataStore opens, and saves each result as an artifact that later steps take by reference. The data model comparison explains how the two models differ.

Translate each step

In the calls below, ds is a cytearc.DataStore, the object that opens a store. ds.pipeline.rna(), ds.pipeline.adt() and ds.pipeline.atac() run each modality’s standard workflow in one call and return a PipelineRun, a saved record of the run’s settings and results. The methods in the table run the same steps one at a time:

StepSeuratCyteArc
Hold the analysisSeuratObjectDataStore
Load a saved projectreadRDS()inspect_seurat, SeuratReader and SeuratToZarr, then DataStore
Hold several modalitiesAssays such as RNA and ADTAssays of the same store
Compute QC metricsThe nCount_RNA and nFeature_RNA columns, and PercentageFeatureSet(obj, pattern = "^MT-")Opening a new store adds RNA_nCounts, RNA_nFeatures, RNA_percentMito and RNA_percentRibo to the cell table
Filter cellssubset(obj, subset = nFeature_RNA > 200 & percent.mt < 5)ds.qc.filter(["RNA_nFeatures", "RNA_percentMito"], lows=[200, None], highs=[None, 5]), whose bounds exclude equal values as > and < do, or ds.qc.auto_filter with bounds from the median absolute deviation; both return a cell selection and delete no cells
Select and normalize genesNormalizeData, FindVariableFeaturesds.features.hvgs, then ds.features.normalize over the same cell selection
Scale and reduceScaleData, RunPCAds.reduction.pca, which standardizes each gene unless feat_scaling=False
Build the neighbor graphFindNeighborsds.graph.ann_index, ds.graph.neighbors, then ds.graph.connectivity
Embed and clusterRunUMAP, FindClustersds.embeddings.umap, ds.clusters.leiden
Find marker genesFindAllMarkersds.markers.search, then ds.markers.load
Correct batches with HarmonyHarmony integration after PCAds.reduction.harmony after PCA, then the graph steps
Integrate modalities with weighted nearest neighbors (WNN)FindMultiModalNeighborsds.pipeline.multimodal([rna_run, adt_run]) on runs of the same cells, or ds.integration.modalities on a neighbor artifact of each assay

The PBMC analysis names the populations of a saved RNA run from their marker genes, and the CITE-seq tutorial analyzes RNA and antibody counts of the same cells and integrates them with WNN.

Which settings give different results

Import a saved Seurat object

CyteArc reads a Seurat .rds file directly, without R. inspect_seurat reports what the file holds and which parts can be imported, SeuratReader selects the parts to read, and SeuratToZarr writes them to a store:

import cytearc

# Read the RNA counts and both reductions, and write them to a new store.
with cytearc.SeuratReader("pbmc.rds", assays=["RNA"], reductions=["pca", "umap"]) as reader:
    imported = cytearc.SeuratToZarr(reader, zarr_loc="pbmc.zarr").dump()

# Keep every imported cell: by default, the first open of a new store
# leaves out cells with 10 or fewer detected genes.
ds = cytearc.DataStore("pbmc.zarr", min_features_per_cell=-1)

The store holds the counts layer of each imported assay and the cell metadata, with the cells in a random order and each cell’s position in the object in sourceRow (cell order). imported.activeIdentity is a clustering artifact, so plots and ds.markers.search accept Seurat’s identities as they accept a Leiden result; imported.reductionArtifacts["umap"] is a layout that plots draw, and a PCA imports as coordinates that a neighbor graph can be built on. imported.notices lists what stayed behind, such as the normalized data and scale.data layers and the command history; CyteArc computes normalized values from the raw counts when a step needs them.

The counts layer of an SCT assay holds SCTransform-corrected counts, not raw counts. When SCT is the active assay, the import therefore makes the assay whose raw counts the SCT models were fitted to, usually RNA, the store’s default assay, and reports an sct_default_assay notice; SeuratToZarr(..., default_assay="SCT") keeps SCT as the default.

The Seurat import tutorial imports a PBMC object of monocytes and dendritic cells, reads the notices of a partial import, such as skipped_metadata_column and sct_default_assay, and shows which parts an import skips or must import and how to set a reduction’s role; the Seurat import reference lists every option. CyteArc does not read .h5seurat files or write Seurat files; to return to R, export H5AD or Matrix Market files as Import and export shows.

References
  1. Hao, Y., Hao, S., Andersen-Nissen, E., Mauck, W. M., Zheng, S., Butler, A., Lee, M. J., Wilk, A. J., Darby, C., Zager, M., Hoffman, P., Stoeckius, M., Papalexi, E., Mimitou, E. P., Jain, J., Srivastava, A., Stuart, T., Fleming, L. M., Yeung, B., … Satija, R. (2021). Integrated analysis of multimodal single-cell data. Cell, 184(13), 3573-3587.e29. 10.1016/j.cell.2021.04.048