Skip to content

Commit

Permalink
WIP remove cattle-outbreak custom rule
Browse files Browse the repository at this point in the history
Shifts to a concept where custom-rules are only for use in analysis
directories, and the custom snakemake file is sourced relative to that
working directory. See <#103 (comment)>
for more discussion about the benefits and limitations of this.

The cattle-outbreak workflow (`h5n1-cattle-outbreak/Snakefile`) now
directly imports the rules it needs rather than using the custom-rules
machinery.
  • Loading branch information
jameshadfield committed Dec 12, 2024
1 parent 90dbd2b commit 0bc582d
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 10 deletions.
3 changes: 2 additions & 1 deletion Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -732,4 +732,5 @@ rule clean:


for rule_file in config.get('custom_rules', []):
include: rule_file
# Relative custom rule paths in the config are expected to be relative to the analysis (working) directory
include: os.path.join(os.getcwd(), rule_file)
2 changes: 2 additions & 0 deletions h5n1-cattle-outbreak/Snakefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
include: "../Snakefile"

include: "cattle-flu.smk"

rule _all:
input: rules.all.input
File renamed without changes.
9 changes: 0 additions & 9 deletions h5n1-cattle-outbreak/config.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,3 @@
# NOTE: The h5n1-cattle-outbreak builds use a specific rule-file (specified within this config)
# and that rule file may have some config-like parameters within it.
# If you are extending this workflow via a --configfile overlay you and you want to add
# your own custom rule you will need to include "rules/cattle-flu.smk" as an element in the
# list in your overlay, as lists are not merged when configs are combined.
custom_rules:
- "rules/cattle-flu.smk"


#### Parameters which define which builds to produce via this config ###
builds:
h5n1-cattle-outbreak: ''
Expand Down

0 comments on commit 0bc582d

Please sign in to comment.