Skip to content

Commit

Permalink
Remove all use of message directive
Browse files Browse the repository at this point in the history
Per Nextstrain's Snakemake style guide, using the `message` directive
overrides the default Snakemake outputs which includes other critical
details.

<https://docs.nextstrain.org/en/latest/reference/snakemake-style-guide.html#avoid-the-message-rule-attribute>
  • Loading branch information
joverlee521 committed Jun 17, 2024
1 parent 5be2a53 commit eb63e29
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 20 deletions.
15 changes: 5 additions & 10 deletions workflow/snakemake_rules/fetch_sequences.smk
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,7 @@ rule create_genbank_ndjson:
"""

rule fetch_biosample:
message:
"""Fetching BioSample data (GenBank only)"""
"""Fetching BioSample data (GenBank only)"""
output:
biosample = temp("data/biosample.ndjson")
benchmark:
Expand All @@ -140,8 +139,7 @@ rule fetch_biosample:


rule fetch_cog_uk_accessions:
message:
"""Fetching COG-UK sample accesions (GenBank only)"""
"""Fetching COG-UK sample accesions (GenBank only)"""
output:
cog_uk_accessions = temp("data/cog_uk_accessions.tsv")
benchmark:
Expand All @@ -154,8 +152,7 @@ rule fetch_cog_uk_accessions:


rule fetch_cog_uk_metadata:
message:
"""Fetching COG-UK metadata (GenBank only)"""
"""Fetching COG-UK metadata (GenBank only)"""
output:
cog_uk_metadata = temp("data/cog_uk_metadata.csv.gz")
benchmark:
Expand Down Expand Up @@ -243,8 +240,7 @@ if config.get("s3_dst") and config.get("s3_src"):
ruleorder: fetch_main_ndjson_from_s3 > create_genbank_ndjson

rule fetch_main_ndjson_from_s3:
message:
"""Fetching main NDJSON from AWS S3"""
"""Fetching main NDJSON from AWS S3"""
params:
file_on_s3_dst=f"{config['s3_dst']}/{database}.ndjson.zst",
file_on_s3_src=f"{config['s3_src']}/{database}.ndjson.zst",
Expand All @@ -260,8 +256,7 @@ if config.get("s3_dst") and config.get("s3_src"):
"""

rule fetch_biosample_from_s3:
message:
"""Fetching BioSample NDJSON from AWS S3"""
"""Fetching BioSample NDJSON from AWS S3"""
params:
file_on_s3_dst=f"{config['s3_dst']}/biosample.ndjson.zst",
file_on_s3_src=f"{config['s3_src']}/biosample.ndjson.zst",
Expand Down
13 changes: 5 additions & 8 deletions workflow/snakemake_rules/nextclade.smk
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,15 @@ wildcard_constraints:


rule create_empty_nextclade_info:
message:
"""Creating empty NextClade info cache file"""
"""Creating empty NextClade info cache file"""
output:
touch(f"data/{database}/nextclade{{reference}}_old.tsv"),
benchmark:
f"benchmarks/create_empty_nextclade_info_{database}{{reference}}.txt"


rule create_empty_nextclade_aligned:
message:
"""Creating empty NextClade aligned cache file"""
"""Creating empty NextClade aligned cache file"""
output:
touch(f"data/{database}/nextclade.aligned.old.fasta"),
*[
Expand Down Expand Up @@ -277,10 +275,9 @@ rule nextclade_tsv_concat_versions:


rule nextclade_info:
message:
"""
Generates nextclade info TSV for all sequences (new + old)
"""
"""
Generates nextclade info TSV for all sequences (new + old)
"""
input:
old_info=f"data/{database}/nextclade{{reference}}_old.tsv",
new_info=rules.nextclade_tsv_concat_versions.output.tsv,
Expand Down
4 changes: 2 additions & 2 deletions workflow/snakemake_rules/trigger.smk
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ These output files are empty flag files to force Snakemake to run the trigger ru
"""

rule trigger_rebuild_pipeline:
message: "Triggering nextstrain/ncov rebuild action (via repository dispatch)"
"""Triggering nextstrain/ncov rebuild action (via repository dispatch)"""
input:
metadata_upload = f"data/{database}/metadata.tsv.zst.upload",
fasta_upload = f"data/{database}/aligned.fasta.zst.upload",
Expand All @@ -32,7 +32,7 @@ rule trigger_rebuild_pipeline:
"""

rule trigger_counts_pipeline:
message: "Triggering nextstrain/counts clade counts action (via repository dispatch)"
"""Triggering nextstrain/counts clade counts action (via repository dispatch)"""
input:
f"data/{database}/upload.done"
output:
Expand Down

0 comments on commit eb63e29

Please sign in to comment.