Skip to content

Commit

Permalink
Simplify nextclade_dataset input
Browse files Browse the repository at this point in the history
  • Loading branch information
joverlee521 committed Jul 26, 2024
1 parent 988fbec commit 6c6a4ff
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions workflow/snakemake_rules/nextclade.smk
Original file line number Diff line number Diff line change
Expand Up @@ -62,22 +62,11 @@ if config.get("s3_dst") and config.get("s3_src"):
ruleorder: download_nextclade_tsv_from_s3 > create_empty_nextclade_info
ruleorder: download_previous_alignment_from_s3 > create_empty_nextclade_aligned

def _convert_dataset_name(wildcards):
if wildcards.reference == '':
dataset_name="sars-cov-2"
elif wildcards.reference == '_21L':
dataset_name="sars-cov-2-21L"
else:
# We shouldn't run into this since we have wildcard_constraints,
# but doesn't hurt to include it in case that changes
raise ValueError(f"Cannot convert unsupported reference {wildcards.reference!r} to Nextclade dataset name")

return f"data/nextclade_data/{dataset_name}.zip",

rule use_nextclade_cache:
input:
nextclade="./nextclade",
nextclade_dataset=_convert_dataset_name,
nextclade_dataset=lambda w: f"data/nextclade_data/sars-cov-2{w.reference.replace('_','-')}.zip",
params:
dst_source=config["s3_dst"],
src_source=config["s3_src"],
Expand Down

0 comments on commit 6c6a4ff

Please sign in to comment.