-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbatchCPCStepTwo.sh
executable file
·105 lines (81 loc) · 2.4 KB
/
batchCPCStepTwo.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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
#!/bin/bash
if [ $# -lt 2 ]; then
echo "$0 manifestFile SettingFile[if not found, uses \${SETTINGPATH}/\$SettingFile] [scriptureEbedDir=scriptureEbed]"
echo "\${SETTINGPATH}=${SETTINGPATH}"
if [[ ${SETTINGPATH} != "" ]]; then
if [ -e ${SETTINGPATH} ]; then
echo ""
echo "setting files available in path are:"
ls ${SETTINGPATH}
fi
fi
echo ""
echo make a manifest file containing the folder name and the renaming of the transcripts
echo e.g.,
echo Mmu_Oocyte Mmu.Oocyte.GSE14605
echo Mmu_DicerKO_Oocyte Mmu.DicerKOOocyte.GSE14605
echo Mmu_AgoKO_Oocyte Mmu.AgoKOOocyte.GSE14605
echo Mmu_4_cell_blastomere Mmu.4cellblastomere.GSE1460
exit
fi
if [ $# -gt 2 ]; then
outputDir=$3
else
outputDir=scriptureEbed
fi
manifestFile=$1
settingFile=$2
runCPC=$3
if [ -e $settingFile ]; then
source $settingFile
else
if [ -e ./$settingFile ]; then
source ./$settingFile
else
if [ -e $SETTINGPATH/$settingFile ]; then
echo "using $SETTINGPATH/$settingFile"
source $SETTINGPATH/$settingFile
else
echo "$settingFile not found. Not in current dir not in \$SETTINGPATH=$SETTINGPATH"
exit
fi
fi
fi
:<<'COMMENT'
manifest.txt:
setting.shvar
folder[\t]transcriptRenamePrefix
e.g.,
Mmu_Oocyte Mmu.Oocyte.GSE14605
Mmu_DicerKO_Oocyte Mmu.DicerKOOocyte.GSE14605
Mmu_AgoKO_Oocyte Mmu.AgoKOOocyte.GSE14605
Mmu_4_cell_blastomere Mmu.4cellblastomere.GSE14605
COMMENT
folders=(`cuta.py -f1 $manifestFile`)
prefices=(`cuta.py -f2 $manifestFile`)
numFolders=${#folders[@]}
numPrefices=${#prefices[@]}
if [[ $numFolders != $numPrefices ]]; then
echo "unequal number of folders and prefices specified. abort"
exit
fi
echo $numFolders of folders specified [ ${folders[@]} ]
echo $numPrefices of prefices specified [ ${prefices[@]} ]
for((i=0;i<$numFolders;i++)) do
folder=${folders[$i]}
prefix=${prefices[$i]}
echo working on $folder with prefix $prefix
cd $outputDir
cd notCoveredBy
for ncb in ${NOTCOVEREDBY[@]}; do
ncbbn=`basename $ncb`
#ncbbnNoExt=${ncbbn/.ebed/}
ncbbnNoExt=`removeExt.sh $ncbbn`
bedpath=$prefix.notCoveredBy$ncbbnNoExt.exonCountGe$blockCountLB.totLenGe$totLenLB.ebed
cpcpath=$prefix.notCoveredBy$ncbbnNoExt.exonCountGe$blockCountLB.totLenGe$totLenLB/CPC
cpcsummarypath=$prefix.notCoveredBy$ncbbnNoExt.exonCountGe$blockCountLB.totLenGe$totLenLB/CPCSummary
bsub CPCStepTwoSummarize.sh $cpcpath $cpcsummarypath -1 $bedpath
done
cd ..
cd ..
done