-
Notifications
You must be signed in to change notification settings - Fork 2
/
buildAnnotation.sh
executable file
·96 lines (78 loc) · 2.28 KB
/
buildAnnotation.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
#!/bin/bash
if [ $# -lt 4 ]; then
echo "$0 friendlyName outputDir setting [ [listOFBeds(ending in list)OrBedFiles] ... ]"
echo "\${SETTINGPATH}=${SETTINGPATH}"
if [[ ${SETTINGPATH} != "" ]]; then
if [ -e ${SETTINGPATH} ]; then
echo ""
echo "setting files available in setting path are:"
ls ${SETTINGPATH}/*.shvar
echo "list files available in setting path are:"
ls ${SETTINGPATH}/*.list
fi
fi
exit
fi
friendlyName=$1
outputDir=$2
settingFile=$3
outputDir=`abspath.py $outputDir`
if [ -e $settingFile ]; then
source $settingFile
else
if [ -e ./$settingFile ]; then
source ./$settingFile
else
if [ -e $SETTINGPATH/$settingFile ]; then
echo "using $SETTINGPATH/$filename"
source $SETTINGPATH/$settingFile
else
echo "$settingFile not found. Not in current dir not in \$SETTINGPATH=$SETTINGPATH"
exit
fi
fi
fi
if [ -e $outputDir ]; then
rm -R $outputDir
fi
mkdir.py $outputDir
shift
shift
shift
while [ $# -gt 0 ]; do
filename=$1
extension=`getExt.sh $filename`
if [[ $extension == "list" ]]; then
if [ -e $filename ]; then
filenames=(`cat $filename`)
else
if [ -e ./$filename ]; then
filenames=(`cat ./$filename`)
else
if [ -e $SETTINGPATH/$filename ]; then
echo "using $SETTINGPATH/$filename"
filenames=(`cat $SETTINGPATH/$filename`)
else
echo "$filename not found. Not in current dir not in \$SETTINGPATH=$SETTINGPATH"
exit
fi
fi
fi
echo "loading bed file listed in $filename"
for filename in ${filenames[@]}; do
echo -e "\tadding bed file $filename"
cat $filename >> $outputDir/combined.ebed
done
else
echo "adding bed file $filename"
cat $filename >> $outputDir/combined.ebed
fi
shift
done
#now easyCluster
echo "easy cluster on combined.ebed"
easyClusterGenesOnEbed.py --not-append-filename-to-combined-name --transcript-exon-number-lower-bound $transcriptExonNumberLowerBound --splice-site-align-lower-bound $spliceSiteAlignLowerBound $strandwareFlag --use-friendly-name $friendlyName $forceNumberOfDigits $outputDir/combined.friendlymap --randomize-color --add-header $friendlyName "$friendlyName Track" itemRgb/On+visibility/full $outputDir/combined.ebed > $outputDir/combined.clustered.ebed
#strandwareFlag=--strand-aware
#spliceSiteAlignLowerBound=1
#transcriptExonNumberLowerBound=0
#forceNumberOfDigits=8