Skip to content

Add config functions#61

Merged
victorlin merged 3 commits intomainfrom
victorlin/add-config-functions
Oct 1, 2025
Merged

Add config functions#61
victorlin merged 3 commits intomainfrom
victorlin/add-config-functions

Conversation

@victorlin
Copy link
Copy Markdown
Member

@victorlin victorlin commented Sep 30, 2025

Description of proposed changes

Adds config-related functions that are planned for reuse across across pathogen repos.

Related issue(s)

write_config() is for nextstrain/pathogen-repo-guide#18
resolve_filepaths() is for nextstrain/public#23

Checklist

  • Checks pass
  • If adding a script, add an entry for it in the README.

The code is already used in WNV¹ and measles².

I placed the function at the very bottom because it should be the final
configuration-related function to be used by any workflow, at least
among functions run at Snakemake startup time.

Docstring/README updated to reflect the new scope of config.smk.

¹ https://github.com/nextstrain/WNV/blob/b143897367fcf0f9ddb4151b891a7da192c124eb/phylogenetic/rules/config.smk#L62-L67
² https://github.com/nextstrain/measles/blob/1a10742c5c04932f87e16e5c83e1e8ca840716cd/phylogenetic/rules/config.smk#L99-L104
This is not necessary since the variable is not assigned a new value
within the function, but the same could be said for 'workflow' in
resolve_config_path(). Adding for consistency.
This code is already used in measles¹ and is expected to be used by other
repos.

I placed the functions above resolve_config_path() because, while
resolve_config_path() is used directly in Snakemake code, eventually it
may be replaced by calls to resolve_filepaths() which uses it as a
helper function.

¹ https://github.com/nextstrain/measles/blob/db993ffa3a0ab80bd46d68f5e30ee47023525bb8/phylogenetic/rules/config.smk#L29-L94
@victorlin victorlin merged commit bfbbb68 into main Oct 1, 2025
2 checks passed
@victorlin victorlin deleted the victorlin/add-config-functions branch October 1, 2025 17:56
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