Skip to content

Commit

Permalink
2.2.2: fixes and small update
Browse files Browse the repository at this point in the history
  • Loading branch information
weber8thomas committed Sep 22, 2023
1 parent 9f2f2fa commit 38150e5
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 15 deletions.
5 changes: 1 addition & 4 deletions workflow/Snakefile
Original file line number Diff line number Diff line change
@@ -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


Expand Down
25 changes: 19 additions & 6 deletions workflow/rules/common.smk
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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__(
Expand Down Expand Up @@ -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
Expand Down
10 changes: 5 additions & 5 deletions workflow/rules/count.smk
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 38150e5

Please sign in to comment.