comparison heatmap.sh @ 33:0097750ad7ad draft

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