@@ -203,7 +203,15 @@ App.TreesPharmacologyController = Ember.ArrayController.extend({
203203 var lens = null ;
204204 var activity = this . get ( 'selectedActivity' ) != null ? this . get ( 'selectedActivity' ) . label : null ;
205205 var unit = this . get ( 'selectedUnit' ) != null ? this . get ( 'selectedUnit' ) . label : null ;
206- var condition = this . get ( 'selectedCondition' ) != null ? this . get ( 'selectedCondition' ) : null ;
206+ var actualUnit = null ;
207+ this . get ( 'activityUnits' ) . forEach ( function ( activityUnit , index ) {
208+ if ( activityUnit . label === unit ) {
209+ actualUnit = activityUnit . uri . split ( '/' ) . pop ( ) . split ( '#' ) . pop ( ) . replace ( / \W + / g, '-' ) . replace ( / ( [ a - z \d ] ) ( [ A - Z ] ) / g, '$1_$2' ) . toLowerCase ( ) ;
210+ }
211+ } ) ;
212+ unit = actualUnit ;
213+
214+ var condition = this . get ( 'selectedCondition' ) != null ? this . get ( 'selectedCondition' ) : null ;
207215 var currentActivityValue = this . get ( 'activityValue' ) != null ? this . get ( 'activityValue' ) : null ;
208216 var activityRelation = null ;
209217 var minActivityValue = null ;
@@ -333,7 +341,15 @@ App.TreesPharmacologyController = Ember.ArrayController.extend({
333341 var lens = null ;
334342 var activity = this . get ( 'selectedActivity' ) != null ? this . get ( 'selectedActivity' ) . label : null ;
335343 var unit = this . get ( 'selectedUnit' ) != null ? this . get ( 'selectedUnit' ) . label : null ;
336- var condition = this . get ( 'selectedCondition' ) != null ? this . get ( 'selectedCondition' ) : null ;
344+ var actualUnit = null ;
345+ this . get ( 'activityUnits' ) . forEach ( function ( activityUnit , index ) {
346+ if ( activityUnit . label === unit ) {
347+ actualUnit = activityUnit . uri . split ( '/' ) . pop ( ) . split ( '#' ) . pop ( ) . replace ( / \W + / g, '-' ) . replace ( / ( [ a - z \d ] ) ( [ A - Z ] ) / g, '$1_$2' ) . toLowerCase ( ) ;
348+ }
349+ } ) ;
350+ unit = actualUnit ;
351+
352+ var condition = this . get ( 'selectedCondition' ) != null ? this . get ( 'selectedCondition' ) : null ;
337353 var currentActivityValue = this . get ( 'activityValue' ) != null ? this . get ( 'activityValue' ) : null ;
338354 var activityRelation = null ;
339355 var minActivityValue = null ;
@@ -459,7 +475,15 @@ App.TreesPharmacologyController = Ember.ArrayController.extend({
459475 var lens = null ;
460476 var activity = this . get ( 'selectedActivity' ) != null ? this . get ( 'selectedActivity' ) . label : null ;
461477 var unit = this . get ( 'selectedUnit' ) != null ? this . get ( 'selectedUnit' ) . label : null ;
462- var condition = this . get ( 'selectedCondition' ) != null ? this . get ( 'selectedCondition' ) : null ;
478+ var actualUnit = null ;
479+ this . get ( 'activityUnits' ) . forEach ( function ( activityUnit , index ) {
480+ if ( activityUnit . label === unit ) {
481+ actualUnit = activityUnit . uri . split ( '/' ) . pop ( ) . split ( '#' ) . pop ( ) . replace ( / \W + / g, '-' ) . replace ( / ( [ a - z \d ] ) ( [ A - Z ] ) / g, '$1_$2' ) . toLowerCase ( ) ;
482+ }
483+ } ) ;
484+ unit = actualUnit ;
485+
486+ var condition = this . get ( 'selectedCondition' ) != null ? this . get ( 'selectedCondition' ) : null ;
463487 var currentActivityValue = this . get ( 'activityValue' ) != null ? this . get ( 'activityValue' ) : null ;
464488 var activityRelation = null ;
465489 var minActivityValue = null ;
@@ -601,10 +625,10 @@ App.TreesPharmacologyController = Ember.ArrayController.extend({
601625 }
602626 } ;
603627 if ( this . get ( 'treeType' ) === 'chebi' ) {
604- searcher . getCompoundClassPharmacologyCount ( me . get ( 'uri' ) , assayOrganism , targetOrganism , activity , activityValue , minActivityValue , minExActivityValue , maxActivityValue , maxExActivityValue , unit , activityRelation , actualPchemblValue , minPchemblValue , minExPchemblValue , maxPchemblValue , maxExPchemblValue , targetType , lens , countCallback ) ;
628+ searcher . getCompoundClassPharmacologyCount ( me . get ( 'uri' ) , assayOrganism , targetOrganism , activity , activityValue , unit , minActivityValue , minExActivityValue , maxActivityValue , maxExActivityValue , activityRelation , actualPchemblValue , minPchemblValue , minExPchemblValue , maxPchemblValue , maxExPchemblValue , targetType , lens , countCallback ) ;
605629
606630 } else {
607- searcher . getTargetClassPharmacologyCount ( me . get ( 'uri' ) , assayOrganism , targetOrganism , activity , activityValue , minActivityValue , minExActivityValue , maxActivityValue , maxExActivityValue , unit , activityRelation , actualPchemblValue , minPchemblValue , minExPchemblValue , maxPchemblValue , maxExPchemblValue , targetType , lens , countCallback ) ;
631+ searcher . getTargetClassPharmacologyCount ( me . get ( 'uri' ) , assayOrganism , targetOrganism , activity , activityValue , unit , minActivityValue , minExActivityValue , maxActivityValue , maxExActivityValue , activityRelation , actualPchemblValue , minPchemblValue , minExPchemblValue , maxPchemblValue , maxExPchemblValue , targetType , lens , countCallback ) ;
608632 }
609633 } ,
610634 resetFilters : function ( ) {
@@ -640,7 +664,15 @@ searcher.getCompoundClassPharmacologyCount(me.get('uri'), assayOrganism, targetO
640664 var lens = null ;
641665 var activity = this . get ( 'selectedActivity' ) != null ? this . get ( 'selectedActivity' ) . label : null ;
642666 var unit = this . get ( 'selectedUnit' ) != null ? this . get ( 'selectedUnit' ) . label : null ;
643- var condition = this . get ( 'selectedCondition' ) != null ? this . get ( 'selectedCondition' ) : null ;
667+ var actualUnit = null ;
668+ this . get ( 'activityUnits' ) . forEach ( function ( activityUnit , index ) {
669+ if ( activityUnit . label === unit ) {
670+ actualUnit = activityUnit . uri . split ( '/' ) . pop ( ) . split ( '#' ) . pop ( ) . replace ( / \W + / g, '-' ) . replace ( / ( [ a - z \d ] ) ( [ A - Z ] ) / g, '$1_$2' ) . toLowerCase ( ) ;
671+ }
672+ } ) ;
673+ unit = actualUnit ;
674+
675+ var condition = this . get ( 'selectedCondition' ) != null ? this . get ( 'selectedCondition' ) : null ;
644676 var currentActivityValue = this . get ( 'activityValue' ) != null ? this . get ( 'activityValue' ) : null ;
645677 var activityRelation = null ;
646678 var minActivityValue = null ;
0 commit comments