bracket.js

Summary
bracket.js
bbop.model.bracket.graphPurpose: An extension of bbop.model.graph to produce a bracketed layout (like the neighborhood view in AmiGO 1.8).
bbop.model.bracket.graph
Functions
bracketExtension of bbop.model.graph
bracket_layoutLargely borrowed from ChewableGraph.pm from the perl section on AmiGO 2.
relation_weightA GO-specific take on the relative importance of relations in a graph.
dominant_relationshipGiven a bunch of relationships, return the one that is more “dominant”.
rich_bracket_layoutVery similar to bracket_layout, except that instead of the node id, there is a list of [node_id, node_label, predicate].

bbop.model.bracket.graph

Purpose: An extension of bbop.model.graph to produce a bracketed layout (like the neighborhood view in AmiGO 1.8).

TODO: A work in progress...

bbop.model.bracket.graph

Summary
Functions
bracketExtension of bbop.model.graph
bracket_layoutLargely borrowed from ChewableGraph.pm from the perl section on AmiGO 2.
relation_weightA GO-specific take on the relative importance of relations in a graph.
dominant_relationshipGiven a bunch of relationships, return the one that is more “dominant”.
rich_bracket_layoutVery similar to bracket_layout, except that instead of the node id, there is a list of [node_id, node_label, predicate].

Functions

bracket

bbop.model.bracket.graph = function()

Extension of bbop.model.graph

Arguments

n/a

Returns

this

bracket_layout

this.bracket_layout = function(term_acc)

Largely borrowed from ChewableGraph.pm from the perl section on AmiGO 2.

Produces a simple bracketed layout based on the maximum distance from the node-of-interest to all other nodes.  It also includes direct children as the last row.  Useful in some layout contexts.

Any node in a properly made graph should be fine, but for the usual end case, see rich_bracket_layout.

Parameters

term_accnode of interest

Returns

list of lists or id strings [[id1, id2], ...]

relation_weight

this.relation_weight = function(predicate_acc,
default_weight)

A GO-specific take on the relative importance of relations in a graph.

Parameters

predicate_accas string
default_weight[optional] as numbrt

Returns

relative weight of predicate as number; defaults to 0

dominant_relationship

this.dominant_relationship = function()

Given a bunch of relationships, return the one that is more “dominant”.

A GO-specific take on the relative importance of relations in a graph.

Parameters

whateverpredicate acc, or lists of lists them...whatever

Returns

string acc of the dominant relationship or null

See also

<relationship_weight>

rich_bracket_layout

this.rich_bracket_layout = function(term_acc,
transitivity_graph)

Very similar to bracket_layout, except that instead of the node id, there is a list of [node_id, node_label, predicate].

This is only reliably producable if the following two condition is met: the transitivity graph is the one made for the node of interest by the GOlr loading engine.  This is easy to meet if using GOlr, but probably better to roll your own if you’re not.

Also, the relative weight of the relations used is very GO-specific--see relation_weight.

Again, heavy borrowing from ChewableGraph.pm from the perl section in AmiGO 2.

Parameters

term_accnode of interest
transitivity_graphthe bbop.model.graph for the relations

Returns

list of lists of lists: [[[id, label, predicate], ...], ...]

bbop.model.bracket.graph = function()
Extension of bbop.model.graph
this.bracket_layout = function(term_acc)
Largely borrowed from ChewableGraph.pm from the perl section on AmiGO 2.
this.relation_weight = function(predicate_acc,
default_weight)
A GO-specific take on the relative importance of relations in a graph.
this.dominant_relationship = function()
Given a bunch of relationships, return the one that is more “dominant”.
this.rich_bracket_layout = function(term_acc,
transitivity_graph)
Very similar to bracket_layout, except that instead of the node id, there is a list of [node_id, node_label, predicate].
Close