Commit c3471ccf authored by Celine Noirot's avatar Celine Noirot
Browse files

Add parsing of new component.

parent 5e5f9197
......@@ -207,19 +207,22 @@ $(function () {
/*
* Define functions in charge to visualize charts
*/
$(".length-view-btn4").click(function() {
$("#percent_graph").click(function() {
if ($(":checked[id^=chk_sample_]").size() > 0) {
// Set dialog window
$("#modal-label-tmpl").html("NG6 <small> " + $("#analyse_name").val() + "</small>");
$("#modal-body-tmpl").html('<div id="highcharts_container4"></div>');
$("#modal-body-tmpl").html('<div id="highcharts_container"></div>');
$("#modal-foot-tmpl").html('<button class="btn btn-default" data-dismiss="modal" aria-hidden="true"><i class="glyphicon glyphicon-remove"></i> Close</button>');
$("#highcharts_container4").css('width', '845px');
$("#highcharts_container").css('width', '845px');
// Set graph
var description = new Array();
var valeurCPG = new Array();
var valeurCHG = new Array();
var valeurCHH = new Array();
$(":checked[id^=chk_sample_]").each(function(){
var index = $(this).attr("id").split("_")[2] ;
......@@ -228,15 +231,12 @@ $(function () {
// tableau pour les valeurs de c en contexte CpG
var V_PercentCinCPG = $("#PercentCinCPG_" + index).val() ;
console.log("CPG : "+V_PercentCinCPG);
valeurCPG.push(parseFloat(V_PercentCinCPG));
// tableau pour les valeurs de c en contexte CHG
var V_PercentCinCHG = $("#PercentCinCHG_" + index).val() ;
console.log("CHG : "+V_PercentCinCHG);
valeurCHG.push(parseFloat(V_PercentCinCHG));
// tableau pour les valeurs de c en contexte CHH
var V_PercentCinCHH = $("#PercentCinCHH_" + index).val() ;
console.log("CHH : "+V_PercentCinCHH);
valeurCHH.push(parseFloat(V_PercentCinCHH));
});
......@@ -244,8 +244,10 @@ $(function () {
// Draw graph
var options = {
chart: {
type: 'column'
},
renderTo: 'highcharts_container',
type: 'column',
margin: [50, 50, 100, 80]
},
title: {
text: '% methylation in context CPG, CHG and CHH :'
},
......@@ -285,11 +287,9 @@ $(function () {
{ name: '% C in CHG', data: valeurCHG },
{ name: '% C in CHH', data: valeurCHH }]
};
// Draw graph
var chart = new Highcharts.Chart(options);
resize_center_btmodal('#ng6modal', chart.chartWidth + 50);
//Display
$("#ng6modal").modal();
}
......
......@@ -19,6 +19,13 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
{block name=results_title}Methylation calling results {/block}
{block name=results}
{assign var="type" value="paired"}
{if $analyse_results|@count > 0}
{assign var="firstelt" value=array_shift(array_slice($analyse_results, 0, 1))}
{if 'single'|array_key_exists:$firstelt["default"] }
{$type="single"}
{/if}
{/if}
<table class="table table-striped table-bordered dataTable analysis-result-table">
<thead>
<tr>
......@@ -34,8 +41,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<th class="numeric-sort" ># mC in CHH</th>
<th class="numeric-sort" ># C in CHH</th>
<th class="numeric-sort" >% methylation in CHH</th>
<th>M-Bias R1</th>
<th>M-Bias R2</th>
</tr>
</thead>
<tbody>
......@@ -83,8 +88,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<td id="sample_{$i}_col_9">{$sample_results["default"].totalMethylatedCinCHH|number_format:0:' ':' '}</td>
<td id="sample_{$i}_col_10">{$sample_results["default"].totalUnmethylatedCinCHH|number_format:0:' ':' '}</td>
<td id="sample_{$i}_col_11">{round(($sample_results["default"].totalMethylatedCinCHH/($sample_results["default"].totalMethylatedCinCHH + $sample_results["default"].totalUnmethylatedCinCHH ))*100,2)}</td>
<td id="sample_{$i}_col_12"><a class="imglink" href="{$sample_results["R1"].img}">M-bias</a></td>
<td id="sample_{$i}_col_13"><a class="imglink" href="{$sample_results["R2"].img}">M-bias</a></td>
</tr>
{$i = $i + 1}
{else}
......@@ -108,8 +111,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<th>{$totalMethylatedCinCHH|number_format:0:' ':' '}</th>
<th>{$totalUnmethylatedCinCHH|number_format:0:' ':' '}</th>
<th></th>
<th></th>
<th></th>
</tr>
<tr>
<th></th>
......@@ -124,30 +125,13 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<th>{($totalMethylatedCinCHH/($analyse_results|@count))|number_format:0:' ':' '}</th>
<th>{($totalUnmethylatedCinCHH/($analyse_results|@count))|number_format:0:' ':' '}</th>
<th></th>
<th></th>
<th></th>
</tr>
<tr>
<th colspan="2"></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th><center><input type="checkbox" id="chk_col_12"> </center></th>
<th><center><input type="checkbox" id="chk_col_13"></center></th>
</tr>
<tr>
<th align="left" colspan="14">
<th align="left" colspan="12">
With selection :
<button type="button" class="btn btn-default multiple-selection-btn" id="columns_extract"><i class="glyphicon glyphicon-picture"></i> Compare</button>
<button type="button" class="btn btn-default multiple-selection-btn length-view-btn"><i class="glyphicon glyphicon-signal"></i> # C analysed</button>
<button type="button" class="btn btn-default multiple-selection-btn length-view-btn4"><i class="glyphicon glyphicon-signal"></i> % C in all context</button>
<button type="button" class="btn btn-default multiple-selection-btn length-view-btn4" id="percent_graph"><i class="glyphicon glyphicon-signal"></i> % C in all context</button>
</th>
</tr>
</tfoot>
......
......@@ -129,7 +129,7 @@ class BismarkMethylationExtractor (Analysis):
"R2" : {}}
"""
graph = {}
prog = re.compile('(\w{3}) context \((R\d)\)?')
prog = re.compile('(\w{3}) context\s?\(?(R\d)?\)?')
fin = open(mbias_file, 'r')
read="R1"
context="CpG"
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment