-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathder2Merge.sh
executable file
·43 lines (34 loc) · 1.01 KB
/
der2Merge.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
#!/bin/sh
## Usage
# sh der2Merge.sh run2-v0.0.42
## derfinder available at http://www.bioconductor.org/packages/release/bioc/html/derfinder.html
# Directories
MAINDIR=/dcs01/lieber/ajaffe/Brain/derRuns/libd_n36
WDIR=${MAINDIR}/derAnalysis
# Define variables
SHORT='der2M-n36'
PREFIX=$1
# Construct shell files
outdir="${PREFIX}"
sname="${SHORT}.${PREFIX}"
echo "Creating script ${sname}"
cat > ${WDIR}/.${sname}.sh <<EOF
#!/bin/bash
#$ -cwd
#$ -m e
#$ -l mem_free=50G,h_vmem=100G,h_fsize=10G
#$ -N ${sname}
echo "**** Job starts ****"
date
mkdir -p ${WDIR}/${outdir}/logs
# merge results
module load R/3.1.x
Rscript -e "library(derfinder); load('/dcs01/lieber/ajaffe/Brain/derRuns/derfinderExample/derGenomicState/GenomicState.Hsapiens.UCSC.hg19.knownGene.Rdata'); mergeResults(prefix='${PREFIX}', genomicState=GenomicState.Hsapiens.UCSC.hg19.knownGene$fullGenome)"
# Move log files into the logs directory
mv ${WDIR}/${sname}.* ${WDIR}/${outdir}/logs/
echo "**** Job ends ****"
date
EOF
call="qsub .${sname}.sh"
echo $call
$call