diff --git a/workflow/Snakefile b/workflow/Snakefile index a6f565e..9798f54 100644 --- a/workflow/Snakefile +++ b/workflow/Snakefile @@ -1,9 +1,6 @@ -from snakemake.utils import min_version - -# min_version("7.14.0") +configfile_location = "config/config.yaml" -configfile_location = "config/config.yaml" configfile: configfile_location diff --git a/workflow/rules/common.smk b/workflow/rules/common.smk index 183a01b..3ee5a85 100644 --- a/workflow/rules/common.smk +++ b/workflow/rules/common.smk @@ -63,9 +63,13 @@ if config["mosaicatcher_pipeline"] == False: ) -def onsuccess_fct(log): - config_metadata = config_definitions = yaml.safe_load(open(configfile_location.replace("config.yaml", "config_metadata.yaml"), "r")) - log_path_new = make_log_useful_ashleys.make_log_useful(log, "SUCCESS", config, config_metadata) +def onsuccess_fct(log): + config_metadata = config_definitions = yaml.safe_load( + open(configfile_location.replace("config.yaml", "config_metadata.yaml"), "r") + ) + log_path_new = make_log_useful_ashleys.make_log_useful( + log, "SUCCESS", config, config_metadata + ) shell( 'mail -s "[Snakemake] smk-wf-catalog/ashleys-qc-pipeline v{} - Run on {} - SUCCESS" {} < {}'.format( config["version"], config["data_location"], config["email"], log_path_new @@ -74,14 +78,19 @@ def onsuccess_fct(log): def onerror_fct(log): - config_metadata = config_definitions = yaml.safe_load(open(configfile_location.replace("config.yaml", "config_metadata.yaml"), "r")) - log_path_new = make_log_useful_ashleys.make_log_useful(log, "ERROR", config, config_metadata) + config_metadata = config_definitions = yaml.safe_load( + open(configfile_location.replace("config.yaml", "config_metadata.yaml"), "r") + ) + log_path_new = make_log_useful_ashleys.make_log_useful( + log, "ERROR", config, config_metadata + ) shell( 'mail -s "[Snakemake] smk-wf-catalog/ashleys-qc-pipeline v{} - Run on {} - ERRROR" {} < {}'.format( config["version"], config["data_location"], config["email"], log_path_new ) ) + # Simple class to retrieve automatically files in the fastq/bam folder and create a config dataframe class HandleInput: def __init__( @@ -264,7 +273,11 @@ class HandleInput: "strandphaser", ] - for sample in [e for e in os.listdir(thisdir) if e not in exclude and e.endswith(".zip") is False]: + for sample in [ + e + for e in os.listdir(thisdir) + if e not in exclude and e.endswith(".zip") is False + ]: # Create a list of files to process for each sample l_files_all = [ f diff --git a/workflow/rules/count.smk b/workflow/rules/count.smk index 43c84ac..99a4349 100644 --- a/workflow/rules/count.smk +++ b/workflow/rules/count.smk @@ -112,11 +112,11 @@ rule plot_mosaic_counts: output: # "{folder}/{sample}/plots/counts/CountComplete.raw.pdf", report( - "{folder}/{sample}/plots/counts/CountComplete.raw.pdf", - category="Mosaic Counts", - subcategory="{sample}", - labels={"Cell": "ALL", "Type": "raw"}, - ), + "{folder}/{sample}/plots/counts/CountComplete.raw.pdf", + category="Mosaic Counts", + subcategory="{sample}", + labels={"Cell": "ALL", "Type": "raw"}, + ), log: "{folder}/log/plot_mosaic_counts/{sample}.log", params: