| Bioinformatics Toolbox™ | ![]() |
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 |
| getancestors (biograph) | Find ancestors in biograph object |
| getdescendants (biograph) | Find descendants 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 in 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 |
| 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 in biograph object |
| getdescendants (biograph) | Find descendants in biograph object |
| getrelatives (biograph) | Find relatives in biograph object |
A biograph object contains two 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 | String to identify the biograph object. Default is ''. (This information is for bookkeeping purposes only.) |
| Label | String to label the biograph object. Default is ''. (This information is for bookkeeping purposes only.) |
| Description | String that describes the biograph object. Default is ''. (This information is for bookkeeping purposes only.) |
| LayoutType | String that specifies the algorithm for the layout engine. Choices are:
|
| EdgeType | String that specifies how edges display. Choices are:
|
| 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' (default) or 'off'. |
| ShowTextInNodes | String that specifies the node property used to label nodes when you display a biograph object using the view method. Choices are:
|
| NodeAutoSize | Controls precalculating the node size before calling the layout engine. Choices are 'on' (default) or 'off'. |
| 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 double-click an edge to activate the first callback, or 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 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 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 | Read-only string defined when the biograph object is created, either by the NodeIDs input argument or internally by the biograph constructor function. Each node object's ID is unique and used internally to identify the node. |
| Label | String for labeling a node when you display a biograph object using the view method. Default is the ID property of the node object. |
| Description | String that describes the node. Default is ''. (This information is for bookkeeping purposes only.) |
| 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 | String 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 | Read-only string defined when the biograph object is created, internally by the biograph constructor function. Each edge object's ID is unique and used internally to identify the edge. |
| Label | String for labeling an edge when you display a biograph object using the view method. Default is the ID property of the edge object. |
| Description | String that describes the edge. Default is ''. (This information is for bookkeeping purposes only.) |
| Weight | Value that represents the weight (cost, distance, length, or capacity) associated with the edge. Default is 1. |
| LineWidth | Positive number. Default is 1. |
| 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 []. |
Accessing Properties of a Biograph Object
You can access properties of a biograph object, BGobj, by using either of the following syntaxes:
PropertyValue = get(BGobj, 'PropertyName')
PropertyValue = BGobj.PropertyName
Accessing Allowed Values of Biograph Object Properties
You can access allowed values for any property that has a finite set of choices by using the following syntax:
set(BGobj, 'PropertyName')
Specifying Properties of a Biograph Object
You can specify properties of a biograph object, BGobj, by using any of the following syntaxes:
set(BGobj, 'PropertyName', PropertyValue)
BGobj.PropertyName = PropertyValue
Bioinformatics Toolbox™ function: biograph (object constructor)
Bioinformatics Toolbox methods of a biograph object: allshortestpaths, conncomp, dolayout, getancestors, getdescendants, getedgesbynodeid, getmatrix, getnodesbyid, getrelatives, isdag, isomorphism, isspantree, maxflow, minspantree, shortestpath, topoorder, traverse, view
![]() | Object Reference | clustergram object | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |