forked from hsienchao/khanlab_pipeline
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpipeline.hic.rules
More file actions
executable file
·42 lines (38 loc) · 1.66 KB
/
pipeline.hic.rules
File metadata and controls
executable file
·42 lines (38 loc) · 1.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
import os
import io
import sys
import traceback
import json
SAMPLES = []
TARGETS = []
samples = config['samples']
data_dir = config['data_dir']
work_dir = config['work_dir']
pipeline_home = config['pipeline_home']
shell.prefix("""
set -e -o pipefail
module purge
sleep 20s
MEM=`echo "${{SLURM_MEM_PER_NODE}} / 1024 "|bc`
LOCAL="/lscratch/${{SLURM_JOBID}}/"
THREADS=${{SLURM_CPUS_ON_NODE}}
""")
configfile: pipeline_home +"/config/common.yml"
pipeline_version = config["pipeline_version"]
emails = config["emails"]
config["pipeline_home"] = pipeline_home
config["work_dir"] = work_dir
suffix_R1 = config["FASTQ_suffix_R1"]
suffix_R2 = config["FASTQ_suffix_R2"]
include: "rules/utility.smk"
include: "rules/pipeline.hic.smk"
onerror:
shell("echo 'HiC pipeline version {pipeline_version} failed on Biowulf. Samples: {SAMPLES}. Working Dir: {work_dir}' |mutt -e 'my_hdr From:chouh@nih.gov' -s 'Khanlab HiC Pipeline Status' `whoami`@mail.nih.gov {emails} ")
onstart:
shell("echo 'HiC pipeline version {pipeline_version} started on Biowulf. Samples: {SAMPLES}. Working Dir: {work_dir}' |mutt -e 'my_hdr From:chouh@nih.gov' -s 'Khanlab HiC Pipeline Status' `whoami`@mail.nih.gov {emails} ")
onsuccess:
shell("echo 'HiC pipeline version {pipeline_version} finished on Biowulf. Samples: {SAMPLES}. Working Dir: {work_dir}' |mutt -e 'my_hdr From:chouh@nih.gov' -s 'Khanlab HiC Pipeline Status' `whoami`@mail.nih.gov {emails} ")
shell("for s in {SAMPLES};do touch {work_dir}/${{s}}/successful.txt;chgrp -R khanlab {work_dir}/${{s}};done")
print("Workflow finished, no error")
rule HiC_pipeline:
input: TARGETS