1
|
1 #echo "1: " $1
|
|
2 #echo "2: " $2
|
|
3 #echo "3: " $3
|
|
4 #echo "4: " $4
|
|
5 #echo "5: " $5
|
|
6 #echo "6: " $6
|
|
7 #echo "7: " $7
|
|
8 #echo "8: " $8
|
|
9 #echo "9: " $9
|
|
10 #echo "10: " ${10}
|
|
11 #echo "11: " ${11}
|
|
12 #echo "12: " ${12}
|
|
13 #echo "13: " ${13}
|
|
14 #echo "14: " ${14}
|
|
15 #echo "15: " ${15}
|
|
16 #echo "16: " ${16}
|
|
17 #echo "17: " ${17}
|
|
18 #echo "18: " ${18}
|
|
19 #echo "19: " ${19}
|
|
20 #echo "20: " ${20}
|
|
21 #echo "21: " ${21}
|
|
22 #echo "22: " ${22}
|
|
23 #echo "23: " ${23}
|
|
24 #echo "23: " ${24}
|
|
25 #echo $1 $2 $3 $4 $5 $6 $7 $8 $9 ${10} ${11} ${12} ${13} ${14} ${15} ${16} ${17} ${18} ${19} ${20} ${21} ${22} ${23}
|
0
|
26
|
2
|
27 #get tool data and tool install directories
|
|
28 tooldir=$(cut -d';' -f1 <<< ${12})
|
|
29 tooldata=$(cut -d';' -f2 <<< ${12})
|
|
30
|
0
|
31 #create temp directory for row and col order and dendro files.
|
2
|
32 tdir=$tooldata/$(date +%y%m%d%M%S)
|
0
|
33 echo $tdir
|
|
34 mkdir $tdir
|
|
35 #run R to cluster matrix
|
2
|
36 output="$(R --slave --vanilla --file=$tooldir/CHM_Advanced.R --args $4 $5 $6 $7 $8 $9 ${10} $tdir/ROfile.txt $tdir/COfile.txt $tdir/RDfile.txt $tdir/CDfile.txt ${13} ${14} ${15} ${16} 2>&1)"
|
0
|
37 rc=$?;
|
|
38 if [ $rc != 0 ]
|
|
39 then
|
|
40 echo $output;
|
|
41 if [ `echo "$output" | grep -c "Inf in foreign function call"` -gt 0 ]
|
|
42 then
|
|
43 echo "";
|
|
44 echo "Note: This error can occur when there is no variation in a row or column. Try a different distance measure or remove rows/columns without variation.";
|
1
|
45 echo "This error may also be caused when a covariate file has inadvertently been selected as an Input Matrix. Check your Input Matrix entry.";
|
0
|
46 fi
|
|
47 exit $rc;
|
|
48 fi
|
1
|
49
|
0
|
50 #there are a variable number of triplicate parameters for classification bars
|
|
51 count=0
|
|
52 classifications=''
|
|
53
|
|
54 #if row cut was done, add that autogenerated classification
|
1
|
55 if [ ${13} -gt 1 ]
|
0
|
56 then
|
1
|
57 classifications="Class $tdir/ROfile.txt.cut row_categorical color_plot"
|
0
|
58 fi
|
|
59
|
|
60 #if col cut was done, add that autogenerated classification
|
1
|
61 if [ ${14} -gt 1 ]
|
0
|
62 then
|
1
|
63 classifications="$classifications Class $tdir/COfile.txt.cut col_categorical color_plot"
|
0
|
64 fi
|
|
65
|
|
66 #now add the user provided classification files
|
|
67 for i in "$@"; do
|
1
|
68 if [ $count -gt 20 ]
|
0
|
69 then
|
1
|
70 # echo "class entry: " $i
|
0
|
71 classifications=$classifications' '$i
|
|
72 fi
|
|
73 count=$((count+1))
|
|
74 done
|
1
|
75 #echo "classifications: " $classifications
|
|
76
|
0
|
77 #call java program to generate NGCHM viewer files.
|
2
|
78 java -jar $tooldir/GalaxyMapGen.jar "${1}" "${2}" "${3}" DataLayer1 $4 linear ${15} ${16} $5 $6 $7 $tdir/ROfile.txt $tdir/RDfile.txt "${17}" "${19}" $8 $9 ${10} $tdir/COfile.txt $tdir/CDfile.txt "${18}" "${20}" ${11} "${21}" $classifications
|
0
|
79 #clean up tempdir
|
|
80 rm -rf $tdir
|