Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

workflow: give input data files unique names #85

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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
12 changes: 6 additions & 6 deletions workflow/snakemake_rules/core.smk
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
'''
This part of the workflow expects input files

sequences = "data/sequences.fasta",
metadata = "data/metadata.tsv",
sequences = "data/{build_name}_sequences.fasta",
metadata = "data/{build_name}_metadata.tsv",

and will produce output files as

Expand All @@ -14,9 +14,9 @@ In addition, `build_dir` and `auspice_dir` need to be defined upstream.

rule wrangle_metadata:
input:
metadata = "data/metadata.tsv"
metadata = "data/{build_name}_metadata.tsv"
output:
metadata = "results/metadata.tsv"
metadata = "results/{build_name}_metadata.tsv"
params:
strain_id = lambda w: config.get('strain_id_field', 'strain')
shell:
Expand All @@ -36,8 +36,8 @@ rule filter:
- minimum genome length of {params.min_length}
"""
input:
sequences = "data/sequences.fasta",
metadata = "results/metadata.tsv",
sequences = "data/{build_name}_sequences.fasta",
metadata = "results/{build_name}_metadata.tsv",
exclude = config["exclude"]
output:
sequences = build_dir + "/{build_name}/filtered.fasta",
Expand Down
4 changes: 2 additions & 2 deletions workflow/snakemake_rules/download_via_lapis.smk
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
rule download_sequences_via_lapis:
output:
sequences = "data/sequences.fasta",
sequences = "data/{build_name}_sequences.fasta",
shell:
"""
curl https://mpox-lapis.genspectrum.org/v1/sample/fasta --output {output.sequences}
"""

rule download_metadata_via_lapis:
output:
metadata = "data/metadata.tsv"
metadata = "data/{build_name}_metadata.tsv"
shell:
"""
curl https://mpox-lapis.genspectrum.org/v1/sample/details?dataFormat=csv | \
Expand Down
12 changes: 6 additions & 6 deletions workflow/snakemake_rules/prepare.smk
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
rule download:
message: "Downloading sequences and metadata from data.nextstrain.org"
output:
sequences = "data/sequences.fasta.xz",
metadata = "data/metadata.tsv.gz"
sequences = "data/{build_name}_sequences.fasta.xz",
metadata = "data/{build_name}_metadata.tsv.gz"
params:
sequences_url = "https://data.nextstrain.org/files/workflows/monkeypox/sequences.fasta.xz",
metadata_url = "https://data.nextstrain.org/files/workflows/monkeypox/metadata.tsv.gz"
Expand All @@ -15,11 +15,11 @@ rule download:
rule decompress:
message: "Decompressing sequences and metadata"
input:
sequences = "data/sequences.fasta.xz",
metadata = "data/metadata.tsv.gz"
sequences = "data/{build_name}_sequences.fasta.xz",
metadata = "data/{build_name}_metadata.tsv.gz"
output:
sequences = "data/sequences.fasta",
metadata = "data/metadata.tsv"
sequences = "data/{build_name}_sequences.fasta",
metadata = "data/{build_name}_metadata.tsv"
shell:
"""
gzip --decompress --keep {input.metadata}
Expand Down