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