Atera#
TrackCell reads 10x Atera bundles in both flavours:
official (Atera 1.x):
cell_feature_matrix.zarr.zip+cells.zarr.zip+transcripts.zarr.zip+experiment.spatialpreview: Xenium-v4 compatible
cell_feature_matrix.h5+cells.parquet+cell_boundaries.parquet+experiment.xenium
The reader auto-detects the format. The resulting AnnData has the same
schema for both formats, so downstream code works unchanged.
See also
Atera 空间转录组 — 官方 Zarr + 单分子点云 — end-to-end notebook for an Atera kidney ROI: official Zarr, polygon visualization, cell QC, Q-score, transcript density, nuclear fraction, single-molecule point cloud and a preview bundle.
First look at a bundle#
Atera bundles can be hundreds of GB. Inspect one before loading anything:
import trackcell as tcl
tcl.io.atera_info("/path/to/ROI_bundle")
This prints cells × features, Gene Expression feature count, polygon coverage, transcript count / grid tiles and the software version, without loading the expression matrix.
Reading#
# auto-detect preview vs official
adata = tcl.io.read_atera("/path/to/ROI_bundle")
# explicit entry points
adata = tcl.io.read_atera_cellseg("/path/to/ROI_bundle")
adata = tcl.io.read_atera_preview("/path/to/preview_bundle")
Common options:
adata = tcl.io.read_atera(
"/path/to/ROI_bundle",
sample="C001_ROI1", # default: experiment region_name
gene_name_index=True, # var_names = gene symbols
build_polygons=True, # ~1 min for 400k cells
include_nucleus=None, # default: same as build_polygons
store_wkt=False, # WKT costs memory; add later on demand
keep_de=False, # drop hundreds of official de_* columns
load_panel=False, # panel_config.json is ~11 MB (customer data)
region=(xmin, ymin, xmax, ymax), # µm, or a shapely geometry
n_cells=None, # random subset
)
Note
region is (xmin, ymin, xmax, ymax), matching shapely / GeoPandas.
Passing (xmin, xmax, ymin, ymax) raises an error instead of silently
selecting the wrong area.
What the AnnData contains#
.XRaw counts (CSR, cells × features). Not normalised or log-transformed.
.obsbarcode(string, same asobs_names),centroid_column/centroid_row(µm),cell_area/nucleus_area(µm²),transcript_counts(gene-only),total_counts(includes control probes/codewords), official cluster / Azimuth columns. Official data also hascell_id(uint32),cell_prefixanddataset_suffix..obsm['spatial'](x, y)in micrometres. Atera centroids are already µm; do not multiply them bypixel_size(that is for morphology images only)..vargene_ids(Ensembl),feature_types(Gene Expression/Negative Control Codeword/ …) andis_gene_expression..uns['atera']coord_unit='um',roi/slide/run,pixel_size,z_step_size,chemistry_version,analysis_version,panel_path,transcripts_path..uns['spatial'][sample]['geometries']Cell polygons (GeoDataFrame).
nucleus_geometriesis added wheninclude_nucleusis enabled (the default followsbuild_polygons)..uns['cell_boundaries']/['nucleus_boundaries']Compact vertex arrays with
layout='index':cell_idxmaps eachobsrow to a polygon index inton_vertices(-1= no polygon);vertex_x/vertex_yare concatenated in that order. Xenium writes the other layout,layout='offset', wherecell_idxis a vertex start offset andn_verticesis row-aligned. tl.split_by_slice reads thelayoutmarker and supports both.
Filter control features before analysis#
Atera panels contain thousands of negative-control codewords. They must be removed before HVG / PCA / clustering:
adata = tcl.io.filter_atera_genes(adata)
print(adata.var["feature_types"].value_counts())
Cell polygons#
tcl.pl.spatial_cell(adata, color="total_counts")
Cells without a polygon (a small fraction) are skipped with a warning.
Use trackcell.io.sync_geometries_after_subset() after subsetting.
If you need WKT strings for serialization:
tcl.io.add_wkt_geometry(adata) # obs['geometry']
tcl.io.add_wkt_geometry(adata, nucleus=True)
Transcript point cloud#
transcripts.zarr.zip contains single molecules and is not loaded into
adata.X. A kidney ROI has ~1.19 billion molecules, so always stream:
for chunk in tcl.io.iter_atera_transcripts(
roi, genes=["NPHS1", "UMOD"], min_qv=20,
region=(0, 0, 2000, 2000)):
print(chunk.head())
Columns: x, y, z (µm), qv, cell_index (row in
adata.obs, -1 = unassigned), cell_prefix, gene_index,
gene (categorical), codeword, overlaps_nucleus.
Pass adata=adata when the AnnData was subset, so cell_index refers to
the subset’s obs order:
sub = tcl.io.read_atera(roi, region=(0, 0, 2000, 2000))
df = tcl.io.read_atera_transcripts(
roi, genes=["NPHS1"], adata=sub
)
min_qv=20matches the official cell matrix. The point cloud itself also contains lower-quality molecules — passmin_qv=Noneto keep them.genes=uses the per-tilegene_offsetindex, so only the requested gene ranges are read. Targeting one gene on a full kidney ROI takes about a second instead of ~5 minutes.read_atera_transcripts(...)returns a single DataFrame for small queries. It refuses to run withoutgenes/region/max_rows(useforce=Trueto override).
QC and plots#
# cell-level QC (from obs / X only)
qc = tcl.io.atera_cell_qc(adata)
# transcript QC (streams the point cloud; ~5 min for 1.19B molecules)
summary = tcl.io.atera_transcript_qc(roi, adata=adata, min_qv=20)
tcl.pl.atera_qc_summary(adata) # 2×2 cell QC panel
tcl.pl.atera_transcript_density(adata) # stored density map
tcl.pl.atera_nuclear_fraction(
adata, genes=["UMOD", "DDX17"]
)
atera_transcript_qc writes back to adata:
obs['tx_q20_counts'],obs['tx_nuclear_counts'],obs['nuclear_fraction']— per-cell Q≥20 transcript count, nuclear count and fraction.uns['atera']['transcript_qc'],['qscore'],['density'],['gene_qc']— summary, histogram, density map and per-gene nuclear fractions.
Because all results live in adata, the plotting functions can be called
repeatedly (they never consume a one-shot iterator).
Multi-ROI and multi-customer delivery#
Atera has no customer barcodes; the delivery unit is an ROI. A run directory contains one sub-directory per ROI:
rois = tcl.io.list_atera_rois("/path/to/run")
print(rois[["roi", "n_cells", "has_transcripts"]])
run = "/path/to/run"
for name, adata in tcl.io.iter_atera_rois(run, rois=["C001_ROI1"]):
...
Merging the same customer’s ROIs requires explicit offsets in µm:
merged = tcl.io.concat_atera_rois(
{"C001_ROI1": a, "C001_ROI2": b},
offsets={"C001_ROI1": (0, 0), "C001_ROI2": (12000, 0)},
index_unique="-",
)
There is no reliable way to derive offsets from
overview_scan_fov_locations.json (5–10 µm error), so the function refuses
to guess. index_unique suffixes barcodes per ROI (Atera barcodes can
repeat across ROIs) and keeps geometry indices consistent.
Supported analyses and limits#
Supported:
gene-level expression, cell polygons, cell QC
Q-score, transcript density, nuclear localisation (
overlaps_nucleus)spatial pseudotime / trajectory (Monocle3, Slingshot, CellRank expression/connectivity kernels) — not RNA velocity
spatial masking to split shared ROIs downstream
Not supported (Atera does not provide the data):
isoform / transcript-level quantification (the WTA panel is gene-level)
splice junctions / alternative splicing
spliced / unspliced counts and RNA velocity (
overlaps_nucleusis not unspliced)customer demultiplexing (there are no customer barcodes)
Performance notes#
Measured on the public kidney WTA dataset (399,120 cells, 1.19B transcripts):
read_atera(..., build_polygons=False): ~3 sbuild_polygons=True: ~60 s (398k cell + 398k nucleus polygons)atera_transcript_qcfull scan: ~320 s, ~400 MB RSSiter_atera_transcripts(genes=["NPHS1"]): ~1 s (gene-range fast path)reading a 717k-cell preview bundle: ~70 s
The transcript reader skips background grid tiles (negative grid keys)
that contain only placeholder rows outside the ROI.
Panel configuration#
panel_config.json is ~11 MB and may contain customer / designer
information, so it is not loaded by default. Only uns['atera']['panel_path']
is recorded. Load it explicitly when needed:
panel = tcl.io.read_atera_panel("/path/to/ROI_bundle")
adata = tcl.io.read_atera(roi, load_panel=True) # uns['gene_panel']