Skip to content

Added support for configurable enum sources, template-only fields, and AMR metadata JSON generation.#883

Merged
albatalavera merged 11 commits into
BU-ISCIII:developfrom
albatalavera:develop
May 22, 2026
Merged

Added support for configurable enum sources, template-only fields, and AMR metadata JSON generation.#883
albatalavera merged 11 commits into
BU-ISCIII:developfrom
albatalavera:develop

Conversation

@albatalavera

@albatalavera albatalavera commented May 21, 2026

Copy link
Copy Markdown
Contributor

Summary

This PR updates schema generation to support configurable enum sources from the input Excel, template-only lab form fields, alphabetically sorted enum values, and automatic generation of amr_genes.json for downstream AMR metadata processing.

Changes

  • Added support for ONLY in submitting_lab_form to include fields in the metadata template while excluding them from the generated JSON schema.
  • Added support for loading long enum lists from .txt files in conf or from Excel sheets using @sheet:sheet_name:column_name.
  • Added support for filtered Excel enum sources using @sheet:sheet_name:column_name:filter_column=filter_value.
  • Updated amr_acquired_genes to derive its enum values from amr_gene_list using the configurable Excel enum source syntax.
  • Added automatic generation of amr_genes.json in the schema output directory using amr_gene_list.
  • Sorted enum values alphabetically, keeping special values such as Not applicable, Not collected, Not provided, Missing, Restricted access, and Other at the end.

PR Checklist

  • This comment contains a description of changes (with reason).
  • Make sure your code lints (black and flake8).
  • CHANGELOG.md is updated.
  • README.md is updated (including new tool citations and authors/contributors).

@albatalavera albatalavera changed the title Support configurable enum sources and AMR metadata JSON generation Added support for configurable enum sources, template-only fields, and AMR metadata JSON generation. May 21, 2026

@Daniel-VM Daniel-VM left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

However, since this is specific to AMR genes only, unless I’m wrong, I’ll move this implementation to the schema utils: https://github.com/BU-ISCIII/relecov-tools/tree/develop/relecov_tools/assets/schema_utils

@Daniel-VM Daniel-VM left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!!

@albatalavera albatalavera merged commit ea935a2 into BU-ISCIII:develop May 22, 2026
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants