33
|
1 #echo $1 $2 $3 $4 $5 $6 $7 $8 $9 ${10} ${11} ${12} ${13} ${14} ${15} ${16} ${17} ${18}
|
32
|
2
|
34
|
3 #get tool data and tool install directories
|
|
4 tooldir=$(cut -d';' -f1 <<< ${12})
|
|
5 tooldata=$(cut -d';' -f2 <<< ${12})
|
|
6
|
2
|
7 #create temp directory for row and col order and dendro files.
|
34
|
8 tdir=$tooldata/$(date +%y%m%d%M%S)
|
2
|
9 echo $tdir
|
|
10 mkdir $tdir
|
32
|
11
|
2
|
12 #run R to cluster matrix
|
34
|
13 output="$(R --slave --vanilla --file=$tooldir/CHM.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)"
|
2
|
14 rc=$?;
|
|
15 if [ $rc != 0 ]
|
|
16 then
|
|
17 echo $output;
|
|
18 if [ `echo "$output" | grep -c "Inf in foreign function call"` -gt 0 ]
|
|
19 then
|
|
20 echo "";
|
|
21 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.";
|
33
|
22 echo "This error may also be caused when a covariate file has inadvertently been selected as an Input Matrix. Check your Input Matrix entry.";
|
2
|
23 fi
|
|
24 exit $rc;
|
|
25 fi
|
|
26
|
|
27 #there are a variable number of triplicate parameters for classification bars
|
|
28 count=0
|
|
29 classifications=''
|
|
30
|
|
31 #if row cut was done, add that autogenerated classification
|
33
|
32 if [ ${13} -gt 1 ]
|
2
|
33 then
|
|
34 classifications="Class $tdir/ROfile.txt.cut row_categorical"
|
|
35 fi
|
|
36
|
|
37 #if col cut was done, add that autogenerated classification
|
33
|
38 if [ ${14} -gt 1 ]
|
2
|
39 then
|
|
40 classifications="$classifications Class $tdir/COfile.txt.cut col_categorical"
|
|
41 fi
|
|
42
|
|
43 #now add the user provided classification files
|
|
44 for i in "$@"; do
|
33
|
45 if [ $count -gt 16 ]
|
2
|
46 then
|
|
47 classifications=$classifications' '$i
|
|
48 fi
|
|
49 count=$((count+1))
|
|
50 done
|
33
|
51 echo "classifications " $classifications
|
|
52 echo "${11} " ${11}
|
2
|
53 #call java program to generate NGCHM viewer files.
|
34
|
54 java -jar $tooldir/GalaxyMapGen.jar "${1}" "${2}" "${3}" DataLayer1 $4 linear ${15} ${16} $5 $6 $7 $tdir/ROfile.txt $tdir/RDfile.txt $8 $9 ${10} $tdir/COfile.txt $tdir/CDfile.txt ${11} $classifications
|
2
|
55 #clean up tempdir
|
|
56 rm -rf $tdir
|