produce root-sequence sidecar JSON
This modifies the default workflow to produce the sidecar root-sequence JSON for each build. See for the functionality this file gives Auspice.
@@ -919,7 +919,8 @@ rule export:
lat_longs = config["files"]["lat_longs"],
description = lambda w: config["builds"][w.build_name]["description"] if "description" in config["builds"][w.build_name] else config["files"]["description"]
output:
- auspice_json = "results/{build_name}/ncov_with_accessions.json"
+ auspice_json = "results/{build_name}/ncov_with_accessions.json",
+ root_sequence_json = "results/{build_name}/ncov_with_accessions_root-sequence.json"
log:
"logs/export_{build_name}.txt"
params:
@@ -932,6 +933,7 @@ rule export:
--metadata {input.metadata} \
--node-data {input.node_data} \
--auspice-config {input.auspice_config} \
+ --include-root-sequence \
--colors {input.colors} \
--lat-longs {input.lat_longs} \
--title {params.title:q} \
@@ -969,10 +971,12 @@ rule finalize:
message: "Remove extraneous colorings for main build and move frequencies"
input:
auspice_json = rules.incorporate_travel_history.output.auspice_json,
- frequencies = rules.tip_frequencies.output.tip_frequencies_json
+ frequencies = rules.tip_frequencies.output.tip_frequencies_json,
+ root_sequence_json = rules.export.output.root_sequence_json
output:
auspice_json = "auspice/ncov_{build_name}.json",
- tip_frequency_json = "auspice/ncov_{build_name}_tip-frequencies.json"
+ tip_frequency_json = "auspice/ncov_{build_name}_tip-frequencies.json",
+ root_sequence_json = "auspice/ncov_{build_name}_root-sequence.json"
log:
"logs/fix_colorings_{build_name}.txt"
conda: config["conda_environment"]
@@ -981,5 +985,6 @@ rule finalize:
python3 scripts/fix-colorings.py \
--input {input.auspice_json} \
--output {output.auspice_json} 2>&1 | tee {log} &&
- cp {input.frequencies} {output.tip_frequency_json}
+ cp {input.frequencies} {output.tip_frequency_json} &&
+ cp {input.root_sequence_json} {output.root_sequence_json}
"""
