Snakemake report plugin: fairscape
Warning
This plugin is not maintained and reviewed by the official Snakemake organization.
This plugin turns a completed Snakemake run into a
FAIRSCAPE EVI RO-Crate: an
ro-crate-metadata.json describing the run as a provenance graph — one
Computation per executed job (with its resolved shell command, parameters,
inputs and outputs), one Software per rule plus the Snakefile and the Snakemake
engine itself, and one Dataset per file the workflow read or wrote. Alongside
the crate it generates the FAIRSCAPE artifact set: a human-readable datasheet,
an AI-Ready score, an interactive evidence graph, a LinkML/D4D export, and —
on request — an inferred schema for every tabular or array data file.
Nothing in your workflow has to change, and no file needs to be flagged with
report(...): the plugin reads Snakemake’s own per-job persistence metadata
plus the report interface’s job records, so every declared output of every
executed job is described, intermediates included.
The report step is post-hoc — it runs as a separate snakemake --reporter
fairscape invocation against .snakemake/metadata, so it adds no runtime
overhead, cannot fail a run, and works on runs that finished before the plugin
was installed.
Identifiers are deterministic ARKs hashed from run-independent strings
(Snakefile path, rule name, rule plus sorted outputs, file path), so
re-generating the report — or re-executing the whole workflow with --forceall
— reproduces byte-identical identifiers.
Install the plugin together with its artifact generator:
pip install 'snakemake-report-plugin-fairscape[artifacts]'
The [artifacts] extra pulls in fairscape-cli, which produces everything
downstream of the crate; those steps need fairscape-cli 1.2.10 or newer.
Without it the crate itself is still written and they are skipped with a note.
Installation
Install this plugin by installing it with pip or mamba directly, e.g.:
pip install snakemake-report-plugin-fairscape
Or, if you are using pixi, add the plugin to your pixi.toml. Be careful to put it under the right dependency type based on the plugin’s availability, e.g.:
snakemake-report-plugin-fairscape = "*"
Usage
In order to use the plugin, run Snakemake (>=8.5) with the corresponding value for the reporter flag:
snakemake --reporter fairscape ...
with ... being any additional arguments you want to use.
Settings
The report plugin has the following settings (which can be passed via command line, the workflow or environment variables, if provided in the respective columns):
Further details
Usage
Run the workflow as usual, then ask for the report:
snakemake --cores 4
snakemake --reporter fairscape
That writes ro-crate-metadata.json into the working directory, followed by
the derived artifacts:
ro-crate-datasheet.htmlandai_ready_score.json— human-readable datasheet and AI-Ready scorero-crate-prov-graph.json/.html— the evidence graph and an interactive visualization of itro-crate-linkml.yaml— the LinkML/D4D (Datasheets for Datasets) export
Those three are on by default and read only the crate JSON. They are produced by fairscape-cli 1.2.10 or newer; with an older fairscape-cli — or none at all — the crate is still written and the steps after it are skipped with a note.
Everything that touches the data files themselves is opt-in:
# infer an EVI Schema per data file (csv/tsv/parquet/h5/hdf5/hea/dcm)
snakemake --reporter fairscape --report-fairscape-schemas
# describe every file inside a directory() output, not just the directory
snakemake --reporter fairscape --report-fairscape-expand-directories
# SHA-256 Merkle tree over the crate's files
snakemake --reporter fairscape --report-fairscape-merkle
Crate-level metadata is worth setting once you publish a crate:
snakemake --reporter fairscape \
--report-fairscape-name "RNA-seq differential expression" \
--report-fairscape-description "Salmon quantification and DESeq2 analysis of the pilot cohort" \
--report-fairscape-author "Jane Doe" \
--report-fairscape-keywords "rna-seq,deseq2,pilot" \
--report-fairscape-license "https://spdx.org/licenses/CC-BY-4.0"
What ends up in the crate
A run Computation for the workflow as a whole:
usedDatasetis the set of root inputs no job produced,generatedthe set of terminal outputs no job consumed, and its start/end times are the earliest and latest job times.One Computation per executed job, carrying the resolved shell command, the rule’s
params, its inputs (from the persistence metadata) and its declared outputs, with wildcards resolved into the job’s name.Software entities for the Snakefile, the Snakemake engine (versioned), and every rule. A rule’s Software points at the file that actually defines its action: the
.py/.Rfile for ascript:rule, the notebook fornotebook:, the resolved wrapper URL forwrapper:, and the Snakefile forshell:/run:rules. Container images and conda environments are recorded when declared.One Dataset per unique file — inputs, outputs, intermediates and configfiles. Files inside the crate directory get a crate-relative
contentUrl; files outside it, or already deleted (temp()intermediates), get alocalPathinstead, since a relativecontentUrlis a promise the bytes are there.
Both directions of every provenance edge are written (generated and
generatedBy), so the graph can be walked from either end.
Which files are captured
Every declared output of every executed job, plus every input recorded in the
persistence metadata, plus configfiles. Nothing needs to be marked with
report(...) — that channel only feeds Snakemake’s own HTML reporter, and this
plugin ignores it in favour of the full job list.
Not captured: files a rule writes without declaring them in output:
(Snakemake has no record of them either), benchmark: files, and jobs that
failed or never ran — a failed job leaves no persistence metadata, so only
successful work is described.
Caveats of the post-hoc design
The reporter reconstructs the run from .snakemake/metadata after the fact.
That is what makes it free of runtime risk, but it also means:
the run Computation’s
commandis literallysnakemake— the original command line is not part of the metadata the report step can see;re-running the same workflow overwrites the persistence metadata, so the crate always describes the most recent run;
temp()intermediates are described with full provenance edges but withoutcontentSize, since the bytes are gone by report time;the Snakefile must still parse at report time.
Relationship to the rest of FAIRSCAPE
This package owns the Snakemake side only: it reduces the report interface,
the persistence metadata and the filesystem state to a plain-data records
document. The Snakefile-to-EVI mapping and the ARK minting live in
fairscape_conversion
(plugins/snakemake), shared with the Nextflow, Cromwell, MLflow, WRROC and
C2M2 converters; the datasheet, evidence graph, LinkML export and schema
inference are fairscape-cli‘s own
functions, called directly rather than reimplemented.
Setting SNAKEMAKE_FAIRSCAPE_DUMP_RECORDS=<path> on a report run dumps the
records document that crosses that boundary, which is the fastest way to see
what the plugin extracted.
Full documentation, including the exact provenance semantics and the list of undeclared Snakemake interfaces the plugin depends on, is in the repository README.