Main Content

biograph object

(Removed) Data structure containing generic interconnected data used to implement directed graph

biograph object and its methods have been removed. Use graph or digraph instead. For details, see Version History.

Description

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.

Method Summary

Following are methods of a biograph object:

allshortestpaths (biograph)(Removed) Find all shortest paths in biograph object
conncomp (biograph)(Removed) Find strongly or weakly connected components in biograph object
dolayout (biograph)(Removed) Calculate node positions and edge trajectories
get (biograph)(To be removed) Retrieve information about biograph object
getancestors (biograph)(Removed) Find ancestors of a node in biograph object
getdescendants (biograph)(Removed) Find descendants of a node in biograph object
getedgesbynodeid (biograph)(Removed) Get handles to edges in biograph object
getmatrix (biograph)(Removed) Get connection matrix from biograph object
getnodesbyid (biograph)(Removed) Get handles to nodes
getrelatives (biograph)(Removed) Find relatives of a node in biograph object
getweightmatrix (biograph)(Removed) Get connection matrix with weights from biograph object
isdag (biograph)(Removed) Test for cycles in biograph object
isomorphism (biograph)(Removed) Find isomorphism between two biograph objects
isspantree (biograph)(Removed) Determine if tree created from biograph object is spanning tree
maxflow (biograph)(Removed) Calculate maximum flow in biograph object
minspantree (biograph)(Removed) Find minimal spanning tree in biograph object
set (biograph)(To be removed) Set property of biograph object
shortestpath (biograph)(Removed) Solve shortest path problem in biograph object
topoorder (biograph)(Removed) Perform topological sort of directed acyclic graph extracted from biograph object
traverse (biograph)(Removed) Traverse biograph object by following adjacent nodes
view (biograph)(Removed) Draw figure from biograph object

Following are methods of a node object:

getancestors (biograph)(Removed) Find ancestors of a node in biograph object
getdescendants (biograph)(Removed) Find descendants of a node in biograph object
getrelatives (biograph)(Removed) Find relatives of a node in biograph object

Property Summary

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

PropertyDescription
ID Character vector to identify the biograph object. Default is ''.
LabelCharacter vector to label the biograph object. Default is ''.
DescriptionCharacter vector that describes the biograph object. Default is ''.
LayoutType

Character vector that specifies the algorithm for the layout engine. Choices are:

  • 'hierarchical' (default) — Uses a topological order of the graph to assign levels, and then arranges the nodes from top to bottom, while minimizing crossing edges.

  • 'radial' — Uses a topological order of the graph to assign levels, and then arranges the nodes from inside to outside of the circle, while minimizing crossing edges.

  • 'equilibrium' — Calculates layout by minimizing the energy in a dynamic spring system.

EdgeType

Character vector that specifies how edges display. Choices are:

  • 'straight'

  • 'curved' (default)

  • 'segmented'

Note

Curved or segmented edges occur only when necessary to avoid obstruction by nodes. Biograph objects with LayoutType equal to 'equilibrium' or 'radial' cannot produce curved or segmented edges.

Scale Positive number that post-scales the node coordinates. Default is 1.
LayoutScalePositive number that scales the size of the nodes before calling the layout engine. Default is 1.
EdgeTextColorThree-element numeric vector of RGB values. Default is [0, 0, 0], which defines black.
EdgeFontSizePositive number that sets the size of the edge font in points. Default is 8.
ShowArrowsControls the display of arrows with the edges. Choices are 'on' (default) or 'off'.
ArrowSizePositive number that sets the size of the arrows in points. Default is 8.
ShowWeightsControls 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 view method. Choices are:

  • 'Label' — Uses the Label property of the node object (default).

  • 'ID' — Uses the ID property of the node object.

  • 'None'

NodeAutoSize

Controls precalculating the node size before calling the layout engine. Choices are 'on' (default) or 'off'.

Note

Set it to off if you want to apply different node sizes by changing the Size property.

NodeCallbackUser-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.
EdgeCallbackUser-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.
CustomNodeDrawFcnFunction handle to a customized function to draw nodes. Default is [].
NodesRead-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.
EdgesRead-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

PropertyDescription
IDCharacter 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.
LabelCharacter vector for labeling a node when you display a biograph object using the view method. Default is ''.
DescriptionCharacter vector that describes the node. Default is ''.
PositionTwo-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:

  • 'box'(default)

  • 'ellipse'

  • 'circle'

  • 'rect' or 'rectangle'

  • 'diamond'

  • 'trapezium'

  • 'invtrapezium'

  • 'house'

  • 'invhouse'

  • 'parallelogram'

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.
UserDataMiscellaneous, 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

PropertyDescription
ID Character vector 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 Character vector for labeling an edge. Default is ''.
Description Character vector that describes the edge. Default is ''.
WeightValue 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.
UserDataMiscellaneous, 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 [].

Version History

Introduced in R2006b

expand all

R2022b: Removed

The biograph object and its methods have been removed. See the following table for alternative functions from graph and digraph objects.

Methods of biographAlternative Functions from graph and digraph Objects
allshortestpaths (biograph)distances
conncomp (biograph)conncomp
dolayout (biograph)Not applicable
getancestors (biograph)predecessors. Note that the function does not let you specify NumGenerations. You can use distances to find the distances from all nodes to the target node after setting the edge weight to 1, and filter the nodes by distance to the appropriate depth.
getdescendants (biograph)successors. If you need to specify NumGenerations, see the workaround listed above for predecessors.
getedgesbynodeid (biograph)findedge
getmatrix (biograph)adjacency
getnodesbyid (biograph)findnode
getrelatives (biograph)neighbors
getweightmatrix (biograph)adjacency
isdag (biograph)isdag
isomorphism (biograph)isomorphism
isspantree (biograph) A graph is a spanning tree if and only if all nodes are reachable from an arbitrary start node, and |E| == |N| - 1, where E is the number of edges and N is the number of nodes. You can use either bfsearch or dfsearch to check such conditions are true for a given graph.
maxflow (biograph)maxflow
minspantree (biograph)minspantree
shortestpath (biograph)shortestpath
topoorder (biograph)toposort
traverse (biograph)bfsearch or dfsearch
view (biograph)plot. The name-value arguments of the plot function can be used to control the properties of the graph. The arguments can be used as replacements for many of the biograph object properties to change the appearance of the graph.

See Also

|