Skip to main content

dcat-ap-plus-chromatography

Chromatography datasets in DCAT-AP-PLUS and Chem-DCAT-AP, completed by computation rather than by a reasoner and answered with verdicts.

Status: pre-release. The interface is not stable.

Specification: docs/specification. Notebooks: docs/notebooks.

Description

The package extends Chem-DCAT-AP with a LinkML schema for liquid and gas chromatography. For the records of a catalogue, it computes what the schema alone does not determine.

Part Modules What it does
Schema schema 47 classes, 48 slots and two enumerations: runs, columns as facets, mobile phases, peaks, measured and computed quantities with a standard uncertainty, peak tables, simulations, corroborations, computing steps and the sample role. Every class and slot has an IRI of its own.
Census and artefacts census, artefacts Reports which distinctions of the schema the emitted RDF cannot carry. Generates OWL, SHACL shapes and a JSON-LD context from the emitted IRIs.
Provenance and verdicts provenance, verdicts Tags every value as stated by its source or supplied by a named convention. Gives every step of a question one verdict and names what blocked it.
Comparison comparability, corroboration, linkage, retention Compares runs on stated facets under declared tolerances, and corroborates retention times at a declared floor. Links records by elimination on witnessed differences before any ranking.
Refinement refinement, scores, admission Computes the nests, cells and pair statuses of a stage, and requirement levels from what each field does. Admits a new slot under six conditions and names it by the partition of the records it induces.
Publication status, propagation Publishes a value only when it leads its best alternative, the candidate "none of these" included, by a threshold that bounds the probability of a wrong publication. Rules propagate published values.
Reading and storage operations, identifiers, emission Reads records from their PROV-O and QUDT descriptions without a program. Keys a stage by the SHA-256 of its files and writes everything computed about it as one RDF dataset, in TriG and JSON-LD. The default graph of that dataset holds the published values only.
Computing steps computing, dcat_ap_plus_chromatography_interface, dcat_ap_plus_chromatography_impl, main Computes nodes from stated nodes by published formulas: column volume, dwell time, retention factor, plate number, elution composition, and for gas chromatography the hold-up time of an open tube, the compressibility factor and the mean velocity. Each computed node keeps its unit, its propagated uncertainty and an activity naming the step, its premises and its hypotheses. A stated value is checked, never overwritten.
Elution transport, ladder, carrier Isocratic transport (retention law, plate height, resolution, peak capacity), gradient elution as a contact ladder solved exactly for piecewise-linear programs, and the carrier gas as an ideal gas in viscous flow.
SciDatS files profile, datamodel Registers the extension as a SciDatS profile, so that a SciDatS file, a parquet table with JSON-LD metadata, carries a run, its analysis and its peaks as typed models of the extension. The models are generated from the schema with its imports merged.
Transfer and separation trees contacts, branching, ranks Contact descriptions of columns and eluents, a response model that predicts elution orders for new descriptions, the record of which descriptions transfer, and separation trees that send the compounds one dimension leaves together to another.

The package does not read vendor files. An external converter, such as raw2dcat, writes the RDF descriptions that the package reads.

Framework

flowchart TD
  vendor[vendor files] --> converter[external converter, such as raw2dcat]
  converter --> descriptions[RDF descriptions in PROV-O and QUDT]

  schema[schema: LinkML, imports Chem-DCAT-AP] --> artefacts[artefacts: OWL, SHACL, JSON-LD context]
  schema --> census[census: distinctions the RDF cannot carry]

  descriptions --> provenance[provenance: stated or supplied]
  descriptions --> operations[operations: records, signatures, attributes]
  descriptions --> computing[computing steps: nodes computed from stated nodes]
  elution[elution: transport, contact ladder, carrier gas] --> computing
  transfer[contact descriptions, separation trees] -. what may be published .-> computing
  provenance --> comparison[comparability, corroboration, linkage]
  provenance --> refinement[refinement and scores: cells, pair statuses, requirement levels]
  operations --> refinement
  refinement --> admission[admission: slots named by their partition]
  comparison --> status[status: margin against none of these, threshold]
  status --> propagation[propagation: rules, depth to evidence]
  propagation --> status

  identifiers[identifiers: stage key from file digests] --> emission[emission: stage writer]
  computing --> emission
  status --> emission
  refinement --> emission
  admission --> emission
  emission --> dataset[(stage dataset: named graphs, TriG and JSON-LD)]
  dataset --> published[default graph: published values only]
  artefacts --> validation{SHACL validation}
  published --> validation
  published --> questions[questions: one verdict per step]

Installation

From PyPI, for Python 3.13. The wheels for Linux, macOS and Windows carry the Rust core.

pip install dcat-ap-plus-chromatography               # the package
pip install "dcat-ap-plus-chromatography[scidats]"    # and SciDatS files (spec 23)
pip install "dcat-ap-plus-chromatography[generators]" # and OWL, SHACL and context generation from the schema

Notebook 20 runs with nothing but these packages; the others need a clone of the repository. Installing from the source distribution, or from the repository, compiles the Rust core and needs a Rust toolchain.

Usage

Complete a catalogue by computing steps and write the stated and derived graphs as one dataset:

from pathlib import Path

from dcat_ap_plus_chromatography.main import complete_file

completion = complete_file(Path("catalogue.ttl"), Path("completed.trig"))
for node in completion.derived:
    print(node.subject, node.slot, node.quantity)
for blocked in completion.declined:
    print(blocked.subject, blocked.step, blocked.reason)

Write a peak table as a SciDatS file, with a PeakTableDataset of the extension as its metadata (notebook 19):

from scidats import SciDatS

from dcat_ap_plus_chromatography import profile

sd = SciDatS(dataframe=peaks)  # one row per peak
profile.attach(sd, dataset)  # validated by the extension's models
sd.write_parquet("peaks.scidats.parquet")
conforms, report = profile.validate(SciDatS(input_filename="peaks.scidats.parquet").graph)

The formulas are available on their own:

from dcat_ap_plus_chromatography import ladder

program = ladder.Program((0.0, 2.0, 17.0, 20.0), (0.05, 0.05, 0.999, 0.999))
ladder.elute(program, ladder.ContactNumbers(log_factor=3.0, sensitivity=12.0), holdup_time=0.735, dwell=1.0)

The notebooks in docs/notebooks show every part on synthetic records and on public retention data.

Data

Notebooks 14–17 and 19 read extracts of RepoRT (Kretschmer et al., Nature Methods 21, 153–155, 2024) in docs/notebooks/data/report. The extracts are licensed CC BY-SA 4.0, as RepoRT is; the rest of the repository is under the MIT licence.

Layout

The heavy computing runs in Rust. Python is the prototype, the reference the Rust code is tested against, and the language of the notebooks. TypeScript carries the web interface. Each language keeps its own build tool, and they share one version.

Path Language What Tool
crates/chromatography-core/ Rust elution, the contact ladder and its fit, the carrier gas, transport; the tool protocol as JSON in and out; no I/O cargo
crates/chromatography-tool/ Rust the chromatography tool <name> command the artefact runtime runs: elute, elution-composition, retention-factor, carrier, contact-numbers cargo
crates/chromatography-wasm/ Rust the core for browsers, through the same protocol wasm-pack
crates/chromatography-py/ Rust the extension module dcat_ap_plus_chromatography._core, built by maturin into every wheel maturin
packages/chromatography/ TypeScript @dcat-ap-plus/chromatography: typed calls of the tools and an SVG figure of a program and its elutions npm
src/dcat_ap_plus_chromatography/, tests/ Python 3.13 the prototype and reference; schema, stage, emission; rust.py asks the extension module uv
docs/notebooks/ Python demonstrations; notebook 18 shows the Rust core agreeing with the Python reference uv
tests/fixtures/core/ JSON values of the Python reference, written by scripts/generate_core_fixtures.py, that the Rust and TypeScript tests must reproduce

Development

Requires uv, the Rust toolchain pinned in rust-toolchain.toml (installed by rustup on first use), wasm-pack and Node 20 or later.

# Python
uv sync   # compiles the extension module from crates/chromatography-py with maturin
uv run pre-commit install --install-hooks
uv run ruff check .
uv run ruff format --check .
uv run zuban check
uv run pytest
uv run --group notebooks python docs/notebooks/build.py
uv run --group docs sphinx-build -b html docs docs/_build

# Rust
cargo fmt --all --check
cargo clippy --workspace --all-targets -- -D warnings
cargo test --workspace

# WebAssembly and TypeScript (the build runs wasm-pack first)
npm ci
npm run build
npm run typecheck
npm test

After a change to a Python reference function, regenerate the fixtures with uv run python scripts/generate_core_fixtures.py; a test fails while they are out of date.

Commit messages follow Conventional Commits. The project follows the copier-python template; copier update brings in changes of the template. See CONTRIBUTING.md.

Support

Questions and reports go to the issue tracker.

Authors and acknowledgment

Kundai Farai Sachikonye, University of Greifswald. Developed within NFDI4Cat, the National Research Data Infrastructure for Catalysis-Related Sciences. See CONTRIBUTORS.md.

Licence

MIT. See LICENSE. The RepoRT extracts in docs/notebooks/data/report are CC BY-SA 4.0.

Metadata

Release files for dcat-ap-plus-chromatography 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for dcat-ap-plus-chromatography 0.1.0
File Size Uploaded Provenance Actions
dcat_ap_plus_chromatography-0.1.0.tar.gz 213.2 kB Without provenance Details for dcat_ap_plus_chromatography-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for dcat-ap-plus-chromatography 0.1.0
File Interpreter ABI Platform Actions
dcat_ap_plus_chromatography-0.1.0-cp313-abi3-win_amd64.whl CPython 3.13 abi3 Windows x86-64 Details for dcat_ap_plus_chromatography-0.1.0-cp313-abi3-win_amd64.whl

Total release size: 636.7 kB

Release files / dcat_ap_plus_chromatography-0.1.0.tar.gz

Download URL dcat_ap_plus_chromatography-0.1.0.tar.gz
Size 213.2 kB
Tags Source
SHA-256 checksum
How to use checksums
87734956e97432296b7d57106025248bdc834b3512cfcb944d79caf3d7893583
BLAKE2b-256 checksum
How to use checksums
cb29154242e753f817640d04d289025166c0a5048de044aeea997be1f3bf7460
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.32 {"installer":{"name":"uv","version":"0.11.32","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / dcat_ap_plus_chromatography-0.1.0-cp313-abi3-win_amd64.whl

Download URL dcat_ap_plus_chromatography-0.1.0-cp313-abi3-win_amd64.whl
Size 423.5 kB
Tags CPython 3.13 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
8834b2de050e1ed632089366e2cddf87317a68efbaeb2b6e74a33955d3472812
BLAKE2b-256 checksum
How to use checksums
21560f99c7df1df6b7f3d79df13fd1063c00fd2137c6608ca527f70ff196e562
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.32 {"installer":{"name":"uv","version":"0.11.32","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for dcat-ap-plus-chromatography 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page