Skip to content

Commit

Permalink
phylogenetic: Use inline root sequence
Browse files Browse the repository at this point in the history
Based on feedback from @jameshadfield in
#56 (comment)

Looking at the existing dataset files on S3,
the 5 KiB root-sequence.json is pretty negligible when the main
Auspice JSON is only 163 KiB. Nextstrain datasets are limited by the
500MB memory cap in Chrome,¹ so we'd be fine adding the
root sequence inline.

¹ nextstrain/auspice#1622
  • Loading branch information
joverlee521 committed Apr 16, 2024
1 parent 3ed4bca commit 3bd8766
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 11 deletions.
3 changes: 1 addition & 2 deletions phylogenetic/Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ configfile: "defaults/config_zika.yaml"

rule all:
input:
auspice_json = "auspice/zika.json",
root_sequence = "auspice/zika_root-sequence.json"
auspice_json = "auspice/zika.json"

include: "rules/prepare_sequences.smk"
include: "rules/merge_sequences_usvi.smk"
Expand Down
13 changes: 4 additions & 9 deletions phylogenetic/rules/export.smk
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,7 @@ rule export:
auspice_config = "defaults/auspice_config.json",
description = "defaults/description.md"
output:
auspice_json = "results/raw_zika.json",
root_sequence = "results/raw_zika_root-sequence.json",
auspice_json = "results/raw_zika.json"
params:
strain_id = config.get("strain_id_field", "strain"),
shell:
Expand All @@ -52,18 +51,16 @@ rule export:
--colors {input.colors} \
--auspice-config {input.auspice_config} \
--description {input.description} \
--include-root-sequence \
--include-root-sequence-inline \
--output {output.auspice_json}
"""

rule final_strain_name:
input:
auspice_json="results/raw_zika.json",
metadata="data/metadata_all.tsv",
root_sequence="results/raw_zika_root-sequence.json",
metadata="data/metadata_all.tsv"
output:
auspice_json="auspice/zika.json",
root_sequence="auspice/zika_root-sequence.json",
auspice_json="auspice/zika.json"
params:
strain_id=config["strain_id_field"],
display_strain_field=config.get("display_strain_field", "strain"),
Expand All @@ -75,6 +72,4 @@ rule final_strain_name:
--input-auspice-json {input.auspice_json} \
--display-strain-name {params.display_strain_field} \
--output {output.auspice_json}
cp {input.root_sequence} {output.root_sequence}
"""

0 comments on commit 3bd8766

Please sign in to comment.