| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → Bioinformatics Toolbox |
| Contents | Index |
| Learn more about Bioinformatics Toolbox |
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 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 |
| 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 in biograph object |
| getdescendants (biograph) | Find descendants in biograph object |
| getrelatives (biograph) | Find relatives 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 | String to identify the biograph object. Default is ''. |
| Label | String to label the biograph object. Default is ''. |
| Description | String that describes the biograph object. Default is ''. |
| 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 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 string 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 | String for labeling a node when you display a biograph object using the view method. Default is ''. |
| Description | String 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 | 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 | Character string automatically generated from the node IDs 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 | String for labeling an edge when you display a biograph object using the view method. Default is ''. |
| Description | String 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 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 []. |
Determining Properties and Property Values of a Biograph Object
You can display all properties and their current values of a biograph object, BGobj, by using the following syntax:
get(BGobj)
You can return all properties and their current values of BGobj, a biograph object, to BGstruct, a scalar structure in which each field name is a property of a biograph object, and each field contains the value of that property, by using the following syntax:
BGstruct = get(BGobj)
You can return the value of a specific property of a biograph object, BGobj, by using either of the following syntaxes:
PropertyValue = get(BGobj, 'PropertyName')
PropertyValue = BGobj.PropertyName
You can return the value of specific properties of a biograph object, BGobj, by using the following syntax:
[Property1Value, Property2Value, ...] = get(BGobj, ... 'Property1Name', 'Property2Name', ...)
Determining Properties and Property Values of a Node or Edge of a Biograph Object
You can display all properties and their current values of the nth node or nth edge of a biograph object, BGobj, by using the following syntaxes:
get(BGobj.nodes(n))
get(BGobj.edges(n))
Determining Possible Values of Biograph Object Properties
You can display possible values for all properties that have a fixed set of property values in a biograph object, BGobj, by using the following syntax:
set(BGobj)
You can display possible values for a specific property that has a fixed set of property values in a biograph object, BGobj, by using the following syntax:
set(BGobj, 'PropertyName')
Specifying Properties of a Biograph Object
You can set a specific property of a biograph object, BGobj, by using either of the following syntaxes:
set(BGobj, 'PropertyName', PropertyValue)
BGobj.PropertyName = PropertyValue
You can set multiple properties of a biograph object, BGobj, by using the following syntax:
set(BGobj, 'Property1Name', Property1Value, ... 'Property2Name', Property2Value, ...)
Specifying Properties of a Node of a Biograph Object
You can set a specific property of the nth node of a biograph object, BGobj, by using either of the following syntaxes:
set(BGobj.nodes(n), 'PropertyName', PropertyValue)
BGobj.nodes(n).PropertyName = PropertyValue
Tip To specify properties of a node using the node's ID, use the getnodesbyid function to create a handle for the node: nodehandle = getnodesbyid(BGobj, NodeID) Then use the handle for the node in either of the following syntaxes: set(nodehandle, 'PropertyName', PropertyValue) nodehandle.PropertyName = PropertyValue |
Specifying Properties of an Edge of a Biograph Object
You can set a specific property of the nth edge of a biograph object, BGobj, by using either of the following syntaxes:
set(BGobj.edges(n), 'PropertyName', PropertyValue)
BGobj.edges(n).PropertyName = PropertyValue
Tip To specify properties of an edge using the source and sink node's ID's, use the getedgesbynodeid function to create a handle for the edge: edgehandle = getedgesbynodeid(BGobj, SourceNodeID, ...
SinkNodeID)Then use the handle for the edge in either of the following syntaxes: set(edgehandle, 'PropertyName', PropertyValue) edgehandle.PropertyName = PropertyValue |
Bioinformatics Toolbox functions: biograph (object constructor),
Bioinformatics Toolbox methods of a biograph object: allshortestpaths, conncomp, dolayout, get, getancestors, getdescendants, getedgesbynodeid, getmatrix, getnodesbyid, getrelatives, isdag, isomorphism, isspantree, maxflow, minspantree, set, shortestpath, topoorder, traverse, view
![]() | baselookup | biograph | ![]() |

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |