forked from albertwcheng/RNASeqMappingScripts3
-
Notifications
You must be signed in to change notification settings - Fork 0
/
runMACSOnBowtieFolderJobArgListSE.sh
executable file
·46 lines (27 loc) · 1023 Bytes
/
runMACSOnBowtieFolderJobArgListSE.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
sampleName=$1
paired=$2
targetSam="accepted_hits.sam"
targetBam="accepted_hits.bam"
#according to scripture manual and examples
scriptDir=`pwd`
cd ..
rootDir=`pwd`
bowtieOutputDir=${rootDir}/bowtieOutput
macsOutputDir=${rootDir}/macsOutput
if [ ! -e $macsOutputDir ]; then
mkdir $macsOutputDir
fi
mkdir.py $macsOutputDir/$sampleName
cd $macsOutputDir/$sampleName
format="BAM"
tsize=36
space=25
mfold="10,30"
macs="macs14"
if [ ! -e $bowtieOutputDir/$sampleName/$targetBam ]; then
#target bam file no exist, make it
echo "targert bam file not exist, make it"
samtools view -bS -o $bowtieOutputDir/$sampleName/$targetBam $bowtieOutputDir/$sampleName/$targetSam > $bowtieOutputDir/$sampleName/$targetBam.stdout 2> $bowtieOutputDir/$sampleName/$targetBam.stderr
fi
echo "run macs"
$macs -t $bowtieOutputDir/$sampleName/$targetBam --format=$format --name=$sampleName --tsize=$tsize --wig --space=$space --mfold="$mfold" > $macsOutputDir/$sampleName/macs.stdout 2> $macsOutputDir/$sampleName/macs.stderr