annotate heatmap_advanced.sh @ 9:2637090c040c draft default tip

Uploaded
author insilico-bob
date Thu, 29 Apr 2021 17:17:57 +0000
parents c1be063b2454
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
6
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
1 #echo "1: " $1 " 2: " $2 " 3: " $3 " 4: " $4 " 5: " $5 " 6: " $6 " 7: " $7 " 8: " $8 " 9: " $9 " 10: " ${10}
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
2 #echo "11: " ${11} " 12: " ${12} 13: " ${13} 14: " ${14} " 15: " ${15} " 16: " ${16} " 17: " ${17} " 18: " ${18} " 19: " ${19} " 20: " ${20}
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
3 #echo "21: "${21}" 22: "${22}" 23: "${23}" 24: "${24}" 25: "${25}" 26: "${26}" 27: "${27}" 28: "${28}" 29: "${29}" 30: "${30}
0
8893ea2915cc Initial Version of Advanced Heat Map Tool
insilico-bob
parents:
diff changeset
4
6
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
5 #Count total number of parameters, dataLayer parameters, and classification parameters
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
6 parmSize=0
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
7 classSize=0
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
8 dataLayerSize=0
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
9 attribSize=0
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
10 for i in "$@"; do
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
11 currParm=$(cut -d'|' -f1 <<< $i)
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
12 parmSize=$((parmSize+1))
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
13 if [ $currParm = "classification" ]
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
14 then
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
15 classSize=$((classSize+1))
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
16 fi
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
17 if [ $currParm = "matrix_files" ]
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
18 then
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
19 dataLayerSize=$((dataLayerSize+1))
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
20 fi
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
21 if [ $currParm = "attribute" ]
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
22 then
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
23 attribSize=$((attribSize+1))
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
24 fi
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
25 done
2
19382473a76b Uploaded
insilico-bob
parents: 1
diff changeset
26
6
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
27 if [ $dataLayerSize -lt 1 ]
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
28 then
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
29 noDataLayer="ERROR: No Heat Map Matrices provided. Please add at least one Heat Map Matrix to your request and try again."
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
30 echo $noDataLayer
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
31 exit $noDataLayer
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
32 fi
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
33
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
34 #Get tool data and tool install directories
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
35 tooldir=$1
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
36 tooldata=$2
0
8893ea2915cc Initial Version of Advanced Heat Map Tool
insilico-bob
parents:
diff changeset
37 #create temp directory for row and col order and dendro files.
2
19382473a76b Uploaded
insilico-bob
parents: 1
diff changeset
38 tdir=$tooldata/$(date +%y%m%d%M%S)
0
8893ea2915cc Initial Version of Advanced Heat Map Tool
insilico-bob
parents:
diff changeset
39 mkdir $tdir
6
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
40 #echo "tdir: "$tdir
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
41
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
42 #Extract parameters for row and column order and dendro files
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
43 rowOrderFile=$tdir/ROfile.txt
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
44 rowDendroFile=$tdir/RDfile.txt
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
45 colOrderFile=$tdir/COfile.txt
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
46 colDendroFile=$tdir/CDfile.txt
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
47 rowOrderJson='"order_file": "'$rowOrderFile'",'
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
48 rowDendroJson='"dendro_file": "'$rowDendroFile'",'
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
49 colOrderJson='"order_file": "'$colOrderFile'",'
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
50 colDendroJson='"dendro_file": "'$colDendroFile'",'
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
51
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
52 #BEGIN: Construct JSON for all non-repeating parameters
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
53 parmJson='{'
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
54 rowConfigJson='"row_configuration": {'
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
55 colConfigJson='"col_configuration": {'
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
56
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
57 ctr=0
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
58 for i in "$@"; do
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
59 if [ $ctr -gt 1 ]
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
60 then
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
61 currParm=$(cut -d'|' -f1 <<< $i)
7
c5489978071a Uploaded
insilico-bob
parents: 6
diff changeset
62 if [ $currParm != "matrix_files" ] && [ $currParm != "row_configuration" ] && [ $currParm != "col_configuration" ] && [ $currParm != "classification" ] && [ $currParm != "attribute" ] && [ $currParm != "chm_name" ]
6
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
63 then
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
64 #Parse pipe-delimited parameter parameter
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
65 parmJson=$parmJson' "'$(cut -d'|' -f1 <<< $i)'":"'$(cut -d'|' -f2 <<< $i)'",'
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
66 fi
7
c5489978071a Uploaded
insilico-bob
parents: 6
diff changeset
67 if [ $currParm = "chm_name" ]
c5489978071a Uploaded
insilico-bob
parents: 6
diff changeset
68 then
c5489978071a Uploaded
insilico-bob
parents: 6
diff changeset
69 currVal=$(cut -d'|' -f2 <<< $i)
c5489978071a Uploaded
insilico-bob
parents: 6
diff changeset
70 currEdit=$(echo "$currVal" | sed 's/\//_/g')
c5489978071a Uploaded
insilico-bob
parents: 6
diff changeset
71 parmJson=$parmJson' "'$(cut -d'|' -f1 <<< $i)'":"'$currEdit'",'
c5489978071a Uploaded
insilico-bob
parents: 6
diff changeset
72 fi
6
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
73 if [ $currParm = "row_configuration" ]
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
74 then
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
75 rowOrder=$(cut -d'|' -f3 <<< $i)
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
76 rowDistance=$(cut -d'|' -f5 <<< $i)
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
77 rowAgglomeration=$(cut -d'|' -f7 <<< $i)
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
78 rowCuts=$(cut -d'|' -f9 <<< $i)
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
79 rowLabels=$(cut -d'|' -f11 <<< $i)
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
80 rowDataTypeJson='"'$(cut -d'|' -f10 <<< $i)'":["'$rowLabels'"],'
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
81 rowCutType=$(cut -d'|' -f16 <<< $i)
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
82 rowTopItemsJson=''
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
83 rowTopItems=$(cut -d'|' -f13 <<< $i)
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
84 if [ $rowTopItems != "None" ] && [ $rowTopItems != "" ]
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
85 then
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
86 rowTopItemsJson='"'$(cut -d'|' -f12 <<< $i)'": ['
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
87 rowTopItems=${rowTopItems//,/'","'}
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
88 rowTopItemsJson=$rowTopItemsJson'"'$rowTopItems'"],'
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
89 fi
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
90 rowCutsJson=''
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
91 if [ $rowCutType != "none" ]
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
92 then
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
93 cutValues=$(cut -d'|' -f15 <<< $i)
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
94 if [ $cutValues != "None" ] && [ $cutValues != "0" ]
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
95 then
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
96 if [ $rowCutType = "treecuts" ]
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
97 then
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
98 rowCutsJson=$rowCutsJson'"tree_cuts": "'$cutValues'",'
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
99 rowCutsJson=$rowCutsJson'"cut_width": "5",'
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
100 fi
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
101 if [ $rowCutType = "positional" ]
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
102 then
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
103 rowCutErrorVal=0
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
104 [[ $cutValues != ?(-)+([0-9,]) ]] && rowCutErrorVal=$((rowCutErrorVal+1))
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
105 if [ $rowCutErrorVal -gt 0 ]
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
106 then
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
107 echo "GALAXY PARAMETER WARNING: Non-numeric values found for Row Fixed Gap Locations. Ignoring parameter value: "$cutValues
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
108 else
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
109 rowCutsJson=$rowCutsJson'"cut_locations": ['$cutValues'],'
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
110 rowCutsJson=$rowCutsJson'"cut_width": "5",'
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
111 fi
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
112 fi
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
113 fi
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
114 fi
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
115 rowConfigJson=$rowConfigJson$rowDataTypeJson$rowCutsJson$rowTopItemsJson
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
116 if [ $rowOrder = 'Hierarchical' ]
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
117 then
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
118 rowConfigJson=$rowConfigJson$rowOrderJson$rowDendroJson
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
119 fi
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
120 rowConfigJson=$rowConfigJson' "'$(cut -d'|' -f2 <<< $i)'":"'$(cut -d'|' -f3 <<< $i)'","'$(cut -d'|' -f4 <<< $i)'":"'$(cut -d'|' -f5 <<< $i)'","'$(cut -d'|' -f6 <<< $i)'":"'$(cut -d'|' -f7 <<< $i)'","'$(cut -d'|' -f17 <<< $i)'":"'$(cut -d'|' -f18 <<< $i)'","'$(cut -d'|' -f19 <<< $i)'":"'$(cut -d'|' -f20 <<< $i)'"},'
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
121 fi
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
122 if [ $currParm = "col_configuration" ]
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
123 then
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
124 colOrder=$(cut -d'|' -f3 <<< $i)
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
125 colDistance=$(cut -d'|' -f5 <<< $i)
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
126 colAgglomeration=$(cut -d'|' -f7 <<< $i)
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
127 colCuts=$(cut -d'|' -f9 <<< $i)
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
128 colLabels=$(cut -d'|' -f11 <<< $i)
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
129 colDataTypeJson='"'$(cut -d'|' -f10 <<< $i)'":["'$colLabels'"],'
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
130 colCutType=$(cut -d'|' -f16 <<< $i)
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
131 colTopItemsJson=''
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
132 colTopItems=$(cut -d'|' -f13 <<< $i)
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
133 if [ $colTopItems != "None" ] && [ $colTopItems != "" ]
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
134 then
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
135 colTopItemsJson='"'$(cut -d'|' -f12 <<< $i)'": ['
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
136 colTopItems=${colTopItems//,/'","'}
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
137 colTopItemsJson=$colTopItemsJson'"'$colTopItems'"],'
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
138 fi
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
139 colCutsJson=''
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
140 if [ $colCutType != "none" ]
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
141 then
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
142 cutValues=$(cut -d'|' -f15 <<< $i)
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
143 if [ $cutValues != "None" ] && [ $cutValues != "0" ]
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
144 then
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
145 if [ $colCutType = "treecuts" ]
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
146 then
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
147 colCutsJson=$colCutsJson'"tree_cuts": "'$cutValues'",'
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
148 colCutsJson=$colCutsJson'"cut_width": "5",'
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
149 fi
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
150 if [ $colCutType = "positional" ]
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
151 then
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
152 colCutErrorVal=0
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
153 [[ $cutValues != ?(-)+([0-9,]) ]] && colCutErrorVal=$((colCutErrorVal+1))
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
154 if [ $colCutErrorVal -gt 0 ]
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
155 then
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
156 echo "GALAXY PARAMETER WARNING: Non-numeric values found for Column Fixed Gap Locations. Ignoring parameter value: "$cutValues
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
157 else
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
158 colCutsJson=$colCutsJson'"cut_locations": ['$cutValues'],'
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
159 colCutsJson=$colCutsJson'"cut_width": "5",'
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
160 fi
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
161 fi
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
162 fi
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
163 fi
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
164 colConfigJson=$colConfigJson$colDataTypeJson$colCutsJson$colTopItemsJson
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
165 if [ $colOrder = 'Hierarchical' ]
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
166 then
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
167 colConfigJson=$colConfigJson$colOrderJson$colDendroJson
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
168 fi
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
169 colConfigJson=$colConfigJson' "'$(cut -d'|' -f2 <<< $i)'":"'$(cut -d'|' -f3 <<< $i)'","'$(cut -d'|' -f4 <<< $i)'":"'$(cut -d'|' -f5 <<< $i)'","'$(cut -d'|' -f6 <<< $i)'":"'$(cut -d'|' -f7 <<< $i)'","'$(cut -d'|' -f17 <<< $i)'":"'$(cut -d'|' -f18 <<< $i)'","'$(cut -d'|' -f19 <<< $i)'":"'$(cut -d'|' -f20 <<< $i)'"},'
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
170 fi
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
171 fi
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
172 ctr=$((ctr+1))
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
173 done
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
174
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
175 #END: Construct JSON for all non-repeating parameters
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
176 #echo "rowOrder: "$rowOrder
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
177 #echo "rowDistance: "$rowDistance
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
178 #echo "rowAgglomeration: "$rowAgglomeration
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
179 #echo "rowCuts: "$rowCuts
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
180 #echo "rowLabels: "$rowLabels
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
181 #echo "ROW CONFIG JSON: "$rowConfigJson
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
182 #echo "colOrder: "$colOrder
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
183 #echo "colDistance: "$colDistance
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
184 #echo "colAgglomeration: "$colAgglomeration
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
185 #echo "colCuts: "$colCuts
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
186 #echo "colLabels: "$colLabels
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
187 #echo "COL CONFIG JSON: "$colConfigJson
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
188
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
189 #BEGIN: Construct JSON for data layers
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
190 matrixJson='"matrix_files": [ '
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
191 inputMatrix=''
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
192 dataLayerIter=0
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
193 dataLayerNames=''
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
194 for i in "$@"; do
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
195 currParm=$(cut -d'|' -f1 <<< $i)
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
196 if [ $currParm = "matrix_files" ]
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
197 then
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
198 if [ $dataLayerIter -lt 1 ]
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
199 then
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
200 inputMatrix=$(cut -d'|' -f3 <<< $i)
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
201 fi
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
202 currMatrixName=$(cut -d'|' -f5 <<< $i)
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
203 dataLayerIter=$((dataLayerIter+1))
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
204 if [[ $dataLayerNames =~ $currMatrixName ]]
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
205 then
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
206 currMatrixName=$currMatrixName$dataLayerIter
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
207 fi
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
208 dataLayerNames=$dataLayerNames$currMatrixName
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
209 colorPref=$(cut -d'|' -f16 <<< $i)
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
210 colorMapJson=''
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
211 if [ $colorPref = "defined" ]
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
212 then
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
213 #validations to place leading zero on first breakpoint (if necessary)
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
214 b1=$(cut -d'|' -f20 <<< $i)
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
215 b1first=$(cut -d'.' -f1 <<< $b1)
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
216 if [ $b1first = "-" ]
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
217 then
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
218 b1="-0."$(cut -d'.' -f2 <<< $b1)
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
219 fi
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
220 if [ "$b1first" = "" ]
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
221 then
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
222 b1="0"$b1
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
223 fi
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
224 #validations to place leading zero on second breakpoint (if necessary)
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
225 b2=$(cut -d'|' -f21 <<< $i)
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
226 b2first=$(cut -d'.' -f1 <<< $b2)
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
227 if [ $b2first = "-" ]
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
228 then
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
229 b2="-0."$(cut -d'.' -f2 <<< $b2)
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
230 fi
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
231 if [ "$b2first" = "" ]
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
232 then
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
233 b2="0"$b2
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
234 fi
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
235 #validations to place leading zero on third breakpoint (if necessary)
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
236 b3=$(cut -d'|' -f22 <<< $i)
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
237 b3first=$(cut -d'.' -f1 <<< $b3)
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
238 if [ $b3first = "-" ]
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
239 then
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
240 b3="-0."$(cut -d'.' -f2 <<< $b3)
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
241 fi
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
242 if [ "$b3first" = "" ]
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
243 then
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
244 b3="0"$b3
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
245 fi
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
246 #validation to ensure that all entered breakpoints are numeric values
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
247 regExp='^[+-]?([0-9]+\.?|[0-9]*\.[0-9]+)$'
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
248 if [[ $b1 =~ $regExp ]] && [[ $b2 =~ $regExp ]] && [[ $b3 =~ $regExp ]]
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
249 then
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
250 colorMapJson=$colorMapJson'"color_map": {"colors": ["'$(cut -d'|' -f17 <<< $i)'","'$(cut -d'|' -f18 <<< $i)'","'$(cut -d'|' -f19 <<< $i)'"],'
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
251 colorMapJson=$colorMapJson'"thresholds": ['$b1','$b2','$b3'],'
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
252 colorMapJson=$colorMapJson'"missing":"'$(cut -d'|' -f23 <<< $i)'"},'
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
253 else
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
254 echo "GALAXY PARAMETER WARNING: Not all user-defined breakpoints are numbers. Defined breakpoints and colors will be ignored."
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
255 fi
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
256 fi
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
257 #Parse pipe-delimited parameter parameter
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
258 matrixJson=$matrixJson' {'$colorMapJson'"'$(cut -d'|' -f2 <<< $i)'":"'$(cut -d'|' -f3 <<< $i)'","'$(cut -d'|' -f4 <<< $i)'":"'$currMatrixName'","'$(cut -d'|' -f6 <<< $i)'":"'$(cut -d'|' -f7 <<< $i)'","'$(cut -d'|' -f8 <<< $i)'":"'$(cut -d'|' -f9 <<< $i)'","'$(cut -d'|' -f10 <<< $i)'":"'$(cut -d'|' -f11 <<< $i)'","'$(cut -d'|' -f12 <<< $i)'":"'$(cut -d'|' -f13 <<< $i)'","'$(cut -d'|' -f14 <<< $i)'":"'$(cut -d'|' -f15 <<< $i)'"}'
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
259 if [ $dataLayerIter -lt $dataLayerSize ]
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
260 then
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
261 matrixJson=$matrixJson','
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
262 fi
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
263 fi
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
264 done
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
265 matrixJson=$matrixJson"],"
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
266 #END: Construct JSON for data layers
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
267 #echo "DATA LAYER JSON: "$matrixJson
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
268 #echo "INPUT MATRIX: "$inputMatrix
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
269
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
270 #BEGIN: Construct JSON for attributes
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
271 attribJson='"chm_attributes": [ '
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
272 attribIter=0
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
273 for i in "$@"; do
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
274 currParm=$(cut -d'|' -f1 <<< $i)
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
275 if [ $currParm = "attribute" ]
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
276 then
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
277 attribIter=$((attribIter+1))
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
278 attribParam=$(cut -d'|' -f2 <<< $i)
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
279 #Parse pipe-delimited 2-part data layer parameter
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
280 attribJson=$attribJson' {"'$(cut -d':' -f1 <<< $attribParam)'":"'$(cut -d':' -f2 <<< $attribParam)'"}'
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
281 if [ $attribIter -lt $attribSize ]
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
282 then
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
283 attribJson=$attribJson','
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
284 fi
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
285 fi
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
286 done
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
287 attribJson=$attribJson'],'
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
288 #END: Construct JSON for attributes
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
289 #echo "ATTRIB JSON: "$attribJson
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
290
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
291 #BEGIN: Construct JSON for classification files
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
292 classJson='"classification_files": [ '
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
293 colCutClass=''
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
294 rowCutClass=''
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
295 if [ $rowCuts -gt 1 ]
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
296 then
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
297 rowCutClass='{"name": "Class", "path": "'$tdir'/ROfile.txt.cut","position": "row", "color_map": {"type": "discrete"}, "bar_type": "color_plot"}'
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
298 fi
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
299
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
300 if [ $colCuts -gt 1 ]
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
301 then
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
302 if [ $rowCuts -gt 1 ]
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
303 then
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
304 rowCutClass=$rowCutClass','
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
305 fi
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
306 colCutClass='{"name": "Class", "path": "'$tdir'/COfile.txt.cut","position": "column", "color_map": {"type": "discrete"}, "bar_type": "color_plot"}'
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
307 if [ $classSize -gt 0 ]
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
308 then
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
309 colCutClass=$colCutClass','
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
310 fi
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
311 else
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
312 if [ $rowCuts -gt 1 ] && [ $classSize -gt 0 ]
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
313 then
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
314 rowCutClass=$rowCutClass','
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
315 fi
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
316 fi
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
317
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
318 classJson=$classJson$rowCutClass$colCutClass
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
319 classIter=0
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
320 for i in "$@"; do
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
321 currParm=$(cut -d'|' -f1 <<< $i)
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
322 if [ $currParm = "classification" ]
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
323 then
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
324 classIter=$((classIter+1))
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
325 className=$(cut -d'|' -f3 <<< $i)
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
326 #Parse pipe-delimited 3-part classification bar parameter
7
c5489978071a Uploaded
insilico-bob
parents: 6
diff changeset
327 if [[ -z "$className" ]]; then
c5489978071a Uploaded
insilico-bob
parents: 6
diff changeset
328 className="covar"$classIter
c5489978071a Uploaded
insilico-bob
parents: 6
diff changeset
329 fi
c5489978071a Uploaded
insilico-bob
parents: 6
diff changeset
330 classJson=$classJson' {"'$(cut -d'|' -f2 <<< $i)'":"'$className'","'$(cut -d'|' -f4 <<< $i)'":"'$(cut -d'|' -f5 <<< $i)'","'$(cut -d'|' -f8 <<< $i)'":"'$(cut -d'|' -f9 <<< $i)'","'$(cut -d'|' -f12 <<< $i)'":"'$(cut -d'|' -f13 <<< $i)'","'$(cut -d'|' -f14 <<< $i)'":"'$(cut -d'|' -f15 <<< $i)'"'
6
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
331 classCat=$(cut -d'|' -f7 <<< $i)
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
332 classColorType=$(cut -d'_' -f2 <<< $classCat)
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
333 classJson=$classJson','
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
334 classHeight=$(cut -d'|' -f11 <<< $i)
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
335 heightErrorVal=0
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
336 [[ $classHeight != ?(-)+([0-9]) ]] && heightErrorVal=$((heightErrorVal+1))
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
337 if [ $heightErrorVal -gt 0 ]
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
338 then
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
339 echo 'GALAXY PARAMETER WARNING: Non-numeric values found for covariate bar ('$className') height. Height value ignored and default of 15 used: '$classHeight
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
340 else
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
341 classJson=$classJson'"height": "'$classHeight'",'
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
342 fi
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
343 classJson=$classJson' "position":"'$(cut -d'_' -f1 <<< $classCat)'","color_map": {"type":"'$classColorType'"}}'
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
344 if [ $classIter -lt $classSize ]
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
345 then
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
346 classJson=$classJson','
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
347 fi
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
348 fi
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
349 done
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
350 classJson=$classJson']'
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
351 #END: Construct JSON for classification files
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
352 #echo "CLASSIFICATION JSON: "$classJson
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
353
8
c1be063b2454 Uploaded
insilico-bob
parents: 7
diff changeset
354 #Add build platform JSON for distinction between GenePattern and Galaxy Builders
c1be063b2454 Uploaded
insilico-bob
parents: 7
diff changeset
355 platformJson='"build_platform": "Galaxy",'
c1be063b2454 Uploaded
insilico-bob
parents: 7
diff changeset
356
6
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
357 #Complete construction of Parameter JSON file by adding all JSON sections created above
8
c1be063b2454 Uploaded
insilico-bob
parents: 7
diff changeset
358 parmJson=$parmJson$rowConfigJson$colConfigJson$attribJson$matrixJson$platformJson$classJson
6
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
359 parmJson=$parmJson'}'
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
360 #echo "COMPLETED PARAMETER JSON: "$parmJson
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
361
0
8893ea2915cc Initial Version of Advanced Heat Map Tool
insilico-bob
parents:
diff changeset
362 #run R to cluster matrix
6
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
363 output="$(R --slave --vanilla --file=$tooldir/CHM_Advanced.R --args $inputMatrix $rowOrder $rowDistance $rowAgglomeration $colOrder $colDistance $colAgglomeration $rowOrderFile $colOrderFile $rowDendroFile $colDendroFile $rowCuts $colCuts $rowLabels $colLabels 2>&1)"
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
364 # Check for errors from R step, log them if found, and exit script
0
8893ea2915cc Initial Version of Advanced Heat Map Tool
insilico-bob
parents:
diff changeset
365 rc=$?;
8893ea2915cc Initial Version of Advanced Heat Map Tool
insilico-bob
parents:
diff changeset
366 if [ $rc != 0 ]
8893ea2915cc Initial Version of Advanced Heat Map Tool
insilico-bob
parents:
diff changeset
367 then
8893ea2915cc Initial Version of Advanced Heat Map Tool
insilico-bob
parents:
diff changeset
368 echo $output;
8893ea2915cc Initial Version of Advanced Heat Map Tool
insilico-bob
parents:
diff changeset
369 if [ `echo "$output" | grep -c "Inf in foreign function call"` -gt 0 ]
8893ea2915cc Initial Version of Advanced Heat Map Tool
insilico-bob
parents:
diff changeset
370 then
8893ea2915cc Initial Version of Advanced Heat Map Tool
insilico-bob
parents:
diff changeset
371 echo "";
7
c5489978071a Uploaded
insilico-bob
parents: 6
diff changeset
372 echo "";
c5489978071a Uploaded
insilico-bob
parents: 6
diff changeset
373 echo "R CLUSTERING: Error in clustering the matrix provided (View Details stdout). "
c5489978071a Uploaded
insilico-bob
parents: 6
diff changeset
374 echo "Note: This error can occur when:"
c5489978071a Uploaded
insilico-bob
parents: 6
diff changeset
375 echo " 1. There is invalid numeric data in the matrix provided. Try using Matrix Manipulation tools to fix invalid data.";
c5489978071a Uploaded
insilico-bob
parents: 6
diff changeset
376 echo " 2. There is no variation in a row or column in the matrix. Try a different distance measure or remove rows/columns without variation using Matrix Manipulation tools.";
c5489978071a Uploaded
insilico-bob
parents: 6
diff changeset
377 echo " 3. A covariate file has inadvertently been selected as an Input Matrix. Check your Input Matrix entry.";
0
8893ea2915cc Initial Version of Advanced Heat Map Tool
insilico-bob
parents:
diff changeset
378 fi
8893ea2915cc Initial Version of Advanced Heat Map Tool
insilico-bob
parents:
diff changeset
379 exit $rc;
8893ea2915cc Initial Version of Advanced Heat Map Tool
insilico-bob
parents:
diff changeset
380 fi
1
603f99d9e776 Version 2.2.1 embedded viewer
insilico-bob
parents: 0
diff changeset
381
6
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
382 #Call java program to generate NGCHM viewer files.
1f13d304ddbd Uploaded
insilico-bob
parents: 2
diff changeset
383 java -jar $tooldir/GalaxyMapGen.jar "$parmJson"
0
8893ea2915cc Initial Version of Advanced Heat Map Tool
insilico-bob
parents:
diff changeset
384 #clean up tempdir
8893ea2915cc Initial Version of Advanced Heat Map Tool
insilico-bob
parents:
diff changeset
385 rm -rf $tdir