Skip to content

Commit

Permalink
Merge branch 'trs/build-name-in-description-links'
Browse files Browse the repository at this point in the history
  • Loading branch information
tsibley committed Feb 3, 2022
2 parents 9524d27 + b68f4c9 commit 59da03e
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 10 deletions.
2 changes: 2 additions & 0 deletions docs/src/reference/change_log.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ We also use this change log to document new features that maintain backward comp

- 29 January 2022: Update "mutational fitness" coloring based on latest results from [Obermeyer et al model](https://www.medrxiv.org/content/10.1101/2021.09.07.21263228v1) via [github.com/broadinstitute/pyro-cov/](https://github.com/broadinstitute/pyro-cov/blob/master/paper/mutations.tsv).

- 26 January 2022: Template build descriptions in export for Auspice by substituting `${BUILD}` in the Markdown with the current build name.

## v10 (5 January 2022)

- 5 January 2022: Move filter and diagnostic steps after subsampling. For workflows with subsampling that does not depend on priority calculations, these changes allow the workflow to start subsampling from the metadata, skipping sequence alignment of the full input sequences and only looping through these input sequences once per build when subsampled sequences are extracted. To skip the alignment step, define your input sequences with the `aligned` directive. If you use priority-based subsampling, define your input sequences with the `sequences` directive. This reorganization of the workflow causes a breaking change in that the workflow no longer supports input-specific filtering with the `exclude_where`, `min_date`, and `exclude_ambiguous_dates_by` parameters. The workflow continues to support input-specific filtering by `min_length` and skipping of diagnostic filters with `skip_diagnostics`. [PR #814](https://github.com/nextstrain/ncov/pull/814).
Expand Down
16 changes: 8 additions & 8 deletions nextstrain_profiles/nextstrain-open/nextstrain_description.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ To maximize the utility and visibility of these generously shared data, [we prov
### Subsampled sequences and intermediate files

The files below exist for the `global` and the regional builds (`africa`, `asia`, `europe`, `north-america`, `oceania` and `south-america`).
The links below refer to the `global` build, substitute `global` with the desired region in the links if necessary

* [global/sequences.fasta.xz](https://data.nextstrain.org/files/ncov/open/global/sequences.fasta.xz)
* [global/metadata.tsv.xz](https://data.nextstrain.org/files/ncov/open/global/metadata.tsv.xz)
* [global/aligned.fasta.xz](https://data.nextstrain.org/files/ncov/open/global/aligned.fasta.xz)
* [global auspice tree](https://data.nextstrain.org/files/ncov/open/global/global.json)
* [global auspice root sequence](https://data.nextstrain.org/files/ncov/open/global/global_root-sequence.json)
* [global auspice tip frequencies](https://data.nextstrain.org/files/ncov/open/global/global_tip-frequencies.json)
The links below refer to the `${BUILD}` build, substitute `${BUILD}` with another build name in the links if desired.

* [${BUILD}/sequences.fasta.xz](https://data.nextstrain.org/files/ncov/open/${BUILD}/sequences.fasta.xz)
* [${BUILD}/metadata.tsv.xz](https://data.nextstrain.org/files/ncov/open/${BUILD}/metadata.tsv.xz)
* [${BUILD}/aligned.fasta.xz](https://data.nextstrain.org/files/ncov/open/${BUILD}/aligned.fasta.xz)
* [${BUILD} auspice tree](https://data.nextstrain.org/files/ncov/open/${BUILD}/${BUILD}.json)
* [${BUILD} auspice root sequence](https://data.nextstrain.org/files/ncov/open/${BUILD}/${BUILD}_root-sequence.json)
* [${BUILD} auspice tip frequencies](https://data.nextstrain.org/files/ncov/open/${BUILD}/${BUILD}_tip-frequencies.json)
21 changes: 19 additions & 2 deletions workflow/snakemake_rules/main_workflow.smk
Original file line number Diff line number Diff line change
Expand Up @@ -1309,16 +1309,33 @@ def _get_node_data_by_wildcards(wildcards):

return inputs

rule build_description:
message: "Templating build description for Auspice"
input:
description = lambda w: config["builds"][w.build_name]["description"] if "description" in config["builds"][w.build_name] else config["files"]["description"]
output:
description = "results/{build_name}/description.md"
log:
"logs/build_description_{build_name}.txt"
conda: config["conda_environment"]
shell:
"""
env BUILD={wildcards.build_name:q} \
perl -pe 's/\$\{{BUILD\}}/$ENV{{BUILD}}/g' \
< {input.description:q} \
> {output.description:q}
"""

rule export:
message: "Exporting data files for for auspice"
message: "Exporting data files for Auspice"
input:
tree = rules.refine.output.tree,
metadata="results/{build_name}/metadata_adjusted.tsv.xz",
node_data = _get_node_data_by_wildcards,
auspice_config = lambda w: config["builds"][w.build_name]["auspice_config"] if "auspice_config" in config["builds"][w.build_name] else config["files"]["auspice_config"],
colors = lambda w: config["builds"][w.build_name]["colors"] if "colors" in config["builds"][w.build_name] else ( config["files"]["colors"] if "colors" in config["files"] else rules.colors.output.colors.format(**w) ),
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"]
description = rules.build_description.output.description
output:
auspice_json = "results/{build_name}/ncov_with_accessions.json",
root_sequence_json = "results/{build_name}/ncov_with_accessions_root-sequence.json"
Expand Down

0 comments on commit 59da03e

Please sign in to comment.