Mercurial > repos > md-anderson-bioinformatics > heat_map_creation
comparison heatmap.sh @ 2:e2b3920e20c1 draft
Uploaded
author | insilico-bob |
---|---|
date | Thu, 26 Jan 2017 09:53:13 -0500 |
parents | |
children | 16593e40c2cd |
comparison
equal
deleted
inserted
replaced
1:aca930d68814 | 2:e2b3920e20c1 |
---|---|
1 echo $1 $2 $3 $4 $5 $6 $7 $8 $9 ${10} ${11} ${12} ${13} ${14} ${15} ${16} ${17} | |
2 #create temp directory for row and col order and dendro files. | |
3 tdir=${11}/$(date +%y%m%d%M%S) | |
4 echo $tdir | |
5 mkdir $tdir | |
6 #run R to cluster matrix | |
7 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)" | |
8 rc=$?; | |
9 if [ $rc != 0 ] | |
10 then | |
11 echo $output; | |
12 if [ `echo "$output" | grep -c "Inf in foreign function call"` -gt 0 ] | |
13 then | |
14 echo ""; | |
15 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."; | |
16 fi | |
17 exit $rc; | |
18 fi | |
19 | |
20 #there are a variable number of triplicate parameters for classification bars | |
21 count=0 | |
22 classifications='' | |
23 | |
24 #if row cut was done, add that autogenerated classification | |
25 if [ ${12} -gt 1 ] | |
26 then | |
27 classifications="Class $tdir/ROfile.txt.cut row_categorical" | |
28 fi | |
29 | |
30 #if col cut was done, add that autogenerated classification | |
31 if [ ${13} -gt 1 ] | |
32 then | |
33 classifications="$classifications Class $tdir/COfile.txt.cut col_categorical" | |
34 fi | |
35 | |
36 #now add the user provided classification files | |
37 for i in "$@"; do | |
38 if [ $count -gt 14 ] | |
39 then | |
40 classifications=$classifications' '$i | |
41 fi | |
42 count=$((count+1)) | |
43 done | |
44 #call java program to generate NGCHM viewer files. | |
45 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 | |
46 #clean up tempdir | |
47 rm -rf $tdir |