comparison heatmap_advanced.sh @ 1:603f99d9e776 draft

Version 2.2.1 embedded viewer
author insilico-bob
date Tue, 05 Dec 2017 14:59:26 -0500
parents 8893ea2915cc
children 19382473a76b
comparison
equal deleted inserted replaced
0:8893ea2915cc 1:603f99d9e776
1 echo $1 $2 $3 $4 $5 $6 $7 $8 $9 ${10} ${11} ${12} ${13} ${14} ${15} ${16} ${17} ${18} ${19} 1 #echo "1: " $1
2 2 #echo "2: " $2
3 #run python to validate the input matrix and covariate files (if any) 3 #echo "3: " $3
4 #output="$(python ${11}/mda_heatmap_gen.py $@)" 4 #echo "4: " $4
5 output=$(python ${11}/mda_heatmap_gen.py "$@") 5 #echo "5: " $5
6 rc=$?; 6 #echo "6: " $6
7 echo $output; 7 #echo "7: " $7
8 if [ $rc != 0 ] 8 #echo "8: " $8
9 then 9 #echo "9: " $9
10 exit $rc; 10 #echo "10: " ${10}
11 fi 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}
12 26
13 #create temp directory for row and col order and dendro files. 27 #create temp directory for row and col order and dendro files.
14 tdir=${11}/$(date +%y%m%d%M%S) 28 tdir=${12}/$(date +%y%m%d%M%S)
15 echo $tdir 29 echo $tdir
16 mkdir $tdir 30 mkdir $tdir
17 #run R to cluster matrix 31 #run R to cluster matrix
18 output="$(R --slave --vanilla --file=${11}/CHM_Advanced.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)" 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)"
19 rc=$?; 33 rc=$?;
20 if [ $rc != 0 ] 34 if [ $rc != 0 ]
21 then 35 then
22 echo $output; 36 echo $output;
23 if [ `echo "$output" | grep -c "Inf in foreign function call"` -gt 0 ] 37 if [ `echo "$output" | grep -c "Inf in foreign function call"` -gt 0 ]
24 then 38 then
25 echo ""; 39 echo "";
26 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."; 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.";
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.";
27 fi 42 fi
28 exit $rc; 43 exit $rc;
29 fi 44 fi
30 45
31 #there are a variable number of triplicate parameters for classification bars 46 #there are a variable number of triplicate parameters for classification bars
32 count=0 47 count=0
33 classifications='' 48 classifications=''
34 49
35 #if row cut was done, add that autogenerated classification 50 #if row cut was done, add that autogenerated classification
36 if [ ${12} -gt 1 ] 51 if [ ${13} -gt 1 ]
37 then 52 then
38 classifications="Class $tdir/ROfile.txt.cut row_categorical" 53 classifications="Class $tdir/ROfile.txt.cut row_categorical color_plot"
39 fi 54 fi
40 55
41 #if col cut was done, add that autogenerated classification 56 #if col cut was done, add that autogenerated classification
42 if [ ${13} -gt 1 ] 57 if [ ${14} -gt 1 ]
43 then 58 then
44 classifications="$classifications Class $tdir/COfile.txt.cut col_categorical" 59 classifications="$classifications Class $tdir/COfile.txt.cut col_categorical color_plot"
45 fi 60 fi
46 61
47 #now add the user provided classification files 62 #now add the user provided classification files
48 for i in "$@"; do 63 for i in "$@"; do
49 if [ $count -gt 15 ] 64 if [ $count -gt 20 ]
50 then 65 then
66 # echo "class entry: " $i
51 classifications=$classifications' '$i 67 classifications=$classifications' '$i
52 fi 68 fi
53 count=$((count+1)) 69 count=$((count+1))
54 done 70 done
71 #echo "classifications: " $classifications
72
55 #call java program to generate NGCHM viewer files. 73 #call java program to generate NGCHM viewer files.
56 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} "${16}" $classifications 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
57 #clean up tempdir 75 #clean up tempdir
58 rm -rf $tdir 76 rm -rf $tdir