Skip to content

Commit

Permalink
phylogenetic: Add query config param to subsample rule
Browse files Browse the repository at this point in the history
Add an explicit `query` config param to make it clear that this is used
for the `--query` option of `augur filter`.
  • Loading branch information
joverlee521 committed Oct 31, 2024
1 parent 6c12b75 commit 831138b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion phylogenetic/defaults/clade-i/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions phylogenetic/rules/prepare_sequences.smk
Original file line number Diff line number Diff line change
Expand Up @@ -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']])}"
Expand All @@ -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}
Expand Down

0 comments on commit 831138b

Please sign in to comment.