@@ -33,7 +33,7 @@ var widgetry = require('noctua-widgetry');
33
33
var jQuery = require ( 'jquery' ) ;
34
34
/* jshint ignore:end */
35
35
36
- // Items
36
+ // Items
37
37
var barista_response = require ( 'bbop-response-barista' ) ;
38
38
var class_expression = require ( 'class-expression' ) ;
39
39
var minerva_requests = require ( 'minerva-requests' ) ;
@@ -47,6 +47,7 @@ var gserv = global_golr_server;
47
47
var defs = new amigo . data . definitions ( ) ;
48
48
var handler = new amigo . handler ( ) ;
49
49
var linker = new amigo . linker ( ) ;
50
+ linker . app_base = 'http://amigo.geneontology.org' ;
50
51
//var dlimit = defs.download_limit();
51
52
var dlimit = 1000 ;
52
53
@@ -113,7 +114,7 @@ var CompanionInit = function(user_token){
113
114
var mmanager = new minerva_manager ( global_barista_location ,
114
115
global_minerva_definition_name ,
115
116
user_token , engine , 'async' ) ;
116
-
117
+
117
118
// GOlr location and conf setup.
118
119
var gconf = new bbop_legacy . golr . conf ( amigo . data . golr ) ;
119
120
@@ -211,15 +212,15 @@ var CompanionInit = function(user_token){
211
212
///
212
213
/// AmiGO comms.
213
214
///
214
-
215
+
215
216
// Ready the primary widget manager.
216
217
var widget_manager = new bbop_legacy . golr . manager . jquery ( gserv , gconf ) ;
217
218
var confc = gconf . get_class ( 'annotation' ) ;
218
219
widget_manager . set_personality ( 'annotation' ) ;
219
220
widget_manager . add_query_filter ( 'document_category' ,
220
221
confc . document_category ( ) , [ '*' ] ) ;
221
222
widget_manager . add_query_filter ( 'aspect' , 'F' ) ; // removable
222
-
223
+
223
224
// Attach filters to manager.
224
225
var hargs = {
225
226
meta_label : 'Total documents: ' ,
@@ -230,24 +231,24 @@ var CompanionInit = function(user_token){
230
231
var filters = new bbop_legacy . widget . live_filters (
231
232
'input-filter-accordion' , widget_manager , gconf , hargs ) ;
232
233
filters . establish_display ( ) ;
233
-
234
+
234
235
// Attach pager to manager.
235
236
var pager_opts = {
236
237
} ;
237
238
var pager = new bbop_legacy . widget . live_pager ( 'pager' , widget_manager ,
238
239
pager_opts ) ;
239
-
240
- // Describe the button that will attempt to compact the selected
240
+
241
+ // Describe the button that will attempt to compact the selected
241
242
// annotations and send macro commands to noctua/minerva.
242
243
// The alrorithm is derived from a diagram here:
243
244
// https://github.com/geneontology/noctua/issues/170#issuecomment-134414048
244
245
var port_to_noctua_button = {
245
246
label : 'Import' ,
246
247
diabled_p : false ,
247
- click_function_generator : function ( results_table , widget_manager ) { //
248
-
248
+ click_function_generator : function ( results_table , widget_manager ) { //
249
+
249
250
return function ( event ) {
250
-
251
+
251
252
var selected_ids = results_table . get_selected_items ( ) ;
252
253
var resp = results_table . last_response ( ) ;
253
254
@@ -256,7 +257,7 @@ var CompanionInit = function(user_token){
256
257
alert ( 'No action can be taken currently.' ) ;
257
258
} else {
258
259
//alert('Actionable input.');
259
-
260
+
260
261
// Extract the documents that we'll operate on.
261
262
var docs_to_run = [ ] ;
262
263
each ( selected_ids , function ( sid ) {
@@ -265,11 +266,11 @@ var CompanionInit = function(user_token){
265
266
docs_to_run . push ( doc ) ;
266
267
}
267
268
} ) ;
268
-
269
+
269
270
// Assemble a batch to run.
270
271
var acls_set = { } ;
271
272
each ( docs_to_run , function ( doc ) {
272
-
273
+
273
274
// Who are we talking about?
274
275
var acls = doc [ 'annotation_class' ] ;
275
276
var bio = doc [ 'bioentity' ] ;
@@ -325,7 +326,7 @@ var CompanionInit = function(user_token){
325
326
withs : withs
326
327
} ) ;
327
328
} ) ;
328
-
329
+
329
330
// WARNING: Warn if we are going to be batching a lot.
330
331
if ( us . keys ( acls_set ) . length > 3 ) {
331
332
alert ( 'You have a lot of requests from different ' +
@@ -342,45 +343,45 @@ var CompanionInit = function(user_token){
342
343
// Now let's actually assemble the /generic/ requests
343
344
// for the run.
344
345
var reqs = new minerva_requests . request_set (
345
- global_barista_token , global_id ) ;
346
+ global_barista_token , global_id ) ;
346
347
reqs . use_groups ( [
347
348
// WARNING: We're minting money that we
348
349
// might not honor here.
349
350
'http://purl.obolibrary.org/go/groups/' + assby
350
351
] ) ;
351
352
352
353
us . each ( acls_assby_subset , function ( bio_set , acls ) {
353
-
354
+
354
355
var sub = reqs . add_individual ( acls ) ;
355
-
356
+
356
357
us . each ( bio_set , function ( ev_list , bio ) {
357
-
358
+
358
359
var obj = reqs . add_individual ( bio ) ;
359
360
var edge = reqs . add_fact (
360
361
[ sub , obj , 'RO:0002333' ] ) ;
361
-
362
+
362
363
us . each ( ev_list , function ( ev_set ) {
363
-
364
+
364
365
// Recover.
365
366
var ev = ev_set [ 'ev' ] ;
366
367
var refs = ev_set [ 'refs' ] ;
367
368
var withs = ev_set [ 'withs' ] ;
368
369
var assby = ev_set [ 'assigned_by' ] ;
369
-
370
+
370
371
// Tag on the final evidence.
371
372
reqs . add_evidence (
372
373
ev , refs , withs ,
373
374
[ sub , obj , 'RO:0002333' ] ) ;
374
375
} ) ;
375
376
} ) ;
376
-
377
- // ???
377
+
378
+ // ???
378
379
} ) ;
379
380
380
381
// Fire and forget.
381
382
mmanager . request_with ( reqs ) ;
382
383
} ) ;
383
-
384
+
384
385
}
385
386
} ;
386
387
}
@@ -397,7 +398,7 @@ var CompanionInit = function(user_token){
397
398
var results = new bbop_legacy . widget . live_results ( 'results' , widget_manager ,
398
399
confc , handler , linker ,
399
400
results_opts ) ;
400
-
401
+
401
402
// Add pre and post run spinner (borrow filter's for now).
402
403
widget_manager . register ( 'prerun' , 'foo' , function ( ) {
403
404
filters . spin_up ( ) ;
0 commit comments