annotate 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
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
33
0097750ad7ad Version 2.2.1 embedded viewer
insilico-bob
parents: 32
diff changeset
1 #echo $1 $2 $3 $4 $5 $6 $7 $8 $9 ${10} ${11} ${12} ${13} ${14} ${15} ${16} ${17} ${18}
32
16593e40c2cd Version 2.0.5
insilico-bob
parents: 2
diff changeset
2
2
e2b3920e20c1 Uploaded
insilico-bob
parents:
diff changeset
3 #create temp directory for row and col order and dendro files.
33
0097750ad7ad Version 2.2.1 embedded viewer
insilico-bob
parents: 32
diff changeset
4 tdir=${12}/$(date +%y%m%d%M%S)
2
e2b3920e20c1 Uploaded
insilico-bob
parents:
diff changeset
5 echo $tdir
e2b3920e20c1 Uploaded
insilico-bob
parents:
diff changeset
6 mkdir $tdir
32
16593e40c2cd Version 2.0.5
insilico-bob
parents: 2
diff changeset
7
2
e2b3920e20c1 Uploaded
insilico-bob
parents:
diff changeset
8 #run R to cluster matrix
33
0097750ad7ad Version 2.2.1 embedded viewer
insilico-bob
parents: 32
diff changeset
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)"
2
e2b3920e20c1 Uploaded
insilico-bob
parents:
diff changeset
10 rc=$?;
e2b3920e20c1 Uploaded
insilico-bob
parents:
diff changeset
11 if [ $rc != 0 ]
e2b3920e20c1 Uploaded
insilico-bob
parents:
diff changeset
12 then
e2b3920e20c1 Uploaded
insilico-bob
parents:
diff changeset
13 echo $output;
e2b3920e20c1 Uploaded
insilico-bob
parents:
diff changeset
14 if [ `echo "$output" | grep -c "Inf in foreign function call"` -gt 0 ]
e2b3920e20c1 Uploaded
insilico-bob
parents:
diff changeset
15 then
e2b3920e20c1 Uploaded
insilico-bob
parents:
diff changeset
16 echo "";
e2b3920e20c1 Uploaded
insilico-bob
parents:
diff changeset
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.";
33
0097750ad7ad Version 2.2.1 embedded viewer
insilico-bob
parents: 32
diff changeset
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.";
2
e2b3920e20c1 Uploaded
insilico-bob
parents:
diff changeset
19 fi
e2b3920e20c1 Uploaded
insilico-bob
parents:
diff changeset
20 exit $rc;
e2b3920e20c1 Uploaded
insilico-bob
parents:
diff changeset
21 fi
e2b3920e20c1 Uploaded
insilico-bob
parents:
diff changeset
22
e2b3920e20c1 Uploaded
insilico-bob
parents:
diff changeset
23 #there are a variable number of triplicate parameters for classification bars
e2b3920e20c1 Uploaded
insilico-bob
parents:
diff changeset
24 count=0
e2b3920e20c1 Uploaded
insilico-bob
parents:
diff changeset
25 classifications=''
e2b3920e20c1 Uploaded
insilico-bob
parents:
diff changeset
26
e2b3920e20c1 Uploaded
insilico-bob
parents:
diff changeset
27 #if row cut was done, add that autogenerated classification
33
0097750ad7ad Version 2.2.1 embedded viewer
insilico-bob
parents: 32
diff changeset
28 if [ ${13} -gt 1 ]
2
e2b3920e20c1 Uploaded
insilico-bob
parents:
diff changeset
29 then
e2b3920e20c1 Uploaded
insilico-bob
parents:
diff changeset
30 classifications="Class $tdir/ROfile.txt.cut row_categorical"
e2b3920e20c1 Uploaded
insilico-bob
parents:
diff changeset
31 fi
e2b3920e20c1 Uploaded
insilico-bob
parents:
diff changeset
32
e2b3920e20c1 Uploaded
insilico-bob
parents:
diff changeset
33 #if col cut was done, add that autogenerated classification
33
0097750ad7ad Version 2.2.1 embedded viewer
insilico-bob
parents: 32
diff changeset
34 if [ ${14} -gt 1 ]
2
e2b3920e20c1 Uploaded
insilico-bob
parents:
diff changeset
35 then
e2b3920e20c1 Uploaded
insilico-bob
parents:
diff changeset
36 classifications="$classifications Class $tdir/COfile.txt.cut col_categorical"
e2b3920e20c1 Uploaded
insilico-bob
parents:
diff changeset
37 fi
e2b3920e20c1 Uploaded
insilico-bob
parents:
diff changeset
38
e2b3920e20c1 Uploaded
insilico-bob
parents:
diff changeset
39 #now add the user provided classification files
e2b3920e20c1 Uploaded
insilico-bob
parents:
diff changeset
40 for i in "$@"; do
33
0097750ad7ad Version 2.2.1 embedded viewer
insilico-bob
parents: 32
diff changeset
41 if [ $count -gt 16 ]
2
e2b3920e20c1 Uploaded
insilico-bob
parents:
diff changeset
42 then
e2b3920e20c1 Uploaded
insilico-bob
parents:
diff changeset
43 classifications=$classifications' '$i
e2b3920e20c1 Uploaded
insilico-bob
parents:
diff changeset
44 fi
e2b3920e20c1 Uploaded
insilico-bob
parents:
diff changeset
45 count=$((count+1))
e2b3920e20c1 Uploaded
insilico-bob
parents:
diff changeset
46 done
33
0097750ad7ad Version 2.2.1 embedded viewer
insilico-bob
parents: 32
diff changeset
47 echo "classifications " $classifications
0097750ad7ad Version 2.2.1 embedded viewer
insilico-bob
parents: 32
diff changeset
48 echo "${11} " ${11}
2
e2b3920e20c1 Uploaded
insilico-bob
parents:
diff changeset
49 #call java program to generate NGCHM viewer files.
33
0097750ad7ad Version 2.2.1 embedded viewer
insilico-bob
parents: 32
diff changeset
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
2
e2b3920e20c1 Uploaded
insilico-bob
parents:
diff changeset
51 #clean up tempdir
e2b3920e20c1 Uploaded
insilico-bob
parents:
diff changeset
52 rm -rf $tdir