Skip to content
Snippets Groups Projects
Commit c78ae311 authored by Kedi Cao's avatar Kedi Cao
Browse files

add option to turn on and off email notifications

parent 77aeb7c4
No related merge requests found
......@@ -53,7 +53,8 @@ k_merge: 63 # for rule popins2_merge_contigs
readlen: 150 # for rules popins2_place_refalign and popins2_place_splitalign
min-qual: 30 # for rule popins2_crop_unmapped, Minimum average quality value in windows for read quality trimming.
min-read-len: 60 # for rule popins2_crop_unmapped, Minimum read length to keep the read after quality trimming.
email: "user@email.com" #replace with your email address to receive email notifications before each notebook execution.
receive_email_notifications: "no" # choose between "yes" or "no" to receive email notifications or not
email: "user@example.com" # specify your email address here to receive email notifications before each notebook execution.
# Sub-directories for OUTPUT_PATH
......
......@@ -9,12 +9,16 @@ if config["SICKLE"]=="no":
params:
email=config["email"], # Replace with your email or retrieve from config
subject="Snakemake Notification",
message="Rule unmapped_analysis is ready to execute."
message="Rule unmapped_analysis is ready to execute.",
receive_email=config["receive_email_notifications"] # "yes" or "no"
shell:
"""
echo "{params.message}" | mail -s "{params.subject}" {params.email}
if [ "{params.receive_email}" = "yes" ]; then
echo "{params.message}" | mail -s "{params.subject}" {params.email}
fi
touch {output.notify_file}
"""
rule unmapped_analysis:
input:
notify="notify/unmapped_analysis.txt"
......@@ -40,10 +44,13 @@ if config["SICKLE"]=="no":
params:
email=config["email"], # Replace with your email or retrieve from config
subject="Snakemake Notification",
message="Rule unmapped_analysis_no_filtler_after_clean is ready to execute."
message="Rule unmapped_analysis_no_filtler_after_clean is ready to execute.",
receive_email=config["receive_email_notifications"] # "yes" or "no"
shell:
"""
echo "{params.message}" | mail -s "{params.subject}" {params.email}
if [ "{params.receive_email}" = "yes" ]; then
echo "{params.message}" | mail -s "{params.subject}" {params.email}
fi
touch {output.notify_file}
"""
rule unmapped_analysis_no_filtler_after_clean:
......@@ -72,10 +79,13 @@ elif config["SICKLE"]=="yes":
params:
email=config["email"], # Replace with your email or retrieve from config
subject="Snakemake Notification",
message="Rule unmapped_analysis_before_filter is ready to execute."
message="Rule unmapped_analysis_before_filter is ready to execute.",
receive_email=config["receive_email_notifications"] # "yes" or "no"
shell:
"""
echo "{params.message}" | mail -s "{params.subject}" {params.email}
if [ "{params.receive_email}" = "yes" ]; then
echo "{params.message}" | mail -s "{params.subject}" {params.email}
fi
touch {output.notify_file}
"""
rule unmapped_analysis_before_filter:
......@@ -102,10 +112,13 @@ elif config["SICKLE"]=="yes":
params:
email=config["email"], # Replace with your email or retrieve from config
subject="Snakemake Notification",
message="Rule unmapped_analysis_after_filter is ready to execute."
message="Rule unmapped_analysis_after_filter is ready to execute.",
receive_email=config["receive_email_notifications"] # "yes" or "no"
shell:
"""
echo "{params.message}" | mail -s "{params.subject}" {params.email}
if [ "{params.receive_email}" = "yes" ]; then
echo "{params.message}" | mail -s "{params.subject}" {params.email}
fi
touch {output.notify_file}
"""
rule unmapped_analysis_after_filter:
......@@ -133,10 +146,13 @@ elif config["SICKLE"]=="yes":
params:
email=config["email"], # Replace with your email or retrieve from config
subject="Snakemake Notification",
message="Rule unmapped_analysis_before_clean_filter is ready to execute."
message="Rule unmapped_analysis_before_clean_filter is ready to execute.",
receive_email=config["receive_email_notifications"] # "yes" or "no"
shell:
"""
echo "{params.message}" | mail -s "{params.subject}" {params.email}
if [ "{params.receive_email}" = "yes" ]; then
echo "{params.message}" | mail -s "{params.subject}" {params.email}
fi
touch {output.notify_file}
"""
rule unmapped_analysis_before_clean_filter:
......@@ -162,10 +178,13 @@ elif config["SICKLE"]=="yes":
params:
email=config["email"], # Replace with your email or retrieve from config
subject="Snakemake Notification",
message="Rule unmapped_analysis_after_clean is ready to execute."
message="Rule unmapped_analysis_after_clean is ready to execute.",
receive_email=config["receive_email_notifications"] # "yes" or "no"
shell:
"""
echo "{params.message}" | mail -s "{params.subject}" {params.email}
if [ "{params.receive_email}" = "yes" ]; then
echo "{params.message}" | mail -s "{params.subject}" {params.email}
fi
touch {output.notify_file}
"""
rule unmapped_analysis_after_clean:
......@@ -191,10 +210,13 @@ elif config["SICKLE"]=="yes":
params:
email=config["email"], # Replace with your email or retrieve from config
subject="Snakemake Notification",
message="Rule unmapped_analysis_after_clean_filter is ready to execute."
message="Rule unmapped_analysis_after_clean_filter is ready to execute.",
receive_email=config["receive_email_notifications"] # "yes" or "no"
shell:
"""
echo "{params.message}" | mail -s "{params.subject}" {params.email}
if [ "{params.receive_email}" = "yes" ]; then
echo "{params.message}" | mail -s "{params.subject}" {params.email}
fi
touch {output.notify_file}
"""
rule unmapped_analysis_after_clean_filter:
......@@ -221,10 +243,13 @@ rule email_assembly_analysis_table:
params:
email=config["email"], # Replace with your email or retrieve from config
subject="Snakemake Notification",
message="Rule assembly_analysis_table is ready to execute."
message="Rule assembly_analysis_table is ready to execute.",
receive_email=config["receive_email_notifications"] # "yes" or "no"
shell:
"""
echo "{params.message}" | mail -s "{params.subject}" {params.email}
if [ "{params.receive_email}" = "yes" ]; then
echo "{params.message}" | mail -s "{params.subject}" {params.email}
fi
touch {output.notify_file}
"""
rule assembly_analysis_table:
......@@ -249,10 +274,13 @@ rule email_assembly_analysis:
params:
email=config["email"], # Replace with your email or retrieve from config
subject="Snakemake Notification",
message="Rule assembly_analysis is ready to execute."
message="Rule assembly_analysis is ready to execute.",
receive_email=config["receive_email_notifications"] # "yes" or "no"
shell:
"""
echo "{params.message}" | mail -s "{params.subject}" {params.email}
if [ "{params.receive_email}" = "yes" ]; then
echo "{params.message}" | mail -s "{params.subject}" {params.email}
fi
touch {output.notify_file}
"""
rule assembly_analysis:
......@@ -296,10 +324,13 @@ rule email_coverage_analysis:
params:
email=config["email"], # Replace with your email or retrieve from config
subject="Snakemake Notification",
message="Rule coverage_analysis is ready to execute."
message="Rule coverage_analysis is ready to execute.",
receive_email=config["receive_email_notifications"] # "yes" or "no"
shell:
"""
echo "{params.message}" | mail -s "{params.subject}" {params.email}
if [ "{params.receive_email}" = "yes" ]; then
echo "{params.message}" | mail -s "{params.subject}" {params.email}
fi
touch {output.notify_file}
"""
rule coverage_analysis:
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment