Repository navigation
Releases
1.5.0
CyteArc 1.5.0 shuffles the cells of every import so that any block of rows is a random sample, writes exports in the imported file's order, and records which features each source of a merge measured. It adds pausing and resuming of pipeline runs, ATAC doublet scoring, a search for the initial and terminal states of a fate map, and a per-run choice of normalizer. Pipeline runs, imports, merges and metadata refuse more malformed input before they write anything. The memory budget is now an approximate planning budget, and the tutorials describe computed values in words instead of quoting them. This release merges 134 pull requests.
Read the breaking changes before upgrading. Code that passes arrays to ds.cells.insert needs a pandas Series keyed by cell ID, a file imported again gets a new cell order, and several results that 1.4.0 saved are computed again on their next call.
The example stores that the tutorials open were rebuilt with this release, and every tutorial page was executed again on Linux against them.
Compatibility with 1.4.0
- Stores that 1.4.0 wrote open in 1.5.0 unchanged, and 1.5.0 writes nothing when it opens one. A result whose operation changed is computed again on its next call, with a
Recomputinglog line that names the saved result. Results computed from it follow without a line of their own: a replayed 1.4.0 RNA run logs the line for its HVG stage and then computes its doublet scores and markers again. On a read-only store, such as anhf://CyteBase dataset, such a call raisesPermissionError, andds.pipeline.plan(run)lists the stages that a replay would compute. To recompute, mount the store withcytearc.mount_datastore(source, at="local.zarr"), which keeps its counts at the source and writes your results locally. - Stored data is not migrated. The next section lists what stays as 1.4.0 stored it and how to rebuild it.
- Stores that 1.5.0 wrote are not supported in 1.4.0, and no 1.4.x patch follows. Section "What 1.4.0 refuses" lists what it refuses.
- Stores that a development build between the two releases wrote are not supported.
- A paused run resumes only under the release that paused it.
The test suite now keeps stores that CyteArc 1.4.0 wrote, and checks that 1.5.0 opens, replays, recomputes, exports and merges them as this section describes.
Data that 1.5.0 reads but does not migrate
| What 1.4.0 stored | How 1.5.0 reads it | How to rebuild it |
|---|---|---|
Cells in the file's order, with no sourceRow |
Reads them as file-ordered and unshuffled, and exports them in stored order, which is the file's order | Import the file again. A default import shuffles and gets a new dataset fingerprint; pass shuffle_cells=False for the earlier order. Mounts and composites that recorded the earlier store refuse the new one |
| Merged columns holding the text "nan" or "NaT", or float dates | Stays as stored, also when the store is merged again | Merge the original sources again with 1.5.0, which stores NaN and NaT as missing rows and dates at the finest unit |
| A union merge of sources that measured different features | Counts the zero fills as measured, and a 1.5.0 merge of the store records them as measured | Merge the original sources again with 1.5.0, which records which features each source measured |
A recorded size factor of 1000 on an assay that a session corrected, merged or composed with sf=None |
Keeps the 1000, also where the source stored another factor | Correct, merge or compose the assay again in 1.5.0, or set sf in the session before you do |
countSummaries without rowNonzero |
Counts unsigned values from rowPositive, and merges and exports of signed and float counts read the counts to count them |
cytearc.tools.repack_zarr.repack_store writes the array and keeps the saved results |
| H5AD categoricals whose categories read alike, stored as one level each by 1.3.0 and 1.4.0 | Reads each as the first of them, so exports, plots and merges work | None needed |
Breaking changes
Cell order and per-cell values
- Every import writer shuffles cells by default:
H5adToZarr,CrToZarr,MtxToZarr,TapestriToZarr,CSVtoZarr,SparseToZarrandSeuratToZarrtakeshuffle_cells=Trueandshuffle_seed=0. Row r of a new store is not row r of its file, and a file imported again gets another dataset fingerprint, another UMAP layout and other Leiden numbers (#388, #389, #391). Each cell keeps its file row in the protected cell columnsourceRow. A shuffled H5AD import takes about 1.5 times as long as one in the file's order, whichshuffle_cells=Falsekeeps. - Merges and composites interleave their sources' cells at random, so a merge built again from the same sources lists its cells in another order (#588).
- Exports write cells in the imported file's order by default.
to_h5ad,to_mtx,DataStore.to_anndata,export_clones,export_charactersandexport_airrtakecell_order="source"andtemp_dir, andcell_order="stored"keeps the store's order. Exports of shuffled stores need temporary disk (#390, #404). ds.cells.insertandupdate_keytake per-cell values only as a pandas Series indexed by cell ID, and raiseTypeErrorfor arrays, lists and tuples. Other per-cell inputs, such asreduction.import_coordinatesandtrajectory.fate(direction=), are keyed by cell ID too (#386).SubsetZarr(cell_idx=)is removed with no alias. Passcell_ids=, which writes the cells in store order (#386).shuffle_cells=Falsealone no longer writes the store that 1.4.0 wrote: every new store holdscountSummaries/rowNonzero, and an H5AD import also needscategorical_columns=False(#406, #533).
Pipeline runs and results computed again
- Every HVG selection and doublet score that 1.4.0 saved is superseded. A rerun of a 1.4.0 run computes again from the HVG stage, and on a read-only store it fails (#385, #398, #575, #607).
- The default HVG
min_cellsgrows with the cube root of the selected cells, so default selections of fewer than 1,901 or more than 8,000 cells pick other genes (#385). - Runs record the normalizer they used,
normalization={"method": ...}chooses it, and Pearson-residual runs no longer scale features in PCA by default. A 1.4.0 run replays with the normalizer of its saved normalized values (#405). - Automatic doublet thresholds take the histogram minimum, else Otsu's threshold, only where it implies at most 50% doublets, and call no cell where neither does. A sample can record
thresholdNone (#575, #607). - Pseudotime and lineage feature modules use exact neighbors, so module numbers, sizes and members change, and the HNSW
ann_paramskeys (ef,M,ef_construction,random_seed,num_threadsandmax_elements) have no effect. Passing one gives aFutureWarning, and CyteArc 1.6.0 stops accepting them (#591). - Recipe settings that their method refuses are refused before the first stage runs (#464).
Imports, metadata and merges
- Imports refuse, before writing anything, NaN, blank or missing IDs, text that is not UTF-8, list-valued metadata and several CSV option combinations that 1.4.0 accepted. The error names the row (#409, #410, #412, #413, #415, #453, #604).
- H5AD categoricals import as categorical columns, and mounts and composites record relative source paths by default (#406).
DataStoreMergetakesfeatures,"union"by default. A merge or composite records which features each source measured, and normalization, HVGs, peaks, scores, markers, the ADT panel, mapping and trajectory and perturbation analyses leave unmeasured features out (#527, #551, #578, #608, #622, #629).- Labels that would merge or print alike, such as
1,1.0andTrue, are refused in regulon specificity, Harmony, mapping and the label metrics (#441).
Memory budgets
mem_budgetis an approximate planning budget. CyteArc estimates the arrays that grow with the data, such as count blocks, coordinates, graphs and per-cell IDs and labels, and 128 KiB for each read of stored arrays in flight, plans each step so that they fit, and refuses a step that cannot fit before it reads or writes. Python, Zarr and NumPy hold a little more of their own, so leave some headroom beside the budget.- A memory refusal ends with "Raise mem_budget to at least N MiB", a quarter more than the refused step needs, rounded up to a whole MiB, and a rerun of the same call at that budget passes that step.
MemoryBudgetErrorgainssuggested_budget_bytes,remedyandsetting, the setting that the closing says to raise;needed_bytesstill gives the estimate at the refused step.str()of the error adds that closing sentence, also to an error that your own code builds, whileargs[0]keeps the message without it (#621). - Many steps charge more memory than in 1.4.0 and can refuse a budget that ran there: imports, trajectory graph loads, LocalMAP and reads of selected cells (#414, #423, #446, #457, #562, #587, #625, #630).
- On Modal, with this release's code, every step of the standard workflow on a 1M-cell CELLxGENE sample stayed within its 24 GiB budget, at most 11.7 GiB, and an import of a 10M-cell H5AD file of 40 GB peaked at 12.1 GiB under a 24 GiB budget, measured as the container's memory every 0.1 s (#427).
What 1.4.0 refuses in a store that 1.5.0 wrote
- A run that paused, resumed or ended from a pause:
list_runsskips it with a warning, and opening it by ID raisesValueError(#537, #550). run.settings(),ds.pipeline.rerunandds.pipeline.plan(run)of any rna, atac, adt or perturbation run, which recordnormalization.method, and of an ATAC run that recordsdoublets(#405, #543).- An HVG selection at revision 3, a clone, receptor, barcode or allele import at revision 2, and a pseudotime aggregation: explicit reads raise, and 1.4.0 never reuses them (#385, #504, #591).
- Mapping references built on another normalizer than library size or on a PCA without feature ...
1.4.0
CyteArc 1.4.0 analyzes four kinds of experiments that 1.3.0 could not: pooled CRISPR screens, clonal lineage tracing, immune repertoires, and mitochondrial and targeted DNA variants. It replaces ds.pipeline.run with one pipeline recipe per modality, saves diagnostics with each result so that a reused result repeats its warnings, and raises a MemoryBudgetError that names the budget a step needs when mem_budget is too small. Seven new tutorials cover the new analyses, and every tutorial was executed again and rewritten from its fresh outputs. This release merges 213 pull requests.
Read the breaking changes before upgrading: code that calls ds.pipeline.run needs the new recipes, several kinds of results that 1.3.0 saved are computed once more on their next call, and runs that 1.4.0 saves do not open in 1.3.0.
Breaking changes
Pipeline runs and example stores
ds.pipeline.runis removed, with no alias. Useds.pipeline.rna, which takes one keyword per stage, or the newds.pipeline.atac,ds.pipeline.adtandds.pipeline.multimodalrecipes (#38). The migration table maps each argument, such ashvg_count=Ntohvg={"top_n": N}andparams={"umap": {...}}toumap={...}. Paris clustering is now off by default (passparis=True),filteringdefaults toNone, and callbacks receiverun_interruptedin place ofpipeline_interrupted. Runs thatpipeline.runsaved still open and report.- New runs cluster every Leiden resolution in one
leidenstage and return the candidates asrun["leiden"], a tuple ordered by resolution, in place of onerun["leiden_<resolution>"]per candidate (#349). Their cell tables and exports hold only the selectedclusters. Runs saved by 1.3.0 keep theirleiden_<resolution>names. To read a candidate the same way in runs of both releases, useds.artifacts.find("clusters", graph=run["connectivity_map"], method="leiden", resolution=1.0). - CyteArc 1.3.0 cannot read the runs that 1.4.0 saves, because their records hold fields that 1.3.0 does not know: 1.3.0 skips them when it lists runs, raises when it opens one, and its
report()rejects their stage records (#38, #283, #349). - The example stores of the
cytearc_docsCyteBase repository were rebuilt with this release and republished in place (#266, #352). Their saved runs come from the pipeline recipes, hold the diagnostics that this release checks, and return Leiden candidates asrun["leiden"]. The tutorials of 1.3.0 openlabel="docs_default", which these stores no longer hold, so use the tutorials of this release with them.
Results computed again
- Results that 1.3.0 saved for highly variable genes, PCA, Harmony, neighbor graphs, UMAP, HTO demultiplexing, cell calling, ambient RNA estimates and doublet scores hold no diagnostics, so their next call computes them once more, with the same values, and the results built on them follow (#179, #190, #196). On a read-only store, such as an
hf://dataset, that recomputation raisesPermissionError. A call that reads such a result directly, such asds.reduction.harmonyon an earlier PCA ords.qc.correct_ambienton an earlier estimate, raises aValueErrorthat names the call to run first. Neighbor artifacts no longer carry aself_hit_rateattribute; readds.artifacts.inspect(ref).diagnostics["selfHitRate"]instead. ds.trajectory.pseudotimenow computes the untruncated population balance potential with MINRES by default (#229). Pseudotimes, and the fate maps and lineage results built on them, shift where a graph's slow modes outnumber 30 and agree closely elsewhere, and saved pseudotimes are computed again on the next default call. Passmethod="truncated"to reproduce 1.3.0.n_singular_valsandrandom_seednow apply only to that method and raiseValueErrorotherwise.- Two fixes listed under major bug fixes change saved results: melded gene scores and fractional size factors normalize correctly (#167), and HTO demultiplexing refuses a zero cutoff where ambient tags reach the cells, so its saved calls are computed once more (#189).
API changes
ds.compare.compute_bulkreturns aBulkProfilesrecord in place of a DataFrame or tuple (#228). Bulk columns are indexed by their labels, as a MultiIndex of group, subgroup and replicate, instead of joined names.return_fractionandreturn_n_cellsare removed: passcount_detected=Truefor detection counts and fractions, and read cell counts from the record'scolumns.ds.regulons.profilesrows are indexed by the group labels themselves.ds.trajectory.aggregationandcytearc.trajectory.feature_dynamics.knn_clusteringtaken_neighborsin place ofn_neighbours, with no alias (#351). Aggregations saved by 1.3.0 are still reused. Names, messages and plot labels now use US English.- The PCA elbow plot numbers components from 1, so its line stands on the number to pass as
dims(#336). Itsvariance_explainedtable holdspcin place of the 0-basedcomponent, andprovenance.extras["elbow_pc"], one higher, replacesprovenance.extras["elbow"]. - Flags such as
invalidate_cache,showand thetransparentargument ofPlotResult.saveaccept only Python and NumPy booleans and raiseTypeErrorfor anything else, where 1.3.0 used the truth of any value (#137).ds.artifacts.loadandds.artifacts.inspectraiseTypeError, notAttributeError, for an argument that is not anArtifactRef. - Plots title a bare label artifact from its record, such as "Leiden, resolution 1.0", in place of its kind, and an embedding keys that artifact's panel in
result.axesby the same title (#350). The newcytearc.plotting.NamedCellArtifact(name, artifact)sets the title and key. CategoricalScaleleavesmissing_color,missing_labelandpalette_nameasNoneunless set, so a scale that sets only some fields keeps a column's stored order and colors (#345).ds.imputation.compute_imputedrefuses a feature name that several features share, with aValueErrorthat names their IDs, where 1.3.0 imputed their mean;FeatureRef(value=name, reduction="mean")asks for the mean (#223). A missing feature raisesKeyError, andds.markers.loadadds afeature_idcolumn.Repository.download_datasetkeeps an existingdata.zarrand the results saved in it, where 1.3.0 downloaded and replaced it (#330). A store made from an older version of the dataset raisesFileExistsError; passoverwrite=Trueto replace it.- Memory refusals raise
cytearc.MemoryBudgetError, a subclass ofMemoryError(#141, #142). A Seurat import refused by its budget raised aValueErrorsubclass in 1.3.0, soexcept ValueErrorno longer catches it.
Imports and stores
- Imports detect normalized values. A non-integer matrix imported without
values=is stored as normalized values when it fits a normalized reading, so steps that need counts refuse it, and fractional counts, such as alevin or RSEM estimates, needvalues="counts"(#165). Negative values are refused. A store that 1.3.0 imported from normalized values still reads as counts; import it again withvalues=. DataStoreMergeandcreate_compositerefuse sources whose size factors differ, and an RNA assay whose storedsize_factoris not a finite positive number no longer opens (#167).- A pandas Categorical inserted into a cell or feature table is stored as integer codes beside its categories (#233). CyteArc 1.3.0 cannot open a store that holds such a column. Stores written by 1.3.0 open unchanged.
- Readers refuse malformed input that 1.3.0 read silently: Matrix Market entries with more fields than the header declares, a Matrix Market header that declares no entries for a file that holds some, and cisTarget motif annotation rows of another width than their header (#139, #176).
MtxReaderandCSVReadernow detect compression from a file's first bytes rather than its name. to_h5ad(nthreads=0)raises, sincenthreadsmust be at least 1 (#231).
Memory budgets
- Budgets count only the memory that grows with the data (#159). The fixed allowances for Python, Zarr and NumPy objects, Paris's 1.35 headroom factor and Harmony's added eighth are gone, so a budget admits these steps at smaller sizes, and a process can exceed
mem_budgetby the runtime's own memory. - Reads reserve each chunk's compressed bytes beside its decoded bytes, and the chunk a reader still holds, so a budget just above the 1.3.0 charge can now raise
MemoryBudgetErroror run fewer blocks at once (#133, #342, #347). - On Windows, the default budget is 75% of physical memory, in place of a fixed 6 GiB (#304). Where CyteArc reads neither physical memory nor a cgroup limit, the default budget raises
RuntimeErrornamingmem_budgetandCYTEARC_MEM_BUDGET.
Regulons and dependencies
ds.regulons.grnandcytearc.regulons.infer_grnfit on spawned worker processes whennthreadsis above 1, so a script that calls them must keep its top-level code underif __name__ == "__main__":(#234). Notebooks need no change.cytearc.regulons.regulon_specificityrefuses labels that are missing or blank with aValueError, asds.regulons.specificitydoes (#373). In 1.3.0 aNonelabel scored as a group of its own and NaN labels added rows of NaN; pass the activity and labels of the labeled cells instead.- CyteArc requires zarr 3.4.2 or later, in place of 3.4.0, because zarr 3.4.0 held about 520 bytes per character to read a text scalar (#127).
- CyteArc requires umap-learn below 0.6, because its UMAP compiles three private functions of umap-learn that a later release could change (#269).
New features
Pooled CRISPR screens
The new ds.perturbation namespace analyzes a pooled CRISPR screen method by method, and ds.pipeline.perturbation runs the whole analysis as one pipeline run th...
1.3.0
What's Changed
- Import Seurat objects in part instead of failing by @parashardhapola in #16
- Keep category colours, on-data labels, and draw order correct in plots by @parashardhapola in #17
- Install HDF5, FFTW, and METIS headers only for the Python 3.15 tests by @parashardhapola in #31
- Harden the analysis agent's evidence, records, and reports by @parashardhapola in #18
- Fix HTO singlet identity and QC edge cases by @parashardhapola in #19
- Fit PCA exactly for every block layout by @parashardhapola in #20
- Round-trip analysis results through AnnData by @parashardhapola in #21
- Make storage reads, metadata writes, and interrupts safe by @parashardhapola in #22
- Update certifi and require uv 0.13.4 after the emSign CA compromise by @parashardhapola in #32
- Require scipy 1.16.2 and exclude numpy 2.2.0 to 2.2.5 to avoid an OpenBLAS crash by @parashardhapola in #33
- Scale HVG detection bounds with the selection and add seurat_v3, Pearson residuals, and batch-aware selection by @parashardhapola in #23
- Filter marker tables by AUC and adjusted p-value, with exact p-values for small groups by @parashardhapola in #24
- Speed up WNN, SNN, bulk aggregation, mapping, merging, and metadata reads by @parashardhapola in #25
- Require pytest-xdist 3.6 and refresh the CI shard durations by @parashardhapola in #34
- Raise neighbour-index defaults so graphs keep their true neighbours at scale by @parashardhapola in #26
- Call cells in raw droplet matrices with EmptyDrops by @parashardhapola in #27
- Cite every documentation DOI from the local bibliography by @parashardhapola in #35
- Simulate and call doublets per sample by @parashardhapola in #28
- Re-execute the tutorials against the updated library by @parashardhapola in #29
- Estimate and remove ambient RNA with the SoupX method by @parashardhapola in #30
- Add the Seurat import tutorial, fix a figure memory leak and improve tests by @parashardhapola in #36
- Remove the cytearc.agent package and its agent extra by @parashardhapola in #37
Full Changelog: 1.2.1...1.3.0
1.2.1
What's Changed
- Import unordered Matrix Market files, add duplicate_feature_ids and HTO positive_quantile, and cache umap-learn kernels by @parashardhapola in #15
Full Changelog: 1.2.0...1.2.1
1.2.0
What's Changed
- Version CyteBase buckets by release (YYMM, YYMM.N) and add cytebase.releases() by @Gautam8387 in #5
- Improve documentation indexing for search engines and LLMs by @parashardhapola in #6
- Serve docs under the organization Pages site by @parashardhapola in #7
- Shard the CI test suite across four jobs per configuration by @parashardhapola in #8
- Minor Changes to speed up the "aha moment" in tutorials by @saatvik-viniak in #9
- Fix sharded index reads, pyarrow string handling, and error pickling by @parashardhapola in #10
- Add SCENIC-style regulons, chromVAR, enhancer-driven regulons, and gene programs by @parashardhapola in #11
- Move CyteBase to its own repository by @parashardhapola in #13
- Replace GPL-derived Harmony and the GPL Leiden dependencies, remove eRegulons, and add third-party notices by @parashardhapola in #14
New Contributors
- @Gautam8387 made their first contribution in #5
- @saatvik-viniak made their first contribution in #9
Full Changelog: 1.1.0...1.2.0
1.1.0
What's Changed
- Add composite datastores for joint CyteBase reanalysis by @parashardhapola in #3
- Improve remote feature reads and isolate composite dataset access by @parashardhapola in #4
Full Changelog: 1.0.0...1.1.0