Skip to content

Commit

Permalink
Lock clock rates for 229E and OC43 [#36]
Browse files Browse the repository at this point in the history
  • Loading branch information
genehack committed Sep 12, 2024
1 parent d9ae40c commit fd368b5
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 30 deletions.
8 changes: 4 additions & 4 deletions phylogenetic/defaults/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ viruses:
subsample_max_sequences: 4000
min_length: 20000
construct_phylogeny:
clock_rate: ""
clock_std_dev: ""
clock_rate: 0.000250
clock_std_dev: 0.00005
coalescent: "opt"
date_inference: "marginal"
clock_filter_iqd: 4
Expand Down Expand Up @@ -68,8 +68,8 @@ oc43:
subsample_max_sequences: 4000
min_length: 20000
construct_phylogeny:
clock_rate: ""
clock_std_dev: ""
clock_rate: 0.000250
clock_std_dev: 0.00005
coalescent: "opt"
date_inference: "marginal"
clock_filter_iqd: 4
Expand Down
40 changes: 14 additions & 26 deletions phylogenetic/rules/construct_phylogeny.smk
Original file line number Diff line number Diff line change
Expand Up @@ -45,31 +45,19 @@ rule refine:
date_inference=lambda wildcards: config[wildcards.virus]["construct_phylogeny"]["date_inference"],
clock_filter_iqd=lambda wildcards: config[wildcards.virus]["construct_phylogeny"]["clock_filter_iqd"],
shell:
# TODO move this conditional logic up into the params lambda (?)
r"""
(
if [ "{wildcards.virus}" == "229e" ] || [ "{wildcards.virus}" == "oc43" ]; then
echo "Estimating clock rate for {wildcards.virus}"
clock_rate=""
clock_std_dev=""
else
echo "Setting clock rate at {params.clock_rate} with std dev {params.clock_std_dev} for {wildcards.virus}"
clock_rate="--clock-rate {params.clock_rate}"
clock_std_dev="--clock-std-dev {params.clock_std_dev}"
fi
augur refine \
--tree {input.tree:q} \
--alignment {input.alignment:q} \
--metadata {input.metadata:q} \
--output-tree {output.tree:q} \
--output-node-data {output.node_data:q} \
--timetree \
$clock_rate \
$clock_std_dev \
--coalescent {params.coalescent:q} \
--date-confidence \
--date-inference {params.date_inference:q} \
--clock-filter-iqd {params.clock_filter_iqd:q}
) 2>{log:q}
augur refine \
--tree {input.tree:q} \
--alignment {input.alignment:q} \
--metadata {input.metadata:q} \
--output-tree {output.tree:q} \
--output-node-data {output.node_data:q} \
--timetree \
--clock-rate {params.clock_rate} \
--clock-std-dev {params.clock_std_dev} \
--coalescent {params.coalescent:q} \
--date-confidence \
--date-inference {params.date_inference:q} \
--clock-filter-iqd {params.clock_filter_iqd:q}
&> {log:q}
"""

0 comments on commit fd368b5

Please sign in to comment.