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 ...@@ -63,6 +63,7 @@ Ext.define('metExploreViz.view.button.buttonImportMapping.ButtonImportMappingCon
metExploreD3.GraphMapping.mapNodeData(mapping, lines); metExploreD3.GraphMapping.mapNodeData(mapping, lines);
metExploreD3.fireEventArg('buttonMap', "jsonmapping", mapping); metExploreD3.fireEventArg('buttonMap', "jsonmapping", mapping);
metExploreD3.fireEventArg('selectMapping', "jsonmapping", mapping);
} }
else else
{ {
...@@ -85,12 +86,16 @@ Ext.define('metExploreViz.view.button.buttonImportMapping.ButtonImportMappingCon ...@@ -85,12 +86,16 @@ Ext.define('metExploreViz.view.button.buttonImportMapping.ButtonImportMappingCon
var newConditions = []; var newConditions = [];
if(conditions[0]!==undefined){ if(conditions[0]!==undefined){
mapping.getConditions().forEach(function (condition) { mapping.getConditions().forEach(function (condition) {
newConditions.push(mapping.getName()+"_"+condition); newConditions.push(mapping.getName()+" / "+condition);
}); });
} }
else else
newConditions.push(mapping.getName()); 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', { ...@@ -9,6 +9,7 @@ Ext.define('metExploreViz.view.form.captionForm.CaptionForm', {
"metExploreViz.view.form.selectComponent.SelectComponent", "metExploreViz.view.form.selectComponent.SelectComponent",
"metExploreViz.view.form.ComponentCaptionForm", "metExploreViz.view.form.ComponentCaptionForm",
"metExploreViz.view.form.captionForm.CaptionFormController", "metExploreViz.view.form.captionForm.CaptionFormController",
"metExploreViz.view.form.selectMapping.SelectMapping",
"metExploreViz.view.form.captionForm.CaptionFormModel" "metExploreViz.view.form.captionForm.CaptionFormModel"
], ],
controller: "form-captionForm-captionForm", controller: "form-captionForm-captionForm",
......
...@@ -220,6 +220,42 @@ Ext.define('metExploreViz.view.form.captionForm.CaptionFormController', { ...@@ -220,6 +220,42 @@ Ext.define('metExploreViz.view.form.captionForm.CaptionFormController', {
if(view.getTitle()=="Pathways"){ 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 // Create checkbox to display convex hull around each components
var highlightLinkCheckbox = Ext.create('Ext.form.field.Checkbox', { var highlightLinkCheckbox = Ext.create('Ext.form.field.Checkbox', {
tooltip: 'Display convex hull around each ' + view.getTitle(), tooltip: 'Display convex hull around each ' + view.getTitle(),
...@@ -250,15 +286,6 @@ Ext.define('metExploreViz.view.form.captionForm.CaptionFormController', { ...@@ -250,15 +286,6 @@ Ext.define('metExploreViz.view.form.captionForm.CaptionFormController', {
// Add component caption to captionForm panel // Add component caption to captionForm panel
if (captionForm != undefined) { if (captionForm != undefined) {
captionForm.add(newConditionPanel); 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 // Create checkbox to display convex hull around each components
var selectAllButton = Ext.create('Ext.button.Button', { var selectAllButton = Ext.create('Ext.button.Button', {
tooltip: 'selectAllButton', tooltip: 'selectAllButton',
......
...@@ -15,7 +15,8 @@ Ext.define('metExploreViz.view.form.selectMapping.SelectMapping', { ...@@ -15,7 +15,8 @@ Ext.define('metExploreViz.view.form.selectMapping.SelectMapping', {
type: "form-selectMapping-selectMapping" type: "form-selectMapping-selectMapping"
}, },
store: { store: {
fields: ['name'] fields: ['name'],
data: [{name:'None'}]
}, },
listeners: { listeners: {
render: function(c) { render: function(c) {
......
...@@ -909,8 +909,8 @@ metExploreD3.GraphMapping = { ...@@ -909,8 +909,8 @@ metExploreD3.GraphMapping = {
* @param {} conditionName : Condition choosed by the user * @param {} conditionName : Condition choosed by the user
*/ */
graphMappingDiscreteData : function(condition, aStyleFormParent, func) { graphMappingDiscreteData : function(condition, aStyleFormParent, func) {
var mappingName = condition.split("_")[0]; var mappingName = condition.split(" / ")[0];
var conditionName = condition.split("_")[1]; var conditionName = condition.split(" / ")[1];
metExploreD3.onloadMapping(mappingName, function(){ metExploreD3.onloadMapping(mappingName, function(){
var mapping = _metExploreViz.getMappingByName(mappingName); var mapping = _metExploreViz.getMappingByName(mappingName);
...@@ -1080,8 +1080,8 @@ metExploreD3.GraphMapping = { ...@@ -1080,8 +1080,8 @@ metExploreD3.GraphMapping = {
* @param {} conditionName : Condition choosed by the user * @param {} conditionName : Condition choosed by the user
*/ */
graphMappingAsSelectionData : function(condition, aStyleFormParent, func) { graphMappingAsSelectionData : function(condition, aStyleFormParent, func) {
var mappingName = condition.split("_")[0]; var mappingName = condition.split(" / ")[0];
var conditionName = condition.split("_")[1]; var conditionName = condition.split(" / ")[1];
metExploreD3.onloadMapping(mappingName, function(){ metExploreD3.onloadMapping(mappingName, function(){
var mapping = _metExploreViz.getMappingByName(mappingName); var mapping = _metExploreViz.getMappingByName(mappingName);
...@@ -1332,8 +1332,8 @@ metExploreD3.GraphMapping = { ...@@ -1332,8 +1332,8 @@ metExploreD3.GraphMapping = {
* @param {} conditionName : Condition choosed by the user * @param {} conditionName : Condition choosed by the user
*/ */
graphMappingContinuousData : function(condition, aStyleFormParent, func) { graphMappingContinuousData : function(condition, aStyleFormParent, func) {
var mappingName = condition.split("_")[0]; var mappingName = condition.split(" / ")[0];
var conditionName = condition.split("_")[1]; var conditionName = condition.split(" / ")[1];
metExploreD3.onloadMapping(mappingName, function(){ metExploreD3.onloadMapping(mappingName, function(){
var mapping = _metExploreViz.getMappingByName(mappingName); var mapping = _metExploreViz.getMappingByName(mappingName);
var myMask = metExploreD3.createLoadMask("Mapping in progress...", 'graphPanel'); var myMask = metExploreD3.createLoadMask("Mapping in progress...", 'graphPanel');
...@@ -2177,6 +2177,8 @@ metExploreD3.GraphMapping = { ...@@ -2177,6 +2177,8 @@ metExploreD3.GraphMapping = {
metExploreD3.fireEventArg('buttonMap', "jsonmapping", mapping); metExploreD3.fireEventArg('buttonMap', "jsonmapping", mapping);
metExploreD3.fireEventArg('selectMapping', "jsonmapping", mapping);
var anim = session.isAnimated("viz"); var anim = session.isAnimated("viz");
if (anim == 'true') { if (anim == 'true') {
var force = session.getForce(); var force = session.getForce();
...@@ -2235,7 +2237,9 @@ metExploreD3.GraphMapping = { ...@@ -2235,7 +2237,9 @@ metExploreD3.GraphMapping = {
metExploreD3.GraphMapping.mapNodeDataFile(mapping, data); metExploreD3.GraphMapping.mapNodeDataFile(mapping, data);
metExploreD3.fireEventArg('buttonMap', "jsonmapping", mapping); metExploreD3.fireEventArg('buttonMap', "jsonmapping", mapping);
metExploreD3.hideMask(myMask); metExploreD3.fireEventArg('selectMapping', "jsonmapping", mapping);
metExploreD3.hideMask(myMask);
if (func!=undefined) {func()}; if (func!=undefined) {func()};
var anim=session.isAnimated("viz"); var anim=session.isAnimated("viz");
if (anim=='true') { if (anim=='true') {
......
...@@ -2101,8 +2101,8 @@ metExploreD3.GraphNode = { ...@@ -2101,8 +2101,8 @@ metExploreD3.GraphNode = {
this.parentNode.insertBefore(this, last); this.parentNode.insertBefore(this, last);
this.parentNode.insertBefore(last, this); this.parentNode.insertBefore(last, this);
var session = _metExploreViz.getSessionById(parent); var combBoxSelectMappingVisu = Ext.getCmp('selectMapping');
var mappingName = session.getActiveMapping(); var mappingName = combBoxSelectMappingVisu.getValue();
if(node.getMappingDatasLength() > 0 && mappingName !== "") if(node.getMappingDatasLength() > 0 && mappingName !== "")
{ {
...@@ -2125,7 +2125,7 @@ metExploreD3.GraphNode = { ...@@ -2125,7 +2125,7 @@ metExploreD3.GraphNode = {
var tooltipText = d3.select("#"+parent).select('#tooltipPathwaysText'); 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 pValText = "p-value BH : "+(mapPE.getMapValue()).toFixed(4);
var nameDOMFormat = $("<div/>").html(covText).text(); var nameDOMFormat = $("<div/>").html(covText).text();
......
...@@ -805,6 +805,7 @@ console.log(panel); ...@@ -805,6 +805,7 @@ console.log(panel);
_metExploreViz.getMappingsSet().forEach(function(mapping){ _metExploreViz.getMappingsSet().forEach(function(mapping){
metExploreD3.GraphMapping.reloadMapping(mapping); metExploreD3.GraphMapping.reloadMapping(mapping);
metExploreD3.fireEventArg('buttonMap', "jsonmapping", mapping); metExploreD3.fireEventArg('buttonMap', "jsonmapping", mapping);
metExploreD3.fireEventArg('selectMapping', "jsonmapping", mapping);
}); });
metExploreD3.fireEventArg('buttonRefresh', "reloadMapping", true); metExploreD3.fireEventArg('buttonRefresh', "reloadMapping", true);
} }
...@@ -990,6 +991,7 @@ console.log(panel); ...@@ -990,6 +991,7 @@ console.log(panel);
_metExploreViz.getMappingsSet().forEach(function(mapping){ _metExploreViz.getMappingsSet().forEach(function(mapping){
metExploreD3.GraphMapping.reloadMapping(mapping); metExploreD3.GraphMapping.reloadMapping(mapping);
metExploreD3.fireEventArg('buttonMap', "jsonmapping", mapping); metExploreD3.fireEventArg('buttonMap', "jsonmapping", mapping);
metExploreD3.fireEventArg('selectMapping', "jsonmapping", mapping);
}); });
metExploreD3.fireEventArg('buttonRefresh', "reloadMapping", true); 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