diff --git a/README.md b/README.md index e0d4744c..887291f4 100644 --- a/README.md +++ b/README.md @@ -26,19 +26,19 @@ nextstrain build . data/sequences.fasta data/metadata.tsv Run pipeline to produce the "overview" tree for `/mpox/all-clades` with: ```bash -nextstrain build . --configfile config/config_mpxv.yaml +nextstrain build . --configfile config/mpxv/config.yaml ``` Run pipeline to produce the "clade IIb" tree for `/mpox/clade-IIb` with: ```bash -nextstrain build . --configfile config/config_hmpxv1.yaml +nextstrain build . --configfile config/hmpxv1/config.yaml ``` Run pipeline to produce the "lineage B.1" tree for `/mpox/lineage-B.1` with: ```bash -nextstrain build . --configfile config/config_hmpxv1_big.yaml +nextstrain build . --configfile config/hmpxv1_big/config.yaml ``` ### Deploying @@ -73,7 +73,7 @@ nextstrain view . ## Configuration -Configuration takes place in `config/config_*.yaml` files for each build.. +Configuration takes place in `config/*/config.yaml` files for each build. The analysis pipeline is contained in `workflow/snakemake_rule/core.smk`. This can be read top-to-bottom, each rule specifies its file inputs and output and pulls its parameters from `config`. There is little redirection and each rule should be able to be reasoned with on its own. @@ -110,18 +110,18 @@ snakemake --configfile config/config_hmpxv1_big.yaml ### Update colors to include new countries -Update `colors_hmpxv1.tsv` to group countries by region based on countries present in its `metadata.tsv`: +Update `hmpxv1/colors.tsv` to group countries by region based on countries present in its `metadata.tsv`: ```bash -python3 scripts/update_colours.py --colors config/colors_hmpxv1.tsv \ - --metadata results/hmpxv1/metadata.tsv --output config/colors_hmpxv1.tsv +python3 scripts/update_colours.py --colors config/hmpxv1/colors.tsv \ + --metadata results/hmpxv1/metadata.tsv --output config/hmpxv1/colors.tsv ``` -and similarly update `colors_mpxv.tsv`: +and similarly update `mpxv/colors.tsv`: ```bash -python3 scripts/update_colours.py --colors config/colors_mpxv.tsv \ - --metadata results/mpxv/metadata.tsv --output config/colors_mpxv.tsv +python3 scripts/update_colours.py --colors config/mpxv/colors.tsv \ + --metadata results/mpxv/metadata.tsv --output config/mpxv/colors.tsv ``` ### Update example data diff --git a/config/exclude_accessions_mpxv.txt b/config/exclude_accessions.txt similarity index 100% rename from config/exclude_accessions_mpxv.txt rename to config/exclude_accessions.txt diff --git a/config/auspice_config_hmpxv1.json b/config/hmpxv1/auspice_config.json similarity index 100% rename from config/auspice_config_hmpxv1.json rename to config/hmpxv1/auspice_config.json diff --git a/config/colors_hmpxv1.tsv b/config/hmpxv1/colors.tsv similarity index 100% rename from config/colors_hmpxv1.tsv rename to config/hmpxv1/colors.tsv diff --git a/config/config_hmpxv1.yaml b/config/hmpxv1/config.yaml similarity index 90% rename from config/config_hmpxv1.yaml rename to config/hmpxv1/config.yaml index 0edb53c2..11bcaa11 100644 --- a/config/config_hmpxv1.yaml +++ b/config/hmpxv1/config.yaml @@ -1,10 +1,11 @@ reference: "config/reference.fasta" genemap: "config/genemap.gff" genbank_reference: "config/reference.gb" -colors: "config/colors_hmpxv1.tsv" +colors: "config/hmpxv1/colors.tsv" +include: "config/hmpxv1/include.txt" clades: "config/clades.tsv" lat_longs: "config/lat_longs.tsv" -auspice_config: "config/auspice_config_hmpxv1.json" +auspice_config: "config/hmpxv1/auspice_config.json" description: "config/description.md" tree_mask: "config/tree_mask.tsv" @@ -17,7 +18,7 @@ build_name: "hmpxv1" auspice_name: "mpox_clade-IIb" filter: - exclude: "config/exclude_accessions_mpxv.txt" + exclude: "config/exclude_accessions.txt" min_date: 2017 min_length: 100000 diff --git a/config/include_hmpxv1.txt b/config/hmpxv1/include.txt similarity index 100% rename from config/include_hmpxv1.txt rename to config/hmpxv1/include.txt diff --git a/config/auspice_config_hmpxv1_big.json b/config/hmpxv1_big/auspice_config.json similarity index 100% rename from config/auspice_config_hmpxv1_big.json rename to config/hmpxv1_big/auspice_config.json diff --git a/config/config_hmpxv1_big.yaml b/config/hmpxv1_big/config.yaml similarity index 86% rename from config/config_hmpxv1_big.yaml rename to config/hmpxv1_big/config.yaml index 2b32589c..79d4878f 100644 --- a/config/config_hmpxv1_big.yaml +++ b/config/hmpxv1_big/config.yaml @@ -1,10 +1,11 @@ reference: "config/reference.fasta" genemap: "config/genemap.gff" genbank_reference: "config/reference.gb" -colors: "config/colors_hmpxv1.tsv" +colors: "config/hmpxv1/colors.tsv" +include: "config/hmpxv1_big/include.txt" clades: "config/clades.tsv" lat_longs: "config/lat_longs.tsv" -auspice_config: "config/auspice_config_hmpxv1_big.json" +auspice_config: "config/hmpxv1_big/auspice_config.json" description: "config/description.md" tree_mask: "config/tree_mask.tsv" @@ -17,7 +18,7 @@ build_name: "hmpxv1_big" auspice_name: "mpox_lineage-B.1" filter: - exclude: "config/exclude_accessions_mpxv.txt" + exclude: "config/exclude_accessions.txt" min_date: 2022 min_length: 180000 diff --git a/config/include_hmpxv1_big.txt b/config/hmpxv1_big/include.txt similarity index 100% rename from config/include_hmpxv1_big.txt rename to config/hmpxv1_big/include.txt diff --git a/config/auspice_config_mpxv.json b/config/mpxv/auspice_config.json similarity index 100% rename from config/auspice_config_mpxv.json rename to config/mpxv/auspice_config.json diff --git a/config/colors_mpxv.tsv b/config/mpxv/colors.tsv similarity index 100% rename from config/colors_mpxv.tsv rename to config/mpxv/colors.tsv diff --git a/config/config_mpxv.yaml b/config/mpxv/config.yaml similarity index 90% rename from config/config_mpxv.yaml rename to config/mpxv/config.yaml index ba93fccf..134cea6c 100644 --- a/config/config_mpxv.yaml +++ b/config/mpxv/config.yaml @@ -1,9 +1,10 @@ +auspice_config: "config/mpxv/auspice_config.json" +include: "config/mpxv/include.txt" +colors: "config/mpxv/colors.tsv" reference: "config/reference.fasta" genemap: "config/genemap.gff" genbank_reference: "config/reference.gb" -colors: "config/colors_mpxv.tsv" lat_longs: "config/lat_longs.tsv" -auspice_config: "config/auspice_config_mpxv.json" description: "config/description.md" clades: "config/clades.tsv" tree_mask: "config/tree_mask.tsv" @@ -17,7 +18,7 @@ build_name: "mpxv" auspice_name: "mpox_all-clades" filter: - exclude: "config/exclude_accessions_mpxv.txt" + exclude: "config/exclude_accessions.txt" min_date: 1950 min_length: 100000 diff --git a/config/include_mpxv.txt b/config/mpxv/include.txt similarity index 100% rename from config/include_mpxv.txt rename to config/mpxv/include.txt diff --git a/profiles/default/config.yaml b/profiles/default/config.yaml index 4f554b22..43180c5d 100644 --- a/profiles/default/config.yaml +++ b/profiles/default/config.yaml @@ -2,4 +2,4 @@ cores: all printshellcmds: true reason: true rerun-incomplete: true -configfile: config/config_mpxv.yaml +configfile: config/mpxv/config.yaml diff --git a/workflow/snakemake_rules/core.smk b/workflow/snakemake_rules/core.smk index ea9bac8f..0ef1cce3 100644 --- a/workflow/snakemake_rules/core.smk +++ b/workflow/snakemake_rules/core.smk @@ -83,7 +83,7 @@ rule combine_samples: ], sequences=rules.filter.output.sequences, metadata=rules.filter.output.metadata, - include="config/include_{build_name}.txt", + include=config["include"], output: sequences=build_dir + "/{build_name}/filtered.fasta", metadata=build_dir + "/{build_name}/metadata.tsv",