Commit 12a3e909 authored by maxchaza's avatar maxchaza

Allows pathway enrichment mapping

parent f972bbbc
......@@ -63,6 +63,7 @@ Ext.define('metExploreViz.view.button.buttonImportMapping.ButtonImportMappingCon
metExploreD3.GraphMapping.mapNodeData(mapping, lines);
metExploreD3.fireEventArg('buttonMap', "jsonmapping", mapping);
metExploreD3.fireEventArg('selectMapping', "jsonmapping", mapping);
}
else
{
......@@ -85,12 +86,16 @@ Ext.define('metExploreViz.view.button.buttonImportMapping.ButtonImportMappingCon
var newConditions = [];
if(conditions[0]!==undefined){
mapping.getConditions().forEach(function (condition) {
newConditions.push(mapping.getName()+"_"+condition);
newConditions.push(mapping.getName()+" / "+condition);
});
}
else
newConditions.push(mapping.getName());
newConditions.forEach(function (value) { conditionStore.add({name: value, type: 'int'}); });
newConditions
.filter(function(cond){
return !(cond.includes("PathwayEnrichment") || cond.includes("PathwayCoverage"))
})
.forEach(function (value) { conditionStore.add({name: value, type: 'int'}); });
}
});
......@@ -9,6 +9,7 @@ Ext.define('metExploreViz.view.form.captionForm.CaptionForm', {
"metExploreViz.view.form.selectComponent.SelectComponent",
"metExploreViz.view.form.ComponentCaptionForm",
"metExploreViz.view.form.captionForm.CaptionFormController",
"metExploreViz.view.form.selectMapping.SelectMapping",
"metExploreViz.view.form.captionForm.CaptionFormModel"
],
controller: "form-captionForm-captionForm",
......
......@@ -220,6 +220,42 @@ Ext.define('metExploreViz.view.form.captionForm.CaptionFormController', {
if(view.getTitle()=="Pathways"){
var mappingPanel = Ext.create('Ext.panel.Panel', {
border: false,
width: '100%',
bodyBorder: false,
xtype: 'panel',
layout: {
type: 'vbox',
align: 'stretch'
},
items: [
{
margin: "15 15 5 15",
xtype: 'label',
html: 'Select mapping to map pathway enrichment on pathway nodes :'
},
{
margin: '5 10 10 10',
xtype: "selectMapping",
id: 'selectMapping',
reference: 'panelMappingPathways'
}
]
});
mappingPanel.lookupReference('panelMappingPathways')
captionForm.add(mappingPanel);
var line = Ext.create('Ext.Component', {
hidden: false,
autoEl: {
tag: 'hr'
}
});
captionForm.add(line);
// Create checkbox to display convex hull around each components
var highlightLinkCheckbox = Ext.create('Ext.form.field.Checkbox', {
tooltip: 'Display convex hull around each ' + view.getTitle(),
......@@ -250,15 +286,6 @@ Ext.define('metExploreViz.view.form.captionForm.CaptionFormController', {
// Add component caption to captionForm panel
if (captionForm != undefined) {
captionForm.add(newConditionPanel);
// Create checkbox to display convex hull around each components
var line = Ext.create('Ext.Component', {
hidden: false,
autoEl: {
tag: 'hr'
}
});
captionForm.add(line);
// Create checkbox to display convex hull around each components
var selectAllButton = Ext.create('Ext.button.Button', {
tooltip: 'selectAllButton',
......
......@@ -15,7 +15,8 @@ Ext.define('metExploreViz.view.form.selectMapping.SelectMapping', {
type: "form-selectMapping-selectMapping"
},
store: {
fields: ['name']
fields: ['name'],
data: [{name:'None'}]
},
listeners: {
render: function(c) {
......
......@@ -909,8 +909,8 @@ metExploreD3.GraphMapping = {
* @param {} conditionName : Condition choosed by the user
*/
graphMappingDiscreteData : function(condition, aStyleFormParent, func) {
var mappingName = condition.split("_")[0];
var conditionName = condition.split("_")[1];
var mappingName = condition.split(" / ")[0];
var conditionName = condition.split(" / ")[1];
metExploreD3.onloadMapping(mappingName, function(){
var mapping = _metExploreViz.getMappingByName(mappingName);
......@@ -1080,8 +1080,8 @@ metExploreD3.GraphMapping = {
* @param {} conditionName : Condition choosed by the user
*/
graphMappingAsSelectionData : function(condition, aStyleFormParent, func) {
var mappingName = condition.split("_")[0];
var conditionName = condition.split("_")[1];
var mappingName = condition.split(" / ")[0];
var conditionName = condition.split(" / ")[1];
metExploreD3.onloadMapping(mappingName, function(){
var mapping = _metExploreViz.getMappingByName(mappingName);
......@@ -1332,8 +1332,8 @@ metExploreD3.GraphMapping = {
* @param {} conditionName : Condition choosed by the user
*/
graphMappingContinuousData : function(condition, aStyleFormParent, func) {
var mappingName = condition.split("_")[0];
var conditionName = condition.split("_")[1];
var mappingName = condition.split(" / ")[0];
var conditionName = condition.split(" / ")[1];
metExploreD3.onloadMapping(mappingName, function(){
var mapping = _metExploreViz.getMappingByName(mappingName);
var myMask = metExploreD3.createLoadMask("Mapping in progress...", 'graphPanel');
......@@ -2177,6 +2177,8 @@ metExploreD3.GraphMapping = {
metExploreD3.fireEventArg('buttonMap', "jsonmapping", mapping);
metExploreD3.fireEventArg('selectMapping', "jsonmapping", mapping);
var anim = session.isAnimated("viz");
if (anim == 'true') {
var force = session.getForce();
......@@ -2235,6 +2237,8 @@ metExploreD3.GraphMapping = {
metExploreD3.GraphMapping.mapNodeDataFile(mapping, data);
metExploreD3.fireEventArg('buttonMap', "jsonmapping", mapping);
metExploreD3.fireEventArg('selectMapping', "jsonmapping", mapping);
metExploreD3.hideMask(myMask);
if (func!=undefined) {func()};
var anim=session.isAnimated("viz");
......
......@@ -2101,8 +2101,8 @@ metExploreD3.GraphNode = {
this.parentNode.insertBefore(this, last);
this.parentNode.insertBefore(last, this);
var session = _metExploreViz.getSessionById(parent);
var mappingName = session.getActiveMapping();
var combBoxSelectMappingVisu = Ext.getCmp('selectMapping');
var mappingName = combBoxSelectMappingVisu.getValue();
if(node.getMappingDatasLength() > 0 && mappingName !== "")
{
......@@ -2125,7 +2125,7 @@ metExploreD3.GraphNode = {
var tooltipText = d3.select("#"+parent).select('#tooltipPathwaysText');
var covText = "Coverage : "+(mapCov.getMapValue()).toFixed(2);
var covText = "Coverage : "+(mapCov.getMapValue()).toFixed(2)*100 + "%";
var pValText = "p-value BH : "+(mapPE.getMapValue()).toFixed(4);
var nameDOMFormat = $("<div/>").html(covText).text();
......
......@@ -805,6 +805,7 @@ console.log(panel);
_metExploreViz.getMappingsSet().forEach(function(mapping){
metExploreD3.GraphMapping.reloadMapping(mapping);
metExploreD3.fireEventArg('buttonMap', "jsonmapping", mapping);
metExploreD3.fireEventArg('selectMapping', "jsonmapping", mapping);
});
metExploreD3.fireEventArg('buttonRefresh', "reloadMapping", true);
}
......@@ -990,6 +991,7 @@ console.log(panel);
_metExploreViz.getMappingsSet().forEach(function(mapping){
metExploreD3.GraphMapping.reloadMapping(mapping);
metExploreD3.fireEventArg('buttonMap', "jsonmapping", mapping);
metExploreD3.fireEventArg('selectMapping', "jsonmapping", mapping);
});
metExploreD3.fireEventArg('buttonRefresh', "reloadMapping", true);
}
......
Markdown is supported
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