feat: enrich RO-Crate output files with EDAM format IDs via tataki#47
Merged
Conversation
Adds add_tataki_edam() to ro_crate.py, called at the end of
generate_ro_crate_metadata() before the final JSON-LD serialisation.
The function runs tataki (ghcr.io/sapporo-wes/tataki:latest) as a
Docker container against all files in the outputs/ directory, parses
the JSON result, and replaces each File entity's encodingFormat with
a proper EDAM ontology ContextEntity:
"encodingFormat": {"@id": "http://edamontology.org/format_3475"}
This replaces the previous mixed-array format
"encodingFormat": ["text/html", {"@id": "...iana..."}]
for files that tataki recognises, enabling tonkaz Level 1-3
file-content comparison on typical nf-core pipeline outputs
(TSV, CSV, JSON, HTML, PDF, PNG, SVG, BAM, VCF, …).
Enrichment is always best-effort: if Docker is unavailable or tataki
fails for any reason the function logs a warning and returns, leaving
the crate unchanged.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
add_tataki_edam()tosapporo/ro_crate.py, called at the end ofgenerate_ro_crate_metadata()before final JSON-LD serialisationoutputs/, parses the JSON result, and replaces eachFileentity'sencodingFormatwith a proper EDAM ontology entityWhat changes
Before (
encodingFormatwas a mixed array):After (proper EDAM entity, as tonkaz expects):
tataki detects formats by file content (not just extension), covering TSV, CSV, JSON, HTML, PDF, PNG, SVG in addition to the existing genomic formats (BAM, VCF, FASTQ, …).
Design
encodingFormatdocker runinvocationDependency
Requires
ghcr.io/sapporo-wes/tataki:latestto be available on the Docker host. This image is built and published via sapporo-wes/tataki#16.Test plan
ro-crate-metadata.jsoncontainsencodingFormat: {"@id": "http://edamontology.org/format_XXXX"}for TSV, HTML, JSON output files🤖 Generated with Claude Code