Skip to content

Commit

Permalink
Merge pull request #166 from nextstrain/inline-root
Browse files Browse the repository at this point in the history
inline root sequence
  • Loading branch information
huddlej committed May 30, 2024
2 parents 08d2c1b + 4431664 commit 2d0f3d0
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 29 deletions.
1 change: 0 additions & 1 deletion Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ def _get_build_outputs():
for segment in config["segments"]:
outputs.extend([
f"auspice/{build_name}_{segment}.json",
f"auspice/{build_name}_{segment}_root-sequence.json",
f"auspice/{build_name}_{segment}_tip-frequencies.json",
])

Expand Down
12 changes: 1 addition & 11 deletions profiles/nextflu-private-forecasts/rename.smk
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ rule all_public:
"auspice_renamed/" + build.get("auspice_name", f"{build_name}_{{segment}}").format(segment=segment) + suffix + ".json"
for build_name, build in config["builds"].items()
for segment in config["segments"]
for suffix in ["", "_root-sequence", "_tip-frequencies", "_measurements"]
for suffix in ["", "_tip-frequencies", "_measurements"]
],

def _get_file_by_auspice_name(wildcards):
Expand All @@ -26,16 +26,6 @@ rule rename_auspice_main:
ln {input} {output}
"""

rule rename_auspice_root_sequence:
input:
lambda wildcards: _get_file_by_auspice_name(wildcards).replace(".json", "_root-sequence.json"),
output:
"auspice_renamed/{auspice_name}_root-sequence.json",
shell:
"""
ln {input} {output}
"""

rule rename_auspice_tip_frequencies:
input:
lambda wildcards: _get_file_by_auspice_name(wildcards).replace(".json", "_tip-frequencies.json"),
Expand Down
5 changes: 2 additions & 3 deletions profiles/nextflu-private/antigenic_distances.smk
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,7 @@ rule export_private:
auspice_config = lambda w: config['builds'][w.build_name]['auspice_config'],
lat_longs = config['lat-longs']
output:
auspice_json = "auspice/{build_name}_{segment}.json",
root_sequence_json = "auspice/{build_name}_{segment}_root-sequence.json",
auspice_json = "auspice/{build_name}_{segment}.json"
conda: "../../workflow/envs/nextstrain.yaml"
benchmark:
"benchmarks/export_{build_name}_{segment}.txt"
Expand All @@ -187,7 +186,7 @@ rule export_private:
--tree {input.tree} \
--metadata {input.metadata} \
--node-data {input.node_data} {input.private_node_data} \
--include-root-sequence \
--include-root-sequence-inline \
--lat-longs {input.lat_longs} \
--auspice-config {input.auspice_config} \
--minify-json \
Expand Down
12 changes: 1 addition & 11 deletions profiles/nextstrain-public/rename.smk
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ rule all_public:
"auspice_renamed/" + build.get("auspice_name", f"{build_name}_{{segment}}").format(segment=segment) + suffix + ".json"
for build_name, build in config["builds"].items()
for segment in config["segments"]
for suffix in ["", "_root-sequence", "_tip-frequencies"]
for suffix in ["", "_tip-frequencies"]
],

def _get_file_by_auspice_name(wildcards):
Expand All @@ -26,16 +26,6 @@ rule rename_auspice_main:
ln {input} {output}
"""

rule rename_auspice_root_sequence:
input:
lambda wildcards: _get_file_by_auspice_name(wildcards).replace(".json", "_root-sequence.json"),
output:
"auspice_renamed/{auspice_name}_root-sequence.json",
shell:
"""
ln {input} {output}
"""

rule rename_auspice_tip_frequencies:
input:
lambda wildcards: _get_file_by_auspice_name(wildcards).replace(".json", "_tip-frequencies.json"),
Expand Down
5 changes: 2 additions & 3 deletions workflow/snakemake_rules/export.smk
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,7 @@ rule export:
auspice_config = lambda w: config['builds'][w.build_name]['auspice_config'],
lat_longs = config.get('lat-longs', "config/lat_longs.tsv"),
output:
auspice_json = "auspice/{build_name}_{segment}.json",
root_sequence_json = "auspice/{build_name}_{segment}_root-sequence.json",
auspice_json = "auspice/{build_name}_{segment}.json"
conda: "../envs/nextstrain.yaml"
benchmark:
"benchmarks/export_{build_name}_{segment}.txt"
Expand All @@ -74,7 +73,7 @@ rule export:
--tree {input.tree} \
--metadata {input.metadata} \
--node-data {input.node_data} \
--include-root-sequence \
--include-root-sequence-inline \
--lat-longs {input.lat_longs} \
--auspice-config {input.auspice_config} \
--output {output.auspice_json} 2>&1 | tee {log}
Expand Down

0 comments on commit 2d0f3d0

Please sign in to comment.