annotate heatmap.sh @ 11:80ab17e6cc42 draft

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