Skip to content

Refactor configuration.json migration to initial-config profiles#860

Merged
Aberdur merged 15 commits intoBU-ISCIII:developfrom
Aberdur:develop
Feb 23, 2026
Merged

Refactor configuration.json migration to initial-config profiles#860
Aberdur merged 15 commits intoBU-ISCIII:developfrom
Aberdur:develop

Conversation

@Aberdur
Copy link
Contributor

@Aberdur Aberdur commented Feb 18, 2026

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

PR Description

This PR completes the configuration migration from configuration.json to project-specific initial configs, and adapts core modules to work with merged runtime config (configuration.json + extra_config.json) per project profile.

Main focus:

  • New/updated project initial configs.
  • download, read-lab-metadata, and validate alignment with the new config model.
  • Cleanup of project-specific values from configuration.json.

Motivation

We now support multiple project profiles (RELECOV, EQA2026, MEPRAM) with different operational settings.
To avoid hardcoded project values in the generic config, project-specific behavior is moved to initial profile YAMLs and then loaded into extra_config.

Key Changes

1) Initial config split and migration

  • Added/updated:
    • relecov_tools/conf/initial_config-relecov.yaml
    • relecov_tools/conf/initial_config-EQA2026.yaml
    • relecov_tools/conf/initial_config-MEPRAM.yaml
  • Kept configuration.json as generic baseline and removed migrated project-specific blocks.
  • Updated initial_config.yaml and profile defaults as needed.

2) download adaptation

  • Switched config loading to merged runtime config:
    • ConfigJson()ConfigJson(extra_config=True).
  • Made metadata sample-id column configurable via:
    • sftp_handle.metadata_processing.sample_id_col
    • fallback remains "Sample ID given for sequencing".
  • Updated duplicate-sample warning text to use the configured sample-id column name.

3) read-lab-metadata adaptation

  • Uses merged config (ConfigJson(extra_config=True)) and resolves project/profile config from extra_config.
  • Added profile-level control for schema casting:
    • cast_values_from_schema (project-level override, fallback to global read_lab_metadata config).
  • adding_ontology_to_enum now supports ontology enums both from:
    • direct properties.<field>.enum, and
    • $ref-resolved enums (e.g. #/$defs/enums/...).
  • adding_fields() now sets:
    • s_json["map_field"] = sample_data_map_field
    • s_json["file"] = "samples_data.json" (prevents missing-key issues in downstream processing).
  • Type conversion in metadata parsing is now conditional:
    • only enforced when cast_values_from_schema=true,
    • with adjusted handling for numeric/date-like Excel cells to preserve behavior across projects.

4) validate adaptation

  • Column tag for invalid Excel is now derived from schema label:
    • properties[sample_id_field].label
    • fallback "Sample ID given for sequencing".

5) Related module alignment

  • Updated other modules that consume migrated config sections:
    • sftp_client.py
    • build_schema.py
    • upload_database.py
    • read_bioinfo_metadata.py
    • map.py
  • Added/updated EQA schema artifacts:
    • relecov_tools/schema/relecov_schema_EQA.json
    • updates in relecov_tools/schema/relecov_schema.json

Files of Interest

  • Config:
    • relecov_tools/conf/configuration.json
    • relecov_tools/conf/initial_config-relecov.yaml
    • relecov_tools/conf/initial_config-EQA2026.yaml
    • relecov_tools/conf/initial_config-MEPRAM.yaml
  • Core modules:
    • relecov_tools/download.py
    • relecov_tools/read_lab_metadata.py
    • relecov_tools/validate.py

@Aberdur Aberdur self-assigned this Feb 18, 2026
@Aberdur Aberdur changed the title Refactor ´configuration.json´ migration to ´initial-config´ profiles Refactor configuration.json migration to initial-config profiles Feb 18, 2026
@Aberdur Aberdur force-pushed the develop branch 2 times, most recently from c58d1d4 to fc5c724 Compare February 20, 2026 09:20
Copy link
Member

@Shettland Shettland left a comment

Choose a reason for hiding this comment

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

LGTM

@Aberdur Aberdur merged commit cc87661 into BU-ISCIII:develop Feb 23, 2026
5 of 18 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