ampliconflow

Data contract v0.1

The pipeline publishes; the site consumes. Nothing here may depend on pipeline internals, only on the files and fields described below.

Release layout

release/<dataset_id>-<YYYYMMDD>/   # e.g. PRJDB7978-20260926: the dataset id and the build date
  manifest.json           # required, small
  studies.parquet         # one row per study
  samples.parquet         # one row per sample (coordinates, geo_source, environment)
  runs.parquet            # one row per run (platform, layout, read counts)
  features.parquet        # taxonomy per feature (gene, region, primers, taxonomy)
  tables/
    <study>.parquet       # count table, sparse or dense, zstd
    <study>.<group>.parquet  # instead of the above, when the study mixes methods:
                             # one table per method group (see method_group below)
    <study>.biom.gz       # the same matrix as BIOM v2.1 (gzipped JSON), one per table:
                         # the exchange format QIIME 2, phyloseq and mothur read
  sequences/
    <study>.fasta.gz      # representative sequences
  ro-crate-metadata.json  # RO-Crate 1.1: the release as a research object (files hashed)
  checksums.txt           # sha256 per file
  metadata/
    <study>.runs.json     # the mapped run table, every ingest column retained
    <study>.samples.json  # the mapped sample table, custom attributes included
    <study>.enrichment.json  # the paper's fields, when one was found (optional)
    raw/<accession>/      # the records as fetched (ENA/NCBI levels), recoverable
    raw-index.json        # the raw store index (optional)
  qc/
    <run>.json            # per-run QC: reads, primers, identity, gate, trim, merge

manifest.json (required fields)

  • dataset_id, title, description
  • pipeline_version (ampliconflow version that produced it)
  • created_at (ISO date)
  • schema_version (this contract, e.g. 0.1)
  • counts: studies, samples, runs, features
  • license: data licence id + URL
  • citation: preferred citation text
  • files: list of {path, bytes, sha256}
  • quality: the release-level gate verdict (optional; present when this pipeline produced

the release). passed (bool), checks (each check/passed/detail), and the thresholds used. A false passed means the release was refused, so a published release always has

passed: true.

  • processing: the batch effects, recorded once. engine, engine_version, mode,

identity, min_feature_size, reference, reference_sha256, read_source,

thresholds, tool_versions, pipeline_version, method_groups. A consumer that merges releases must carry this block and compare within a method group.

Field requirements

  • samples.parquet: sample_accession, study_accession, latitude,

longitude, geo_source in (metadata, publication, none),

environment_term, collection_date (ISO or partial YYYY-MM),

is_control (bool; a blank or mock sample, excluded from every count table). MIxS-lite names, passed through from the source and not remapped to ENVO IDs:

env_broad_scale, env_local_scale, env_medium, geo_loc_name, depth (see

summary.mixs.fields for which archive column each came from).

  • runs.parquet: run_accession, sample_accession, instrument_model,

library_layout, read_count, target_gene, region, primers (list),

source (ena, sra), identity (16S/not_16S/unknown),

identity_method (primer/alignment/signature), primer_state,

qc_passed (bool), method_group (the qc.cohorts label; runs in one study with different values are not directly comparable). When a study has more than one method_group, the count tables are shipped one per group (tables/<study>.<group>.parquet), never combined, so unlike runs cannot share a feature; the sample_index and feature_index in those tables still point into the single samples.parquet and features.parquet. Every column the ingest mapping kept is retained as well, so the schema is a superset of the names above; unknown columns are additions, never renames.

  • features.parquet: feature_id, sequence_hash, taxonomy (ranked),

target_gene, region, method_group (the group the feature belongs to; a feature is only comparable to another feature from the same group).

summary.json

The site reads this in full, so it carries the study-level view:

  • counts, created_at, reads_per_sample (min/median/max),

features_nonzero, top_phylum, top_genus, downloads.

  • publication / enrichment: the paper and the fields derived from it, when found.
  • cohorts: the method mixture. mixed (bool), groups (label, runs,

share), and uncomparable_runs (runs in groups too small to compare). When

mixed is true, a caller that aggregates must do so within a group.

  • taxonomy: the labels' completeness. unclassified per rank (features,

features_share, reads, reads_share), sintax_cutoff, and flagged (true when more than half the features are unclassified at domain level, so a consumer can distrust the labels rather than hide the gap).

  • depth_floor and excluded_samples: the publication read floor and the samples

below it (sample_accession, reads), so a consumer can apply the same rule.

  • controls: the blank/mock samples (samples, reads, features,

shared_features, contamination_estimate): the study's own background.

  • qc_warnings: per-run gate warnings that did not fail the run: runs (count),

share, and checks (name -> how many runs warned). A release with warnings is not clean, and this is where it says so.

  • mixs: the MIxS-lite profile and the mapping (fields, note).

Corrections to a release

Releases are immutable, but a metadata value can be wrong, and a wrong value must be fixed in the release rather than worked around downstream. When a field is corrected, the edited file carries a

corrections array: one entry per change, with field, date, by, was, now and reason. A consumer can then see that a value changed, what it changed from, and why, without needing an older copy of the release.

This applies to metadata only: manifest.json, summary.json, and the fields derived from a linked publication. A correction never edits a count table, a feature, or a sequence in place, because those are the observation. A correction to those is a new release.

A linked publication is taken on the paper's identity, checked against the archive's own study title: a citation whose title has almost no words in common with the registered title is a mismatched match, and is dropped rather than published. Fields said to be "parsed from the paper" must come from the paper that is actually linked; when a paper is not open access, nothing is parsed from it and the release says so instead of carrying fields from a different paper.

Rules

  • Formats: parquet + zstd for tables, gzipped BIOM v2.1 JSON for the exchange copy,

gzipped FASTA for sequences, small JSON for manifests and the RO-Crate. No pickles, no h5ad in public releases, nothing above about 1 MB as uncompressed text.

  • Every release is immutable; corrections ship as a new release.
  • A release carries its own provenance: ro-crate-metadata.json (RO-Crate 1.1) wraps

the dataset, its files with hashes, the processing, and the publication when one was linked, so the release is reusable and citable on its own.

  • Checksums are mandatory so mirrors and clients can verify, and they cover the

metadata/ and qc/ files as well as the tables and sequences.

  • Batch effects: processing is mandatory when a pipeline run produced the release, and

manifest.json is the place to read it; a merged analysis must carry it.

  • Metadata retention: every column the ingest mapping kept reaches the parquet

tables, and the mapped tables and raw records ship under metadata/, so a consumer can trace any value back to the record it came from.