From 50194209c1163d0d3e1f7dbe22a228fd7ce27258 Mon Sep 17 00:00:00 2001
From: Cornelius Roemer <cornelius.roemer@gmail.com>
Date: Wed, 20 Sep 2023 19:19:43 +0200
Subject: [PATCH] Undo defaults.yaml change, use one config per build, add
 default profile

---
 Snakefile                     |  4 ---
 config/config_hmpxv1.yaml     | 16 +++++++++++
 config/config_hmpxv1_big.yaml | 16 +++++++++++
 config/config_mpxv.yaml       | 23 ++++++++++++++++
 config/defaults.yaml          | 50 -----------------------------------
 profiles/default/config.yaml  |  5 ++++
 6 files changed, 60 insertions(+), 54 deletions(-)
 delete mode 100644 config/defaults.yaml
 create mode 100644 profiles/default/config.yaml

diff --git a/Snakefile b/Snakefile
index 0f1b2f66..60b06be7 100644
--- a/Snakefile
+++ b/Snakefile
@@ -11,10 +11,6 @@ if version.parse(augur_version) < version.parse(min_augur_version):
     sys.exit(1)
 
 
-# Use default configuration values. Override with Snakemake's --configfile/--config options.
-configfile: "config/defaults.yaml"
-
-
 build_dir = "results"
 
 
diff --git a/config/config_hmpxv1.yaml b/config/config_hmpxv1.yaml
index 807a9f38..489a0be9 100644
--- a/config/config_hmpxv1.yaml
+++ b/config/config_hmpxv1.yaml
@@ -1,5 +1,18 @@
+exclude: "config/exclude_accessions_mpxv.txt"
+reference: "config/reference.fasta"
+genemap: "config/genemap.gff"
+genbank_reference: "config/reference.gb"
 colors: "config/colors_hmpxv1.tsv"
+clades: "config/clades.tsv"
+lat_longs: "config/lat_longs.tsv"
 auspice_config: "config/auspice_config_hmpxv1.json"
+description: "config/description.md"
+tree_mask: "config/tree_mask.tsv"
+
+# Use `accession` as the ID column since `strain` currently contains duplicates¹.
+# ¹ https://github.com/nextstrain/monkeypox/issues/33
+strain_id_field: "accession"
+display_strain_field: "strain"
 
 build_name: "hmpxv1"
 auspice_name: "mpox_mpxv-IIb"
@@ -58,6 +71,9 @@ root: "MK783032 MK783030"
 clock_rate: 5.7e-5
 clock_std_dev: 2e-5
 
+## recency
+recency: true
+
 mask:
   from_beginning: 800
   from_end: 6422
diff --git a/config/config_hmpxv1_big.yaml b/config/config_hmpxv1_big.yaml
index ced85742..6fba0745 100644
--- a/config/config_hmpxv1_big.yaml
+++ b/config/config_hmpxv1_big.yaml
@@ -1,5 +1,18 @@
+exclude: "config/exclude_accessions_mpxv.txt"
+reference: "config/reference.fasta"
+genemap: "config/genemap.gff"
+genbank_reference: "config/reference.gb"
 colors: "config/colors_hmpxv1.tsv"
+clades: "config/clades.tsv"
+lat_longs: "config/lat_longs.tsv"
 auspice_config: "config/auspice_config_hmpxv1_big.json"
+description: "config/description.md"
+tree_mask: "config/tree_mask.tsv"
+
+# Use `accession` as the ID column since `strain` currently contains duplicates¹.
+# ¹ https://github.com/nextstrain/monkeypox/issues/33
+strain_id_field: "accession"
+display_strain_field: "strain"
 
 build_name: "hmpxv1_big"
 auspice_name: "mpox_mpxv-IIb-B.1"
@@ -36,6 +49,9 @@ root: "OP890401"
 clock_rate: 5.7e-5
 clock_std_dev: 2e-5
 
+## recency
+recency: true
+
 mask:
   from_beginning: 800
   from_end: 6422
diff --git a/config/config_mpxv.yaml b/config/config_mpxv.yaml
index 5447e329..168c56fd 100644
--- a/config/config_mpxv.yaml
+++ b/config/config_mpxv.yaml
@@ -1,5 +1,18 @@
+exclude: "config/exclude_accessions_mpxv.txt"
+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"
+
+# Use `accession` as the ID column since `strain` currently contains duplicates¹.
+# ¹ https://github.com/nextstrain/monkeypox/issues/33
+strain_id_field: "accession"
+display_strain_field: "strain"
 
 build_name: "mpxv"
 auspice_name: "mpox_mpxv"
@@ -41,12 +54,22 @@ filter:
     group_by: "--group-by country year"
     sequences_per_group: "--subsample-max-sequences 100"
 
+## align
+max_indel: 10000
+seed_spacing: 1000
+
+## treefix
+fix_tree: true
+
 ## refine
 timetree: false
 root: "min_dev"
 clock_rate: 3e-6
 clock_std_dev: 6e-6
 
+## recency
+recency: true
+
 mask:
   from_beginning: 1350
   from_end: 6422
diff --git a/config/defaults.yaml b/config/defaults.yaml
deleted file mode 100644
index 7d685a22..00000000
--- a/config/defaults.yaml
+++ /dev/null
@@ -1,50 +0,0 @@
-# This configuration file contains all required configuration entries with
-# hmpxv1-focused default values.
-# Use Snakemake's --configfile/--config options to override default values.
-
-exclude: "config/exclude_accessions_mpxv.txt"
-reference: "config/reference.fasta"
-genemap: "config/genemap.gff"
-genbank_reference: "config/reference.gb"
-colors: "config/colors_hmpxv1.tsv"
-clades: "config/clades.tsv"
-lat_longs: "config/lat_longs.tsv"
-auspice_config: "config/auspice_config_hmpxv1.json"
-description: "config/description.md"
-tree_mask: "config/tree_mask.tsv"
-
-# Use `accession` as the ID column since `strain` currently contains duplicates¹.
-# ¹ https://github.com/nextstrain/monkeypox/issues/33
-strain_id_field: "accession"
-display_strain_field: "strain"
-
-build_name: "default_hmpxv1"
-auspice_name: "default_hmpxv1"
-
-## filter
-min_date: 2017
-min_length: 100000
-sequences_per_group: "--sequences-per-group 40"
-group_by: "--group-by year month country"
-filters: "--exclude-where outbreak!=hMPXV-1"
-
-## align
-max_indel: 10000
-seed_spacing: 1000
-
-## treefix
-fix_tree: true
-
-## refine
-timetree: true
-root: "MK783032 MK783030"
-clock_rate: 5.7e-5
-clock_std_dev: 2e-5
-
-## recency
-recency: true
-
-mask:
-  from_beginning: 800
-  from_end: 6422
-  maskfile: "config/mask.bed"
diff --git a/profiles/default/config.yaml b/profiles/default/config.yaml
new file mode 100644
index 00000000..4f554b22
--- /dev/null
+++ b/profiles/default/config.yaml
@@ -0,0 +1,5 @@
+cores: all
+printshellcmds: true
+reason: true
+rerun-incomplete: true
+configfile: config/config_mpxv.yaml