-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathstep1-fullCoverage.sh
executable file
·58 lines (44 loc) · 1.11 KB
/
step1-fullCoverage.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
#!/bin/sh
## Usage
# sh step1-fullCoverage.sh brainspan
# Define variables
EXPERIMENT=$1
SHORT="fullCov-${EXPERIMENT}"
CORES=10
# Directories
ROOTDIR=/dcl01/lieber/ajaffe/derRuns/derSupplement
MAINDIR=${ROOTDIR}/${EXPERIMENT}
WDIR=${MAINDIR}/CoverageInfo
if [[ "${EXPERIMENT}" == "brainspan" ]]
then
DATADIR=/nexsan2/disk3/ajaffe/BrainSpan/RNAseq/bigwig/
CUTOFF=0.25
else
echo "Specify a valid experiment: brainspan"
fi
# Construct shell file
echo 'Creating script for loading the Coverage data'
cat > ${ROOTDIR}/.${SHORT}.sh <<EOF
#!/bin/bash
#$ -cwd
#$ -m e
#$ -l mem_free=20G,h_vmem=30G,h_fsize=40G
#$ -N ${SHORT}
#$ -pe local ${CORES}
echo '**** Job starts ****'
date
# Make logs directory
mkdir -p ${WDIR}/logs
# Load the data, save the coverage without filtering, then save each file separately
cd ${WDIR}
module load R/3.3
module load samtools/1.1
Rscript ${ROOTDIR}/step1-fullCoverage.R -d "${DATADIR}" -p "out$" -c "${CUTOFF}" -m ${CORES}
## Move log files into the logs directory
mv ${ROOTDIR}/${SHORT}.* ${WDIR}/logs/
echo '**** Job ends ****'
date
EOF
call="qsub .${SHORT}.sh"
echo $call
$call