-
Notifications
You must be signed in to change notification settings - Fork 0
/
optional3-summOv.sh
executable file
·59 lines (47 loc) · 1.07 KB
/
optional3-summOv.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 optional3-summOv.sh snyder
# sh optional3-summOv.sh hippo
# Define variables
EXPERIMENT=$1
SHORT="summOv-${EXPERIMENT}"
# Directories
ROOTDIR=/dcl01/lieber/ajaffe/derRuns/derCountSupp
MAINDIR=${ROOTDIR}/${EXPERIMENT}
WDIR=${MAINDIR}/summOv
if [[ "${EXPERIMENT}" == "snyder" ]]
then
CORES=10
DATADIR=/dcs01/ajaffe/Snyder/RNAseq/TopHat
elif [[ "${EXPERIMENT}" == "hippo" ]]
then
CORES=24
DATADIR=/dcs01/ajaffe/Hippo/TopHat
else
echo "Specify a valid experiment: snyder or hippo"
fi
# Construct shell files
sname="${SHORT}"
echo "Creating script ${sname}"
cat > ${ROOTDIR}/.${sname}.sh <<EOF
#!/bin/bash
#$ -cwd
#$ -m e
#$ -l mem_free=3G,h_vmem=15G,h_fsize=30G
#$ -pe local ${CORES}
#$ -N ${sname}
echo "**** Job starts ****"
date
mkdir -p ${WDIR}/logs
## Summarize overlaps
module load R/3.2.x
Rscript -e "datadir <- '$DATADIR'; cores <- '$CORES'; source('optional3-summOv.R')"
# Move log files into the logs directory
mv ${ROOTDIR}/${sname}.* ${WDIR}/logs/
### Done
echo "**** Job ends ****"
date
EOF
call="qsub .${sname}.sh"
echo $call
$call