From ab00efeedc40c466736fab38414e2df707716451 Mon Sep 17 00:00:00 2001 From: cramakri <cramakri> Date: Wed, 9 Jan 2013 14:37:58 +0000 Subject: [PATCH] CCS-26 SP-446 : Support inspecting strains without data in openbis SVN: 28040 --- .../basynthec/browser/basynthec-browser.js | 24 +++++++++++-------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/eu_basynthec/source/core-plugins/basynthec/1/as/webapps/basynthec/browser/basynthec-browser.js b/eu_basynthec/source/core-plugins/basynthec/1/as/webapps/basynthec/browser/basynthec-browser.js index a8273cef9a6..0a0c6a66f55 100644 --- a/eu_basynthec/source/core-plugins/basynthec/1/as/webapps/basynthec/browser/basynthec-browser.js +++ b/eu_basynthec/source/core-plugins/basynthec/1/as/webapps/basynthec/browser/basynthec-browser.js @@ -312,7 +312,7 @@ AppPresenter.prototype.toggleInspected = function(d, connectedNode) { d.dataSets = [{ bis : d.dataSet }]; retrieveFilesForDataSets(d.dataSets); } else if (!d.dataSets) { - d.dataSets = model.dataSetsByStrain[d.name].dataSets.map(function(ds){ return {bis : ds} }); + d.dataSets = model.dataSetsByStrain[d.name].dataSets.map(function(ds){ return {bis : ds} }); retrieveFilesForDataSets(d.dataSets); } } @@ -350,8 +350,8 @@ AppPresenter.prototype.toggleOd600Inspected = function(d) { if (d instanceof DataSetWrapper) { d.dataSets = [{ bis : d.dataSet }]; retrieveFilesForDataSets(d.dataSets); - } else if (!d.dataSets) { - d.dataSets = model.dataSetsByStrain[d.name].dataSets.map(function(ds){ return {bis : ds} }); + } else if (!d.dataSets && d.data.isKnown) { + d.dataSets = model.dataSetsByStrain[d.name].dataSets.map(function(ds){ return {bis : ds} }); retrieveFilesForDataSets(d.dataSets); } } @@ -561,7 +561,7 @@ AppModel.prototype.initializeOd600WithPhenotypesAndPredictionsModel = function(c return "OD600" == dataset.dataSetTypeCode; }); - if (hasOd600Datasets) { + if (hasOd600Datasets) { if(hasPhenotypesOrPredictions){ strainData.isKnown = true; strainsKnownToOpenbisWithPhenotypesOrPredictions.push(strainData); @@ -584,10 +584,18 @@ AppModel.prototype.initializeOd600WithPhenotypesAndPredictionsModel = function(c var hasPhenotypesOrPredictions = strainData && (strainData.hasPhenotypes || strainData.hasPredictions); var hasDatasets = strainDatasets && strainDatasets.dataSets.length > 0; - if(hasPhenotypesOrPredictions && !hasDatasets){ + if(hasPhenotypesOrPredictions && !hasDatasets) { strainData.isKnown = false; strainsUnknownToOpenbisWithPhenotypesOrPredictions.push(strainData); } + + strainData.phenotypeMap = {}; + if (strainData.hasPhenotypes) { + strainData.phenotypes.forEach(function(each) { + strainData.phenotypeMap[each.media] = each.relativeGrowth; + model.addGrowthMedium(each.media, strainName); + }); + } } model.od600StrainsWithPhenotypesAndPredictionsGroups = []; @@ -845,11 +853,7 @@ Od600StrainWithPhenotypesAndPredictionsView.prototype.updateView = function(dura var tds = trs.selectAll("td").data(function(d) { return d }); tds.enter() .append("td") - .on("click", function(d){ - if(d.data.isKnown){ - return toggleOd600Inspected(d); - } - }) + .on("click", function(d) { return toggleOd600Inspected(d); }) .text(function(d) { return d.label }) .style("color", function(d){ if(d.data.hasPhenotypes && d.data.hasPredictions){ -- GitLab