User:Hisa/SemanticSbox: Difference between revisions
From FANTOM5_SSTAR
No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
<html> | <html> | ||
<script type="text/ | <script type="text/javascript" src="/resource_browser/rb_js/datatables/media/js/jquery.dataTables.min.js"></script> | ||
<script type="text/ | <script type="text/javascript" src="/resource_browser/rb_js/datatables/extras/TableTools/media/js/TableTools.min.js"></script> | ||
<script type="text/ | <script type="text/javascript" src="/resource_browser/rb_js/d3.v2.min.js"></script> | ||
<style type="text/css"> | |||
@import "/resource_browser/rb_js/datatables/media/css/jquery.dataTables.css"; | @import "/resource_browser/rb_js/datatables/media/css/jquery.dataTables.css"; | ||
@import "/resource_browser/rb_js/datatables/extras/TableTools/media/css/TableTools.css"; | @import "/resource_browser/rb_js/datatables/extras/TableTools/media/css/TableTools.css"; | ||
</ | .axis path, | ||
.axis line { | |||
fill: none; | |||
stroke: black; | |||
shape-rendering: crispEdges; | |||
} | |||
.axis text { | |||
font-family: sans-serif; | |||
font-size: 12px; | |||
} | |||
circle { | |||
stroke: none; | |||
} | |||
circle:hover { | |||
stroke: slategray; | |||
stroke-width: 15px; | |||
} | |||
#progress { | |||
-webkit-border-radius: 10px; | |||
background-color: rgba(0, 0, 0, 0.7); | |||
color: white; | |||
font-size: 18px; | |||
font-weight: bold; | |||
height: 80px; | |||
padding: auto; | |||
line-height:80px; | |||
margin: 0 auto; | |||
text-align: center; | |||
top:120px; | |||
width:120px; | |||
} | |||
</style> | |||
<div id="elem01"></div> | |||
<div id="mes01"></div> | |||
<table id='gene_exptable'><thead><tr><th>Sample</th><th><div class="rotate90"><p>p1@ACTB</p></div></th><th><div class="rotate90"><p>p2@ACTB</p></div></th><th><div class="rotate90"><p>p3@ACTB</p></div></th><th><div class="rotate90"><p>p4@ACTB</p></div></th><th><div class="rotate90"><p>p5@ACTB</p></div></th><th><div class="rotate90"><p>p6@ACTB</p></div></th><th><div class="rotate90"><p>p7@ACTB</p></div></th><th><div class="rotate90"><p>p8@ACTB</p></div></th><th><div class="rotate90"><p>p9@ACTB</p></div></th><th><div class="rotate90"><p>p10@ACTB</p></div></th></tr></thead><tbody><tr><td><a href="https://fantom5-collaboration.gsc.riken.jp/resource_browser/index.php/FF:11376-118A8">Adipocyte - breast, donor1.CNhs11051.11376-118A8</a></td><td align="center" style="background-color: rgb(0,172,0);color: white">11260.43</td><td align="center" style="background-color: rgb(0,75,0);color: white">58.32</td><td align="center" style="background-color: rgb(0,54,0);color: white">17.62</td><td align="center" style="background-color: rgb(0,58,0);color: white">22.16</td><td align="center" style="background-color: rgb(0,49,0);color: white">13.26</td><td align="center" style="background-color: rgb(0,40,0);color: white">7.63</td><td align="center" style="background-color: rgb(0,41,0);color: white">8.36</td><td align="center" style="background-color: rgb(0,54,0);color: white">17.99</td><td align="center" style="background-color: rgb(0,48,0);color: white">12.17</td><td align="center" style="background-color: rgb(0,33,0);color: white">4.91</td></tr><tr><td><a href="https://fantom5-collaboration.gsc.riken.jp/resource_browser/index.php/FF:11327-117E4">Adipocyte - breast, donor2.CNhs11969.11327-117E4</a></td><td align="center" style="background-color: rgb(0,166,0);color: white">7972.25</td><td align="center" style="background-color: rgb(0,67,0);color: white">36.83</td><td align="center" style="background-color: rgb(0,69,0);color: white">41.96</td><td align="center" style="background-color: rgb(0,54,0);color: white">17.34</td><td align="center" style="background-color: rgb(0,46,0);color: white">11.13</td><td align="center" style="background-color: rgb(0,49,0);color: white">13.49</td><td align="center" style="background-color: rgb(0,58,0);color: white">21.84</td><td align="center" style="background-color: rgb(0,44,0);color: white">9.63</td><td align="center" style="background-color: rgb(0,50,0);color: white">13.92</td><td align="center" style="background-color: rgb(0,45,0);color: white">10.28</td></tr><tr><td><a href="https://fantom5-collaboration.gsc.riken.jp/resource_browser/index.php/FF:11473-119C6">Adipocyte - omental, donor1.CNhs11054.11473-119C6</a></td><td align="center" style="background-color: rgb(0,171,0);color: white">10453.32</td><td align="center" style="background-color: rgb(0,75,0);color: white">57.23</td><td align="center" style="background-color: rgb(0,57,0);color: white">21.28</td><td align="center" style="background-color: rgb(0,57,0);color: white">20.72</td><td align="center" style="background-color: rgb(0,49,0);color: white">12.97</td><td align="center" style="background-color: rgb(0,49,0);color: white">13.39</td><td align="center" style="background-color: rgb(0,39,0);color: white">7.47</td><td align="center" style="background-color: rgb(0,51,0);color: white">14.52</td><td align="center" style="background-color: rgb(0,46,0);color: white">11.28</td><td align="center" style="background-color: rgb(0,39,0);color: white">7.33</td></tr><tr><td><a href="https://fantom5-collaboration.gsc.riken.jp/resource_browser/index.php/FF:11474-119C7">Adipocyte - omental, donor2.CNhs12067.11474-119C7</a></td><td align="center" style="background-color: rgb(0,172,0);color: white">11241.23</td><td align="center" style="background-color: rgb(0,72,0);color: white">48.04</td><td align="center" style="background-color: rgb(0,68,0);color: white">38.03</td><td align="center" style="background-color: rgb(0,68,0);color: white">38.03</td><td align="center" style="background-color: rgb(0,58,0);color: white">22.02</td><td align="center" style="background-color: rgb(0,67,0);color: white">37.03</td><td align="center" style="background-color: rgb(0,57,0);color: white">21.02</td><td align="center" style="background-color: rgb(0,58,0);color: white">22.02</td><td align="center" style="background-color: rgb(0,69,0);color: white">42.03</td><td align="center" style="background-color: rgb(0,36,0);color: white">6.00</td></tr><tr><td><a href="https://fantom5-collaboration.gsc.riken.jp/resource_browser/index.php/FF:11475-119C8">Adipocyte - omental, donor3.CNhs12068.11475-119C8</a></td><td align="center" style="background-color: rgb(0,164,0);color: white">7147.35</td><td align="center" style="background-color: rgb(0,67,0);color: white">36.65</td><td align="center" style="background-color: rgb(0,58,0);color: white">22.35</td><td align="center" style="background-color: rgb(0,58,0);color: white">21.90</td><td align="center" style="background-color: rgb(0,48,0);color: white">12.51</td><td align="center" style="background-color: rgb(0,64,0);color: white">30.84</td><td align="center" style="background-color: rgb(0,49,0);color: white">12.96</td><td align="center" style="background-color: rgb(0,46,0);color: white">11.17</td><td align="center" style="background-color: rgb(0,71,0);color: white">45.14</td><td align="center" style="background-color: rgb(0,41,0);color: white">8.05</td></tr><tr><td><a href="https://fantom5-collaboration.gsc.riken.jp/resource_browser/index.php/FF:11476-119C9">Adipocyte - perirenal, donor1.CNhs12069.11476-119C9</a></td><td align="center" style="background-color: rgb(0,171,0);color: white">10420.96</td><td align="center" style="background-color: rgb(0,65,0);color: white">33.15</td><td align="center" style="background-color: rgb(0,63,0);color: white">29.66</td><td align="center" style="background-color: rgb(0,69,0);color: white">41.87</td><td align="center" style="background-color: rgb(0,54,0);color: white">17.45</td><td align="center" style="background-color: rgb(0,70,0);color: white">43.62</td><td align="center" style="background-color: rgb(0,56,0);color: white">20.06</td><td align="center" style="background-color: rgb(0,52,0);color: white">15.70</td><td align="center" style="background-color: rgb(0,67,0);color: white">37.51</td><td align="center" style="background-color: rgb(0,45,0);color: white">10.47</td></tr><tr><td><a href="https://fantom5-collaboration.gsc.riken.jp/resource_browser/index.php/FF:11259-116F8">Adipocyte - subcutaneous, donor1.CNhs12494.11259-116F8</a></td><td align="center" style="background-color: rgb(0,170,0);color: white">10023.08</td><td align="center" style="background-color: rgb(0,75,0);color: white">55.73</td><td align="center" style="background-color: rgb(0,44,0);color: white">10.13</td><td align="center" style="background-color: rgb(0,54,0);color: white">17.73</td><td align="center" style="background-color: rgb(0,48,0);color: white">12.66</td><td align="center" style="background-color: rgb(0,68,0);color: white">37.99</td><td align="center" style="background-color: rgb(0,23,0);color: white">2.53</td><td align="center" style="background-color: rgb(0,66,0);color: white">35.46</td><td align="center" style="background-color: rgb(0,56,0);color: white">20.26</td><td align="center" style="background-color: rgb(0,23,0);color: white">2.53</td></tr><tr><td><a href="https://fantom5-collaboration.gsc.riken.jp/resource_browser/index.php/FF:11336-117F4">Adipocyte - subcutaneous, donor2.CNhs11371.11336-117F4</a></td><td align="center" style="background-color: rgb(0,152,0);color: white">3841.49</td><td align="center" style="background-color: rgb(0,61,0);color: white">25.90</td><td align="center" style="background-color: rgb(0,42,0);color: white">8.84</td><td align="center" style="background-color: rgb(0,37,0);color: white">6.32</td><td align="center" style="background-color: rgb(0,38,0);color: white">6.95</td><td align="center" style="background-color: rgb(0,38,0);color: white">6.95</td><td align="center" style="background-color: rgb(0,23,0);color: white">2.53</td><td align="center" style="background-color: rgb(0,29,0);color: white">3.79</td><td align="center" style="background-color: rgb(0,37,0);color: white">6.32</td><td align="center" style="background-color: rgb(0,15,0);color: white">1.26</td></tr><tr><td><a href="https://fantom5-collaboration.gsc.riken.jp/resource_browser/index.php/FF:11408-118E4">Adipocyte - subcutaneous, donor3.CNhs12017.11408-118E4</a></td><td align="center" style="background-color: rgb(0,148,0);color: white">2962.63</td><td align="center" style="background-color: rgb(0,52,0);color: white">15.67</td><td align="center" style="background-color: rgb(0,39,0);color: white">7.31</td><td align="center" style="background-color: rgb(0,42,0);color: white">8.62</td><td align="center" style="background-color: rgb(0,37,0);color: white">6.27</td><td align="center" style="background-color: rgb(0,41,0);color: white">8.36</td><td align="center" style="background-color: rgb(0,30,0);color: white">4.18</td><td align="center" style="background-color: rgb(0,37,0);color: white">6.27</td><td align="center" style="background-color: rgb(0,26,0);color: white">3.13</td><td align="center" style="background-color: rgb(0,17,0);color: white">1.57</td></tr><tr><td><a href="https://fantom5-collaboration.gsc.riken.jp/resource_browser/index.php/FF:11510-119G7">Alveolar Epithelial Cells, donor1.CNhs11325.11510-119G7</a></td><td align="center" style="background-color: rgb(0,175,0);color: white">13276.02</td><td align="center" style="background-color: rgb(0,66,0);color: white">35.39</td><td align="center" style="background-color: rgb(0,67,0);color: white">36.37</td><td align="center" style="background-color: rgb(0,55,0);color: white">18.18</td><td align="center" style="background-color: rgb(0,55,0);color: white">18.68</td><td align="center" style="background-color: rgb(0,30,0);color: white">4.18</td><td align="center" style="background-color: rgb(0,50,0);color: white">14.25</td><td align="center" style="background-color: rgb(0,31,0);color: white">4.42</td><td align="center" style="background-color: rgb(0,20,0);color: white">1.97</td><td align="center" style="background-color: rgb(0,38,0);color: white">6.88</td></tr><tr><td><a href="https://fantom5-collaboration.gsc.riken.jp/resource_browser/index.php/FF:11590-120G6">Alveolar Epithelial Cells, donor2.CNhs12084.11590-120G6</a></td><td align="center" style="background-color: rgb(0,193,0);color: black">34850.98</td><td align="center" style="background-color: rgb(0,78,0);color: white">67.69</td><td align="center" style="background-color: rgb(0,87,0);color: white">111.65</td><td align="center" style="background-color: rgb(0,84,0);color: white">91.41</td><td align="center" style="background-color: rgb(0,63,0);color: white">29.31</td><td align="center" style="background-color: rgb(0,71,0);color: white">46.75</td><td align="center" style="background-color: rgb(0,75,0);color: white">55.82</td><td align="center" style="background-color: rgb(0,60,0);color: white">24.42</td><td align="center" style="background-color: rgb(0,77,0);color: white">62.10</td><td align="center" style="background-color: rgb(0,52,0);color: white">16.05</td></tr></tbody></table> | |||
<div id='chart'></div> | |||
<script type="text/javascript"> | |||
//width | |||
w = 750; | |||
//height | |||
h = 400; | |||
//padding | |||
var pad = 50; | |||
//color generator | |||
var c10 = d3.scale.category10(); | |||
//chart body | |||
var svg; | |||
var oTable = $('#gene_exptable').dataTable({ | |||
"sScrollY": "300px", | |||
"bPaginate": false, | |||
"bScrollCollapse": true, | |||
"iDisplayLength": -1, | |||
"aaSorting": [[1,'desc']], | |||
"aoColumnDefs": [ { "asSorting": [ "desc", "asc" ], "aTargets": [ "_all" ] } , { "bSortable": false, "aTargets": [ 0 ] }], | |||
"fnDrawCallback": function() {drawchart()} | |||
// "fnDrawCallback": function() {$('#mes01').text($("#gene_exptable tr")[1].cells[5].innerHTML);} | |||
}); | |||
function drawchart(){ | |||
d3.select("#svg01").remove(); | |||
var data = []; | |||
var mx1 = []; | |||
var sname = []; | |||
svg = d3.select("#chart").append('svg:svg').attr("id", "svg01").attr("width", w).attr("height", h); | |||
for (i2=1, len2=11; i2<len2; i2++){ | |||
var plots = []; | |||
for (i1=1, len1=$('#gene_exptable tr').length; i1<len1; i1++) { | |||
plots.push([i1, parseFloat($("#gene_exptable tr")[i1].cells[i2].innerHTML)]); | |||
} | |||
sname.push(name+i2); | |||
mx1.push(d3.max(plots, function(d) { return d[1]; })); | |||
data.push(plots); | |||
} | |||
$('#mes01').text(sname); | |||
var xScale = d3.scale.linear() | |||
.domain([0, data[0].length]) | |||
.range([pad, w - pad]); | |||
var yScale = d3.scale.linear().domain([0, d3.max(mx1)]).range([h - pad, pad]); | |||
for(i1=0, len1=data.length; i1 < len1; i1++){ | |||
svg.selectAll("circle"+i1).data(data[i1]).enter().append("circle") | |||
.attr("cx", function(d) {return xScale(d[0]);}) | |||
.attr("cy", function(d) {return yScale(d[1]);}) | |||
.attr("r", 3) | |||
.style("fill", c10(i1)) | |||
.append("svg:title").text(function(d, i) { return "TPM: " + d[1]; }); | |||
// legends | |||
svg.append("circle") | |||
.attr("cx", w - 150) | |||
.attr("cy", pad + 20 * i1) | |||
.attr("r", 5) | |||
.style("fill", c10(i1)); | |||
svg.append("text") | |||
.attr("x", w - 140) | |||
.attr("y", pad + 22 * i1) | |||
.text(sname[i1]) | |||
.on("mouseover", function(){updatetxt()}) | |||
.style("fill", c10(i1)); | |||
} | |||
var yAxis = d3.svg.axis() | |||
.scale(yScale) | |||
.orient("left") | |||
.ticks(5); | |||
svg.append("g") | |||
.attr("class", "axis") | |||
.attr("transform", "translate(" + pad + ",0)") | |||
.call(yAxis); | |||
} | |||
// drawchart(); | |||
function updatetxt(t){ | |||
$('#mes01').text(t+'yes!'); | |||
} | |||
</script> | </script> | ||
</html> | </html> | ||
Revision as of 15:17, 19 November 2012
Sample | p1@ACTB | p2@ACTB | p3@ACTB | p4@ACTB | p5@ACTB | p6@ACTB | p7@ACTB | p8@ACTB | p9@ACTB | p10@ACTB |
---|---|---|---|---|---|---|---|---|---|---|
Adipocyte - breast, donor1.CNhs11051.11376-118A8 | 11260.43 | 58.32 | 17.62 | 22.16 | 13.26 | 7.63 | 8.36 | 17.99 | 12.17 | 4.91 |
Adipocyte - breast, donor2.CNhs11969.11327-117E4 | 7972.25 | 36.83 | 41.96 | 17.34 | 11.13 | 13.49 | 21.84 | 9.63 | 13.92 | 10.28 |
Adipocyte - omental, donor1.CNhs11054.11473-119C6 | 10453.32 | 57.23 | 21.28 | 20.72 | 12.97 | 13.39 | 7.47 | 14.52 | 11.28 | 7.33 |
Adipocyte - omental, donor2.CNhs12067.11474-119C7 | 11241.23 | 48.04 | 38.03 | 38.03 | 22.02 | 37.03 | 21.02 | 22.02 | 42.03 | 6.00 |
Adipocyte - omental, donor3.CNhs12068.11475-119C8 | 7147.35 | 36.65 | 22.35 | 21.90 | 12.51 | 30.84 | 12.96 | 11.17 | 45.14 | 8.05 |
Adipocyte - perirenal, donor1.CNhs12069.11476-119C9 | 10420.96 | 33.15 | 29.66 | 41.87 | 17.45 | 43.62 | 20.06 | 15.70 | 37.51 | 10.47 |
Adipocyte - subcutaneous, donor1.CNhs12494.11259-116F8 | 10023.08 | 55.73 | 10.13 | 17.73 | 12.66 | 37.99 | 2.53 | 35.46 | 20.26 | 2.53 |
Adipocyte - subcutaneous, donor2.CNhs11371.11336-117F4 | 3841.49 | 25.90 | 8.84 | 6.32 | 6.95 | 6.95 | 2.53 | 3.79 | 6.32 | 1.26 |
Adipocyte - subcutaneous, donor3.CNhs12017.11408-118E4 | 2962.63 | 15.67 | 7.31 | 8.62 | 6.27 | 8.36 | 4.18 | 6.27 | 3.13 | 1.57 |
Alveolar Epithelial Cells, donor1.CNhs11325.11510-119G7 | 13276.02 | 35.39 | 36.37 | 18.18 | 18.68 | 4.18 | 14.25 | 4.42 | 1.97 | 6.88 |
Alveolar Epithelial Cells, donor2.CNhs12084.11590-120G6 | 34850.98 | 67.69 | 111.65 | 91.41 | 29.31 | 46.75 | 55.82 | 24.42 | 62.10 | 16.05 |