Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
# -- Cross-project references ------------------------------------------------

intersphinx_mapping = {
'augur': ('https://docs.nextstrain.org/projects/augur/page/', None),
'augur': ('https://nextstrain--1963.org.readthedocs.build/projects/augur/en/1963/', None),
'auspice': ('https://docs.nextstrain.org/projects/auspice/page/', None),
'cli': ('https://docs.nextstrain.org/projects/cli/page/', None),
'nextclade': ('https://docs.nextstrain.org/projects/nextclade/page/', None),
Expand Down
8 changes: 7 additions & 1 deletion src/guides/bioinformatics/filtering-and-subsampling.rst
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,7 @@ Below is an example of how it can be used in Snakemake.
.. code-block:: python

import yaml
from augur.subsample import get_referenced_files
from augur.subsample import get_referenced_files, get_parallelism

with open("results/subsample_config.yaml", "w") as f:
yaml.dump(config["builds"]["build1"]["subsample"], f, sort_keys=False)
Expand All @@ -541,11 +541,13 @@ Below is an example of how it can be used in Snakemake.
referenced_files = get_referenced_files("results/subsample_config.yaml"),
output:
metadata = "results/subsampled.tsv",
threads: get_parallelism("results/subsample_config.yaml", limit=workflow.cores)
shell:
"""
augur subsample \
--metadata {input.metadata} \
--config {input.config} \
--nthreads {threads} \
--output-metadata {output.metadata}
"""

Expand All @@ -556,6 +558,10 @@ Below is an example of how it can be used in Snakemake.
using it ensures that changes to those files will trigger this rule to
re-run.

:py:func:`augur.subsample.get_parallelism` is a helper function that returns
the degree of parallelism based on the ``augur subsample`` config. While optional,
using it allows Snakemake to allocate an optimal amount of threads.

Other options (less ideal):

- Maintain a separate YAML dedicated to ``augur subsample``. This is not ideal
Expand Down
Loading