-
Notifications
You must be signed in to change notification settings - Fork 0
/
modifiedpeaks.sh
executable file
·56 lines (48 loc) · 1.58 KB
/
modifiedpeaks.sh
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#!/usr/bin/env bash
#------
###SYNTAX to run
#bsub -P watcher -q compbio -J modifiedpeaks-toil -o modifiedpeaks-toil_out -e modifiedpeaks-toil_err -N ./modifiedpeaks.sh
####
#------
###FILES
#------
location="/rgs01/project_space/abrahgrp/Software_Dev_Sandbox/common/101madetunji/ToilGettingThere"
parameters="$location/temp-parameters.yml" #$1" #inputparameters.yml"
script="$location/workflows/modifiedpeaks.cwl" #ToilChipSeq-1st-mapping.cwl"
OLD_UUID=$1
NEW_UUID=${NEW_UUID:=${OLD_UUID%%.yml}} #reuse old file
NEW_UUID=${NEW_UUID:=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 5 | head -n 1)"_"`date +%s`} #temporary file for the 2nd step
#temporary output & error files
out="$(pwd)/modifiedpeaks-"$NEW_UUID"-outdir"
tmp="$(pwd)/modifiedpeaks-"$NEW_UUID"-tmpdir"
jobstore="modifiedpeaks-"$NEW_UUID"-jobstore"
logtxt="modifiedpeaks-"$NEW_UUID"-log.txt"
logout="modifiedpeaks-"$NEW_UUID"-outfile_out"
logerr="modifiedpeaks-"$NEW_UUID"-outfile_err"
rm -rf $jobstore $logtxt $logout $logerr
#------
###Modules & PATHS update
#------
module load R/3.6.1
module load bedtools/2.25.0
module load bedops/2.4.2
#export R_LIBS_USER=$R_LIBS_USER:~/R/x86_64-pc-linux-gnu-library/3.6
export R_LIBS_USER=$R_LIBS_USER:$location/R #to find SPP local package
export PATH=$PATH:$location/scripts
#------
###HOUSEKEEPING
#------
mkdir -p $tmp $out
#------
###WORKFLOW
#------
toil-cwl-runner --batchSystem=lsf \
--preserve-entire-environment \
--disableCaching \
--logFile $logtxt \
--jobStore $jobstore \
--clean never \
--workDir $tmp \
--cleanWorkDir never \
--outdir $out \
$script $parameters 1>$logout 2>$logerr