AssemblyTrace
A genome project accumulates assembly versions (a draft, polishing rounds, curated and renamed copies for submission) and a directory of files made from one of them. Their metadata can be missing or inconsistent. AssemblyTrace examines the files to answer:
- Which versions does the project hold, and how exactly do they differ? Every FASTA receives GA4GH refget sequence-collection digests; versions are diffed without an external aligner, and events from resolved comparisons rebuild the target sequence exactly.
- Which versions are consistent with each file? Annotations, proteins, alignments, variant calls and QC reports are assessed from reference-bound evidence, with separate likelihood ratios and posterior probabilities. Files incompatible with every candidate are flagged; insufficient evidence remains unresolved.
- Where does an annotation go in another version? GFF3/GTF, BED and VCF records are moved exactly through the events of the pair.
Install from PyPI, or from a source checkout or unpacked source archive
(python -m pip install .):
python -m pip install assemblytrace
assemblytrace --version
assemblytrace scan /path/to/project --out-dir audit
The package version is 1.1.0; the source commit and distribution hashes
identify the evaluated build. Installing an unpinned package from a public
index does not select this checkout.
Linux, macOS and Windows, Python 3.10 or newer; Biopython and, except on Windows, pysam (MD tags of indexed BAM) are the dependencies.
Use it in your browser
https://maciejkochanowski.github.io/AssemblyTrace/ runs scan and diff
without installing anything: choose a project folder, several files or two
FASTA files, or try the bundled example, and download the report and all
outputs as a ZIP. Your files are read inside the browser tab by Python
compiled to WebAssembly (Pyodide) and are never uploaded. Browser memory
limits the data size, so use the command-line tool for large genomes. The page
lives in web/ and is published by .github/workflows/pages.yml.
Commands
| Command | What it does |
|---|---|
scan PROJECT --out-dir DIR |
versions, their differences, attribution of every file, provenance records, HTML report |
diff A.fa B.fa |
alignment-free events between two versions of one assembly |
lift FILE --from A.fa --to B.fa --output OUT |
exact transfer of GFF3/GTF, BED or VCF coordinates between versions |
seqcol A.fa |
GA4GH refget sequence-collection digests |
verify PROJECT --lock FILE |
verify pinned files; exit 2 on drift, unreadable content or incomplete verification |
identity, annotation, release-check, changes, paf-changes, normalize-indels, snapshot, capture-run, resolve |
single-artefact checks and provenance manifests |
How it works
Versions. Every FASTA receives refget seqcol digests (identical to the GA4GH reference implementation). Files with the same digest are one version; files with the same sequences under other names form one content class. The lineage of versions is taken from workflow records (shell scripts are read with their variables and loops spelled out) or from the release you declare; it is not guessed from sequence similarity, which places polished siblings closer to each other than to their source. Where no record names a version's source, the versions it can have been made from are listed.
Differences. Paired contigs are diffed by an anchored walk that
resynchronises on exact 40-mers; indels are left-aligned, and in tandem
arrays the anchor with the longest exact match is preferred so a unit
inserted in a satellite stays one event. A stretch with no shared anchor
within 128 kb (a rebuilt rDNA array, a large insertion) becomes one
replacement event, and the walk continues behind it; an exact inversion is
one event. A contig rotated to a new start or reverse complemented (a circular
replicon reoriented to dnaA) is oriented before the walk, contigs whose
names were swapped or reused are paired by content, and contigs merged, split
or moved between versions (scaffolding, a closed genome made from a draft) are
diffed through frames: blocks of the earlier version, between anchors unique
in both versions, joined in the order the later contig holds them. The events turn one
version into the other exactly; curation/ holds them as VCF, ready for
bcftools consensus, and as BED tracks.
Attribution. Reads carry the sample's alleles whichever version they were aligned to, so read sequences never decide provenance. The evidence is reference-bound: @SQ names, lengths and M5 digests, @PG command lines, reference bases implied by MD tags, VCF REF alleles, proteins against what each version encodes (gene models moved exactly into every version), CDS reading frames and QC statistics. Evidence comes in groups whose weight is bounded (one header stated a thousand times is still one header). Version selection and Bayes factors use likelihoods; posterior probabilities use an equal prior mass for each content class, split among its versions. A difference in prior mass is not evidence, and identical likelihoods stay undecided. Content-class resolution is reported separately: the sequence content may be resolved while its renamed versions remain indistinguishable. All probabilities are conditional on the listed candidates and the model. Incompatible or conflicting evidence is reported explicitly. Names, lengths and statistics fit any version of the same layout, listed or not, so an attribution resting on them alone is never reported as confident. Workflow records (scripts, job logs, command lines in headers, Snakemake metadata) are checked against the content, and files linked by a derivation are attributed jointly, so a regenerated file that broke a chain is found.
Lift. Coordinates move through the events of the pair, so a feature lands exactly where its sequence went; a feature an event touches is marked (a CDS also with the state of its reading frame in the target), a feature inside an exact inversion is mirrored onto the other strand, and one whose end falls in a deleted span is reported unmapped.
Outputs. report.html (the result in plain language with what to do
next, the versions, the version of every file and the provenance of the run;
self-contained, no network access), scan.json, attribution.tsv, events.tsv,
claims.tsv, inventory.tsv, per lineage transition in curation/ the
changes as VCF and BED, prov.json (W3C PROV-JSON),
assemblytrace-ro-crate-metadata.json (a detached RO-Crate 1.2 with a
Process Run Crate action) and assemblytrace.lock.json. A compact
scan-summary.json records completion independently of the audit verdict.
After path-safety checks, an incomplete marker is written before any export
is replaced; the completed record is published last. A completed scan can
correctly return fail and exit 2.
Integrity. verify reports pass only when every pinned entry can be
verified and no drift is found. Damaged or unreadable pinned content gives
fail; an entry without a pinned digest gives partial unless another
failure is present. Both fail and partial exit with code 2. The coverage
fields show how many pinned entries were verified. A project without an
assembly produces a controlled report with no candidate versions. Coordinate
operations reject duplicate contig identifiers, and output paths are checked
against inputs before reports and change tracks are written.
Validation
validation/make_example_project.py builds a small project that the test
suite scans end to end. validation/attribution_benchmark.py scores
attribution on a real genome with negative controls;
validation/attribution_real.py scores projects whose files were made by real
tools from known versions; validation/diff_compare.py compares the diff with
minimap2/paftools and MUMmer dnadiff and checks that each method's changes
rebuild the later version; validation/hg002_compare.py compares diff and
lift with the official HG002 Q100 patches. The data, the development and
held-out sets and the results are in docs/SPECIFICATION.md and
docs/VALIDATION_PROTOCOL.md. A held-out claim applies to its named frozen
commit; rerunning a previously inspected dataset after a code change is a
regression check. File-level percentages describe those files, while
generalization to new projects requires project-level validation.
validation/publication_tables.py validates row-level scoring outputs and
source hashes, reconciles listed, omitted and mixed-origin denominators, and
writes JSON, CSV and Markdown tables with project/seed summaries. Optional
confidence intervals resample whole projects or seeds. It can update the
canonical manuscript's managed blocks from supplied results; the protocol
contains the reproducible command and interpretation rules.
python -m pip install -e '.[test,bam]'
python -m pytest -q
Scope
AssemblyTrace does not assemble, map or polish reads, and does not say which
version is right. Attribution states what the files show; a file without
informative evidence stays unattributed. See docs/SPECIFICATION.md and
docs/LIMITATIONS.md.
MIT licence.
Metadata
Release files for assemblytrace 1.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| assemblytrace-1.1.0.tar.gz | 492.3 kB | With provenance | Details for assemblytrace-1.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| assemblytrace-1.1.0-py3-none-any.whl | Python 3 | none | any | Details for assemblytrace-1.1.0-py3-none-any.whl |
Total release size: 666.7 kB
Release files / assemblytrace-1.1.0.tar.gz
| Download URL | assemblytrace-1.1.0.tar.gz |
|---|---|
| Size | 492.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
13b484f13232764fde799d2595698fe488865bd2ba9f5a5950c0aaca73a689e8
|
|
BLAKE2b-256 checksum How to use checksums |
73fbca795ae3158ff79eac09fadb63dc0942d57b884eb82278879441337841ad
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 30, 2026.
Transparency logRelease files / assemblytrace-1.1.0-py3-none-any.whl
| Download URL | assemblytrace-1.1.0-py3-none-any.whl |
|---|---|
| Size | 174.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4b6f271c63f52fd9d029b2cab4ec400b3267e3a4b5bb1927c66f9ce2259ba71f
|
|
BLAKE2b-256 checksum How to use checksums |
40993d3e8fab6184266c57dd186465578e3c649fbd5b9c7d98e6dbb48d1cf2cf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 30, 2026.
Transparency logSecurity for assemblytrace 1.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.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for assemblytrace-1.1.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 30, 2026.
Transparency logA 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.