From 6c12b7535bf843c537420580e1e23c6673d43e2e Mon Sep 17 00:00:00 2001 From: Jover Lee Date: Wed, 30 Oct 2024 14:13:51 -0700 Subject: [PATCH 1/2] phylogenetic: Update clade-i/config.yaml Use `--query` to filter to Clade I and children clades since we have migrated to Nextclade v3 that includes clades I, Ia, and Ib. Resolves https://github.com/nextstrain/mpox/issues/283 --- phylogenetic/defaults/clade-i/config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/phylogenetic/defaults/clade-i/config.yaml b/phylogenetic/defaults/clade-i/config.yaml index e8ad850..da4df50 100644 --- a/phylogenetic/defaults/clade-i/config.yaml +++ b/phylogenetic/defaults/clade-i/config.yaml @@ -19,14 +19,14 @@ auspice_name: "mpox_clade-I" filter: min_date: 1900 min_length: 100000 - exclude_where: 'clade!=I' -### We don't want to subsample, so specify a config which is essentially a no-op +### Filter to only Clade I sequences subsample: everything: group_by: "" sequences_per_group: "" + other_filters: "--query \"clade in ['I', 'Ia', 'Ib']\"" ## align max_indel: 10000 From 831138beb22ee157a410b65204c1c1e1599eb018 Mon Sep 17 00:00:00 2001 From: Jover Lee Date: Thu, 31 Oct 2024 09:36:42 -0700 Subject: [PATCH 2/2] phylogenetic: Add `query` config param to subsample rule Add an explicit `query` config param to make it clear that this is used for the `--query` option of `augur filter`. --- phylogenetic/defaults/clade-i/config.yaml | 2 +- phylogenetic/rules/prepare_sequences.smk | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/phylogenetic/defaults/clade-i/config.yaml b/phylogenetic/defaults/clade-i/config.yaml index da4df50..ea40698 100644 --- a/phylogenetic/defaults/clade-i/config.yaml +++ b/phylogenetic/defaults/clade-i/config.yaml @@ -26,7 +26,7 @@ subsample: everything: group_by: "" sequences_per_group: "" - other_filters: "--query \"clade in ['I', 'Ia', 'Ib']\"" + query: "'clade in [\"I\", \"Ia\", \"Ib\"]'" ## align max_indel: 10000 diff --git a/phylogenetic/rules/prepare_sequences.smk b/phylogenetic/rules/prepare_sequences.smk index 4916379..2fc7ce8 100644 --- a/phylogenetic/rules/prepare_sequences.smk +++ b/phylogenetic/rules/prepare_sequences.smk @@ -98,6 +98,11 @@ rule subsample: sequences_per_group=lambda w: config["subsample"][w.sample][ "sequences_per_group" ], + query=lambda w: ( + f"--query {config['subsample'][w.sample]['query']}" + if "query" in config["subsample"][w.sample] + else "" + ), other_filters=lambda w: config["subsample"][w.sample].get("other_filters", ""), exclude=lambda w: ( f"--exclude-where {' '.join([f'lineage={l}' for l in config['subsample'][w.sample]['exclude_lineages']])}" @@ -113,6 +118,7 @@ rule subsample: --output-strains {output.strains} \ {params.group_by} \ {params.sequences_per_group} \ + {params.query} \ {params.exclude} \ {params.other_filters} \ --output-log {output.log}