Data structure containing generic interconnected data used to implement directed graph
A biograph object is a data structure containing generic interconnected data used to implement a directed graph. Nodes represent proteins, genes, or any other biological entity, and edges represent interactions, dependences, or any other relationship between the nodes. A biograph object also stores information, such as color properties and text label characteristics, used to create a 2-D visualization of the graph.
You create a biograph object using the object constructor function biograph
. You can view a graphical representation
of a biograph object using the view
method.
Following are methods of a biograph object:
allshortestpaths (biograph) | Find all shortest paths in biograph object |
conncomp (biograph) | Find strongly or weakly connected components in biograph object |
dolayout (biograph) | Calculate node positions and edge trajectories |
get (biograph) | Retrieve information about biograph object |
getancestors (biograph) | Find ancestors of a node in biograph object |
getdescendants (biograph) | Find descendants of a node in biograph object |
getedgesbynodeid (biograph) | Get handles to edges in biograph object |
getmatrix (biograph) | Get connection matrix from biograph object |
getnodesbyid (biograph) | Get handles to nodes |
getrelatives (biograph) | Find relatives of a node in biograph object |
getweightmatrix (biograph) | Get connection matrix with weights from biograph object |
isdag (biograph) | Test for cycles in biograph object |
isomorphism (biograph) | Find isomorphism between two biograph objects |
isspantree (biograph) | Determine if tree created from biograph object is spanning tree |
maxflow (biograph) | Calculate maximum flow in biograph object |
minspantree (biograph) | Find minimal spanning tree in biograph object |
set (biograph) | Set property of biograph object |
shortestpath (biograph) | Solve shortest path problem in biograph object |
topoorder (biograph) | Perform topological sort of directed acyclic graph extracted from biograph object |
traverse (biograph) | Traverse biograph object by following adjacent nodes |
view (biograph) | Draw figure from biograph object |
Following are methods of a node object:
getancestors (biograph) | Find ancestors of a node in biograph object |
getdescendants (biograph) | Find descendants of a node in biograph object |
getrelatives (biograph) | Find relatives of a node in biograph object |
A biograph object contains two kinds of objects, node objects and edge objects, that have their own properties. For a list of the properties of node objects and edge objects, see the following tables.
Properties of a Biograph Object
Property | Description |
---|---|
ID
| Character vector to identify the biograph
object. Default is '' . |
Label | Character vector to label the biograph
object. Default is '' . |
Description | Character vector that describes the biograph
object. Default is '' . |
LayoutType
| Character vector that specifies the algorithm for the layout engine. Choices are:
|
EdgeType | Character vector that specifies how edges display. Choices are:
Note Curved or segmented edges occur only when necessary to avoid
obstruction by nodes. Biograph objects with |
Scale | Positive number that post-scales the
node coordinates. Default is 1 . |
LayoutScale | Positive number that scales the size
of the nodes before calling the layout engine. Default is 1 . |
EdgeTextColor | Three-element numeric vector of RGB values.
Default is [0, 0, 0] , which defines black. |
EdgeFontSize | Positive number that sets the size of
the edge font in points. Default is 8 . |
ShowArrows | Controls the display of arrows with the
edges. Choices are 'on' (default) or 'off' . |
ArrowSize | Positive number that sets the size of
the arrows in points. Default is 8 . |
ShowWeights | Controls the display of text indicating
the weight of the edges. Choices are 'on' or 'off' (default). |
ShowTextInNodes | Character vector that specifies
the node property used to label nodes when you display a biograph
object using the
|
NodeAutoSize | Controls precalculating the node size before calling the layout
engine. Choices are Note Set it to
|
NodeCallback | User-defined callback for all nodes.
Enter the name of a function, a function handle, or a cell array with
multiple function handles. After using the view function
to display the biograph object in the Biograph Viewer, you can double-click
a node to activate the first callback, or right-click and select a
callback to activate. Default is the anonymous function, @(node)
inspect(node) , which displays the Property Inspector dialog
box. |
EdgeCallback | User-defined callback for all edges.
Enter the name of a function, a function handle, or a cell array with
multiple function handles. After using the view function
to display the biograph object in the Biograph Viewer, you can right-click
and select a callback to activate. Default is the anonymous function, @(edge)
inspect(edge) , which displays the Property Inspector dialog
box. |
CustomNodeDrawFcn | Function handle to a customized function
to draw nodes. Default is [] . |
Nodes | Read-only column vector with handles to node objects of a biograph object. The size of the vector is the number of nodes. For properties of node objects, see Properties of a Node Object. |
Edges | Read-only column vector with handles to edge objects of a biograph object. The size of the vector is the number of edges. For properties of edge objects, see Properties of an Edge Object. |
Properties of a Node Object
Property | Description |
---|---|
ID | Character vector defined when the biograph object is created,
either by the NodeIDs input argument or
internally by the biograph constructor
function. You can modify this property using the set method, but
each node object's ID must be unique. |
Label | Character vector for labeling a node when you display a biograph
object using the view method. Default is '' . |
Description | Character vector that describes the node. Default is '' . |
Position | Two-element numeric vector of x -
and y -coordinates, for example, [150,
150] . If you do not specify this property, default is initially [] ,
then when the layout algorithms are executed, it becomes a two-element
numeric vector of x - and y -coordinates
computed by the layout engine. |
Shape | Character vector that specifies the shape of the nodes. Choices are:
|
Size | Two-element numeric vector calculated before calling the layout
engine using the actual font size and shape of the node. Default is [10,
10] . |
Color | Three-element numeric vector of RGB values that specifies the
fill color of the node. Default is [1, 1, 0.7] ,
which defines yellow. |
LineWidth | Positive number. Default is 1 . |
LineColor | Three-element numeric vector of RGB values that specifies the
outline color of the node. Default is [0.3, 0.3, 1] ,
which defines blue. |
FontSize | Positive number that sets the size of the node font in points.
Default is 8 . |
TextColor | Three-element numeric vector of RGB values that specifies the
color of the node labels. Default is [0, 0, 0] ,
which defines black. |
UserData | Miscellaneous, user-defined data that you want to associate
with the node. The node does not use this property, but you can access
and specify it using the get and set functions. Default
is [] . |
Properties of an Edge Object
Property | Description |
---|---|
ID | Character vector automatically generated from the node ID s
when the biograph object is created by the biograph constructor
function. You can modify this property using the set method, but
each edge object's ID must be unique. |
Label | Character vector for labeling an edge. Default is '' . |
Description | Character vector that describes the edge. Default is '' . |
Weight | Value that represents the weight (cost, distance, length, or
capacity) associated with the edge. Default is 1 . |
LineWidth | Positive number. Default is 0.5 . |
LineColor | Three-element numeric vector of RGB values that specifies the
color of the edge. Default is [0.5, 0.5, 0.5] ,
which defines gray. |
UserData | Miscellaneous, user-defined data that you want to associate
with the edge. The edge does not use this property, but you can access
and specify it using the get and set functions. Default
is [] . |
allshortestpaths
| biograph
| conncomp
| dolayout
| get
| getancestors
| getdescendants
| getedgesbynodeid
| getmatrix
| getnodesbyid
| getrelatives
| isdag
| isomorphism
| isspantree
| maxflow
| minspantree
| set
| shortestpath
| topoorder
| traverse
| view