annotate heatmap.sh @ 36:11a5827d5559 draft

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