1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
if(typeof Example==="undefined"||!Example){var Example = {};}
if (typeof tkjs === 'undefined' || !tkjs) {var tkjs = {};}
if (typeof tkjs.heatmap === 'undefined' || !tkjs.heatmap) {tkjs.heatmap = {};}
if (typeof tkjs.heatmap.view === 'undefined' || !tkjs.heatmap.view) {tkjs.heatmap.view = {};}
// LinkData.getObjects(workId, fileId, sbjId, propId)
tkjs.heatmap.load_linkdata = function() {
var prop, work, works, workId, filename, filenames, fileId, subjects, subject, subjectId, property, properties, propertyId, row, col, rows, cols, line, header, genelist, samplelist, cell, i, j, genes, values, hm, prop2, samples;
works = LinkData.getWorks();
console.log("HANDLING SUCKING LINKDATA");
console.log("works=" + works);
console.log(typeof(works));
hm = null;
for (prop in works) {
if (works.hasOwnProperty(prop)) {
console.log(works[prop]);
workId = works[prop];
console.log('workId = ' + workId);
filenames = LinkData.getFiles(workId);
console.log('filenames = ' + filenames);
console.log(typeof(filenames));
console.log(filenames[0]);
filename = filenames[0];
properties = LinkData.getProperties(workId, filename);
subjects = LinkData.getSubjects(workId, filename);
// console.log("properties : " + (typeof properties))
//console.log(properties);
// console.log("subjects : " + (typeof subjects));
// console.log(subjects);
cols = properties.length - 1;
rows = subjects.length;
genes = [];
property = properties[0];
for (i = 0; i < subjects.length; i++) {
cell = LinkData.getObjects(workId, filename, subjects[i], property);
genes.push(cell.toString().split(',')[0]);
}
samples = [];
for (i = 2; i < properties.length; i++) {
property = properties[i].toString().split('#');
samples.push(property[property.length - 1]);
console.log(samples);
//console.log(
// console.log(tkjs.heatmap.HeatMap);
hm = new tkjs.heatmap.HeatMap(genes);
hm.set_color_scale(4.0);
for (i = 0; i < samples.length; i++) {
values = [];
for (j = 0; j < subjects.length; j++) {
cell = parseFloat(LinkData.getObjects(workId, filename, subjects[j], properties[i + 2]).toString());
values.push(cell);
hm.set_array(samples[i], new Float32Array(values));
console.log(samples[i] + " : " + values);
// for (i = 0; i < properties.
// hm.set_array(
line = "";
for (j = 0; j < properties.length; j++) {
cell = LinkData.getObjects(workId, filename, subjects[i], properties[j]);
if (j === 0) {
line = cell;
} else {
line += ", " + parseFloat(cell).toFixed(2);
console.log(line);
if (i >= 10) { break;}
break;
console.log("BYE SUCKING LINKDATA");
return hm;
};
Example.getWorks = function() {
return LinkData.getWorks();
Example.getFiles = function(workId) {
return LinkData.getFiles(workId);
Example.getSubjects = function(workId, fileName) {
return LinkData.getSubjects(workId, fileName);
Example.getProperties = function(workId, fileName) {
return LinkData.getProperties(workId, fileName);
Example.getObjects = function(workId, fileName, subject, property) {
return LinkData.getObjects(workId, fileName, subject, property);
window.onload = function() {
var hm;
hm = tkjs.heatmap.load_linkdata();
if (hm === null) {
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
body {
margin:0px;
padding:0px;
#my_container {
/* margin-left:auto;*/
/* margin-right:auto;*/
margin-left:30px;
/*
width:800px;
margin:top:0px;
*/
/* border:1px solid green;*/
#contents {
position:absolute;
top:0px;
height:100%;
/* border:1px solid yellow;*/
#graph {
left:50px;
bottom:0px;
width:250px;
#sliderregion {
left:300px;
width:50px;
#slider {
top:8px;
left:4px;
width:10px;
bottom:8px;
#genelist {
left:350px;
width:450px;
/* background:#eee;*/
overflow:hidden;
/* border:1px solid blue;*/
.label {
font-family:Monaco, monospace;
font-size:8pt;
width:200px;
color:#222;
.label:hover {
color:red;
background:#cfd;
#genedialog {
width:400px;
height:400px;
font-size:medium;
#genedialog a {
color:blue;
#genedialog a:hover {
color:white;
background:darkslateblue;
.geneinformation {
left:0px;
right:0px;
#legend {
top:10px;
right:10px;
width:300px;
font-family:Helvetica, serif;
border:1px solid #40c0ff;
background:#fff;
color:#004;
padding:10px;
#legend table {
width:90%;
border:1px solid gray;
background:#eee;
border-collapse:collapse;
#legend td {
margin:auto;
text-align:center;
white-space:normal;
#legend th {
background:#482;
font-weight:bold;
<!DOCTYPE HTML>
<html lang="en">
<head>
<title>{{title}}</title>
<meta charset="utf-8">
<!--
<link href="css/heatmap.css" rel="stylesheet" type="text/css">
-->
<link rel="stylesheet" href="http://code.jquery.com/ui/1.8.23/themes/base/jquery-ui.css" type="text/css" media="all" />
<!-- <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" type="text/javascript"></script>-->
<script src="http://jquery-ui.googlecode.com/svn/tags/latest/ui/minified/i18n/jquery-ui-i18n.min.js" type="text/javascript"></script>
<script src="js/tklib.js" type="text/javascript"></script>
<script src="js/tkheatmap.js" type="text/javascript"></script>
<script type="text/javascript">
var inserted_data = {
"genes":"{{genes}}",
"author":"{{author}}",
"columns":"{{columns}}",
"scale":"{{scale}}",
"data":"{{data}}",
"code":"{{code}}",
"species":"{{species}}"
</script>
</head>
<body onresize="resized()" onload="console.log('running');">
<div id="my_container">
<div id="contents">
<canvas id="graph">
</canvas>
<div id="sliderregion">
<div id="slider"></div>
</div>
<div id="genelist">
<div id="legend"></div>
<div id="result"></div>
<!-- </body> -->
</html>
Click the Browse button or drag and drop to choose files to upload
The Maximum upload size is 1MB.(bmp,gif,jpeg,jpg,png)
*Required field
Add name for another language
You can upload jpg, gif, png file formats
Add description for another language
Fork original application has been updated. >>see
Original application has been updated. >>see
Playing...
Please enter a valid URL