Skip to content

feat: Automate configuration YAML generation (Resolves #24) - #43

Open
dyrpsf wants to merge 1 commit into
draeger-lab:devfrom
dyrpsf:feature/issue-24-config-sync
Open

feat: Automate configuration YAML generation (Resolves #24)#43
dyrpsf wants to merge 1 commit into
draeger-lab:devfrom
dyrpsf:feature/issue-24-config-sync

Conversation

@dyrpsf

@dyrpsf dyrpsf commented Jul 14, 2026

Copy link
Copy Markdown

Description

This PR addresses Issue #24 to improve QoL for developers maintaining configuration files[cite: 8]. Instead of maintaining basic, advanced, and default YAMLs manually and risking inconsistencies, a Python script has been added to automate the generation process[cite: 8].

Key Changes

  • Added scripts/sync_configs.py.
  • Default Config: Remains the single source of truth.
  • Advanced Config: The script copies the default config but strips out inline developer tags (# @IDEA, # @TODO, # @DEV)[cite: 7, 8].
  • Basic Config: The script strips out developer tags and drops complex configuration blocks (like refinement_cleanup, GeneGapFiller, mcc) to create a minimal "quick-and-dirty" file[cite: 7, 8].

Usage

Developers only need to edit src/specimen/data/config/hqtb_config_default.yaml, then run:
python scripts/sync_configs.py from the root directory to safely overwrite and sync the advanced and basic configuration files.

Resolves draeger-lab#24. Introduces scripts/sync_configs.py to automatically parse hqtb_config_default.yaml and generate basic and advanced variations, stripping dev tags (@todo, @IdEA) and omitting advanced parameter blocks.
@dyrpsf
dyrpsf changed the base branch from main to dev July 16, 2026 11:28
@draeger
draeger requested review from cb-Hades and Copilot July 29, 2026 11:40

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR implements Issue #24 by adding a developer script to generate/synchronize the derived HQTB YAML configs (advanced/basic) from the default config, reducing manual duplication and drift across config variants.

Changes:

  • Added scripts/sync_configs.py to regenerate hqtb_advanced_config_expl.yaml and hqtb_basic_config_expl.yaml from hqtb_config_default.yaml.
  • Updated the advanced/basic YAMLs to reflect regenerated output (including new/realigned sections like template.namespace, validation, performance).
  • Attempted to make the “basic” config minimal by omitting “advanced” blocks.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.

File Description
scripts/sync_configs.py Adds generator that rewrites advanced/basic configs from the default source-of-truth.
src/specimen/data/config/hqtb_basic_config_expl.yaml Regenerated “basic” config; currently omits sections the workflow expects.
src/specimen/data/config/hqtb_advanced_config_expl.yaml Regenerated “advanced” config to align with the default config contents/structure.
Comments suppressed due to low confidence (1)

src/specimen/data/config/hqtb_advanced_config_expl.yaml:109

  • The comment references isreaction_comlete(), which looks like a misspelling of isreaction_complete(). Since this file is generated from the default config, fix the reference in hqtb_config_default.yaml (source of truth) and regenerate rather than editing only the generated output.
        formula-check: 'existence'  # When checking, if a metabolite can be added to the model
                              # also check the formula. For more information about
                              # available options, please refer to the docs of 
                              # the function isreaction_comlete().
        exclude-dna: True           # Exclude reactions containing 'DNA' in their name

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread scripts/sync_configs.py
Comment on lines +1 to +2
import os
import re
Comment thread scripts/sync_configs.py
Comment on lines +13 to +21
# Blocks to entirely skip for the basic "quick-and-dirty" configuration
ADVANCED_BLOCKS = [
"refinement_cleanup:",
"refinement_smoothing:",
"GeneGapFiller:",
"media_gap:",
"mcc:",
"egc:",
]
Comment on lines 117 to +118
########## step 3.2: cleanup ##########
refinement_cleanup:

# gap-filling
# """""""""""

# general options _________________________________________
# parameters, that apply to all the gap filling algorithms
# current default means no gapfilling
formula-check: 'existence' # When checking, if a metabolite can be added to the model
# also check the formula. For more information about
# available options, please refer to the docs of
# the function isreaction_comlete().

# enable algorithms ________________________________________
GeneGapFiller: False # Activate gap filling via GFF
GeneGapFiller parameters:
fasta: USER # FASTA (containing CDS) for the GeneGapFiller.
# Depending on the case, might be the same as annotated genome.
gff: USER # Path to a gff file (does not have to be the RefSeq).
# Needs to be from the same genome the model was build on.
type: 'swissprot' # Type of database. Can either be 'swissprot' or 'user'.
dmnd-database: USER # Path to the SwissProt/User DIAMOND database file.
database-mapping: USER # Path to the SwissProt/User mapping file (against EC / BRENDA in case of SwissProt)
check-NCBI: False # Enable checking NCBI accession numbers for EC numbers - time costly.
sensitivity: 'more-sensitive' # Sensitivity option for the DIAMOND run.
coverage: 90.0 # Coverage (parameter for DIAMOND).
percentage identity: 90.0 # Percentage identity threshold value for accepting
# matches found by DIAMOND as homologous.
# via COBRApy - medium ........
media_gap: null # path to a medium config file. Set it to null to skip this gapfiller
########## step 3.3: annotation ##########
Comment on lines 106 to +109
# also check the formula. For more information about
# available options, please refer to the docs of
# the function isreaction_comlete().
exclude-dna: True # Exclude reactions containing 'DNA' in their name
Comment on lines 101 to +104
sensitivity: more-sensitive # change the sensitivity of DIAMOND
coverage: 95.0 # Set the min. coverage
pid: 90.0 # set the minimal percentage identity value for valid hits
# params for adding entities during extension
pid: 90.0 # set the minimal percentage identify value for valid hits
# params for adding entities during
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