Skip to content

Releases

1.5.0

Choose a tag to compare

@parashardhapola parashardhapola released this 29 Nov 18:55
3dd2c1b

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 Recomputing log 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 an hf:// CyteBase dataset, such a call raises PermissionError, and ds.pipeline.plan(run) lists the stages that a replay would compute. To recompute, mount the store with cytearc.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, SparseToZarr and SeuratToZarr take shuffle_cells=True and shuffle_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 column sourceRow. A shuffled H5AD import takes about 1.5 times as long as one in the file's order, which shuffle_cells=False keeps.
  • 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_characters and export_airr take cell_order="source" and temp_dir, and cell_order="stored" keeps the store's order. Exports of shuffled stores need temporary disk (#390, #404).
  • ds.cells.insert and update_key take per-cell values only as a pandas Series indexed by cell ID, and raise TypeError for arrays, lists and tuples. Other per-cell inputs, such as reduction.import_coordinates and trajectory.fate(direction=), are keyed by cell ID too (#386).
  • SubsetZarr(cell_idx=) is removed with no alias. Pass cell_ids=, which writes the cells in store order (#386).
  • shuffle_cells=False alone no longer writes the store that 1.4.0 wrote: every new store holds countSummaries/rowNonzero, and an H5AD import also needs categorical_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_cells grows 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 threshold None (#575, #607).
  • Pseudotime and lineage feature modules use exact neighbors, so module numbers, sizes and members change, and the HNSW ann_params keys (ef, M, ef_construction, random_seed, num_threads and max_elements) have no effect. Passing one gives a FutureWarning, 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).
  • DataStoreMerge takes features, "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.0 and True, are refused in regulon specificity, Harmony, mapping and the label metrics (#441).

Memory budgets

  • mem_budget is 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. MemoryBudgetError gains suggested_budget_bytes, remedy and setting, the setting that the closing says to raise; needed_bytes still gives the estimate at the refused step. str() of the error adds that closing sentence, also to an error that your own code builds, while args[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_runs skips it with a warning, and opening it by ID raises ValueError (#537, #550).
  • run.settings(), ds.pipeline.rerun and ds.pipeline.plan(run) of any rna, atac, adt or perturbation run, which record normalization.method, and of an ATAC run that records doublets (#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 ...
Read more

1.4.0

Choose a tag to compare

@parashardhapola parashardhapola released this 16 Nov 12:39
2f986ab

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.run is removed, with no alias. Use ds.pipeline.rna, which takes one keyword per stage, or the new ds.pipeline.atac, ds.pipeline.adt and ds.pipeline.multimodal recipes (#38). The migration table maps each argument, such as hvg_count=N to hvg={"top_n": N} and params={"umap": {...}} to umap={...}. Paris clustering is now off by default (pass paris=True), filtering defaults to None, and callbacks receive run_interrupted in place of pipeline_interrupted. Runs that pipeline.run saved still open and report.
  • New runs cluster every Leiden resolution in one leiden stage and return the candidates as run["leiden"], a tuple ordered by resolution, in place of one run["leiden_<resolution>"] per candidate (#349). Their cell tables and exports hold only the selected clusters. Runs saved by 1.3.0 keep their leiden_<resolution> names. To read a candidate the same way in runs of both releases, use ds.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_docs CyteBase 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 as run["leiden"]. The tutorials of 1.3.0 open label="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 raises PermissionError. A call that reads such a result directly, such as ds.reduction.harmony on an earlier PCA or ds.qc.correct_ambient on an earlier estimate, raises a ValueError that names the call to run first. Neighbor artifacts no longer carry a self_hit_rate attribute; read ds.artifacts.inspect(ref).diagnostics["selfHitRate"] instead.
  • ds.trajectory.pseudotime now 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. Pass method="truncated" to reproduce 1.3.0. n_singular_vals and random_seed now apply only to that method and raise ValueError otherwise.
  • 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_bulk returns a BulkProfiles record 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_fraction and return_n_cells are removed: pass count_detected=True for detection counts and fractions, and read cell counts from the record's columns. ds.regulons.profiles rows are indexed by the group labels themselves.
  • ds.trajectory.aggregation and cytearc.trajectory.feature_dynamics.knn_clustering take n_neighbors in place of n_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). Its variance_explained table holds pc in place of the 0-based component, and provenance.extras["elbow_pc"], one higher, replaces provenance.extras["elbow"].
  • Flags such as invalidate_cache, show and the transparent argument of PlotResult.save accept only Python and NumPy booleans and raise TypeError for anything else, where 1.3.0 used the truth of any value (#137). ds.artifacts.load and ds.artifacts.inspect raise TypeError, not AttributeError, for an argument that is not an ArtifactRef.
  • 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.axes by the same title (#350). The new cytearc.plotting.NamedCellArtifact(name, artifact) sets the title and key.
  • CategoricalScale leaves missing_color, missing_label and palette_name as None unless set, so a scale that sets only some fields keeps a column's stored order and colors (#345).
  • ds.imputation.compute_imputed refuses a feature name that several features share, with a ValueError that names their IDs, where 1.3.0 imputed their mean; FeatureRef(value=name, reduction="mean") asks for the mean (#223). A missing feature raises KeyError, and ds.markers.load adds a feature_id column.
  • Repository.download_dataset keeps an existing data.zarr and the results saved in it, where 1.3.0 downloaded and replaced it (#330). A store made from an older version of the dataset raises FileExistsError; pass overwrite=True to replace it.
  • Memory refusals raise cytearc.MemoryBudgetError, a subclass of MemoryError (#141, #142). A Seurat import refused by its budget raised a ValueError subclass in 1.3.0, so except ValueError no 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, need values="counts" (#165). Negative values are refused. A store that 1.3.0 imported from normalized values still reads as counts; import it again with values=.
  • DataStoreMerge and create_composite refuse sources whose size factors differ, and an RNA assay whose stored size_factor is 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). MtxReader and CSVReader now detect compression from a file's first bytes rather than its name.
  • to_h5ad(nthreads=0) raises, since nthreads must 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_budget by 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 MemoryBudgetError or 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 RuntimeError naming mem_budget and CYTEARC_MEM_BUDGET.

Regulons and dependencies

  • ds.regulons.grn and cytearc.regulons.infer_grn fit on spawned worker processes when nthreads is above 1, so a script that calls them must keep its top-level code under if __name__ == "__main__": (#234). Notebooks need no change.
  • cytearc.regulons.regulon_specificity refuses labels that are missing or blank with a ValueError, as ds.regulons.specificity does (#373). In 1.3.0 a None label 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...

Read more

1.3.0

Choose a tag to compare

@parashardhapola parashardhapola released this 23 Oct 23:59
dc81f51

What's Changed

Full Changelog: 1.2.1...1.3.0

1.2.1

Choose a tag to compare

@parashardhapola parashardhapola released this 21 Oct 14:07
efbd23c

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

Choose a tag to compare

@parashardhapola parashardhapola released this 19 Oct 06:28
2edce5e

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

Full Changelog: 1.1.0...1.2.0

1.1.0

Choose a tag to compare

@parashardhapola parashardhapola released this 12 Oct 13:02

What's Changed

Full Changelog: 1.0.0...1.1.0

1.0.0

Choose a tag to compare

@parashardhapola parashardhapola released this 09 Oct 00:52

Full Changelog: 1.0.0rc1...1.0.0

1.0.0rc1

1.0.0rc1 Pre-release
Pre-release

Choose a tag to compare

@parashardhapola parashardhapola released this 08 Oct 22:26