Skip to content

Add MEPRAM and Redlabra schemas/templates to assets, add amr genes json to conf, and improve metadata template formatting#889

Merged
albatalavera merged 10 commits into
BU-ISCIII:developfrom
albatalavera:multiproject
May 27, 2026
Merged

Add MEPRAM and Redlabra schemas/templates to assets, add amr genes json to conf, and improve metadata template formatting#889
albatalavera merged 10 commits into
BU-ISCIII:developfrom
albatalavera:multiproject

Conversation

@albatalavera
Copy link
Copy Markdown
Contributor

This PR adds MEPRAM and RedLabRA schemas/templates to assets, adds the AMR genes JSON to conf, and improves metadata template formatting.

Changes

  • Add MEPRAM and RedLabRA JSON schemas.
  • Add MEPRAM and RedLabRA metadata templates.
  • Add AMR genes JSON configuration.
  • Clean ontology annotations from enum values in generated templates.
  • Support conditional required values such as Y if ....
  • Normalize required labels in generated templates:
    • Y -> YES
    • N -> NO
    • Y if ... -> YES if ...

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).

Copy link
Copy Markdown
Member

@ESapenaVentura ESapenaVentura left a comment

Choose a reason for hiding this comment

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

Haven't checked the JSON files, some minor comments in the code 👍

Comment thread relecov_tools/build_schema.py Outdated
if not isinstance(values, list):
return values
return self._unique_enum_values(
[self._clean_enum_ontology_annotation(value) for value in values]
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.

Suggested change
[self._clean_enum_ontology_annotation(value) for value in values]
[BuildSchema._clean_enum_ontology_annotation(value) for value in values]

Comment thread relecov_tools/build_schema.py Outdated

@staticmethod
def _clean_enum_ontology_annotation(value: any) -> any:
"""Remove ontology annotations displayed between brackets from enum labels."""
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.

Comment thread relecov_tools/build_schema.py Outdated
[re.sub(r"\s*\[.*?\]", "", item).strip() for item in enums]
if database_definition:
required_values = {
property_id: self._format_template_required_value(
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.

Suggested change
property_id: self._format_template_required_value(
property_id: BuildSchema._format_template_required_value(

Copy link
Copy Markdown
Member

@ESapenaVentura ESapenaVentura left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@albatalavera albatalavera merged commit 6b6e66a into BU-ISCIII:develop May 27, 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