Skip to content

Commit

Permalink
chore: replace snakemake message directives with comments
Browse files Browse the repository at this point in the history
This is a stylistic change to make the Snakemake code conform to documented
Nextstrain Snakemake Styleguide:

  Avoid the message rule attribute.
  When the message attribute is defined, Snakemake suppresses other
  critical details that otherwise get displayed by default (e.g., job id,
  rule name, input, output, etc.).
  • Loading branch information
j23414 committed May 8, 2023
1 parent 5023ba1 commit ace74cd
Showing 1 changed file with 29 additions and 33 deletions.
62 changes: 29 additions & 33 deletions Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ rule files:
files = rules.files.params

rule download:
message: "Downloading sequences and metadata from data.nextstrain.org"
"""Downloading sequences and metadata from data.nextstrain.org"""
output:
sequences = "data/sequences.fasta.zst",
metadata = "data/metadata.tsv.zst"
Expand All @@ -28,7 +28,7 @@ rule download:
"""

rule decompress:
message: "Decompressing sequences and metadata"
"""Decompressing sequences and metadata"""
input:
sequences = "data/sequences.fasta.zst",
metadata = "data/metadata.tsv.zst"
Expand All @@ -42,14 +42,13 @@ rule decompress:
"""

rule filter:
message:
"""
Filtering to
- {params.sequences_per_group} sequence(s) per {params.group_by!s}
- from {params.min_date} onwards
- excluding strains in {input.exclude}
- minimum genome length of {params.min_length} (50% of Zika virus genome)
"""
"""
Filtering to
- {params.sequences_per_group} sequence(s) per {params.group_by!s}
- from {params.min_date} onwards
- excluding strains in {input.exclude}
- minimum genome length of {params.min_length} (50% of Zika virus genome)
"""
input:
sequences = "data/sequences.fasta",
metadata = "data/metadata.tsv",
Expand All @@ -75,11 +74,10 @@ rule filter:
"""

rule align:
message:
"""
Aligning sequences to {input.reference}
- filling gaps with N
"""
"""
Aligning sequences to {input.reference}
- filling gaps with N
"""
input:
sequences = "results/filtered.fasta",
reference = files.reference
Expand All @@ -96,7 +94,7 @@ rule align:
"""

rule tree:
message: "Building tree"
"""Building tree"""
input:
alignment = "results/aligned.fasta"
output:
Expand All @@ -109,14 +107,13 @@ rule tree:
"""

rule refine:
message:
"""
Refining tree
- estimate timetree
- use {params.coalescent} coalescent timescale
- estimate {params.date_inference} node dates
- filter tips more than {params.clock_filter_iqd} IQDs from clock expectation
"""
"""
Refining tree
- estimate timetree
- use {params.coalescent} coalescent timescale
- estimate {params.date_inference} node dates
- filter tips more than {params.clock_filter_iqd} IQDs from clock expectation
"""
input:
tree = "results/tree_raw.nwk",
alignment = "results/aligned.fasta",
Expand Down Expand Up @@ -144,7 +141,7 @@ rule refine:
"""

rule ancestral:
message: "Reconstructing ancestral sequences and mutations"
"""Reconstructing ancestral sequences and mutations"""
input:
tree = "results/tree.nwk",
alignment = "results/aligned.fasta"
Expand All @@ -162,7 +159,7 @@ rule ancestral:
"""

rule translate:
message: "Translating amino acid sequences"
"""Translating amino acid sequences"""
input:
tree = "results/tree.nwk",
node_data = "results/nt_muts.json",
Expand All @@ -179,11 +176,10 @@ rule translate:
"""

rule traits:
message:
"""
Inferring ancestral traits for {params.columns!s}
- increase uncertainty of reconstruction by {params.sampling_bias_correction} to partially account for sampling bias
"""
"""
Inferring ancestral traits for {params.columns!s}
- increase uncertainty of reconstruction by {params.sampling_bias_correction} to partially account for sampling bias
"""
input:
tree = "results/tree.nwk",
metadata = "data/metadata.tsv"
Expand All @@ -204,7 +200,7 @@ rule traits:
"""

rule export:
message: "Exporting data files for for auspice"
"""Exporting data files for for auspice"""
input:
tree = "results/tree.nwk",
metadata = "data/metadata.tsv",
Expand All @@ -231,7 +227,7 @@ rule export:
"""

rule clean:
message: "Removing directories: {params}"
"""Removing directories: {params}"""
params:
"data ",
"results ",
Expand Down

0 comments on commit ace74cd

Please sign in to comment.