-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathstep8-coverageToExon.sh
executable file
·59 lines (46 loc) · 1.05 KB
/
step8-coverageToExon.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
57
58
59
#!/bin/sh
## Usage
# sh step8-coverageToExon.sh brainspan
# Define variables
EXPERIMENT=$1
SHORT="covToEx-${EXPERIMENT}"
CORES=1
# Directories
ROOTDIR=/dcl01/lieber/ajaffe/derRuns/derSupplement
MAINDIR=${ROOTDIR}/${EXPERIMENT}
WDIR=${MAINDIR}/coverageToExon
if [[ "${EXPERIMENT}" == "brainspan" ]]
then
RLENGTH=100
else
echo "Specify a valid experiment: brainspan"
fi
for anno in ensembl ucsc
do
# Construct shell files
sname="${SHORT}-${anno}"
echo "Creating script ${sname}"
cat > ${ROOTDIR}/.${sname}.sh <<EOF
#!/bin/bash
#$ -cwd
#$ -m e
#$ -l mem_free=240G,h_vmem=270G,h_fsize=30G
#$ -N ${sname}
#$ -hold_jid fullCov-${EXPERIMENT}
echo "**** Job starts ****"
date
# Make logs directory
mkdir -p ${WDIR}/logs
# Run coverageToExon()
cd ${WDIR}
module load R/3.3
Rscript ${ROOTDIR}/step8-coverageToExon.R -e "${EXPERIMENT}" -a "${anno}" -r ${RLENGTH} -c ${CORES}
## Move log files into the logs directory
mv ${ROOTDIR}/${sname}.* ${WDIR}/logs/
echo "**** Job ends ****"
date
EOF
call="qsub .${sname}.sh"
echo $call
$call
done