Skip to content

Commit

Permalink
Put each build's specific config files in folders
Browse files Browse the repository at this point in the history
Propagate config restructure to workflows and readme
  • Loading branch information
corneliusroemer committed Sep 22, 2023
1 parent dc19890 commit 2661eee
Show file tree
Hide file tree
Showing 15 changed files with 24 additions and 21 deletions.
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
7 changes: 4 additions & 3 deletions config/config_hmpxv1.yaml → config/hmpxv1/config.yaml
Original file line number Diff line number Diff line change
@@ -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"

Expand All @@ -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

Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -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"

Expand All @@ -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

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
7 changes: 4 additions & 3 deletions config/config_mpxv.yaml → config/mpxv/config.yaml
Original file line number Diff line number Diff line change
@@ -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"
Expand All @@ -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

Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion profiles/default/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ cores: all
printshellcmds: true
reason: true
rerun-incomplete: true
configfile: config/config_mpxv.yaml
configfile: config/mpxv/config.yaml
2 changes: 1 addition & 1 deletion workflow/snakemake_rules/core.smk
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 2661eee

Please sign in to comment.