7.1.1.4.1.4. cobramod.visualization.force_graph¶
Added in version 1.3.0.
This module contains the logic to create a three-dimensional representation
from a cobra.core.Group or a cobra.Reaction
using 3d-force-graph .
7.1.1.4.1.4.1. Classes¶
Added in version 1.3.0. |
7.1.1.4.1.4.2. Module Contents¶
- class cobramod.visualization.force_graph.Links(source, target, value)¶
- class cobramod.visualization.force_graph.GraphData¶
- class cobramod.visualization.force_graph.ForceGraphIntegration¶
Bases:
anywidget.AnyWidgetAdded in version 1.3.0.
Widget for displaying a
cobra.core.group.Grouporcobra.Reactionas a force directed graph.- property model: Type[cobra.core.Group] | Type[cobra.Reaction] | None¶
The Model to be represented. It can ether be a
cobra.core.group.Grouporcobra.Reaction. It is set to None upon initialization.- Return type:
Optional[Union[Type[cobra.core.Group], Type[cobra.Reaction]]]
- property solution: Type[cobra.Solution] | dict[str, float] | None¶
The flux values to be taken into account when creating the graph. These scale the stoichiometry of the respective reaction. If a reaction is not found in this object, a flux of 1 is assumed. The flux values can either be passed as cobra.Solution or as dict, where the key is the reaction ID and the value is the flux value. It is set to None upon initialization.
- Return type:
Optional[Union[Type[cobra.Solution], dict[str, float]]]
- save_layout(file)¶
Method to save the layout of the current display. The resulting file is a CSV containing the ID of the metabolite and its X, Y and Z position in the other columns.
- Parameters:
file (Union[str, pathlib.Path]) – The path where the layout is to be saved.
- load_layout(file)¶
Method to restore the layout that was saved using
save_layout().- Parameters:
file (Union[str, pathlib.Path]) – Path to the file containing the saved layout.