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
|
|
27 #create temp directory for row and col order and dendro files.
|
1
|
28 tdir=${12}/$(date +%y%m%d%M%S)
|
0
|
29 echo $tdir
|
|
30 mkdir $tdir
|
|
31 #run R to cluster matrix
|
1
|
32 output="$(R --slave --vanilla --file=${12}/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
|
33 rc=$?;
|
|
34 if [ $rc != 0 ]
|
|
35 then
|
|
36 echo $output;
|
|
37 if [ `echo "$output" | grep -c "Inf in foreign function call"` -gt 0 ]
|
|
38 then
|
|
39 echo "";
|
|
40 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
|
41 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
|
42 fi
|
|
43 exit $rc;
|
|
44 fi
|
1
|
45
|
0
|
46 #there are a variable number of triplicate parameters for classification bars
|
|
47 count=0
|
|
48 classifications=''
|
|
49
|
|
50 #if row cut was done, add that autogenerated classification
|
1
|
51 if [ ${13} -gt 1 ]
|
0
|
52 then
|
1
|
53 classifications="Class $tdir/ROfile.txt.cut row_categorical color_plot"
|
0
|
54 fi
|
|
55
|
|
56 #if col cut was done, add that autogenerated classification
|
1
|
57 if [ ${14} -gt 1 ]
|
0
|
58 then
|
1
|
59 classifications="$classifications Class $tdir/COfile.txt.cut col_categorical color_plot"
|
0
|
60 fi
|
|
61
|
|
62 #now add the user provided classification files
|
|
63 for i in "$@"; do
|
1
|
64 if [ $count -gt 20 ]
|
0
|
65 then
|
1
|
66 # echo "class entry: " $i
|
0
|
67 classifications=$classifications' '$i
|
|
68 fi
|
|
69 count=$((count+1))
|
|
70 done
|
1
|
71 #echo "classifications: " $classifications
|
|
72
|
0
|
73 #call java program to generate NGCHM viewer files.
|
1
|
74 java -jar ${12}/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
|
75 #clean up tempdir
|
|
76 rm -rf $tdir
|