AF
momapy.sbgn.af
SBGN Activity Flow (AF) subpackage facade.
Layout-model mapping catalogue
This section lists, for each model-element category in SBGN-AF, the shape of the corresponding key in LayoutModelMapping. See LayoutModelMapping for the general concepts (singleton keys, frozenset keys, anchors).
Singleton keys (one layout element represents the model element):
| Model element | Layout element used as the key |
|---|---|
| Compartment | CompartmentLayout |
| BiologicalActivity | BiologicalActivityLayout |
| Phenotype | PhenotypeLayout |
| UnitOfInformation and subclasses (e.g. MacromoleculeUnitOfInformation, NucleicAcidFeatureUnitOfInformation, SimpleChemicalUnitOfInformation, ComplexUnitOfInformation, UnspecifiedEntityUnitOfInformation, PerturbationUnitOfInformation) | The corresponding *UnitOfInformationLayout (e.g. MacromoleculeUnitOfInformationLayout, PerturbationUnitOfInformationLayout) |
| Submap | SubmapLayout |
| LogicalOperatorInput | LogicArcLayout |
| TagReference, TerminalReference | EquivalenceArcLayout |
Frozenset keys (a cluster of layout elements jointly represents the
model element; the anchor is the layout that stands for the cluster
on its own and must be passed as anchor= when calling
add_mapping):
| Model element | Members of the frozenset key | Anchor |
|---|---|---|
| LogicalOperator and subclasses (e.g. AndOperator, OrOperator, NotOperator, DelayOperator) | The operator *Layout (e.g. AndOperatorLayout, DelayOperatorLayout) + every LogicArcLayout input + every target layout those logic arcs point to |
The operator *Layout |
| Influence and subclasses (e.g. UnknownInfluence, PositiveInfluence, NegativeInfluence, NecessaryStimulation) | The influence arc layout (e.g. UnknownInfluenceLayout, PositiveInfluenceLayout, NecessaryStimulationLayout) + all layouts in the source cluster (resolved via the source's own frozenset key if it has one, else the source layout itself) + all layouts in the target cluster (resolved the same way) | The influence arc layout |
| Tag or Terminal carrying TagReference or TerminalReference arcs | The TagLayout or TerminalLayout + every EquivalenceArcLayout reference arc + every referenced activity layout | The TagLayout or TerminalLayout |
Standalone Tag and Terminal instances (with no reference arcs) use a singleton key: TagLayout or TerminalLayout.
Modules:
| Name | Description |
|---|---|
layout |
Layout classes for SBGN Activity Flow (AF) maps. |
map |
Map classes for SBGN Activity Flow (AF) maps. |
model |
Model classes for SBGN Activity Flow (AF) maps. |
Classes:
| Name | Description |
|---|---|
Activity |
Activity in an SBGN-AF map. |
AndOperator |
Logical AND operator. |
AndOperatorLayout |
Layout for AND operators. |
BiologicalActivity |
Biological activity. |
BiologicalActivityLayout |
Layout for biological activities. |
Compartment |
Compartment in an SBGN-AF map. |
CompartmentLayout |
Layout for compartments. |
ComplexUnitOfInformation |
Unit of information typing a biological activity as a complex. |
ComplexUnitOfInformationLayout |
Layout for complex units of information. |
DelayOperator |
Logical DELAY operator. |
DelayOperatorLayout |
Layout for DELAY operators. |
EquivalenceArcLayout |
Layout for equivalence arcs. |
Influence |
Influence between activities. |
LogicArcLayout |
Layout for logic arcs. |
LogicalOperator |
Logical operator. |
LogicalOperatorInput |
Input to a logical operator. |
MacromoleculeUnitOfInformation |
Unit of information typing a biological activity as a macromolecule. |
MacromoleculeUnitOfInformationLayout |
Layout for macromolecule units of information. |
NecessaryStimulation |
Necessary stimulation. |
NecessaryStimulationLayout |
Layout for necessary stimulations. |
NegativeInfluence |
Negative (inhibiting) influence. |
NegativeInfluenceLayout |
Layout for negative influences. |
NotOperator |
Logical NOT operator. |
NotOperatorLayout |
Layout for NOT operators. |
NucleicAcidFeatureUnitOfInformation |
Unit of information typing a biological activity as a nucleic acid feature. |
NucleicAcidFeatureUnitOfInformationLayout |
Layout for nucleic acid feature units of information. |
OrOperator |
Logical OR operator. |
OrOperatorLayout |
Layout for OR operators. |
PerturbationUnitOfInformation |
Unit of information typing a biological activity as a perturbation. |
PerturbationUnitOfInformationLayout |
Layout for perturbation units of information. |
Phenotype |
Phenotype activity. |
PhenotypeLayout |
Layout for phenotypes. |
PositiveInfluence |
Positive (stimulating) influence. |
PositiveInfluenceLayout |
Layout for positive influences. |
SBGNAFLayout |
SBGN-AF layout. |
SBGNAFMap |
SBGN-AF map. |
SBGNAFModel |
SBGN-AF model. |
SimpleChemicalUnitOfInformation |
Unit of information typing a biological activity as a simple chemical. |
SimpleChemicalUnitOfInformationLayout |
Layout for simple chemical units of information. |
Submap |
Submap element. |
SubmapLayout |
Layout for submaps. |
Tag |
Tag element. |
TagLayout |
Layout for tags. |
TagReference |
Reference to a tag. |
Terminal |
Terminal element. |
TerminalLayout |
Layout for terminals. |
TerminalReference |
Reference to a terminal. |
UnitOfInformation |
Unit of information for activities and compartments. |
UnitOfInformationLayout |
Class for unit of information layouts |
UnknownInfluence |
Influence of unspecified sign. |
UnknownInfluenceLayout |
Layout for unknown influences. |
UnspecifiedEntityUnitOfInformation |
Unit of information typing a biological activity as an unspecified entity. |
UnspecifiedEntityUnitOfInformationLayout |
Layout for unspecified entity units of information. |
Activity
dataclass
Activity(*, id_: str = make_uuid4_as_str(), label: str | None = None, compartment: Compartment | None = None)
Bases: SBGNModelElement
Activity in an SBGN-AF map.
Activities represent biological activities or processes.
Attributes:
| Name | Type | Description |
|---|
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
id_
|
str
|
The id of the map element. This id is purely for the user to keep track of the element, it does not need to be unique and is not part of the identity of the element, i.e., it is not considered when testing for equality between two map elements or when hashing the map element |
'8d9ca32a-45df-438c-be7a-0aa9a4af2cfa'
|
label
|
str | None
|
|
None
|
compartment
|
Compartment | None
|
|
None
|
Methods:
| Name | Description |
|---|---|
descendants |
Return every |
descendants
descendants() -> list[ModelElement]
Return every ModelElement reachable from self, excluding self.
Walks scalar ModelElement fields and frozenset/tuple
containers, deduplicating by object identity.
Returns:
| Type | Description |
|---|---|
list[ModelElement]
|
The list of reachable |
list[ModelElement]
|
order, without |
Source code in src/momapy/core/elements.py
AndOperator
dataclass
AndOperator(*, id_: str = make_uuid4_as_str(), inputs: frozenset[LogicalOperatorInput] = frozenset())
Bases: LogicalOperator
Logical AND operator.
The output is active only when every input is active.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
id_
|
str
|
The id of the map element. This id is purely for the user to keep track of the element, it does not need to be unique and is not part of the identity of the element, i.e., it is not considered when testing for equality between two map elements or when hashing the map element |
'266c5a05-6c29-46de-bc87-228b0c4ca609'
|
inputs
|
frozenset[LogicalOperatorInput]
|
Build an immutable unordered collection of unique elements. |
<dynamic>
|
Methods:
| Name | Description |
|---|---|
descendants |
Return every |
descendants
descendants() -> list[ModelElement]
Return every ModelElement reachable from self, excluding self.
Walks scalar ModelElement fields and frozenset/tuple
containers, deduplicating by object identity.
Returns:
| Type | Description |
|---|---|
list[ModelElement]
|
The list of reachable |
list[ModelElement]
|
order, without |
Source code in src/momapy/core/elements.py
AndOperatorLayout
dataclass
AndOperatorLayout(fill: NoneValueType | Color | None = white, stroke: NoneValueType | Color | None = black, stroke_width: float | None = 1.25, *, id_: str = make_uuid4_as_str(), layout_elements: tuple[LayoutElement] = tuple(), group_fill: NoneValueType | Color | None = None, group_fill_rule: FillRule | None = None, group_filter: NoneValueType | Filter | None = None, group_font_family: str | None = None, group_font_size: float | None = None, group_font_style: FontStyle | None = None, group_font_weight: FontWeight | float | None = None, group_stroke: NoneValueType | Color | None = None, group_stroke_dasharray: NoneValueType | tuple[float, ...] | None = None, group_stroke_dashoffset: NoneValueType | float | None = None, group_stroke_width: NoneValueType | float | None = None, group_text_anchor: TextAnchor | None = None, group_transform: NoneValueType | tuple[Transformation] | None = None, filter: NoneValueType | Filter | None = None, height: float = 30.0, label: TextLayout | None = None, position: Point, stroke_dasharray: NoneValueType | tuple[float, ...] | None = None, stroke_dashoffset: NoneValueType | float | None = None, transform: NoneValueType | tuple[Transformation] | None = None, width: float = 30.0, text: str = 'AND', font_family: str = DEFAULT_FONT_FAMILY, font_fill: Color | NoneValueType = black, font_stroke: Color | NoneValueType = NoneValue, font_style: FontStyle = NORMAL, font_weight: FontWeight | float = NORMAL, direction: Direction = HORIZONTAL, left_to_right: bool = True, left_connector_length: float = 10.0, right_connector_length: float = 10.0, left_connector_stroke: NoneValueType | Color | None = None, left_connector_stroke_width: float | None = None, left_connector_stroke_dasharray: NoneValueType | tuple[float] | None = None, left_connector_stroke_dashoffset: float | None = None, left_connector_fill: NoneValueType | Color | None = None, left_connector_transform: NoneValueType | tuple[Transformation] | None = None, left_connector_filter: NoneValueType | Filter | None = None, right_connector_stroke: NoneValueType | Color | None = None, right_connector_stroke_width: float | None = None, right_connector_stroke_dasharray: NoneValueType | tuple[float] | None = None, right_connector_stroke_dashoffset: float | None = None, right_connector_fill: NoneValueType | Color | None = None, right_connector_transform: NoneValueType | tuple[Transformation] | None = None, right_connector_filter: NoneValueType | Filter | None = None)
Bases: _ConnectorsMixin, _SimpleMixin, _TextMixin, SBGNNode
Layout for AND operators.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
id_
|
str
|
The id of the map element. This id is purely for the user to keep track of the element, it does not need to be unique and is not part of the identity of the element, i.e., it is not considered when testing for equality between two map elements or when hashing the map element |
'95bb94dc-4773-4e9b-8c4d-de1a06905620'
|
layout_elements
|
tuple[LayoutElement]
|
The sub-layout elements of the group layout. These are part of the children of the group layout |
<dynamic>
|
group_fill
|
NoneValueType | Color | None
|
The fill color of the group layout |
None
|
group_fill_rule
|
FillRule | None
|
The fill rule of the group layout |
None
|
group_filter
|
NoneValueType | Filter | None
|
The filter of the group layout |
None
|
group_font_family
|
str | None
|
The font family of the group layout |
None
|
group_font_size
|
float | None
|
The font size of the group layout |
None
|
group_font_style
|
FontStyle | None
|
The font style of the group layout |
None
|
group_font_weight
|
FontWeight | float | None
|
The font weight of the group layout |
None
|
group_stroke
|
NoneValueType | Color | None
|
The stroke color of the group layout |
None
|
group_stroke_dasharray
|
NoneValueType | tuple[float, ...] | None
|
The stroke dasharray of the group layout |
None
|
group_stroke_dashoffset
|
NoneValueType | float | None
|
The stroke dashoffset of the group layout |
None
|
group_stroke_width
|
NoneValueType | float | None
|
The stroke width of the group layout |
None
|
group_text_anchor
|
TextAnchor | None
|
The text anchor of the group layout |
None
|
group_transform
|
NoneValueType | tuple[Transformation] | None
|
The transform of the group layout |
None
|
fill
|
NoneValueType | Color | None
|
The fill color of the node |
Color(red=255, green=255, blue=255, alpha=1.0)
|
filter
|
NoneValueType | Filter | None
|
The filter of the node |
None
|
height
|
float
|
The height of the node |
30.0
|
label
|
TextLayout | None
|
The label of the node |
None
|
position
|
Point
|
The position of the node |
required |
stroke
|
NoneValueType | Color | None
|
The stroke color of the node |
Color(red=0, green=0, blue=0, alpha=1.0)
|
stroke_dasharray
|
NoneValueType | tuple[float, ...] | None
|
The stroke dasharray of the node |
None
|
stroke_dashoffset
|
NoneValueType | float | None
|
The stroke dashoffset of the node |
None
|
stroke_width
|
float | None
|
The stroke width of the node |
1.25
|
transform
|
NoneValueType | tuple[Transformation] | None
|
The transform of the node |
None
|
width
|
float
|
The width width of the node |
30.0
|
text
|
str
|
|
'AND'
|
font_family
|
str
|
|
'DejaVu Sans'
|
font_fill
|
Color | NoneValueType
|
|
Color(red=0, green=0, blue=0, alpha=1.0)
|
font_stroke
|
Color | NoneValueType
|
|
<momapy.drawing.NoneValueType object at 0x7fbe12e88d70>
|
font_style
|
FontStyle
|
|
<FontStyle.NORMAL: 0>
|
font_weight
|
FontWeight | float
|
|
<FontWeight.NORMAL: 0>
|
direction
|
Direction
|
|
<Direction.HORIZONTAL: 1>
|
left_to_right
|
bool
|
|
True
|
left_connector_length
|
float
|
|
10.0
|
right_connector_length
|
float
|
|
10.0
|
left_connector_stroke
|
NoneValueType | Color | None
|
|
None
|
left_connector_stroke_width
|
float | None
|
|
None
|
left_connector_stroke_dasharray
|
NoneValueType | tuple[float] | None
|
|
None
|
left_connector_stroke_dashoffset
|
float | None
|
|
None
|
left_connector_fill
|
NoneValueType | Color | None
|
|
None
|
left_connector_transform
|
NoneValueType | tuple[Transformation] | None
|
|
None
|
left_connector_filter
|
NoneValueType | Filter | None
|
|
None
|
right_connector_stroke
|
NoneValueType | Color | None
|
|
None
|
right_connector_stroke_width
|
float | None
|
|
None
|
right_connector_stroke_dasharray
|
NoneValueType | tuple[float] | None
|
|
None
|
right_connector_stroke_dashoffset
|
float | None
|
|
None
|
right_connector_fill
|
NoneValueType | Color | None
|
|
None
|
right_connector_transform
|
NoneValueType | tuple[Transformation] | None
|
|
None
|
right_connector_filter
|
NoneValueType | Filter | None
|
|
None
|
Methods:
| Name | Description |
|---|---|
anchor_point |
Return an anchor point of the layout element |
angle |
Return the point on the border of the node that intersects the drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal. |
bbox |
Compute and return the bounding box of the group layout element |
border |
Return the point on the border of the node that intersects the drawing elements of the node with the line formed of the center anchor point of the node and the given point. |
center |
Return the center anchor of the node |
childless |
Return a copy of the node with no children |
children |
Return the children of the group layout. |
contains |
Return |
descendants |
Return the descendants of the layout element |
drawing_elements |
Return the drawing elements of the group layout. |
east |
Get the east (right) anchor point. |
east_north_east |
Return the east north east anchor of the node |
east_south_east |
Return the east south east west anchor of the node |
equals |
Return |
flattened |
Return a list containing copy of the layout element with no children and all its descendants with no children |
label_center |
Return the label center anchor of the node |
left_connector_base |
Get the base point of the left connector. |
left_connector_tip |
Get the tip point of the left connector. |
north |
Get the north (top) anchor point. |
north_east |
Return the north east anchor of the node |
north_north_east |
Return the north north east anchor of the node |
north_north_west |
Return the north north west anchor of the node |
north_west |
Return the north west anchor of the node |
own_angle |
Return the point on the border of the node that intersects the self drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal. |
own_bbox |
Compute and return the bounding box of the self drawing element of the group layout |
own_border |
Return the point on the border of the node that intersects the self drawing elements of the node with the line formed of the center anchor point of the node and the given point. |
own_children |
Return the self children of the node. A node has unique child that is its label |
own_drawing_elements |
Return the node's own drawing elements |
own_to_geometry |
Return a list of geometry primitives from the self drawing elements. |
right_connector_base |
Get the base point of the right connector. |
right_connector_tip |
Get the tip point of the right connector. |
size |
Return the size of the node |
south |
Get the south (bottom) anchor point. |
south_east |
Return the south east anchor of the node |
south_south_east |
Return the south south east anchor of the node |
south_south_west |
Return the south south west anchor of the node |
south_west |
Return the south west anchor of the node |
to_geometry |
Return a list of geometry primitives from the drawing elements. |
west |
Get the west (left) anchor point. |
west_north_west |
Return the west north west anchor of the node |
west_south_west |
Return the west south west anchor of the node |
Attributes:
| Name | Type | Description |
|---|---|---|
x |
float
|
Return the x coordinate of the node |
y |
float
|
Return the y coordinate of the node |
anchor_point
anchor_point(anchor_name: str) -> Point
angle
angle(angle: float, unit: Literal['degrees', 'radians'] = 'degrees') -> Point | None
Return the point on the border of the node that intersects the drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.
Source code in src/momapy/core/layout.py
bbox
bbox() -> Bbox
Compute and return the bounding box of the group layout element
Source code in src/momapy/core/layout.py
border
Return the point on the border of the node that intersects the drawing elements of the node with the line formed of the center anchor point of the node and the given point. When there are multiple intersection points, the one closest to the given point is returned
Source code in src/momapy/core/layout.py
center
center() -> Point
childless
children
children() -> list[LayoutElement]
Return the children of the group layout.
These are the self children of the group layout (returned by the own_children method) and the other children of the group layout (given by the layout_elements attribute)
Source code in src/momapy/core/layout.py
contains
contains(other: LayoutElement) -> bool
Return true if another layout element is a descendant of the layout element, false otherwise
drawing_elements
drawing_elements() -> list[DrawingElement]
Return the drawing elements of the group layout. The returned drawing elements are a group drawing element formed of the self drawing elements of the group layout and the drawing elements of its children
Source code in src/momapy/core/layout.py
east
east() -> Point
Get the east (right) anchor point.
Returns:
| Type | Description |
|---|---|
Point
|
Point on the east side of the element. |
Source code in src/momapy/sbgn/elements.py
east_north_east
east_north_east() -> Point
Return the east north east anchor of the node
Source code in src/momapy/core/layout.py
east_south_east
east_south_east() -> Point
Return the east south east west anchor of the node
Source code in src/momapy/core/layout.py
equals
equals(other: LayoutElement, flattened: bool = False, unordered: bool = False) -> bool
Return true if the layout element is equal to another layout element, false otherwise
Source code in src/momapy/core/elements.py
flattened
flattened() -> list[LayoutElement]
Return a list containing copy of the layout element with no children and all its descendants with no children
Source code in src/momapy/core/elements.py
label_center
label_center() -> Point
left_connector_base
left_connector_base() -> Point
Get the base point of the left connector.
Returns:
| Type | Description |
|---|---|
Point
|
Point where the left connector attaches to the shape. |
Source code in src/momapy/sbgn/elements.py
left_connector_tip
left_connector_tip() -> Point
Get the tip point of the left connector.
Returns:
| Type | Description |
|---|---|
Point
|
Point at the end of the left connector line. |
Source code in src/momapy/sbgn/elements.py
north
north() -> Point
Get the north (top) anchor point.
Returns:
| Type | Description |
|---|---|
Point
|
Point on the north side of the element. |
Source code in src/momapy/sbgn/elements.py
north_east
north_east() -> Point
Return the north east anchor of the node
Source code in src/momapy/core/layout.py
north_north_east
north_north_east() -> Point
Return the north north east anchor of the node
Source code in src/momapy/core/layout.py
north_north_west
north_north_west() -> Point
Return the north north west anchor of the node
Source code in src/momapy/core/layout.py
north_west
north_west() -> Point
Return the north west anchor of the node
Source code in src/momapy/core/layout.py
own_angle
own_angle(angle: float, unit: Literal['degrees', 'radians'] = 'degrees') -> Point | None
Return the point on the border of the node that intersects the self drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.
Source code in src/momapy/core/layout.py
own_bbox
own_bbox() -> Bbox
Compute and return the bounding box of the self drawing element of the group layout
Source code in src/momapy/core/layout.py
own_border
Return the point on the border of the node that intersects the self drawing elements of the node with the line formed of the center anchor point of the node and the given point. When there are multiple intersection points, the one closest to the given point is returned
Source code in src/momapy/core/layout.py
own_children
own_children() -> list[LayoutElement]
Return the self children of the node. A node has unique child that is its label
own_drawing_elements
own_drawing_elements() -> list[DrawingElement]
Return the node's own drawing elements
Source code in src/momapy/core/layout.py
own_to_geometry
own_to_geometry() -> list[Segment | QuadraticBezierCurve | CubicBezierCurve | EllipticalArc]
Return a list of geometry primitives from the self drawing elements.
Source code in src/momapy/core/layout.py
right_connector_base
right_connector_base() -> Point
Get the base point of the right connector.
Returns:
| Type | Description |
|---|---|
Point
|
Point where the right connector attaches to the shape. |
Source code in src/momapy/sbgn/elements.py
right_connector_tip
right_connector_tip() -> Point
Get the tip point of the right connector.
Returns:
| Type | Description |
|---|---|
Point
|
Point at the end of the right connector line. |
Source code in src/momapy/sbgn/elements.py
size
south
south() -> Point
Get the south (bottom) anchor point.
Returns:
| Type | Description |
|---|---|
Point
|
Point on the south side of the element. |
Source code in src/momapy/sbgn/elements.py
south_east
south_east() -> Point
Return the south east anchor of the node
Source code in src/momapy/core/layout.py
south_south_east
south_south_east() -> Point
Return the south south east anchor of the node
Source code in src/momapy/core/layout.py
south_south_west
south_south_west() -> Point
Return the south south west anchor of the node
Source code in src/momapy/core/layout.py
south_west
south_west() -> Point
Return the south west anchor of the node
Source code in src/momapy/core/layout.py
to_geometry
to_geometry() -> list[Segment | QuadraticBezierCurve | CubicBezierCurve | EllipticalArc]
Return a list of geometry primitives from the drawing elements.
Source code in src/momapy/core/elements.py
west
west() -> Point
Get the west (left) anchor point.
Returns:
| Type | Description |
|---|---|
Point
|
Point on the west side of the element. |
Source code in src/momapy/sbgn/elements.py
west_north_west
west_north_west() -> Point
Return the west north west anchor of the node
Source code in src/momapy/core/layout.py
west_south_west
west_south_west() -> Point
Return the west south west anchor of the node
Source code in src/momapy/core/layout.py
BiologicalActivity
dataclass
BiologicalActivity(*, id_: str = make_uuid4_as_str(), label: str | None = None, compartment: Compartment | None = None, units_of_information: frozenset[UnitOfInformation] = frozenset())
Bases: Activity
Biological activity.
Represents a biological activity with associated units of information.
Attributes:
| Name | Type | Description |
|---|
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
id_
|
str
|
The id of the map element. This id is purely for the user to keep track of the element, it does not need to be unique and is not part of the identity of the element, i.e., it is not considered when testing for equality between two map elements or when hashing the map element |
'4a921d0d-ca3b-437f-becf-804cce8ff690'
|
label
|
str | None
|
|
None
|
compartment
|
Compartment | None
|
|
None
|
units_of_information
|
frozenset[UnitOfInformation]
|
Build an immutable unordered collection of unique elements. |
<dynamic>
|
Methods:
| Name | Description |
|---|---|
descendants |
Return every |
descendants
descendants() -> list[ModelElement]
Return every ModelElement reachable from self, excluding self.
Walks scalar ModelElement fields and frozenset/tuple
containers, deduplicating by object identity.
Returns:
| Type | Description |
|---|---|
list[ModelElement]
|
The list of reachable |
list[ModelElement]
|
order, without |
Source code in src/momapy/core/elements.py
BiologicalActivityLayout
dataclass
BiologicalActivityLayout(fill: NoneValueType | Color | None = white, stroke: NoneValueType | Color | None = black, stroke_width: float | None = 1.25, *, id_: str = make_uuid4_as_str(), layout_elements: tuple[LayoutElement] = tuple(), group_fill: NoneValueType | Color | None = None, group_fill_rule: FillRule | None = None, group_filter: NoneValueType | Filter | None = None, group_font_family: str | None = None, group_font_size: float | None = None, group_font_style: FontStyle | None = None, group_font_weight: FontWeight | float | None = None, group_stroke: NoneValueType | Color | None = None, group_stroke_dasharray: NoneValueType | tuple[float, ...] | None = None, group_stroke_dashoffset: NoneValueType | float | None = None, group_stroke_width: NoneValueType | float | None = None, group_text_anchor: TextAnchor | None = None, group_transform: NoneValueType | tuple[Transformation] | None = None, filter: NoneValueType | Filter | None = None, height: float = 30.0, label: TextLayout | None = None, position: Point, stroke_dasharray: NoneValueType | tuple[float, ...] | None = None, stroke_dashoffset: NoneValueType | float | None = None, transform: NoneValueType | tuple[Transformation] | None = None, width: float = 60.0)
Bases: _SimpleMixin, SBGNNode
Layout for biological activities.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
id_
|
str
|
The id of the map element. This id is purely for the user to keep track of the element, it does not need to be unique and is not part of the identity of the element, i.e., it is not considered when testing for equality between two map elements or when hashing the map element |
'f475d054-edcc-4781-8439-55cc67d087c2'
|
layout_elements
|
tuple[LayoutElement]
|
The sub-layout elements of the group layout. These are part of the children of the group layout |
<dynamic>
|
group_fill
|
NoneValueType | Color | None
|
The fill color of the group layout |
None
|
group_fill_rule
|
FillRule | None
|
The fill rule of the group layout |
None
|
group_filter
|
NoneValueType | Filter | None
|
The filter of the group layout |
None
|
group_font_family
|
str | None
|
The font family of the group layout |
None
|
group_font_size
|
float | None
|
The font size of the group layout |
None
|
group_font_style
|
FontStyle | None
|
The font style of the group layout |
None
|
group_font_weight
|
FontWeight | float | None
|
The font weight of the group layout |
None
|
group_stroke
|
NoneValueType | Color | None
|
The stroke color of the group layout |
None
|
group_stroke_dasharray
|
NoneValueType | tuple[float, ...] | None
|
The stroke dasharray of the group layout |
None
|
group_stroke_dashoffset
|
NoneValueType | float | None
|
The stroke dashoffset of the group layout |
None
|
group_stroke_width
|
NoneValueType | float | None
|
The stroke width of the group layout |
None
|
group_text_anchor
|
TextAnchor | None
|
The text anchor of the group layout |
None
|
group_transform
|
NoneValueType | tuple[Transformation] | None
|
The transform of the group layout |
None
|
fill
|
NoneValueType | Color | None
|
The fill color of the node |
Color(red=255, green=255, blue=255, alpha=1.0)
|
filter
|
NoneValueType | Filter | None
|
The filter of the node |
None
|
height
|
float
|
The height of the node |
30.0
|
label
|
TextLayout | None
|
The label of the node |
None
|
position
|
Point
|
The position of the node |
required |
stroke
|
NoneValueType | Color | None
|
The stroke color of the node |
Color(red=0, green=0, blue=0, alpha=1.0)
|
stroke_dasharray
|
NoneValueType | tuple[float, ...] | None
|
The stroke dasharray of the node |
None
|
stroke_dashoffset
|
NoneValueType | float | None
|
The stroke dashoffset of the node |
None
|
stroke_width
|
float | None
|
The stroke width of the node |
1.25
|
transform
|
NoneValueType | tuple[Transformation] | None
|
The transform of the node |
None
|
width
|
float
|
The width width of the node |
60.0
|
Methods:
| Name | Description |
|---|---|
anchor_point |
Return an anchor point of the layout element |
angle |
Return the point on the border of the node that intersects the drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal. |
bbox |
Compute and return the bounding box of the group layout element |
border |
Return the point on the border of the node that intersects the drawing elements of the node with the line formed of the center anchor point of the node and the given point. |
center |
Return the center anchor of the node |
childless |
Return a copy of the node with no children |
children |
Return the children of the group layout. |
contains |
Return |
descendants |
Return the descendants of the layout element |
drawing_elements |
Return the drawing elements of the group layout. |
east |
Return the east anchor of the node |
east_north_east |
Return the east north east anchor of the node |
east_south_east |
Return the east south east west anchor of the node |
equals |
Return |
flattened |
Return a list containing copy of the layout element with no children and all its descendants with no children |
label_center |
Return the label center anchor of the node |
north |
Return the north anchor of the node |
north_east |
Return the north east anchor of the node |
north_north_east |
Return the north north east anchor of the node |
north_north_west |
Return the north north west anchor of the node |
north_west |
Return the north west anchor of the node |
own_angle |
Return the point on the border of the node that intersects the self drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal. |
own_bbox |
Compute and return the bounding box of the self drawing element of the group layout |
own_border |
Return the point on the border of the node that intersects the self drawing elements of the node with the line formed of the center anchor point of the node and the given point. |
own_children |
Return the self children of the node. A node has unique child that is its label |
own_drawing_elements |
Return the node's own drawing elements |
own_to_geometry |
Return a list of geometry primitives from the self drawing elements. |
size |
Return the size of the node |
south |
Return the south anchor of the node |
south_east |
Return the south east anchor of the node |
south_south_east |
Return the south south east anchor of the node |
south_south_west |
Return the south south west anchor of the node |
south_west |
Return the south west anchor of the node |
to_geometry |
Return a list of geometry primitives from the drawing elements. |
west |
Return the west anchor of the node |
west_north_west |
Return the west north west anchor of the node |
west_south_west |
Return the west south west anchor of the node |
Attributes:
| Name | Type | Description |
|---|---|---|
x |
float
|
Return the x coordinate of the node |
y |
float
|
Return the y coordinate of the node |
anchor_point
anchor_point(anchor_name: str) -> Point
angle
angle(angle: float, unit: Literal['degrees', 'radians'] = 'degrees') -> Point | None
Return the point on the border of the node that intersects the drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.
Source code in src/momapy/core/layout.py
bbox
bbox() -> Bbox
Compute and return the bounding box of the group layout element
Source code in src/momapy/core/layout.py
border
Return the point on the border of the node that intersects the drawing elements of the node with the line formed of the center anchor point of the node and the given point. When there are multiple intersection points, the one closest to the given point is returned
Source code in src/momapy/core/layout.py
center
center() -> Point
childless
children
children() -> list[LayoutElement]
Return the children of the group layout.
These are the self children of the group layout (returned by the own_children method) and the other children of the group layout (given by the layout_elements attribute)
Source code in src/momapy/core/layout.py
contains
contains(other: LayoutElement) -> bool
Return true if another layout element is a descendant of the layout element, false otherwise
drawing_elements
drawing_elements() -> list[DrawingElement]
Return the drawing elements of the group layout. The returned drawing elements are a group drawing element formed of the self drawing elements of the group layout and the drawing elements of its children
Source code in src/momapy/core/layout.py
east
east() -> Point
east_north_east
east_north_east() -> Point
Return the east north east anchor of the node
Source code in src/momapy/core/layout.py
east_south_east
east_south_east() -> Point
Return the east south east west anchor of the node
Source code in src/momapy/core/layout.py
equals
equals(other: LayoutElement, flattened: bool = False, unordered: bool = False) -> bool
Return true if the layout element is equal to another layout element, false otherwise
Source code in src/momapy/core/elements.py
flattened
flattened() -> list[LayoutElement]
Return a list containing copy of the layout element with no children and all its descendants with no children
Source code in src/momapy/core/elements.py
label_center
label_center() -> Point
north
north() -> Point
north_east
north_east() -> Point
Return the north east anchor of the node
Source code in src/momapy/core/layout.py
north_north_east
north_north_east() -> Point
Return the north north east anchor of the node
Source code in src/momapy/core/layout.py
north_north_west
north_north_west() -> Point
Return the north north west anchor of the node
Source code in src/momapy/core/layout.py
north_west
north_west() -> Point
Return the north west anchor of the node
Source code in src/momapy/core/layout.py
own_angle
own_angle(angle: float, unit: Literal['degrees', 'radians'] = 'degrees') -> Point | None
Return the point on the border of the node that intersects the self drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.
Source code in src/momapy/core/layout.py
own_bbox
own_bbox() -> Bbox
Compute and return the bounding box of the self drawing element of the group layout
Source code in src/momapy/core/layout.py
own_border
Return the point on the border of the node that intersects the self drawing elements of the node with the line formed of the center anchor point of the node and the given point. When there are multiple intersection points, the one closest to the given point is returned
Source code in src/momapy/core/layout.py
own_children
own_children() -> list[LayoutElement]
Return the self children of the node. A node has unique child that is its label
own_drawing_elements
own_drawing_elements() -> list[DrawingElement]
Return the node's own drawing elements
Source code in src/momapy/core/layout.py
own_to_geometry
own_to_geometry() -> list[Segment | QuadraticBezierCurve | CubicBezierCurve | EllipticalArc]
Return a list of geometry primitives from the self drawing elements.
Source code in src/momapy/core/layout.py
size
south
south() -> Point
south_east
south_east() -> Point
Return the south east anchor of the node
Source code in src/momapy/core/layout.py
south_south_east
south_south_east() -> Point
Return the south south east anchor of the node
Source code in src/momapy/core/layout.py
south_south_west
south_south_west() -> Point
Return the south south west anchor of the node
Source code in src/momapy/core/layout.py
south_west
south_west() -> Point
Return the south west anchor of the node
Source code in src/momapy/core/layout.py
to_geometry
to_geometry() -> list[Segment | QuadraticBezierCurve | CubicBezierCurve | EllipticalArc]
Return a list of geometry primitives from the drawing elements.
Source code in src/momapy/core/elements.py
west
west() -> Point
west_north_west
west_north_west() -> Point
Return the west north west anchor of the node
Source code in src/momapy/core/layout.py
west_south_west
west_south_west() -> Point
Return the west south west anchor of the node
Source code in src/momapy/core/layout.py
Compartment
dataclass
Compartment(*, id_: str = make_uuid4_as_str(), label: str | None = None, units_of_information: frozenset[UnitOfInformation] = frozenset())
Bases: SBGNModelElement
Compartment in an SBGN-AF map.
Compartments represent distinct spatial regions where activities are located.
Attributes:
| Name | Type | Description |
|---|
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
id_
|
str
|
The id of the map element. This id is purely for the user to keep track of the element, it does not need to be unique and is not part of the identity of the element, i.e., it is not considered when testing for equality between two map elements or when hashing the map element |
'828435b0-be05-46dd-b826-feeb85c2eda9'
|
label
|
str | None
|
|
None
|
units_of_information
|
frozenset[UnitOfInformation]
|
Build an immutable unordered collection of unique elements. |
<dynamic>
|
Methods:
| Name | Description |
|---|---|
descendants |
Return every |
descendants
descendants() -> list[ModelElement]
Return every ModelElement reachable from self, excluding self.
Walks scalar ModelElement fields and frozenset/tuple
containers, deduplicating by object identity.
Returns:
| Type | Description |
|---|---|
list[ModelElement]
|
The list of reachable |
list[ModelElement]
|
order, without |
Source code in src/momapy/core/elements.py
CompartmentLayout
dataclass
CompartmentLayout(fill: NoneValueType | Color | None = white, stroke: NoneValueType | Color | None = black, stroke_width: float | None = 1.25, *, id_: str = make_uuid4_as_str(), layout_elements: tuple[LayoutElement] = tuple(), group_fill: NoneValueType | Color | None = None, group_fill_rule: FillRule | None = None, group_filter: NoneValueType | Filter | None = None, group_font_family: str | None = None, group_font_size: float | None = None, group_font_style: FontStyle | None = None, group_font_weight: FontWeight | float | None = None, group_stroke: NoneValueType | Color | None = None, group_stroke_dasharray: NoneValueType | tuple[float, ...] | None = None, group_stroke_dashoffset: NoneValueType | float | None = None, group_stroke_width: NoneValueType | float | None = None, group_text_anchor: TextAnchor | None = None, group_transform: NoneValueType | tuple[Transformation] | None = None, filter: NoneValueType | Filter | None = None, height: float = 80.0, label: TextLayout | None = None, position: Point, stroke_dasharray: NoneValueType | tuple[float, ...] | None = None, stroke_dashoffset: NoneValueType | float | None = None, transform: NoneValueType | tuple[Transformation] | None = None, width: float = 80.0, rounded_corners: float = 5.0, border_stroke_width: float | None = 3.25)
Bases: _SimpleMixin, SBGNNode
Layout for compartments.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
id_
|
str
|
The id of the map element. This id is purely for the user to keep track of the element, it does not need to be unique and is not part of the identity of the element, i.e., it is not considered when testing for equality between two map elements or when hashing the map element |
'34cf0d83-1348-4b6d-a925-55c396bd8760'
|
layout_elements
|
tuple[LayoutElement]
|
The sub-layout elements of the group layout. These are part of the children of the group layout |
<dynamic>
|
group_fill
|
NoneValueType | Color | None
|
The fill color of the group layout |
None
|
group_fill_rule
|
FillRule | None
|
The fill rule of the group layout |
None
|
group_filter
|
NoneValueType | Filter | None
|
The filter of the group layout |
None
|
group_font_family
|
str | None
|
The font family of the group layout |
None
|
group_font_size
|
float | None
|
The font size of the group layout |
None
|
group_font_style
|
FontStyle | None
|
The font style of the group layout |
None
|
group_font_weight
|
FontWeight | float | None
|
The font weight of the group layout |
None
|
group_stroke
|
NoneValueType | Color | None
|
The stroke color of the group layout |
None
|
group_stroke_dasharray
|
NoneValueType | tuple[float, ...] | None
|
The stroke dasharray of the group layout |
None
|
group_stroke_dashoffset
|
NoneValueType | float | None
|
The stroke dashoffset of the group layout |
None
|
group_stroke_width
|
NoneValueType | float | None
|
The stroke width of the group layout |
None
|
group_text_anchor
|
TextAnchor | None
|
The text anchor of the group layout |
None
|
group_transform
|
NoneValueType | tuple[Transformation] | None
|
The transform of the group layout |
None
|
fill
|
NoneValueType | Color | None
|
The fill color of the node |
Color(red=255, green=255, blue=255, alpha=1.0)
|
filter
|
NoneValueType | Filter | None
|
The filter of the node |
None
|
height
|
float
|
The height of the node |
80.0
|
label
|
TextLayout | None
|
The label of the node |
None
|
position
|
Point
|
The position of the node |
required |
stroke
|
NoneValueType | Color | None
|
The stroke color of the node |
Color(red=0, green=0, blue=0, alpha=1.0)
|
stroke_dasharray
|
NoneValueType | tuple[float, ...] | None
|
The stroke dasharray of the node |
None
|
stroke_dashoffset
|
NoneValueType | float | None
|
The stroke dashoffset of the node |
None
|
stroke_width
|
float | None
|
The stroke width of the node |
1.25
|
transform
|
NoneValueType | tuple[Transformation] | None
|
The transform of the node |
None
|
width
|
float
|
The width width of the node |
80.0
|
rounded_corners
|
float
|
|
5.0
|
border_stroke_width
|
float | None
|
|
3.25
|
Methods:
| Name | Description |
|---|---|
anchor_point |
Return an anchor point of the layout element |
angle |
Return the point on the border of the node that intersects the drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal. |
bbox |
Compute and return the bounding box of the group layout element |
border |
Return the point on the border of the node that intersects the drawing elements of the node with the line formed of the center anchor point of the node and the given point. |
center |
Return the center anchor of the node |
childless |
Return a copy of the node with no children |
children |
Return the children of the group layout. |
contains |
Return |
descendants |
Return the descendants of the layout element |
drawing_elements |
Return the drawing elements of the group layout. |
east |
Return the east anchor of the node |
east_north_east |
Return the east north east anchor of the node |
east_south_east |
Return the east south east west anchor of the node |
equals |
Return |
flattened |
Return a list containing copy of the layout element with no children and all its descendants with no children |
label_center |
Return the label center anchor of the node |
north |
Return the north anchor of the node |
north_east |
Return the north east anchor of the node |
north_north_east |
Return the north north east anchor of the node |
north_north_west |
Return the north north west anchor of the node |
north_west |
Return the north west anchor of the node |
own_angle |
Return the point on the border of the node that intersects the self drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal. |
own_bbox |
Compute and return the bounding box of the self drawing element of the group layout |
own_border |
Return the point on the border of the node that intersects the self drawing elements of the node with the line formed of the center anchor point of the node and the given point. |
own_children |
Return the self children of the node. A node has unique child that is its label |
own_drawing_elements |
Return the node's own drawing elements |
own_to_geometry |
Return a list of geometry primitives from the self drawing elements. |
size |
Return the size of the node |
south |
Return the south anchor of the node |
south_east |
Return the south east anchor of the node |
south_south_east |
Return the south south east anchor of the node |
south_south_west |
Return the south south west anchor of the node |
south_west |
Return the south west anchor of the node |
to_geometry |
Return a list of geometry primitives from the drawing elements. |
west |
Return the west anchor of the node |
west_north_west |
Return the west north west anchor of the node |
west_south_west |
Return the west south west anchor of the node |
Attributes:
| Name | Type | Description |
|---|---|---|
x |
float
|
Return the x coordinate of the node |
y |
float
|
Return the y coordinate of the node |
anchor_point
anchor_point(anchor_name: str) -> Point
angle
angle(angle: float, unit: Literal['degrees', 'radians'] = 'degrees') -> Point | None
Return the point on the border of the node that intersects the drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.
Source code in src/momapy/core/layout.py
bbox
bbox() -> Bbox
Compute and return the bounding box of the group layout element
Source code in src/momapy/core/layout.py
border
Return the point on the border of the node that intersects the drawing elements of the node with the line formed of the center anchor point of the node and the given point. When there are multiple intersection points, the one closest to the given point is returned
Source code in src/momapy/core/layout.py
center
center() -> Point
childless
children
children() -> list[LayoutElement]
Return the children of the group layout.
These are the self children of the group layout (returned by the own_children method) and the other children of the group layout (given by the layout_elements attribute)
Source code in src/momapy/core/layout.py
contains
contains(other: LayoutElement) -> bool
Return true if another layout element is a descendant of the layout element, false otherwise
drawing_elements
drawing_elements() -> list[DrawingElement]
Return the drawing elements of the group layout. The returned drawing elements are a group drawing element formed of the self drawing elements of the group layout and the drawing elements of its children
Source code in src/momapy/core/layout.py
east
east() -> Point
east_north_east
east_north_east() -> Point
Return the east north east anchor of the node
Source code in src/momapy/core/layout.py
east_south_east
east_south_east() -> Point
Return the east south east west anchor of the node
Source code in src/momapy/core/layout.py
equals
equals(other: LayoutElement, flattened: bool = False, unordered: bool = False) -> bool
Return true if the layout element is equal to another layout element, false otherwise
Source code in src/momapy/core/elements.py
flattened
flattened() -> list[LayoutElement]
Return a list containing copy of the layout element with no children and all its descendants with no children
Source code in src/momapy/core/elements.py
label_center
label_center() -> Point
north
north() -> Point
north_east
north_east() -> Point
Return the north east anchor of the node
Source code in src/momapy/core/layout.py
north_north_east
north_north_east() -> Point
Return the north north east anchor of the node
Source code in src/momapy/core/layout.py
north_north_west
north_north_west() -> Point
Return the north north west anchor of the node
Source code in src/momapy/core/layout.py
north_west
north_west() -> Point
Return the north west anchor of the node
Source code in src/momapy/core/layout.py
own_angle
own_angle(angle: float, unit: Literal['degrees', 'radians'] = 'degrees') -> Point | None
Return the point on the border of the node that intersects the self drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.
Source code in src/momapy/core/layout.py
own_bbox
own_bbox() -> Bbox
Compute and return the bounding box of the self drawing element of the group layout
Source code in src/momapy/core/layout.py
own_border
Return the point on the border of the node that intersects the self drawing elements of the node with the line formed of the center anchor point of the node and the given point. When there are multiple intersection points, the one closest to the given point is returned
Source code in src/momapy/core/layout.py
own_children
own_children() -> list[LayoutElement]
Return the self children of the node. A node has unique child that is its label
own_drawing_elements
own_drawing_elements() -> list[DrawingElement]
Return the node's own drawing elements
Source code in src/momapy/core/layout.py
own_to_geometry
own_to_geometry() -> list[Segment | QuadraticBezierCurve | CubicBezierCurve | EllipticalArc]
Return a list of geometry primitives from the self drawing elements.
Source code in src/momapy/core/layout.py
size
south
south() -> Point
south_east
south_east() -> Point
Return the south east anchor of the node
Source code in src/momapy/core/layout.py
south_south_east
south_south_east() -> Point
Return the south south east anchor of the node
Source code in src/momapy/core/layout.py
south_south_west
south_south_west() -> Point
Return the south south west anchor of the node
Source code in src/momapy/core/layout.py
south_west
south_west() -> Point
Return the south west anchor of the node
Source code in src/momapy/core/layout.py
to_geometry
to_geometry() -> list[Segment | QuadraticBezierCurve | CubicBezierCurve | EllipticalArc]
Return a list of geometry primitives from the drawing elements.
Source code in src/momapy/core/elements.py
west
west() -> Point
west_north_west
west_north_west() -> Point
Return the west north west anchor of the node
Source code in src/momapy/core/layout.py
west_south_west
west_south_west() -> Point
Return the west south west anchor of the node
Source code in src/momapy/core/layout.py
ComplexUnitOfInformation
dataclass
Bases: UnitOfInformation
Unit of information typing a biological activity as a complex.
Rendered as an SBGN complex glyph embedded in the activity node.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
id_
|
str
|
The id of the map element. This id is purely for the user to keep track of the element, it does not need to be unique and is not part of the identity of the element, i.e., it is not considered when testing for equality between two map elements or when hashing the map element |
'75344ec9-67ec-4947-baa6-c04a5a2de19b'
|
label
|
str | None
|
|
None
|
Methods:
| Name | Description |
|---|---|
descendants |
Return every |
descendants
descendants() -> list[ModelElement]
Return every ModelElement reachable from self, excluding self.
Walks scalar ModelElement fields and frozenset/tuple
containers, deduplicating by object identity.
Returns:
| Type | Description |
|---|---|
list[ModelElement]
|
The list of reachable |
list[ModelElement]
|
order, without |
Source code in src/momapy/core/elements.py
ComplexUnitOfInformationLayout
dataclass
ComplexUnitOfInformationLayout(fill: NoneValueType | Color | None = white, stroke: NoneValueType | Color | None = black, stroke_width: float | None = 1.25, *, id_: str = make_uuid4_as_str(), layout_elements: tuple[LayoutElement] = tuple(), group_fill: NoneValueType | Color | None = None, group_fill_rule: FillRule | None = None, group_filter: NoneValueType | Filter | None = None, group_font_family: str | None = None, group_font_size: float | None = None, group_font_style: FontStyle | None = None, group_font_weight: FontWeight | float | None = None, group_stroke: NoneValueType | Color | None = None, group_stroke_dasharray: NoneValueType | tuple[float, ...] | None = None, group_stroke_dashoffset: NoneValueType | float | None = None, group_stroke_width: NoneValueType | float | None = None, group_text_anchor: TextAnchor | None = None, group_transform: NoneValueType | tuple[Transformation] | None = None, filter: NoneValueType | Filter | None = None, height: float = 12.0, label: TextLayout | None = None, position: Point, stroke_dasharray: NoneValueType | tuple[float, ...] | None = None, stroke_dashoffset: NoneValueType | float | None = None, transform: NoneValueType | tuple[Transformation] | None = None, width: float = 12.0, cut_corners: float = 5.0)
Bases: _SimpleMixin, SBGNNode
Layout for complex units of information.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
id_
|
str
|
The id of the map element. This id is purely for the user to keep track of the element, it does not need to be unique and is not part of the identity of the element, i.e., it is not considered when testing for equality between two map elements or when hashing the map element |
'a3cd5ec0-be2b-4aa4-8ba6-3c33874301d6'
|
layout_elements
|
tuple[LayoutElement]
|
The sub-layout elements of the group layout. These are part of the children of the group layout |
<dynamic>
|
group_fill
|
NoneValueType | Color | None
|
The fill color of the group layout |
None
|
group_fill_rule
|
FillRule | None
|
The fill rule of the group layout |
None
|
group_filter
|
NoneValueType | Filter | None
|
The filter of the group layout |
None
|
group_font_family
|
str | None
|
The font family of the group layout |
None
|
group_font_size
|
float | None
|
The font size of the group layout |
None
|
group_font_style
|
FontStyle | None
|
The font style of the group layout |
None
|
group_font_weight
|
FontWeight | float | None
|
The font weight of the group layout |
None
|
group_stroke
|
NoneValueType | Color | None
|
The stroke color of the group layout |
None
|
group_stroke_dasharray
|
NoneValueType | tuple[float, ...] | None
|
The stroke dasharray of the group layout |
None
|
group_stroke_dashoffset
|
NoneValueType | float | None
|
The stroke dashoffset of the group layout |
None
|
group_stroke_width
|
NoneValueType | float | None
|
The stroke width of the group layout |
None
|
group_text_anchor
|
TextAnchor | None
|
The text anchor of the group layout |
None
|
group_transform
|
NoneValueType | tuple[Transformation] | None
|
The transform of the group layout |
None
|
fill
|
NoneValueType | Color | None
|
The fill color of the node |
Color(red=255, green=255, blue=255, alpha=1.0)
|
filter
|
NoneValueType | Filter | None
|
The filter of the node |
None
|
height
|
float
|
The height of the node |
12.0
|
label
|
TextLayout | None
|
The label of the node |
None
|
position
|
Point
|
The position of the node |
required |
stroke
|
NoneValueType | Color | None
|
The stroke color of the node |
Color(red=0, green=0, blue=0, alpha=1.0)
|
stroke_dasharray
|
NoneValueType | tuple[float, ...] | None
|
The stroke dasharray of the node |
None
|
stroke_dashoffset
|
NoneValueType | float | None
|
The stroke dashoffset of the node |
None
|
stroke_width
|
float | None
|
The stroke width of the node |
1.25
|
transform
|
NoneValueType | tuple[Transformation] | None
|
The transform of the node |
None
|
width
|
float
|
The width width of the node |
12.0
|
cut_corners
|
float
|
|
5.0
|
Methods:
| Name | Description |
|---|---|
anchor_point |
Return an anchor point of the layout element |
angle |
Return the point on the border of the node that intersects the drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal. |
bbox |
Compute and return the bounding box of the group layout element |
border |
Return the point on the border of the node that intersects the drawing elements of the node with the line formed of the center anchor point of the node and the given point. |
center |
Return the center anchor of the node |
childless |
Return a copy of the node with no children |
children |
Return the children of the group layout. |
contains |
Return |
descendants |
Return the descendants of the layout element |
drawing_elements |
Return the drawing elements of the group layout. |
east |
Return the east anchor of the node |
east_north_east |
Return the east north east anchor of the node |
east_south_east |
Return the east south east west anchor of the node |
equals |
Return |
flattened |
Return a list containing copy of the layout element with no children and all its descendants with no children |
label_center |
Return the label center anchor of the node |
north |
Return the north anchor of the node |
north_east |
Return the north east anchor of the node |
north_north_east |
Return the north north east anchor of the node |
north_north_west |
Return the north north west anchor of the node |
north_west |
Return the north west anchor of the node |
own_angle |
Return the point on the border of the node that intersects the self drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal. |
own_bbox |
Compute and return the bounding box of the self drawing element of the group layout |
own_border |
Return the point on the border of the node that intersects the self drawing elements of the node with the line formed of the center anchor point of the node and the given point. |
own_children |
Return the self children of the node. A node has unique child that is its label |
own_drawing_elements |
Return the node's own drawing elements |
own_to_geometry |
Return a list of geometry primitives from the self drawing elements. |
size |
Return the size of the node |
south |
Return the south anchor of the node |
south_east |
Return the south east anchor of the node |
south_south_east |
Return the south south east anchor of the node |
south_south_west |
Return the south south west anchor of the node |
south_west |
Return the south west anchor of the node |
to_geometry |
Return a list of geometry primitives from the drawing elements. |
west |
Return the west anchor of the node |
west_north_west |
Return the west north west anchor of the node |
west_south_west |
Return the west south west anchor of the node |
Attributes:
| Name | Type | Description |
|---|---|---|
x |
float
|
Return the x coordinate of the node |
y |
float
|
Return the y coordinate of the node |
anchor_point
anchor_point(anchor_name: str) -> Point
angle
angle(angle: float, unit: Literal['degrees', 'radians'] = 'degrees') -> Point | None
Return the point on the border of the node that intersects the drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.
Source code in src/momapy/core/layout.py
bbox
bbox() -> Bbox
Compute and return the bounding box of the group layout element
Source code in src/momapy/core/layout.py
border
Return the point on the border of the node that intersects the drawing elements of the node with the line formed of the center anchor point of the node and the given point. When there are multiple intersection points, the one closest to the given point is returned
Source code in src/momapy/core/layout.py
center
center() -> Point
childless
children
children() -> list[LayoutElement]
Return the children of the group layout.
These are the self children of the group layout (returned by the own_children method) and the other children of the group layout (given by the layout_elements attribute)
Source code in src/momapy/core/layout.py
contains
contains(other: LayoutElement) -> bool
Return true if another layout element is a descendant of the layout element, false otherwise
drawing_elements
drawing_elements() -> list[DrawingElement]
Return the drawing elements of the group layout. The returned drawing elements are a group drawing element formed of the self drawing elements of the group layout and the drawing elements of its children
Source code in src/momapy/core/layout.py
east
east() -> Point
east_north_east
east_north_east() -> Point
Return the east north east anchor of the node
Source code in src/momapy/core/layout.py
east_south_east
east_south_east() -> Point
Return the east south east west anchor of the node
Source code in src/momapy/core/layout.py
equals
equals(other: LayoutElement, flattened: bool = False, unordered: bool = False) -> bool
Return true if the layout element is equal to another layout element, false otherwise
Source code in src/momapy/core/elements.py
flattened
flattened() -> list[LayoutElement]
Return a list containing copy of the layout element with no children and all its descendants with no children
Source code in src/momapy/core/elements.py
label_center
label_center() -> Point
north
north() -> Point
north_east
north_east() -> Point
Return the north east anchor of the node
Source code in src/momapy/core/layout.py
north_north_east
north_north_east() -> Point
Return the north north east anchor of the node
Source code in src/momapy/core/layout.py
north_north_west
north_north_west() -> Point
Return the north north west anchor of the node
Source code in src/momapy/core/layout.py
north_west
north_west() -> Point
Return the north west anchor of the node
Source code in src/momapy/core/layout.py
own_angle
own_angle(angle: float, unit: Literal['degrees', 'radians'] = 'degrees') -> Point | None
Return the point on the border of the node that intersects the self drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.
Source code in src/momapy/core/layout.py
own_bbox
own_bbox() -> Bbox
Compute and return the bounding box of the self drawing element of the group layout
Source code in src/momapy/core/layout.py
own_border
Return the point on the border of the node that intersects the self drawing elements of the node with the line formed of the center anchor point of the node and the given point. When there are multiple intersection points, the one closest to the given point is returned
Source code in src/momapy/core/layout.py
own_children
own_children() -> list[LayoutElement]
Return the self children of the node. A node has unique child that is its label
own_drawing_elements
own_drawing_elements() -> list[DrawingElement]
Return the node's own drawing elements
Source code in src/momapy/core/layout.py
own_to_geometry
own_to_geometry() -> list[Segment | QuadraticBezierCurve | CubicBezierCurve | EllipticalArc]
Return a list of geometry primitives from the self drawing elements.
Source code in src/momapy/core/layout.py
size
south
south() -> Point
south_east
south_east() -> Point
Return the south east anchor of the node
Source code in src/momapy/core/layout.py
south_south_east
south_south_east() -> Point
Return the south south east anchor of the node
Source code in src/momapy/core/layout.py
south_south_west
south_south_west() -> Point
Return the south south west anchor of the node
Source code in src/momapy/core/layout.py
south_west
south_west() -> Point
Return the south west anchor of the node
Source code in src/momapy/core/layout.py
to_geometry
to_geometry() -> list[Segment | QuadraticBezierCurve | CubicBezierCurve | EllipticalArc]
Return a list of geometry primitives from the drawing elements.
Source code in src/momapy/core/elements.py
west
west() -> Point
west_north_west
west_north_west() -> Point
Return the west north west anchor of the node
Source code in src/momapy/core/layout.py
west_south_west
west_south_west() -> Point
Return the west south west anchor of the node
Source code in src/momapy/core/layout.py
DelayOperator
dataclass
DelayOperator(*, id_: str = make_uuid4_as_str(), inputs: frozenset[LogicalOperatorInput] = frozenset())
Bases: LogicalOperator
Logical DELAY operator.
The output mirrors the input after a delay; used to model time-shifted influences.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
id_
|
str
|
The id of the map element. This id is purely for the user to keep track of the element, it does not need to be unique and is not part of the identity of the element, i.e., it is not considered when testing for equality between two map elements or when hashing the map element |
'fdc9cd80-d4f8-43a4-8971-511e52f9a51c'
|
inputs
|
frozenset[LogicalOperatorInput]
|
Build an immutable unordered collection of unique elements. |
<dynamic>
|
Methods:
| Name | Description |
|---|---|
descendants |
Return every |
descendants
descendants() -> list[ModelElement]
Return every ModelElement reachable from self, excluding self.
Walks scalar ModelElement fields and frozenset/tuple
containers, deduplicating by object identity.
Returns:
| Type | Description |
|---|---|
list[ModelElement]
|
The list of reachable |
list[ModelElement]
|
order, without |
Source code in src/momapy/core/elements.py
DelayOperatorLayout
dataclass
DelayOperatorLayout(fill: NoneValueType | Color | None = white, stroke: NoneValueType | Color | None = black, stroke_width: float | None = 1.25, *, id_: str = make_uuid4_as_str(), layout_elements: tuple[LayoutElement] = tuple(), group_fill: NoneValueType | Color | None = None, group_fill_rule: FillRule | None = None, group_filter: NoneValueType | Filter | None = None, group_font_family: str | None = None, group_font_size: float | None = None, group_font_style: FontStyle | None = None, group_font_weight: FontWeight | float | None = None, group_stroke: NoneValueType | Color | None = None, group_stroke_dasharray: NoneValueType | tuple[float, ...] | None = None, group_stroke_dashoffset: NoneValueType | float | None = None, group_stroke_width: NoneValueType | float | None = None, group_text_anchor: TextAnchor | None = None, group_transform: NoneValueType | tuple[Transformation] | None = None, filter: NoneValueType | Filter | None = None, height: float = 30.0, label: TextLayout | None = None, position: Point, stroke_dasharray: NoneValueType | tuple[float, ...] | None = None, stroke_dashoffset: NoneValueType | float | None = None, transform: NoneValueType | tuple[Transformation] | None = None, width: float = 30.0, text: str = 'τ', font_family: str = DEFAULT_FONT_FAMILY, font_fill: Color | NoneValueType = black, font_stroke: Color | NoneValueType = NoneValue, font_style: FontStyle = NORMAL, font_weight: FontWeight | float = NORMAL, direction: Direction = HORIZONTAL, left_to_right: bool = True, left_connector_length: float = 10.0, right_connector_length: float = 10.0, left_connector_stroke: NoneValueType | Color | None = None, left_connector_stroke_width: float | None = None, left_connector_stroke_dasharray: NoneValueType | tuple[float] | None = None, left_connector_stroke_dashoffset: float | None = None, left_connector_fill: NoneValueType | Color | None = None, left_connector_transform: NoneValueType | tuple[Transformation] | None = None, left_connector_filter: NoneValueType | Filter | None = None, right_connector_stroke: NoneValueType | Color | None = None, right_connector_stroke_width: float | None = None, right_connector_stroke_dasharray: NoneValueType | tuple[float] | None = None, right_connector_stroke_dashoffset: float | None = None, right_connector_fill: NoneValueType | Color | None = None, right_connector_transform: NoneValueType | tuple[Transformation] | None = None, right_connector_filter: NoneValueType | Filter | None = None)
Bases: _ConnectorsMixin, _SimpleMixin, _TextMixin, SBGNNode
Layout for DELAY operators.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
id_
|
str
|
The id of the map element. This id is purely for the user to keep track of the element, it does not need to be unique and is not part of the identity of the element, i.e., it is not considered when testing for equality between two map elements or when hashing the map element |
'17209f63-4599-4d6c-ad4c-7e8b06623318'
|
layout_elements
|
tuple[LayoutElement]
|
The sub-layout elements of the group layout. These are part of the children of the group layout |
<dynamic>
|
group_fill
|
NoneValueType | Color | None
|
The fill color of the group layout |
None
|
group_fill_rule
|
FillRule | None
|
The fill rule of the group layout |
None
|
group_filter
|
NoneValueType | Filter | None
|
The filter of the group layout |
None
|
group_font_family
|
str | None
|
The font family of the group layout |
None
|
group_font_size
|
float | None
|
The font size of the group layout |
None
|
group_font_style
|
FontStyle | None
|
The font style of the group layout |
None
|
group_font_weight
|
FontWeight | float | None
|
The font weight of the group layout |
None
|
group_stroke
|
NoneValueType | Color | None
|
The stroke color of the group layout |
None
|
group_stroke_dasharray
|
NoneValueType | tuple[float, ...] | None
|
The stroke dasharray of the group layout |
None
|
group_stroke_dashoffset
|
NoneValueType | float | None
|
The stroke dashoffset of the group layout |
None
|
group_stroke_width
|
NoneValueType | float | None
|
The stroke width of the group layout |
None
|
group_text_anchor
|
TextAnchor | None
|
The text anchor of the group layout |
None
|
group_transform
|
NoneValueType | tuple[Transformation] | None
|
The transform of the group layout |
None
|
fill
|
NoneValueType | Color | None
|
The fill color of the node |
Color(red=255, green=255, blue=255, alpha=1.0)
|
filter
|
NoneValueType | Filter | None
|
The filter of the node |
None
|
height
|
float
|
The height of the node |
30.0
|
label
|
TextLayout | None
|
The label of the node |
None
|
position
|
Point
|
The position of the node |
required |
stroke
|
NoneValueType | Color | None
|
The stroke color of the node |
Color(red=0, green=0, blue=0, alpha=1.0)
|
stroke_dasharray
|
NoneValueType | tuple[float, ...] | None
|
The stroke dasharray of the node |
None
|
stroke_dashoffset
|
NoneValueType | float | None
|
The stroke dashoffset of the node |
None
|
stroke_width
|
float | None
|
The stroke width of the node |
1.25
|
transform
|
NoneValueType | tuple[Transformation] | None
|
The transform of the node |
None
|
width
|
float
|
The width width of the node |
30.0
|
text
|
str
|
|
'τ'
|
font_family
|
str
|
|
'DejaVu Sans'
|
font_fill
|
Color | NoneValueType
|
|
Color(red=0, green=0, blue=0, alpha=1.0)
|
font_stroke
|
Color | NoneValueType
|
|
<momapy.drawing.NoneValueType object at 0x7fbe12e88d70>
|
font_style
|
FontStyle
|
|
<FontStyle.NORMAL: 0>
|
font_weight
|
FontWeight | float
|
|
<FontWeight.NORMAL: 0>
|
direction
|
Direction
|
|
<Direction.HORIZONTAL: 1>
|
left_to_right
|
bool
|
|
True
|
left_connector_length
|
float
|
|
10.0
|
right_connector_length
|
float
|
|
10.0
|
left_connector_stroke
|
NoneValueType | Color | None
|
|
None
|
left_connector_stroke_width
|
float | None
|
|
None
|
left_connector_stroke_dasharray
|
NoneValueType | tuple[float] | None
|
|
None
|
left_connector_stroke_dashoffset
|
float | None
|
|
None
|
left_connector_fill
|
NoneValueType | Color | None
|
|
None
|
left_connector_transform
|
NoneValueType | tuple[Transformation] | None
|
|
None
|
left_connector_filter
|
NoneValueType | Filter | None
|
|
None
|
right_connector_stroke
|
NoneValueType | Color | None
|
|
None
|
right_connector_stroke_width
|
float | None
|
|
None
|
right_connector_stroke_dasharray
|
NoneValueType | tuple[float] | None
|
|
None
|
right_connector_stroke_dashoffset
|
float | None
|
|
None
|
right_connector_fill
|
NoneValueType | Color | None
|
|
None
|
right_connector_transform
|
NoneValueType | tuple[Transformation] | None
|
|
None
|
right_connector_filter
|
NoneValueType | Filter | None
|
|
None
|
Methods:
| Name | Description |
|---|---|
anchor_point |
Return an anchor point of the layout element |
angle |
Return the point on the border of the node that intersects the drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal. |
bbox |
Compute and return the bounding box of the group layout element |
border |
Return the point on the border of the node that intersects the drawing elements of the node with the line formed of the center anchor point of the node and the given point. |
center |
Return the center anchor of the node |
childless |
Return a copy of the node with no children |
children |
Return the children of the group layout. |
contains |
Return |
descendants |
Return the descendants of the layout element |
drawing_elements |
Return the drawing elements of the group layout. |
east |
Get the east (right) anchor point. |
east_north_east |
Return the east north east anchor of the node |
east_south_east |
Return the east south east west anchor of the node |
equals |
Return |
flattened |
Return a list containing copy of the layout element with no children and all its descendants with no children |
label_center |
Return the label center anchor of the node |
left_connector_base |
Get the base point of the left connector. |
left_connector_tip |
Get the tip point of the left connector. |
north |
Get the north (top) anchor point. |
north_east |
Return the north east anchor of the node |
north_north_east |
Return the north north east anchor of the node |
north_north_west |
Return the north north west anchor of the node |
north_west |
Return the north west anchor of the node |
own_angle |
Return the point on the border of the node that intersects the self drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal. |
own_bbox |
Compute and return the bounding box of the self drawing element of the group layout |
own_border |
Return the point on the border of the node that intersects the self drawing elements of the node with the line formed of the center anchor point of the node and the given point. |
own_children |
Return the self children of the node. A node has unique child that is its label |
own_drawing_elements |
Return the node's own drawing elements |
own_to_geometry |
Return a list of geometry primitives from the self drawing elements. |
right_connector_base |
Get the base point of the right connector. |
right_connector_tip |
Get the tip point of the right connector. |
size |
Return the size of the node |
south |
Get the south (bottom) anchor point. |
south_east |
Return the south east anchor of the node |
south_south_east |
Return the south south east anchor of the node |
south_south_west |
Return the south south west anchor of the node |
south_west |
Return the south west anchor of the node |
to_geometry |
Return a list of geometry primitives from the drawing elements. |
west |
Get the west (left) anchor point. |
west_north_west |
Return the west north west anchor of the node |
west_south_west |
Return the west south west anchor of the node |
Attributes:
| Name | Type | Description |
|---|---|---|
x |
float
|
Return the x coordinate of the node |
y |
float
|
Return the y coordinate of the node |
anchor_point
anchor_point(anchor_name: str) -> Point
angle
angle(angle: float, unit: Literal['degrees', 'radians'] = 'degrees') -> Point | None
Return the point on the border of the node that intersects the drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.
Source code in src/momapy/core/layout.py
bbox
bbox() -> Bbox
Compute and return the bounding box of the group layout element
Source code in src/momapy/core/layout.py
border
Return the point on the border of the node that intersects the drawing elements of the node with the line formed of the center anchor point of the node and the given point. When there are multiple intersection points, the one closest to the given point is returned
Source code in src/momapy/core/layout.py
center
center() -> Point
childless
children
children() -> list[LayoutElement]
Return the children of the group layout.
These are the self children of the group layout (returned by the own_children method) and the other children of the group layout (given by the layout_elements attribute)
Source code in src/momapy/core/layout.py
contains
contains(other: LayoutElement) -> bool
Return true if another layout element is a descendant of the layout element, false otherwise
drawing_elements
drawing_elements() -> list[DrawingElement]
Return the drawing elements of the group layout. The returned drawing elements are a group drawing element formed of the self drawing elements of the group layout and the drawing elements of its children
Source code in src/momapy/core/layout.py
east
east() -> Point
Get the east (right) anchor point.
Returns:
| Type | Description |
|---|---|
Point
|
Point on the east side of the element. |
Source code in src/momapy/sbgn/elements.py
east_north_east
east_north_east() -> Point
Return the east north east anchor of the node
Source code in src/momapy/core/layout.py
east_south_east
east_south_east() -> Point
Return the east south east west anchor of the node
Source code in src/momapy/core/layout.py
equals
equals(other: LayoutElement, flattened: bool = False, unordered: bool = False) -> bool
Return true if the layout element is equal to another layout element, false otherwise
Source code in src/momapy/core/elements.py
flattened
flattened() -> list[LayoutElement]
Return a list containing copy of the layout element with no children and all its descendants with no children
Source code in src/momapy/core/elements.py
label_center
label_center() -> Point
left_connector_base
left_connector_base() -> Point
Get the base point of the left connector.
Returns:
| Type | Description |
|---|---|
Point
|
Point where the left connector attaches to the shape. |
Source code in src/momapy/sbgn/elements.py
left_connector_tip
left_connector_tip() -> Point
Get the tip point of the left connector.
Returns:
| Type | Description |
|---|---|
Point
|
Point at the end of the left connector line. |
Source code in src/momapy/sbgn/elements.py
north
north() -> Point
Get the north (top) anchor point.
Returns:
| Type | Description |
|---|---|
Point
|
Point on the north side of the element. |
Source code in src/momapy/sbgn/elements.py
north_east
north_east() -> Point
Return the north east anchor of the node
Source code in src/momapy/core/layout.py
north_north_east
north_north_east() -> Point
Return the north north east anchor of the node
Source code in src/momapy/core/layout.py
north_north_west
north_north_west() -> Point
Return the north north west anchor of the node
Source code in src/momapy/core/layout.py
north_west
north_west() -> Point
Return the north west anchor of the node
Source code in src/momapy/core/layout.py
own_angle
own_angle(angle: float, unit: Literal['degrees', 'radians'] = 'degrees') -> Point | None
Return the point on the border of the node that intersects the self drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.
Source code in src/momapy/core/layout.py
own_bbox
own_bbox() -> Bbox
Compute and return the bounding box of the self drawing element of the group layout
Source code in src/momapy/core/layout.py
own_border
Return the point on the border of the node that intersects the self drawing elements of the node with the line formed of the center anchor point of the node and the given point. When there are multiple intersection points, the one closest to the given point is returned
Source code in src/momapy/core/layout.py
own_children
own_children() -> list[LayoutElement]
Return the self children of the node. A node has unique child that is its label
own_drawing_elements
own_drawing_elements() -> list[DrawingElement]
Return the node's own drawing elements
Source code in src/momapy/core/layout.py
own_to_geometry
own_to_geometry() -> list[Segment | QuadraticBezierCurve | CubicBezierCurve | EllipticalArc]
Return a list of geometry primitives from the self drawing elements.
Source code in src/momapy/core/layout.py
right_connector_base
right_connector_base() -> Point
Get the base point of the right connector.
Returns:
| Type | Description |
|---|---|
Point
|
Point where the right connector attaches to the shape. |
Source code in src/momapy/sbgn/elements.py
right_connector_tip
right_connector_tip() -> Point
Get the tip point of the right connector.
Returns:
| Type | Description |
|---|---|
Point
|
Point at the end of the right connector line. |
Source code in src/momapy/sbgn/elements.py
size
south
south() -> Point
Get the south (bottom) anchor point.
Returns:
| Type | Description |
|---|---|
Point
|
Point on the south side of the element. |
Source code in src/momapy/sbgn/elements.py
south_east
south_east() -> Point
Return the south east anchor of the node
Source code in src/momapy/core/layout.py
south_south_east
south_south_east() -> Point
Return the south south east anchor of the node
Source code in src/momapy/core/layout.py
south_south_west
south_south_west() -> Point
Return the south south west anchor of the node
Source code in src/momapy/core/layout.py
south_west
south_west() -> Point
Return the south west anchor of the node
Source code in src/momapy/core/layout.py
to_geometry
to_geometry() -> list[Segment | QuadraticBezierCurve | CubicBezierCurve | EllipticalArc]
Return a list of geometry primitives from the drawing elements.
Source code in src/momapy/core/elements.py
west
west() -> Point
Get the west (left) anchor point.
Returns:
| Type | Description |
|---|---|
Point
|
Point on the west side of the element. |
Source code in src/momapy/sbgn/elements.py
west_north_west
west_north_west() -> Point
Return the west north west anchor of the node
Source code in src/momapy/core/layout.py
west_south_west
west_south_west() -> Point
Return the west south west anchor of the node
Source code in src/momapy/core/layout.py
EquivalenceArcLayout
dataclass
EquivalenceArcLayout(path_fill: NoneValueType | Color | None = NoneValue, path_stroke: NoneValueType | Color | None = black, path_stroke_width: float | None = 1.25, arrowhead_fill: NoneValueType | Color | None = white, arrowhead_stroke: NoneValueType | Color | None = black, arrowhead_stroke_width: float | None = 1.25, *, id_: str = make_uuid4_as_str(), layout_elements: tuple[LayoutElement] = tuple(), group_fill: NoneValueType | Color | None = None, group_fill_rule: FillRule | None = None, group_filter: NoneValueType | Filter | None = None, group_font_family: str | None = None, group_font_size: float | None = None, group_font_style: FontStyle | None = None, group_font_weight: FontWeight | float | None = None, group_stroke: NoneValueType | Color | None = None, group_stroke_dasharray: NoneValueType | tuple[float, ...] | None = None, group_stroke_dashoffset: NoneValueType | float | None = None, group_stroke_width: NoneValueType | float | None = None, group_text_anchor: TextAnchor | None = None, group_transform: NoneValueType | tuple[Transformation] | None = None, end_shorten: float = 0.0, fill: NoneValueType | Color | None = None, filter: NoneValueType | Filter | None = None, path_filter: NoneValueType | Filter | None = None, path_stroke_dasharray: NoneValueType | tuple[float, ...] | None = None, path_stroke_dashoffset: NoneValueType | float | None = None, path_transform: NoneValueType | tuple[Transformation] | None = None, stroke: NoneValueType | Color | None = None, stroke_dasharray: NoneValueType | tuple[float] | None = None, stroke_dashoffset: NoneValueType | float | None = None, stroke_width: NoneValueType | float | None = None, segments: tuple[Segment | QuadraticBezierCurve | CubicBezierCurve | EllipticalArc] = tuple(), source: LayoutElement | None = None, start_shorten: float = 0.0, target: LayoutElement | None = None, transform: NoneValueType | tuple[Transformation] | None = None, arrowhead_filter: NoneValueType | Filter | None = None, arrowhead_stroke_dasharray: NoneValueType | tuple[float, ...] | None = None, arrowhead_stroke_dashoffset: NoneValueType | float | None = None, arrowhead_transform: NoneValueType | tuple[Transformation] | None = None)
Bases: SBGNSingleHeadedArc
Layout for equivalence arcs.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
id_
|
str
|
The id of the map element. This id is purely for the user to keep track of the element, it does not need to be unique and is not part of the identity of the element, i.e., it is not considered when testing for equality between two map elements or when hashing the map element |
'05d2b5b4-3e62-486d-9431-f6dc454c4f2d'
|
layout_elements
|
tuple[LayoutElement]
|
The sub-layout elements of the group layout. These are part of the children of the group layout |
<dynamic>
|
group_fill
|
NoneValueType | Color | None
|
The fill color of the group layout |
None
|
group_fill_rule
|
FillRule | None
|
The fill rule of the group layout |
None
|
group_filter
|
NoneValueType | Filter | None
|
The filter of the group layout |
None
|
group_font_family
|
str | None
|
The font family of the group layout |
None
|
group_font_size
|
float | None
|
The font size of the group layout |
None
|
group_font_style
|
FontStyle | None
|
The font style of the group layout |
None
|
group_font_weight
|
FontWeight | float | None
|
The font weight of the group layout |
None
|
group_stroke
|
NoneValueType | Color | None
|
The stroke color of the group layout |
None
|
group_stroke_dasharray
|
NoneValueType | tuple[float, ...] | None
|
The stroke dasharray of the group layout |
None
|
group_stroke_dashoffset
|
NoneValueType | float | None
|
The stroke dashoffset of the group layout |
None
|
group_stroke_width
|
NoneValueType | float | None
|
The stroke width of the group layout |
None
|
group_text_anchor
|
TextAnchor | None
|
The text anchor of the group layout |
None
|
group_transform
|
NoneValueType | tuple[Transformation] | None
|
The transform of the group layout |
None
|
end_shorten
|
float
|
The length the end of the arc will be shorten by |
0.0
|
fill
|
NoneValueType | Color | None
|
The fill color of the arc |
None
|
filter
|
NoneValueType | Filter | None
|
The fill filter of the arc |
None
|
path_fill
|
NoneValueType | Color | None
|
The path fill color of the arc |
<momapy.drawing.NoneValueType object at 0x7fbe12e88d70>
|
path_filter
|
NoneValueType | Filter | None
|
The path filter of the arc |
None
|
path_stroke
|
NoneValueType | Color | None
|
The path stroke color of the arc |
Color(red=0, green=0, blue=0, alpha=1.0)
|
path_stroke_dasharray
|
NoneValueType | tuple[float, ...] | None
|
The path stroke dasharray of the arc |
None
|
path_stroke_dashoffset
|
NoneValueType | float | None
|
The path stroke dashoffset of the arc |
None
|
path_stroke_width
|
float | None
|
The path stroke width of the arc |
1.25
|
path_transform
|
NoneValueType | tuple[Transformation] | None
|
The path transform of the arc |
None
|
stroke
|
NoneValueType | Color | None
|
The stroke color of the arc |
None
|
stroke_dasharray
|
NoneValueType | tuple[float] | None
|
The stroke dasharray of the arc |
None
|
stroke_dashoffset
|
NoneValueType | float | None
|
The stroke dashoffset of the arc |
None
|
stroke_width
|
NoneValueType | float | None
|
The stroke width of the arc |
None
|
segments
|
tuple[Segment | QuadraticBezierCurve | CubicBezierCurve | EllipticalArc]
|
The path segments of the arc |
<dynamic>
|
source
|
LayoutElement | None
|
The source of the arc |
None
|
start_shorten
|
float
|
The length the start of the arc will be shorten by |
0.0
|
target
|
LayoutElement | None
|
The target of the arc |
None
|
transform
|
NoneValueType | tuple[Transformation] | None
|
The transform of the arc |
None
|
arrowhead_fill
|
NoneValueType | Color | None
|
The arrowhead fill color of the arc |
Color(red=255, green=255, blue=255, alpha=1.0)
|
arrowhead_filter
|
NoneValueType | Filter | None
|
The arrowhead filter of the arc |
None
|
arrowhead_stroke
|
NoneValueType | Color | None
|
The arrowhead stroke color of the arc |
Color(red=0, green=0, blue=0, alpha=1.0)
|
arrowhead_stroke_dasharray
|
NoneValueType | tuple[float, ...] | None
|
The arrowhead stroke dasharray of the arc |
None
|
arrowhead_stroke_dashoffset
|
NoneValueType | float | None
|
The arrowhead stroke dashoffset of the arc |
None
|
arrowhead_stroke_width
|
float | None
|
The arrowhead stroke width of the arc |
1.25
|
arrowhead_transform
|
NoneValueType | tuple[Transformation] | None
|
The arrowhead transform of the arc |
None
|
Methods:
| Name | Description |
|---|---|
anchor_point |
Return an anchor point of the layout element |
arrowhead_base |
Return the arrowhead base anchor point of the single-headed arc |
arrowhead_bbox |
Return the bounding box of the single-headed arc arrowhead |
arrowhead_border |
Return the point at the intersection of the drawing elements of the single-headed arc arrowhead and the line going through the center of these drawing elements and the given point. |
arrowhead_drawing_elements |
Return the drawing elements of the single-headed arc arrowhead |
arrowhead_length |
Return the length of the single-headed arc arrowhead |
arrowhead_tip |
Return the arrowhead tip anchor point of the single-headed arc |
bbox |
Compute and return the bounding box of the group layout element |
childless |
Return a copy of the arc with no children |
children |
Return the children of the group layout. |
contains |
Return |
descendants |
Return the descendants of the layout element |
drawing_elements |
Return the drawing elements of the group layout. |
end_point |
Return the ending point of the arc |
equals |
Return |
flattened |
Return a list containing copy of the layout element with no children and all its descendants with no children |
fraction |
Return the position and angle on the arc at a given fraction (of the total arc length) |
length |
Return the total length of the arc path |
own_bbox |
Compute and return the bounding box of the self drawing element of the group layout |
own_children |
Return the self children of the arc |
own_drawing_elements |
Return the self drawing elements of the single-headed arc |
own_to_geometry |
Return a list of geometry primitives from the self drawing elements. |
path_drawing_elements |
Return the drawing elements of the single-headed arc path |
points |
Return the points of the arc path |
start_point |
Return the starting point of the arc |
to_geometry |
Return a list of geometry primitives from the drawing elements. |
anchor_point
anchor_point(anchor_name: str) -> Point
arrowhead_base
arrowhead_base() -> Point
Return the arrowhead base anchor point of the single-headed arc
Source code in src/momapy/core/layout.py
arrowhead_border
arrowhead_border(point) -> Point
Return the point at the intersection of the drawing elements of the single-headed arc arrowhead and the line going through the center of these drawing elements and the given point. When there are multiple intersection points, the one closest to the given point is returned
Source code in src/momapy/core/layout.py
arrowhead_drawing_elements
arrowhead_drawing_elements() -> list[DrawingElement]
Return the drawing elements of the single-headed arc arrowhead
Source code in src/momapy/core/layout.py
arrowhead_length
Return the length of the single-headed arc arrowhead
Source code in src/momapy/core/layout.py
arrowhead_tip
arrowhead_tip() -> Point
Return the arrowhead tip anchor point of the single-headed arc
Source code in src/momapy/core/layout.py
bbox
bbox() -> Bbox
Compute and return the bounding box of the group layout element
Source code in src/momapy/core/layout.py
childless
children
children() -> list[LayoutElement]
Return the children of the group layout.
These are the self children of the group layout (returned by the own_children method) and the other children of the group layout (given by the layout_elements attribute)
Source code in src/momapy/core/layout.py
contains
contains(other: LayoutElement) -> bool
Return true if another layout element is a descendant of the layout element, false otherwise
drawing_elements
drawing_elements() -> list[DrawingElement]
Return the drawing elements of the group layout. The returned drawing elements are a group drawing element formed of the self drawing elements of the group layout and the drawing elements of its children
Source code in src/momapy/core/layout.py
end_point
end_point() -> Point
equals
equals(other: LayoutElement, flattened: bool = False, unordered: bool = False) -> bool
Return true if the layout element is equal to another layout element, false otherwise
Source code in src/momapy/core/elements.py
flattened
flattened() -> list[LayoutElement]
Return a list containing copy of the layout element with no children and all its descendants with no children
Source code in src/momapy/core/elements.py
fraction
fraction(fraction: float) -> tuple[Point, float]
Return the position and angle on the arc at a given fraction (of the total arc length)
Source code in src/momapy/core/layout.py
length
own_bbox
own_bbox() -> Bbox
Compute and return the bounding box of the self drawing element of the group layout
Source code in src/momapy/core/layout.py
own_children
own_children() -> list[LayoutElement]
own_drawing_elements
own_drawing_elements() -> list[DrawingElement]
Return the self drawing elements of the single-headed arc
Source code in src/momapy/core/layout.py
own_to_geometry
own_to_geometry() -> list[Segment | QuadraticBezierCurve | CubicBezierCurve | EllipticalArc]
Return a list of geometry primitives from the self drawing elements.
Source code in src/momapy/core/layout.py
path_drawing_elements
path_drawing_elements() -> list[Path]
Return the drawing elements of the single-headed arc path
Source code in src/momapy/core/layout.py
points
points() -> list[Point]
start_point
start_point() -> Point
to_geometry
to_geometry() -> list[Segment | QuadraticBezierCurve | CubicBezierCurve | EllipticalArc]
Return a list of geometry primitives from the drawing elements.
Source code in src/momapy/core/elements.py
Influence
dataclass
Influence(*, id_: str = make_uuid4_as_str(), source: BiologicalActivity | LogicalOperator, target: Activity)
Bases: SBGNModelElement
Influence between activities.
Represents an influence from a source activity to a target activity.
Attributes:
| Name | Type | Description |
|---|
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
id_
|
str
|
The id of the map element. This id is purely for the user to keep track of the element, it does not need to be unique and is not part of the identity of the element, i.e., it is not considered when testing for equality between two map elements or when hashing the map element |
'efe6add0-eb6a-4947-815d-4c22374d02ae'
|
source
|
BiologicalActivity | LogicalOperator
|
|
required |
target
|
Activity
|
|
required |
Methods:
| Name | Description |
|---|---|
descendants |
Return every |
descendants
descendants() -> list[ModelElement]
Return every ModelElement reachable from self, excluding self.
Walks scalar ModelElement fields and frozenset/tuple
containers, deduplicating by object identity.
Returns:
| Type | Description |
|---|---|
list[ModelElement]
|
The list of reachable |
list[ModelElement]
|
order, without |
Source code in src/momapy/core/elements.py
LogicArcLayout
dataclass
LogicArcLayout(path_fill: NoneValueType | Color | None = NoneValue, path_stroke: NoneValueType | Color | None = black, path_stroke_width: float | None = 1.25, arrowhead_fill: NoneValueType | Color | None = white, arrowhead_stroke: NoneValueType | Color | None = black, arrowhead_stroke_width: float | None = 1.25, *, id_: str = make_uuid4_as_str(), layout_elements: tuple[LayoutElement] = tuple(), group_fill: NoneValueType | Color | None = None, group_fill_rule: FillRule | None = None, group_filter: NoneValueType | Filter | None = None, group_font_family: str | None = None, group_font_size: float | None = None, group_font_style: FontStyle | None = None, group_font_weight: FontWeight | float | None = None, group_stroke: NoneValueType | Color | None = None, group_stroke_dasharray: NoneValueType | tuple[float, ...] | None = None, group_stroke_dashoffset: NoneValueType | float | None = None, group_stroke_width: NoneValueType | float | None = None, group_text_anchor: TextAnchor | None = None, group_transform: NoneValueType | tuple[Transformation] | None = None, end_shorten: float = 0.0, fill: NoneValueType | Color | None = None, filter: NoneValueType | Filter | None = None, path_filter: NoneValueType | Filter | None = None, path_stroke_dasharray: NoneValueType | tuple[float, ...] | None = None, path_stroke_dashoffset: NoneValueType | float | None = None, path_transform: NoneValueType | tuple[Transformation] | None = None, stroke: NoneValueType | Color | None = None, stroke_dasharray: NoneValueType | tuple[float] | None = None, stroke_dashoffset: NoneValueType | float | None = None, stroke_width: NoneValueType | float | None = None, segments: tuple[Segment | QuadraticBezierCurve | CubicBezierCurve | EllipticalArc] = tuple(), source: LayoutElement | None = None, start_shorten: float = 0.0, target: LayoutElement | None = None, transform: NoneValueType | tuple[Transformation] | None = None, arrowhead_filter: NoneValueType | Filter | None = None, arrowhead_stroke_dasharray: NoneValueType | tuple[float, ...] | None = None, arrowhead_stroke_dashoffset: NoneValueType | float | None = None, arrowhead_transform: NoneValueType | tuple[Transformation] | None = None)
Bases: SBGNSingleHeadedArc
Layout for logic arcs.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
id_
|
str
|
The id of the map element. This id is purely for the user to keep track of the element, it does not need to be unique and is not part of the identity of the element, i.e., it is not considered when testing for equality between two map elements or when hashing the map element |
'4a2c6a39-155b-4951-9d71-e9c4ed7ebb92'
|
layout_elements
|
tuple[LayoutElement]
|
The sub-layout elements of the group layout. These are part of the children of the group layout |
<dynamic>
|
group_fill
|
NoneValueType | Color | None
|
The fill color of the group layout |
None
|
group_fill_rule
|
FillRule | None
|
The fill rule of the group layout |
None
|
group_filter
|
NoneValueType | Filter | None
|
The filter of the group layout |
None
|
group_font_family
|
str | None
|
The font family of the group layout |
None
|
group_font_size
|
float | None
|
The font size of the group layout |
None
|
group_font_style
|
FontStyle | None
|
The font style of the group layout |
None
|
group_font_weight
|
FontWeight | float | None
|
The font weight of the group layout |
None
|
group_stroke
|
NoneValueType | Color | None
|
The stroke color of the group layout |
None
|
group_stroke_dasharray
|
NoneValueType | tuple[float, ...] | None
|
The stroke dasharray of the group layout |
None
|
group_stroke_dashoffset
|
NoneValueType | float | None
|
The stroke dashoffset of the group layout |
None
|
group_stroke_width
|
NoneValueType | float | None
|
The stroke width of the group layout |
None
|
group_text_anchor
|
TextAnchor | None
|
The text anchor of the group layout |
None
|
group_transform
|
NoneValueType | tuple[Transformation] | None
|
The transform of the group layout |
None
|
end_shorten
|
float
|
The length the end of the arc will be shorten by |
0.0
|
fill
|
NoneValueType | Color | None
|
The fill color of the arc |
None
|
filter
|
NoneValueType | Filter | None
|
The fill filter of the arc |
None
|
path_fill
|
NoneValueType | Color | None
|
The path fill color of the arc |
<momapy.drawing.NoneValueType object at 0x7fbe12e88d70>
|
path_filter
|
NoneValueType | Filter | None
|
The path filter of the arc |
None
|
path_stroke
|
NoneValueType | Color | None
|
The path stroke color of the arc |
Color(red=0, green=0, blue=0, alpha=1.0)
|
path_stroke_dasharray
|
NoneValueType | tuple[float, ...] | None
|
The path stroke dasharray of the arc |
None
|
path_stroke_dashoffset
|
NoneValueType | float | None
|
The path stroke dashoffset of the arc |
None
|
path_stroke_width
|
float | None
|
The path stroke width of the arc |
1.25
|
path_transform
|
NoneValueType | tuple[Transformation] | None
|
The path transform of the arc |
None
|
stroke
|
NoneValueType | Color | None
|
The stroke color of the arc |
None
|
stroke_dasharray
|
NoneValueType | tuple[float] | None
|
The stroke dasharray of the arc |
None
|
stroke_dashoffset
|
NoneValueType | float | None
|
The stroke dashoffset of the arc |
None
|
stroke_width
|
NoneValueType | float | None
|
The stroke width of the arc |
None
|
segments
|
tuple[Segment | QuadraticBezierCurve | CubicBezierCurve | EllipticalArc]
|
The path segments of the arc |
<dynamic>
|
source
|
LayoutElement | None
|
The source of the arc |
None
|
start_shorten
|
float
|
The length the start of the arc will be shorten by |
0.0
|
target
|
LayoutElement | None
|
The target of the arc |
None
|
transform
|
NoneValueType | tuple[Transformation] | None
|
The transform of the arc |
None
|
arrowhead_fill
|
NoneValueType | Color | None
|
The arrowhead fill color of the arc |
Color(red=255, green=255, blue=255, alpha=1.0)
|
arrowhead_filter
|
NoneValueType | Filter | None
|
The arrowhead filter of the arc |
None
|
arrowhead_stroke
|
NoneValueType | Color | None
|
The arrowhead stroke color of the arc |
Color(red=0, green=0, blue=0, alpha=1.0)
|
arrowhead_stroke_dasharray
|
NoneValueType | tuple[float, ...] | None
|
The arrowhead stroke dasharray of the arc |
None
|
arrowhead_stroke_dashoffset
|
NoneValueType | float | None
|
The arrowhead stroke dashoffset of the arc |
None
|
arrowhead_stroke_width
|
float | None
|
The arrowhead stroke width of the arc |
1.25
|
arrowhead_transform
|
NoneValueType | tuple[Transformation] | None
|
The arrowhead transform of the arc |
None
|
Methods:
| Name | Description |
|---|---|
anchor_point |
Return an anchor point of the layout element |
arrowhead_base |
Return the arrowhead base anchor point of the single-headed arc |
arrowhead_bbox |
Return the bounding box of the single-headed arc arrowhead |
arrowhead_border |
Return the point at the intersection of the drawing elements of the single-headed arc arrowhead and the line going through the center of these drawing elements and the given point. |
arrowhead_drawing_elements |
Return the drawing elements of the single-headed arc arrowhead |
arrowhead_length |
Return the length of the single-headed arc arrowhead |
arrowhead_tip |
Return the arrowhead tip anchor point of the single-headed arc |
bbox |
Compute and return the bounding box of the group layout element |
childless |
Return a copy of the arc with no children |
children |
Return the children of the group layout. |
contains |
Return |
descendants |
Return the descendants of the layout element |
drawing_elements |
Return the drawing elements of the group layout. |
end_point |
Return the ending point of the arc |
equals |
Return |
flattened |
Return a list containing copy of the layout element with no children and all its descendants with no children |
fraction |
Return the position and angle on the arc at a given fraction (of the total arc length) |
length |
Return the total length of the arc path |
own_bbox |
Compute and return the bounding box of the self drawing element of the group layout |
own_children |
Return the self children of the arc |
own_drawing_elements |
Return the self drawing elements of the single-headed arc |
own_to_geometry |
Return a list of geometry primitives from the self drawing elements. |
path_drawing_elements |
Return the drawing elements of the single-headed arc path |
points |
Return the points of the arc path |
start_point |
Return the starting point of the arc |
to_geometry |
Return a list of geometry primitives from the drawing elements. |
anchor_point
anchor_point(anchor_name: str) -> Point
arrowhead_base
arrowhead_base() -> Point
Return the arrowhead base anchor point of the single-headed arc
Source code in src/momapy/core/layout.py
arrowhead_border
arrowhead_border(point) -> Point
Return the point at the intersection of the drawing elements of the single-headed arc arrowhead and the line going through the center of these drawing elements and the given point. When there are multiple intersection points, the one closest to the given point is returned
Source code in src/momapy/core/layout.py
arrowhead_drawing_elements
arrowhead_drawing_elements() -> list[DrawingElement]
Return the drawing elements of the single-headed arc arrowhead
Source code in src/momapy/core/layout.py
arrowhead_length
Return the length of the single-headed arc arrowhead
Source code in src/momapy/core/layout.py
arrowhead_tip
arrowhead_tip() -> Point
Return the arrowhead tip anchor point of the single-headed arc
Source code in src/momapy/core/layout.py
bbox
bbox() -> Bbox
Compute and return the bounding box of the group layout element
Source code in src/momapy/core/layout.py
childless
children
children() -> list[LayoutElement]
Return the children of the group layout.
These are the self children of the group layout (returned by the own_children method) and the other children of the group layout (given by the layout_elements attribute)
Source code in src/momapy/core/layout.py
contains
contains(other: LayoutElement) -> bool
Return true if another layout element is a descendant of the layout element, false otherwise
drawing_elements
drawing_elements() -> list[DrawingElement]
Return the drawing elements of the group layout. The returned drawing elements are a group drawing element formed of the self drawing elements of the group layout and the drawing elements of its children
Source code in src/momapy/core/layout.py
end_point
end_point() -> Point
equals
equals(other: LayoutElement, flattened: bool = False, unordered: bool = False) -> bool
Return true if the layout element is equal to another layout element, false otherwise
Source code in src/momapy/core/elements.py
flattened
flattened() -> list[LayoutElement]
Return a list containing copy of the layout element with no children and all its descendants with no children
Source code in src/momapy/core/elements.py
fraction
fraction(fraction: float) -> tuple[Point, float]
Return the position and angle on the arc at a given fraction (of the total arc length)
Source code in src/momapy/core/layout.py
length
own_bbox
own_bbox() -> Bbox
Compute and return the bounding box of the self drawing element of the group layout
Source code in src/momapy/core/layout.py
own_children
own_children() -> list[LayoutElement]
own_drawing_elements
own_drawing_elements() -> list[DrawingElement]
Return the self drawing elements of the single-headed arc
Source code in src/momapy/core/layout.py
own_to_geometry
own_to_geometry() -> list[Segment | QuadraticBezierCurve | CubicBezierCurve | EllipticalArc]
Return a list of geometry primitives from the self drawing elements.
Source code in src/momapy/core/layout.py
path_drawing_elements
path_drawing_elements() -> list[Path]
Return the drawing elements of the single-headed arc path
Source code in src/momapy/core/layout.py
points
points() -> list[Point]
start_point
start_point() -> Point
to_geometry
to_geometry() -> list[Segment | QuadraticBezierCurve | CubicBezierCurve | EllipticalArc]
Return a list of geometry primitives from the drawing elements.
Source code in src/momapy/core/elements.py
LogicalOperator
dataclass
LogicalOperator(*, id_: str = make_uuid4_as_str(), inputs: frozenset[LogicalOperatorInput] = frozenset())
Bases: SBGNModelElement
Logical operator.
Represents logical operations (AND, OR, NOT, DELAY) on activities.
Attributes:
| Name | Type | Description |
|---|
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
id_
|
str
|
The id of the map element. This id is purely for the user to keep track of the element, it does not need to be unique and is not part of the identity of the element, i.e., it is not considered when testing for equality between two map elements or when hashing the map element |
'38d10717-932e-4e00-9285-67326bc5f4ed'
|
inputs
|
frozenset[LogicalOperatorInput]
|
Build an immutable unordered collection of unique elements. |
<dynamic>
|
Methods:
| Name | Description |
|---|---|
descendants |
Return every |
descendants
descendants() -> list[ModelElement]
Return every ModelElement reachable from self, excluding self.
Walks scalar ModelElement fields and frozenset/tuple
containers, deduplicating by object identity.
Returns:
| Type | Description |
|---|---|
list[ModelElement]
|
The list of reachable |
list[ModelElement]
|
order, without |
Source code in src/momapy/core/elements.py
LogicalOperatorInput
dataclass
LogicalOperatorInput(*, id_: str = make_uuid4_as_str(), element: Union[BiologicalActivity, ForwardRef(LogicalOperator, module=modules[__name__])])
Bases: SBGNRole
Input to a logical operator.
Represents an input connection to a logical operator.
Attributes:
| Name | Type | Description |
|---|
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
id_
|
str
|
The id of the map element. This id is purely for the user to keep track of the element, it does not need to be unique and is not part of the identity of the element, i.e., it is not considered when testing for equality between two map elements or when hashing the map element |
'45367176-bcf4-4ed8-86fc-edf93ff841c5'
|
element
|
BiologicalActivity | ForwardRef
|
|
required |
Methods:
| Name | Description |
|---|---|
descendants |
Return every |
descendants
descendants() -> list[ModelElement]
Return every ModelElement reachable from self, excluding self.
Walks scalar ModelElement fields and frozenset/tuple
containers, deduplicating by object identity.
Returns:
| Type | Description |
|---|---|
list[ModelElement]
|
The list of reachable |
list[ModelElement]
|
order, without |
Source code in src/momapy/core/elements.py
MacromoleculeUnitOfInformation
dataclass
Bases: UnitOfInformation
Unit of information typing a biological activity as a macromolecule.
Rendered as an SBGN macromolecule glyph embedded in the activity node.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
id_
|
str
|
The id of the map element. This id is purely for the user to keep track of the element, it does not need to be unique and is not part of the identity of the element, i.e., it is not considered when testing for equality between two map elements or when hashing the map element |
'c0a37493-3d5d-468c-bf82-79aa80bd7273'
|
label
|
str | None
|
|
None
|
Methods:
| Name | Description |
|---|---|
descendants |
Return every |
descendants
descendants() -> list[ModelElement]
Return every ModelElement reachable from self, excluding self.
Walks scalar ModelElement fields and frozenset/tuple
containers, deduplicating by object identity.
Returns:
| Type | Description |
|---|---|
list[ModelElement]
|
The list of reachable |
list[ModelElement]
|
order, without |
Source code in src/momapy/core/elements.py
MacromoleculeUnitOfInformationLayout
dataclass
MacromoleculeUnitOfInformationLayout(fill: NoneValueType | Color | None = white, stroke: NoneValueType | Color | None = black, stroke_width: float | None = 1.25, *, id_: str = make_uuid4_as_str(), layout_elements: tuple[LayoutElement] = tuple(), group_fill: NoneValueType | Color | None = None, group_fill_rule: FillRule | None = None, group_filter: NoneValueType | Filter | None = None, group_font_family: str | None = None, group_font_size: float | None = None, group_font_style: FontStyle | None = None, group_font_weight: FontWeight | float | None = None, group_stroke: NoneValueType | Color | None = None, group_stroke_dasharray: NoneValueType | tuple[float, ...] | None = None, group_stroke_dashoffset: NoneValueType | float | None = None, group_stroke_width: NoneValueType | float | None = None, group_text_anchor: TextAnchor | None = None, group_transform: NoneValueType | tuple[Transformation] | None = None, filter: NoneValueType | Filter | None = None, height: float = 12.0, label: TextLayout | None = None, position: Point, stroke_dasharray: NoneValueType | tuple[float, ...] | None = None, stroke_dashoffset: NoneValueType | float | None = None, transform: NoneValueType | tuple[Transformation] | None = None, width: float = 12.0, rounded_corners: float = 5.0)
Bases: _SimpleMixin, SBGNNode
Layout for macromolecule units of information.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
id_
|
str
|
The id of the map element. This id is purely for the user to keep track of the element, it does not need to be unique and is not part of the identity of the element, i.e., it is not considered when testing for equality between two map elements or when hashing the map element |
'e07134ba-6144-40b1-9509-1e6d0203ff5c'
|
layout_elements
|
tuple[LayoutElement]
|
The sub-layout elements of the group layout. These are part of the children of the group layout |
<dynamic>
|
group_fill
|
NoneValueType | Color | None
|
The fill color of the group layout |
None
|
group_fill_rule
|
FillRule | None
|
The fill rule of the group layout |
None
|
group_filter
|
NoneValueType | Filter | None
|
The filter of the group layout |
None
|
group_font_family
|
str | None
|
The font family of the group layout |
None
|
group_font_size
|
float | None
|
The font size of the group layout |
None
|
group_font_style
|
FontStyle | None
|
The font style of the group layout |
None
|
group_font_weight
|
FontWeight | float | None
|
The font weight of the group layout |
None
|
group_stroke
|
NoneValueType | Color | None
|
The stroke color of the group layout |
None
|
group_stroke_dasharray
|
NoneValueType | tuple[float, ...] | None
|
The stroke dasharray of the group layout |
None
|
group_stroke_dashoffset
|
NoneValueType | float | None
|
The stroke dashoffset of the group layout |
None
|
group_stroke_width
|
NoneValueType | float | None
|
The stroke width of the group layout |
None
|
group_text_anchor
|
TextAnchor | None
|
The text anchor of the group layout |
None
|
group_transform
|
NoneValueType | tuple[Transformation] | None
|
The transform of the group layout |
None
|
fill
|
NoneValueType | Color | None
|
The fill color of the node |
Color(red=255, green=255, blue=255, alpha=1.0)
|
filter
|
NoneValueType | Filter | None
|
The filter of the node |
None
|
height
|
float
|
The height of the node |
12.0
|
label
|
TextLayout | None
|
The label of the node |
None
|
position
|
Point
|
The position of the node |
required |
stroke
|
NoneValueType | Color | None
|
The stroke color of the node |
Color(red=0, green=0, blue=0, alpha=1.0)
|
stroke_dasharray
|
NoneValueType | tuple[float, ...] | None
|
The stroke dasharray of the node |
None
|
stroke_dashoffset
|
NoneValueType | float | None
|
The stroke dashoffset of the node |
None
|
stroke_width
|
float | None
|
The stroke width of the node |
1.25
|
transform
|
NoneValueType | tuple[Transformation] | None
|
The transform of the node |
None
|
width
|
float
|
The width width of the node |
12.0
|
rounded_corners
|
float
|
|
5.0
|
Methods:
| Name | Description |
|---|---|
anchor_point |
Return an anchor point of the layout element |
angle |
Return the point on the border of the node that intersects the drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal. |
bbox |
Compute and return the bounding box of the group layout element |
border |
Return the point on the border of the node that intersects the drawing elements of the node with the line formed of the center anchor point of the node and the given point. |
center |
Return the center anchor of the node |
childless |
Return a copy of the node with no children |
children |
Return the children of the group layout. |
contains |
Return |
descendants |
Return the descendants of the layout element |
drawing_elements |
Return the drawing elements of the group layout. |
east |
Return the east anchor of the node |
east_north_east |
Return the east north east anchor of the node |
east_south_east |
Return the east south east west anchor of the node |
equals |
Return |
flattened |
Return a list containing copy of the layout element with no children and all its descendants with no children |
label_center |
Return the label center anchor of the node |
north |
Return the north anchor of the node |
north_east |
Return the north east anchor of the node |
north_north_east |
Return the north north east anchor of the node |
north_north_west |
Return the north north west anchor of the node |
north_west |
Return the north west anchor of the node |
own_angle |
Return the point on the border of the node that intersects the self drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal. |
own_bbox |
Compute and return the bounding box of the self drawing element of the group layout |
own_border |
Return the point on the border of the node that intersects the self drawing elements of the node with the line formed of the center anchor point of the node and the given point. |
own_children |
Return the self children of the node. A node has unique child that is its label |
own_drawing_elements |
Return the node's own drawing elements |
own_to_geometry |
Return a list of geometry primitives from the self drawing elements. |
size |
Return the size of the node |
south |
Return the south anchor of the node |
south_east |
Return the south east anchor of the node |
south_south_east |
Return the south south east anchor of the node |
south_south_west |
Return the south south west anchor of the node |
south_west |
Return the south west anchor of the node |
to_geometry |
Return a list of geometry primitives from the drawing elements. |
west |
Return the west anchor of the node |
west_north_west |
Return the west north west anchor of the node |
west_south_west |
Return the west south west anchor of the node |
Attributes:
| Name | Type | Description |
|---|---|---|
x |
float
|
Return the x coordinate of the node |
y |
float
|
Return the y coordinate of the node |
anchor_point
anchor_point(anchor_name: str) -> Point
angle
angle(angle: float, unit: Literal['degrees', 'radians'] = 'degrees') -> Point | None
Return the point on the border of the node that intersects the drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.
Source code in src/momapy/core/layout.py
bbox
bbox() -> Bbox
Compute and return the bounding box of the group layout element
Source code in src/momapy/core/layout.py
border
Return the point on the border of the node that intersects the drawing elements of the node with the line formed of the center anchor point of the node and the given point. When there are multiple intersection points, the one closest to the given point is returned
Source code in src/momapy/core/layout.py
center
center() -> Point
childless
children
children() -> list[LayoutElement]
Return the children of the group layout.
These are the self children of the group layout (returned by the own_children method) and the other children of the group layout (given by the layout_elements attribute)
Source code in src/momapy/core/layout.py
contains
contains(other: LayoutElement) -> bool
Return true if another layout element is a descendant of the layout element, false otherwise
drawing_elements
drawing_elements() -> list[DrawingElement]
Return the drawing elements of the group layout. The returned drawing elements are a group drawing element formed of the self drawing elements of the group layout and the drawing elements of its children
Source code in src/momapy/core/layout.py
east
east() -> Point
east_north_east
east_north_east() -> Point
Return the east north east anchor of the node
Source code in src/momapy/core/layout.py
east_south_east
east_south_east() -> Point
Return the east south east west anchor of the node
Source code in src/momapy/core/layout.py
equals
equals(other: LayoutElement, flattened: bool = False, unordered: bool = False) -> bool
Return true if the layout element is equal to another layout element, false otherwise
Source code in src/momapy/core/elements.py
flattened
flattened() -> list[LayoutElement]
Return a list containing copy of the layout element with no children and all its descendants with no children
Source code in src/momapy/core/elements.py
label_center
label_center() -> Point
north
north() -> Point
north_east
north_east() -> Point
Return the north east anchor of the node
Source code in src/momapy/core/layout.py
north_north_east
north_north_east() -> Point
Return the north north east anchor of the node
Source code in src/momapy/core/layout.py
north_north_west
north_north_west() -> Point
Return the north north west anchor of the node
Source code in src/momapy/core/layout.py
north_west
north_west() -> Point
Return the north west anchor of the node
Source code in src/momapy/core/layout.py
own_angle
own_angle(angle: float, unit: Literal['degrees', 'radians'] = 'degrees') -> Point | None
Return the point on the border of the node that intersects the self drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.
Source code in src/momapy/core/layout.py
own_bbox
own_bbox() -> Bbox
Compute and return the bounding box of the self drawing element of the group layout
Source code in src/momapy/core/layout.py
own_border
Return the point on the border of the node that intersects the self drawing elements of the node with the line formed of the center anchor point of the node and the given point. When there are multiple intersection points, the one closest to the given point is returned
Source code in src/momapy/core/layout.py
own_children
own_children() -> list[LayoutElement]
Return the self children of the node. A node has unique child that is its label
own_drawing_elements
own_drawing_elements() -> list[DrawingElement]
Return the node's own drawing elements
Source code in src/momapy/core/layout.py
own_to_geometry
own_to_geometry() -> list[Segment | QuadraticBezierCurve | CubicBezierCurve | EllipticalArc]
Return a list of geometry primitives from the self drawing elements.
Source code in src/momapy/core/layout.py
size
south
south() -> Point
south_east
south_east() -> Point
Return the south east anchor of the node
Source code in src/momapy/core/layout.py
south_south_east
south_south_east() -> Point
Return the south south east anchor of the node
Source code in src/momapy/core/layout.py
south_south_west
south_south_west() -> Point
Return the south south west anchor of the node
Source code in src/momapy/core/layout.py
south_west
south_west() -> Point
Return the south west anchor of the node
Source code in src/momapy/core/layout.py
to_geometry
to_geometry() -> list[Segment | QuadraticBezierCurve | CubicBezierCurve | EllipticalArc]
Return a list of geometry primitives from the drawing elements.
Source code in src/momapy/core/elements.py
west
west() -> Point
west_north_west
west_north_west() -> Point
Return the west north west anchor of the node
Source code in src/momapy/core/layout.py
west_south_west
west_south_west() -> Point
Return the west south west anchor of the node
Source code in src/momapy/core/layout.py
NecessaryStimulation
dataclass
NecessaryStimulation(*, id_: str = make_uuid4_as_str(), source: BiologicalActivity | LogicalOperator, target: Activity)
Bases: Influence
Necessary stimulation.
The target requires the source to be active; without it the target cannot be active.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
id_
|
str
|
The id of the map element. This id is purely for the user to keep track of the element, it does not need to be unique and is not part of the identity of the element, i.e., it is not considered when testing for equality between two map elements or when hashing the map element |
'8daec6d4-486d-457b-82b7-44ac796efb79'
|
source
|
BiologicalActivity | LogicalOperator
|
|
required |
target
|
Activity
|
|
required |
Methods:
| Name | Description |
|---|---|
descendants |
Return every |
descendants
descendants() -> list[ModelElement]
Return every ModelElement reachable from self, excluding self.
Walks scalar ModelElement fields and frozenset/tuple
containers, deduplicating by object identity.
Returns:
| Type | Description |
|---|---|
list[ModelElement]
|
The list of reachable |
list[ModelElement]
|
order, without |
Source code in src/momapy/core/elements.py
NecessaryStimulationLayout
dataclass
NecessaryStimulationLayout(path_fill: NoneValueType | Color | None = NoneValue, path_stroke: NoneValueType | Color | None = black, path_stroke_width: float | None = 1.25, arrowhead_fill: NoneValueType | Color | None = white, arrowhead_stroke: NoneValueType | Color | None = black, arrowhead_stroke_width: float | None = 1.25, *, id_: str = make_uuid4_as_str(), layout_elements: tuple[LayoutElement] = tuple(), group_fill: NoneValueType | Color | None = None, group_fill_rule: FillRule | None = None, group_filter: NoneValueType | Filter | None = None, group_font_family: str | None = None, group_font_size: float | None = None, group_font_style: FontStyle | None = None, group_font_weight: FontWeight | float | None = None, group_stroke: NoneValueType | Color | None = None, group_stroke_dasharray: NoneValueType | tuple[float, ...] | None = None, group_stroke_dashoffset: NoneValueType | float | None = None, group_stroke_width: NoneValueType | float | None = None, group_text_anchor: TextAnchor | None = None, group_transform: NoneValueType | tuple[Transformation] | None = None, end_shorten: float = 0.0, fill: NoneValueType | Color | None = None, filter: NoneValueType | Filter | None = None, path_filter: NoneValueType | Filter | None = None, path_stroke_dasharray: NoneValueType | tuple[float, ...] | None = None, path_stroke_dashoffset: NoneValueType | float | None = None, path_transform: NoneValueType | tuple[Transformation] | None = None, stroke: NoneValueType | Color | None = None, stroke_dasharray: NoneValueType | tuple[float] | None = None, stroke_dashoffset: NoneValueType | float | None = None, stroke_width: NoneValueType | float | None = None, segments: tuple[Segment | QuadraticBezierCurve | CubicBezierCurve | EllipticalArc] = tuple(), source: LayoutElement | None = None, start_shorten: float = 0.0, target: LayoutElement | None = None, transform: NoneValueType | tuple[Transformation] | None = None, arrowhead_filter: NoneValueType | Filter | None = None, arrowhead_stroke_dasharray: NoneValueType | tuple[float, ...] | None = None, arrowhead_stroke_dashoffset: NoneValueType | float | None = None, arrowhead_transform: NoneValueType | tuple[Transformation] | None = None, arrowhead_bar_height: float = 12.0, arrowhead_sep: float = 3.0, arrowhead_triangle_height: float = 10.0, arrowhead_triangle_width: float = 10.0)
Bases: SBGNSingleHeadedArc
Layout for necessary stimulations.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
id_
|
str
|
The id of the map element. This id is purely for the user to keep track of the element, it does not need to be unique and is not part of the identity of the element, i.e., it is not considered when testing for equality between two map elements or when hashing the map element |
'3cd21fce-fc3c-4b33-973f-f55e3650d70d'
|
layout_elements
|
tuple[LayoutElement]
|
The sub-layout elements of the group layout. These are part of the children of the group layout |
<dynamic>
|
group_fill
|
NoneValueType | Color | None
|
The fill color of the group layout |
None
|
group_fill_rule
|
FillRule | None
|
The fill rule of the group layout |
None
|
group_filter
|
NoneValueType | Filter | None
|
The filter of the group layout |
None
|
group_font_family
|
str | None
|
The font family of the group layout |
None
|
group_font_size
|
float | None
|
The font size of the group layout |
None
|
group_font_style
|
FontStyle | None
|
The font style of the group layout |
None
|
group_font_weight
|
FontWeight | float | None
|
The font weight of the group layout |
None
|
group_stroke
|
NoneValueType | Color | None
|
The stroke color of the group layout |
None
|
group_stroke_dasharray
|
NoneValueType | tuple[float, ...] | None
|
The stroke dasharray of the group layout |
None
|
group_stroke_dashoffset
|
NoneValueType | float | None
|
The stroke dashoffset of the group layout |
None
|
group_stroke_width
|
NoneValueType | float | None
|
The stroke width of the group layout |
None
|
group_text_anchor
|
TextAnchor | None
|
The text anchor of the group layout |
None
|
group_transform
|
NoneValueType | tuple[Transformation] | None
|
The transform of the group layout |
None
|
end_shorten
|
float
|
The length the end of the arc will be shorten by |
0.0
|
fill
|
NoneValueType | Color | None
|
The fill color of the arc |
None
|
filter
|
NoneValueType | Filter | None
|
The fill filter of the arc |
None
|
path_fill
|
NoneValueType | Color | None
|
The path fill color of the arc |
<momapy.drawing.NoneValueType object at 0x7fbe12e88d70>
|
path_filter
|
NoneValueType | Filter | None
|
The path filter of the arc |
None
|
path_stroke
|
NoneValueType | Color | None
|
The path stroke color of the arc |
Color(red=0, green=0, blue=0, alpha=1.0)
|
path_stroke_dasharray
|
NoneValueType | tuple[float, ...] | None
|
The path stroke dasharray of the arc |
None
|
path_stroke_dashoffset
|
NoneValueType | float | None
|
The path stroke dashoffset of the arc |
None
|
path_stroke_width
|
float | None
|
The path stroke width of the arc |
1.25
|
path_transform
|
NoneValueType | tuple[Transformation] | None
|
The path transform of the arc |
None
|
stroke
|
NoneValueType | Color | None
|
The stroke color of the arc |
None
|
stroke_dasharray
|
NoneValueType | tuple[float] | None
|
The stroke dasharray of the arc |
None
|
stroke_dashoffset
|
NoneValueType | float | None
|
The stroke dashoffset of the arc |
None
|
stroke_width
|
NoneValueType | float | None
|
The stroke width of the arc |
None
|
segments
|
tuple[Segment | QuadraticBezierCurve | CubicBezierCurve | EllipticalArc]
|
The path segments of the arc |
<dynamic>
|
source
|
LayoutElement | None
|
The source of the arc |
None
|
start_shorten
|
float
|
The length the start of the arc will be shorten by |
0.0
|
target
|
LayoutElement | None
|
The target of the arc |
None
|
transform
|
NoneValueType | tuple[Transformation] | None
|
The transform of the arc |
None
|
arrowhead_fill
|
NoneValueType | Color | None
|
The arrowhead fill color of the arc |
Color(red=255, green=255, blue=255, alpha=1.0)
|
arrowhead_filter
|
NoneValueType | Filter | None
|
The arrowhead filter of the arc |
None
|
arrowhead_stroke
|
NoneValueType | Color | None
|
The arrowhead stroke color of the arc |
Color(red=0, green=0, blue=0, alpha=1.0)
|
arrowhead_stroke_dasharray
|
NoneValueType | tuple[float, ...] | None
|
The arrowhead stroke dasharray of the arc |
None
|
arrowhead_stroke_dashoffset
|
NoneValueType | float | None
|
The arrowhead stroke dashoffset of the arc |
None
|
arrowhead_stroke_width
|
float | None
|
The arrowhead stroke width of the arc |
1.25
|
arrowhead_transform
|
NoneValueType | tuple[Transformation] | None
|
The arrowhead transform of the arc |
None
|
arrowhead_bar_height
|
float
|
|
12.0
|
arrowhead_sep
|
float
|
|
3.0
|
arrowhead_triangle_height
|
float
|
|
10.0
|
arrowhead_triangle_width
|
float
|
|
10.0
|
Methods:
| Name | Description |
|---|---|
anchor_point |
Return an anchor point of the layout element |
arrowhead_base |
Return the arrowhead base anchor point of the single-headed arc |
arrowhead_bbox |
Return the bounding box of the single-headed arc arrowhead |
arrowhead_border |
Return the point at the intersection of the drawing elements of the single-headed arc arrowhead and the line going through the center of these drawing elements and the given point. |
arrowhead_drawing_elements |
Return the drawing elements of the single-headed arc arrowhead |
arrowhead_length |
Return the length of the single-headed arc arrowhead |
arrowhead_tip |
Return the arrowhead tip anchor point of the single-headed arc |
bbox |
Compute and return the bounding box of the group layout element |
childless |
Return a copy of the arc with no children |
children |
Return the children of the group layout. |
contains |
Return |
descendants |
Return the descendants of the layout element |
drawing_elements |
Return the drawing elements of the group layout. |
end_point |
Return the ending point of the arc |
equals |
Return |
flattened |
Return a list containing copy of the layout element with no children and all its descendants with no children |
fraction |
Return the position and angle on the arc at a given fraction (of the total arc length) |
length |
Return the total length of the arc path |
own_bbox |
Compute and return the bounding box of the self drawing element of the group layout |
own_children |
Return the self children of the arc |
own_drawing_elements |
Return the self drawing elements of the single-headed arc |
own_to_geometry |
Return a list of geometry primitives from the self drawing elements. |
path_drawing_elements |
Return the drawing elements of the single-headed arc path |
points |
Return the points of the arc path |
start_point |
Return the starting point of the arc |
to_geometry |
Return a list of geometry primitives from the drawing elements. |
anchor_point
anchor_point(anchor_name: str) -> Point
arrowhead_base
arrowhead_base() -> Point
Return the arrowhead base anchor point of the single-headed arc
Source code in src/momapy/core/layout.py
arrowhead_border
arrowhead_border(point) -> Point
Return the point at the intersection of the drawing elements of the single-headed arc arrowhead and the line going through the center of these drawing elements and the given point. When there are multiple intersection points, the one closest to the given point is returned
Source code in src/momapy/core/layout.py
arrowhead_drawing_elements
arrowhead_drawing_elements() -> list[DrawingElement]
Return the drawing elements of the single-headed arc arrowhead
Source code in src/momapy/core/layout.py
arrowhead_length
Return the length of the single-headed arc arrowhead
Source code in src/momapy/core/layout.py
arrowhead_tip
arrowhead_tip() -> Point
Return the arrowhead tip anchor point of the single-headed arc
Source code in src/momapy/core/layout.py
bbox
bbox() -> Bbox
Compute and return the bounding box of the group layout element
Source code in src/momapy/core/layout.py
childless
children
children() -> list[LayoutElement]
Return the children of the group layout.
These are the self children of the group layout (returned by the own_children method) and the other children of the group layout (given by the layout_elements attribute)
Source code in src/momapy/core/layout.py
contains
contains(other: LayoutElement) -> bool
Return true if another layout element is a descendant of the layout element, false otherwise
drawing_elements
drawing_elements() -> list[DrawingElement]
Return the drawing elements of the group layout. The returned drawing elements are a group drawing element formed of the self drawing elements of the group layout and the drawing elements of its children
Source code in src/momapy/core/layout.py
end_point
end_point() -> Point
equals
equals(other: LayoutElement, flattened: bool = False, unordered: bool = False) -> bool
Return true if the layout element is equal to another layout element, false otherwise
Source code in src/momapy/core/elements.py
flattened
flattened() -> list[LayoutElement]
Return a list containing copy of the layout element with no children and all its descendants with no children
Source code in src/momapy/core/elements.py
fraction
fraction(fraction: float) -> tuple[Point, float]
Return the position and angle on the arc at a given fraction (of the total arc length)
Source code in src/momapy/core/layout.py
length
own_bbox
own_bbox() -> Bbox
Compute and return the bounding box of the self drawing element of the group layout
Source code in src/momapy/core/layout.py
own_children
own_children() -> list[LayoutElement]
own_drawing_elements
own_drawing_elements() -> list[DrawingElement]
Return the self drawing elements of the single-headed arc
Source code in src/momapy/core/layout.py
own_to_geometry
own_to_geometry() -> list[Segment | QuadraticBezierCurve | CubicBezierCurve | EllipticalArc]
Return a list of geometry primitives from the self drawing elements.
Source code in src/momapy/core/layout.py
path_drawing_elements
path_drawing_elements() -> list[Path]
Return the drawing elements of the single-headed arc path
Source code in src/momapy/core/layout.py
points
points() -> list[Point]
start_point
start_point() -> Point
to_geometry
to_geometry() -> list[Segment | QuadraticBezierCurve | CubicBezierCurve | EllipticalArc]
Return a list of geometry primitives from the drawing elements.
Source code in src/momapy/core/elements.py
NegativeInfluence
dataclass
NegativeInfluence(*, id_: str = make_uuid4_as_str(), source: BiologicalActivity | LogicalOperator, target: Activity)
Bases: Influence
Negative (inhibiting) influence.
The source decreases the activity of the target.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
id_
|
str
|
The id of the map element. This id is purely for the user to keep track of the element, it does not need to be unique and is not part of the identity of the element, i.e., it is not considered when testing for equality between two map elements or when hashing the map element |
'996e3361-fcc1-4561-9b4b-1c45089a6079'
|
source
|
BiologicalActivity | LogicalOperator
|
|
required |
target
|
Activity
|
|
required |
Methods:
| Name | Description |
|---|---|
descendants |
Return every |
descendants
descendants() -> list[ModelElement]
Return every ModelElement reachable from self, excluding self.
Walks scalar ModelElement fields and frozenset/tuple
containers, deduplicating by object identity.
Returns:
| Type | Description |
|---|---|
list[ModelElement]
|
The list of reachable |
list[ModelElement]
|
order, without |
Source code in src/momapy/core/elements.py
NegativeInfluenceLayout
dataclass
NegativeInfluenceLayout(path_fill: NoneValueType | Color | None = NoneValue, path_stroke: NoneValueType | Color | None = black, path_stroke_width: float | None = 1.25, arrowhead_fill: NoneValueType | Color | None = white, arrowhead_stroke: NoneValueType | Color | None = black, arrowhead_stroke_width: float | None = 1.25, *, id_: str = make_uuid4_as_str(), layout_elements: tuple[LayoutElement] = tuple(), group_fill: NoneValueType | Color | None = None, group_fill_rule: FillRule | None = None, group_filter: NoneValueType | Filter | None = None, group_font_family: str | None = None, group_font_size: float | None = None, group_font_style: FontStyle | None = None, group_font_weight: FontWeight | float | None = None, group_stroke: NoneValueType | Color | None = None, group_stroke_dasharray: NoneValueType | tuple[float, ...] | None = None, group_stroke_dashoffset: NoneValueType | float | None = None, group_stroke_width: NoneValueType | float | None = None, group_text_anchor: TextAnchor | None = None, group_transform: NoneValueType | tuple[Transformation] | None = None, end_shorten: float = 0.0, fill: NoneValueType | Color | None = None, filter: NoneValueType | Filter | None = None, path_filter: NoneValueType | Filter | None = None, path_stroke_dasharray: NoneValueType | tuple[float, ...] | None = None, path_stroke_dashoffset: NoneValueType | float | None = None, path_transform: NoneValueType | tuple[Transformation] | None = None, stroke: NoneValueType | Color | None = None, stroke_dasharray: NoneValueType | tuple[float] | None = None, stroke_dashoffset: NoneValueType | float | None = None, stroke_width: NoneValueType | float | None = None, segments: tuple[Segment | QuadraticBezierCurve | CubicBezierCurve | EllipticalArc] = tuple(), source: LayoutElement | None = None, start_shorten: float = 0.0, target: LayoutElement | None = None, transform: NoneValueType | tuple[Transformation] | None = None, arrowhead_filter: NoneValueType | Filter | None = None, arrowhead_stroke_dasharray: NoneValueType | tuple[float, ...] | None = None, arrowhead_stroke_dashoffset: NoneValueType | float | None = None, arrowhead_transform: NoneValueType | tuple[Transformation] | None = None, arrowhead_height: float = 10.0)
Bases: SBGNSingleHeadedArc
Layout for negative influences.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
id_
|
str
|
The id of the map element. This id is purely for the user to keep track of the element, it does not need to be unique and is not part of the identity of the element, i.e., it is not considered when testing for equality between two map elements or when hashing the map element |
'def0b7cb-0a27-491a-a54f-cf49ecfb797f'
|
layout_elements
|
tuple[LayoutElement]
|
The sub-layout elements of the group layout. These are part of the children of the group layout |
<dynamic>
|
group_fill
|
NoneValueType | Color | None
|
The fill color of the group layout |
None
|
group_fill_rule
|
FillRule | None
|
The fill rule of the group layout |
None
|
group_filter
|
NoneValueType | Filter | None
|
The filter of the group layout |
None
|
group_font_family
|
str | None
|
The font family of the group layout |
None
|
group_font_size
|
float | None
|
The font size of the group layout |
None
|
group_font_style
|
FontStyle | None
|
The font style of the group layout |
None
|
group_font_weight
|
FontWeight | float | None
|
The font weight of the group layout |
None
|
group_stroke
|
NoneValueType | Color | None
|
The stroke color of the group layout |
None
|
group_stroke_dasharray
|
NoneValueType | tuple[float, ...] | None
|
The stroke dasharray of the group layout |
None
|
group_stroke_dashoffset
|
NoneValueType | float | None
|
The stroke dashoffset of the group layout |
None
|
group_stroke_width
|
NoneValueType | float | None
|
The stroke width of the group layout |
None
|
group_text_anchor
|
TextAnchor | None
|
The text anchor of the group layout |
None
|
group_transform
|
NoneValueType | tuple[Transformation] | None
|
The transform of the group layout |
None
|
end_shorten
|
float
|
The length the end of the arc will be shorten by |
0.0
|
fill
|
NoneValueType | Color | None
|
The fill color of the arc |
None
|
filter
|
NoneValueType | Filter | None
|
The fill filter of the arc |
None
|
path_fill
|
NoneValueType | Color | None
|
The path fill color of the arc |
<momapy.drawing.NoneValueType object at 0x7fbe12e88d70>
|
path_filter
|
NoneValueType | Filter | None
|
The path filter of the arc |
None
|
path_stroke
|
NoneValueType | Color | None
|
The path stroke color of the arc |
Color(red=0, green=0, blue=0, alpha=1.0)
|
path_stroke_dasharray
|
NoneValueType | tuple[float, ...] | None
|
The path stroke dasharray of the arc |
None
|
path_stroke_dashoffset
|
NoneValueType | float | None
|
The path stroke dashoffset of the arc |
None
|
path_stroke_width
|
float | None
|
The path stroke width of the arc |
1.25
|
path_transform
|
NoneValueType | tuple[Transformation] | None
|
The path transform of the arc |
None
|
stroke
|
NoneValueType | Color | None
|
The stroke color of the arc |
None
|
stroke_dasharray
|
NoneValueType | tuple[float] | None
|
The stroke dasharray of the arc |
None
|
stroke_dashoffset
|
NoneValueType | float | None
|
The stroke dashoffset of the arc |
None
|
stroke_width
|
NoneValueType | float | None
|
The stroke width of the arc |
None
|
segments
|
tuple[Segment | QuadraticBezierCurve | CubicBezierCurve | EllipticalArc]
|
The path segments of the arc |
<dynamic>
|
source
|
LayoutElement | None
|
The source of the arc |
None
|
start_shorten
|
float
|
The length the start of the arc will be shorten by |
0.0
|
target
|
LayoutElement | None
|
The target of the arc |
None
|
transform
|
NoneValueType | tuple[Transformation] | None
|
The transform of the arc |
None
|
arrowhead_fill
|
NoneValueType | Color | None
|
The arrowhead fill color of the arc |
Color(red=255, green=255, blue=255, alpha=1.0)
|
arrowhead_filter
|
NoneValueType | Filter | None
|
The arrowhead filter of the arc |
None
|
arrowhead_stroke
|
NoneValueType | Color | None
|
The arrowhead stroke color of the arc |
Color(red=0, green=0, blue=0, alpha=1.0)
|
arrowhead_stroke_dasharray
|
NoneValueType | tuple[float, ...] | None
|
The arrowhead stroke dasharray of the arc |
None
|
arrowhead_stroke_dashoffset
|
NoneValueType | float | None
|
The arrowhead stroke dashoffset of the arc |
None
|
arrowhead_stroke_width
|
float | None
|
The arrowhead stroke width of the arc |
1.25
|
arrowhead_transform
|
NoneValueType | tuple[Transformation] | None
|
The arrowhead transform of the arc |
None
|
arrowhead_height
|
float
|
|
10.0
|
Methods:
| Name | Description |
|---|---|
anchor_point |
Return an anchor point of the layout element |
arrowhead_base |
Return the arrowhead base anchor point of the single-headed arc |
arrowhead_bbox |
Return the bounding box of the single-headed arc arrowhead |
arrowhead_border |
Return the point at the intersection of the drawing elements of the single-headed arc arrowhead and the line going through the center of these drawing elements and the given point. |
arrowhead_drawing_elements |
Return the drawing elements of the single-headed arc arrowhead |
arrowhead_length |
Return the length of the single-headed arc arrowhead |
arrowhead_tip |
Return the arrowhead tip anchor point of the single-headed arc |
bbox |
Compute and return the bounding box of the group layout element |
childless |
Return a copy of the arc with no children |
children |
Return the children of the group layout. |
contains |
Return |
descendants |
Return the descendants of the layout element |
drawing_elements |
Return the drawing elements of the group layout. |
end_point |
Return the ending point of the arc |
equals |
Return |
flattened |
Return a list containing copy of the layout element with no children and all its descendants with no children |
fraction |
Return the position and angle on the arc at a given fraction (of the total arc length) |
length |
Return the total length of the arc path |
own_bbox |
Compute and return the bounding box of the self drawing element of the group layout |
own_children |
Return the self children of the arc |
own_drawing_elements |
Return the self drawing elements of the single-headed arc |
own_to_geometry |
Return a list of geometry primitives from the self drawing elements. |
path_drawing_elements |
Return the drawing elements of the single-headed arc path |
points |
Return the points of the arc path |
start_point |
Return the starting point of the arc |
to_geometry |
Return a list of geometry primitives from the drawing elements. |
anchor_point
anchor_point(anchor_name: str) -> Point
arrowhead_base
arrowhead_base() -> Point
Return the arrowhead base anchor point of the single-headed arc
Source code in src/momapy/core/layout.py
arrowhead_border
arrowhead_border(point) -> Point
Return the point at the intersection of the drawing elements of the single-headed arc arrowhead and the line going through the center of these drawing elements and the given point. When there are multiple intersection points, the one closest to the given point is returned
Source code in src/momapy/core/layout.py
arrowhead_drawing_elements
arrowhead_drawing_elements() -> list[DrawingElement]
Return the drawing elements of the single-headed arc arrowhead
Source code in src/momapy/core/layout.py
arrowhead_length
Return the length of the single-headed arc arrowhead
Source code in src/momapy/core/layout.py
arrowhead_tip
arrowhead_tip() -> Point
Return the arrowhead tip anchor point of the single-headed arc
Source code in src/momapy/core/layout.py
bbox
bbox() -> Bbox
Compute and return the bounding box of the group layout element
Source code in src/momapy/core/layout.py
childless
children
children() -> list[LayoutElement]
Return the children of the group layout.
These are the self children of the group layout (returned by the own_children method) and the other children of the group layout (given by the layout_elements attribute)
Source code in src/momapy/core/layout.py
contains
contains(other: LayoutElement) -> bool
Return true if another layout element is a descendant of the layout element, false otherwise
drawing_elements
drawing_elements() -> list[DrawingElement]
Return the drawing elements of the group layout. The returned drawing elements are a group drawing element formed of the self drawing elements of the group layout and the drawing elements of its children
Source code in src/momapy/core/layout.py
end_point
end_point() -> Point
equals
equals(other: LayoutElement, flattened: bool = False, unordered: bool = False) -> bool
Return true if the layout element is equal to another layout element, false otherwise
Source code in src/momapy/core/elements.py
flattened
flattened() -> list[LayoutElement]
Return a list containing copy of the layout element with no children and all its descendants with no children
Source code in src/momapy/core/elements.py
fraction
fraction(fraction: float) -> tuple[Point, float]
Return the position and angle on the arc at a given fraction (of the total arc length)
Source code in src/momapy/core/layout.py
length
own_bbox
own_bbox() -> Bbox
Compute and return the bounding box of the self drawing element of the group layout
Source code in src/momapy/core/layout.py
own_children
own_children() -> list[LayoutElement]
own_drawing_elements
own_drawing_elements() -> list[DrawingElement]
Return the self drawing elements of the single-headed arc
Source code in src/momapy/core/layout.py
own_to_geometry
own_to_geometry() -> list[Segment | QuadraticBezierCurve | CubicBezierCurve | EllipticalArc]
Return a list of geometry primitives from the self drawing elements.
Source code in src/momapy/core/layout.py
path_drawing_elements
path_drawing_elements() -> list[Path]
Return the drawing elements of the single-headed arc path
Source code in src/momapy/core/layout.py
points
points() -> list[Point]
start_point
start_point() -> Point
to_geometry
to_geometry() -> list[Segment | QuadraticBezierCurve | CubicBezierCurve | EllipticalArc]
Return a list of geometry primitives from the drawing elements.
Source code in src/momapy/core/elements.py
NotOperator
dataclass
NotOperator(*, id_: str = make_uuid4_as_str(), inputs: frozenset[LogicalOperatorInput] = frozenset())
Bases: LogicalOperator
Logical NOT operator.
The output is active when its (single) input is inactive.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
id_
|
str
|
The id of the map element. This id is purely for the user to keep track of the element, it does not need to be unique and is not part of the identity of the element, i.e., it is not considered when testing for equality between two map elements or when hashing the map element |
'b50cac62-096e-47b8-a3b3-967e41d37e09'
|
inputs
|
frozenset[LogicalOperatorInput]
|
Build an immutable unordered collection of unique elements. |
<dynamic>
|
Methods:
| Name | Description |
|---|---|
descendants |
Return every |
descendants
descendants() -> list[ModelElement]
Return every ModelElement reachable from self, excluding self.
Walks scalar ModelElement fields and frozenset/tuple
containers, deduplicating by object identity.
Returns:
| Type | Description |
|---|---|
list[ModelElement]
|
The list of reachable |
list[ModelElement]
|
order, without |
Source code in src/momapy/core/elements.py
NotOperatorLayout
dataclass
NotOperatorLayout(fill: NoneValueType | Color | None = white, stroke: NoneValueType | Color | None = black, stroke_width: float | None = 1.25, *, id_: str = make_uuid4_as_str(), layout_elements: tuple[LayoutElement] = tuple(), group_fill: NoneValueType | Color | None = None, group_fill_rule: FillRule | None = None, group_filter: NoneValueType | Filter | None = None, group_font_family: str | None = None, group_font_size: float | None = None, group_font_style: FontStyle | None = None, group_font_weight: FontWeight | float | None = None, group_stroke: NoneValueType | Color | None = None, group_stroke_dasharray: NoneValueType | tuple[float, ...] | None = None, group_stroke_dashoffset: NoneValueType | float | None = None, group_stroke_width: NoneValueType | float | None = None, group_text_anchor: TextAnchor | None = None, group_transform: NoneValueType | tuple[Transformation] | None = None, filter: NoneValueType | Filter | None = None, height: float = 30.0, label: TextLayout | None = None, position: Point, stroke_dasharray: NoneValueType | tuple[float, ...] | None = None, stroke_dashoffset: NoneValueType | float | None = None, transform: NoneValueType | tuple[Transformation] | None = None, width: float = 30.0, text: str = 'NOT', font_family: str = DEFAULT_FONT_FAMILY, font_fill: Color | NoneValueType = black, font_stroke: Color | NoneValueType = NoneValue, font_style: FontStyle = NORMAL, font_weight: FontWeight | float = NORMAL, direction: Direction = HORIZONTAL, left_to_right: bool = True, left_connector_length: float = 10.0, right_connector_length: float = 10.0, left_connector_stroke: NoneValueType | Color | None = None, left_connector_stroke_width: float | None = None, left_connector_stroke_dasharray: NoneValueType | tuple[float] | None = None, left_connector_stroke_dashoffset: float | None = None, left_connector_fill: NoneValueType | Color | None = None, left_connector_transform: NoneValueType | tuple[Transformation] | None = None, left_connector_filter: NoneValueType | Filter | None = None, right_connector_stroke: NoneValueType | Color | None = None, right_connector_stroke_width: float | None = None, right_connector_stroke_dasharray: NoneValueType | tuple[float] | None = None, right_connector_stroke_dashoffset: float | None = None, right_connector_fill: NoneValueType | Color | None = None, right_connector_transform: NoneValueType | tuple[Transformation] | None = None, right_connector_filter: NoneValueType | Filter | None = None)
Bases: _ConnectorsMixin, _SimpleMixin, _TextMixin, SBGNNode
Layout for NOT operators.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
id_
|
str
|
The id of the map element. This id is purely for the user to keep track of the element, it does not need to be unique and is not part of the identity of the element, i.e., it is not considered when testing for equality between two map elements or when hashing the map element |
'2f595ac9-b605-4318-b692-8f5b02e65c81'
|
layout_elements
|
tuple[LayoutElement]
|
The sub-layout elements of the group layout. These are part of the children of the group layout |
<dynamic>
|
group_fill
|
NoneValueType | Color | None
|
The fill color of the group layout |
None
|
group_fill_rule
|
FillRule | None
|
The fill rule of the group layout |
None
|
group_filter
|
NoneValueType | Filter | None
|
The filter of the group layout |
None
|
group_font_family
|
str | None
|
The font family of the group layout |
None
|
group_font_size
|
float | None
|
The font size of the group layout |
None
|
group_font_style
|
FontStyle | None
|
The font style of the group layout |
None
|
group_font_weight
|
FontWeight | float | None
|
The font weight of the group layout |
None
|
group_stroke
|
NoneValueType | Color | None
|
The stroke color of the group layout |
None
|
group_stroke_dasharray
|
NoneValueType | tuple[float, ...] | None
|
The stroke dasharray of the group layout |
None
|
group_stroke_dashoffset
|
NoneValueType | float | None
|
The stroke dashoffset of the group layout |
None
|
group_stroke_width
|
NoneValueType | float | None
|
The stroke width of the group layout |
None
|
group_text_anchor
|
TextAnchor | None
|
The text anchor of the group layout |
None
|
group_transform
|
NoneValueType | tuple[Transformation] | None
|
The transform of the group layout |
None
|
fill
|
NoneValueType | Color | None
|
The fill color of the node |
Color(red=255, green=255, blue=255, alpha=1.0)
|
filter
|
NoneValueType | Filter | None
|
The filter of the node |
None
|
height
|
float
|
The height of the node |
30.0
|
label
|
TextLayout | None
|
The label of the node |
None
|
position
|
Point
|
The position of the node |
required |
stroke
|
NoneValueType | Color | None
|
The stroke color of the node |
Color(red=0, green=0, blue=0, alpha=1.0)
|
stroke_dasharray
|
NoneValueType | tuple[float, ...] | None
|
The stroke dasharray of the node |
None
|
stroke_dashoffset
|
NoneValueType | float | None
|
The stroke dashoffset of the node |
None
|
stroke_width
|
float | None
|
The stroke width of the node |
1.25
|
transform
|
NoneValueType | tuple[Transformation] | None
|
The transform of the node |
None
|
width
|
float
|
The width width of the node |
30.0
|
text
|
str
|
|
'NOT'
|
font_family
|
str
|
|
'DejaVu Sans'
|
font_fill
|
Color | NoneValueType
|
|
Color(red=0, green=0, blue=0, alpha=1.0)
|
font_stroke
|
Color | NoneValueType
|
|
<momapy.drawing.NoneValueType object at 0x7fbe12e88d70>
|
font_style
|
FontStyle
|
|
<FontStyle.NORMAL: 0>
|
font_weight
|
FontWeight | float
|
|
<FontWeight.NORMAL: 0>
|
direction
|
Direction
|
|
<Direction.HORIZONTAL: 1>
|
left_to_right
|
bool
|
|
True
|
left_connector_length
|
float
|
|
10.0
|
right_connector_length
|
float
|
|
10.0
|
left_connector_stroke
|
NoneValueType | Color | None
|
|
None
|
left_connector_stroke_width
|
float | None
|
|
None
|
left_connector_stroke_dasharray
|
NoneValueType | tuple[float] | None
|
|
None
|
left_connector_stroke_dashoffset
|
float | None
|
|
None
|
left_connector_fill
|
NoneValueType | Color | None
|
|
None
|
left_connector_transform
|
NoneValueType | tuple[Transformation] | None
|
|
None
|
left_connector_filter
|
NoneValueType | Filter | None
|
|
None
|
right_connector_stroke
|
NoneValueType | Color | None
|
|
None
|
right_connector_stroke_width
|
float | None
|
|
None
|
right_connector_stroke_dasharray
|
NoneValueType | tuple[float] | None
|
|
None
|
right_connector_stroke_dashoffset
|
float | None
|
|
None
|
right_connector_fill
|
NoneValueType | Color | None
|
|
None
|
right_connector_transform
|
NoneValueType | tuple[Transformation] | None
|
|
None
|
right_connector_filter
|
NoneValueType | Filter | None
|
|
None
|
Methods:
| Name | Description |
|---|---|
anchor_point |
Return an anchor point of the layout element |
angle |
Return the point on the border of the node that intersects the drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal. |
bbox |
Compute and return the bounding box of the group layout element |
border |
Return the point on the border of the node that intersects the drawing elements of the node with the line formed of the center anchor point of the node and the given point. |
center |
Return the center anchor of the node |
childless |
Return a copy of the node with no children |
children |
Return the children of the group layout. |
contains |
Return |
descendants |
Return the descendants of the layout element |
drawing_elements |
Return the drawing elements of the group layout. |
east |
Get the east (right) anchor point. |
east_north_east |
Return the east north east anchor of the node |
east_south_east |
Return the east south east west anchor of the node |
equals |
Return |
flattened |
Return a list containing copy of the layout element with no children and all its descendants with no children |
label_center |
Return the label center anchor of the node |
left_connector_base |
Get the base point of the left connector. |
left_connector_tip |
Get the tip point of the left connector. |
north |
Get the north (top) anchor point. |
north_east |
Return the north east anchor of the node |
north_north_east |
Return the north north east anchor of the node |
north_north_west |
Return the north north west anchor of the node |
north_west |
Return the north west anchor of the node |
own_angle |
Return the point on the border of the node that intersects the self drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal. |
own_bbox |
Compute and return the bounding box of the self drawing element of the group layout |
own_border |
Return the point on the border of the node that intersects the self drawing elements of the node with the line formed of the center anchor point of the node and the given point. |
own_children |
Return the self children of the node. A node has unique child that is its label |
own_drawing_elements |
Return the node's own drawing elements |
own_to_geometry |
Return a list of geometry primitives from the self drawing elements. |
right_connector_base |
Get the base point of the right connector. |
right_connector_tip |
Get the tip point of the right connector. |
size |
Return the size of the node |
south |
Get the south (bottom) anchor point. |
south_east |
Return the south east anchor of the node |
south_south_east |
Return the south south east anchor of the node |
south_south_west |
Return the south south west anchor of the node |
south_west |
Return the south west anchor of the node |
to_geometry |
Return a list of geometry primitives from the drawing elements. |
west |
Get the west (left) anchor point. |
west_north_west |
Return the west north west anchor of the node |
west_south_west |
Return the west south west anchor of the node |
Attributes:
| Name | Type | Description |
|---|---|---|
x |
float
|
Return the x coordinate of the node |
y |
float
|
Return the y coordinate of the node |
anchor_point
anchor_point(anchor_name: str) -> Point
angle
angle(angle: float, unit: Literal['degrees', 'radians'] = 'degrees') -> Point | None
Return the point on the border of the node that intersects the drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.
Source code in src/momapy/core/layout.py
bbox
bbox() -> Bbox
Compute and return the bounding box of the group layout element
Source code in src/momapy/core/layout.py
border
Return the point on the border of the node that intersects the drawing elements of the node with the line formed of the center anchor point of the node and the given point. When there are multiple intersection points, the one closest to the given point is returned
Source code in src/momapy/core/layout.py
center
center() -> Point
childless
children
children() -> list[LayoutElement]
Return the children of the group layout.
These are the self children of the group layout (returned by the own_children method) and the other children of the group layout (given by the layout_elements attribute)
Source code in src/momapy/core/layout.py
contains
contains(other: LayoutElement) -> bool
Return true if another layout element is a descendant of the layout element, false otherwise
drawing_elements
drawing_elements() -> list[DrawingElement]
Return the drawing elements of the group layout. The returned drawing elements are a group drawing element formed of the self drawing elements of the group layout and the drawing elements of its children
Source code in src/momapy/core/layout.py
east
east() -> Point
Get the east (right) anchor point.
Returns:
| Type | Description |
|---|---|
Point
|
Point on the east side of the element. |
Source code in src/momapy/sbgn/elements.py
east_north_east
east_north_east() -> Point
Return the east north east anchor of the node
Source code in src/momapy/core/layout.py
east_south_east
east_south_east() -> Point
Return the east south east west anchor of the node
Source code in src/momapy/core/layout.py
equals
equals(other: LayoutElement, flattened: bool = False, unordered: bool = False) -> bool
Return true if the layout element is equal to another layout element, false otherwise
Source code in src/momapy/core/elements.py
flattened
flattened() -> list[LayoutElement]
Return a list containing copy of the layout element with no children and all its descendants with no children
Source code in src/momapy/core/elements.py
label_center
label_center() -> Point
left_connector_base
left_connector_base() -> Point
Get the base point of the left connector.
Returns:
| Type | Description |
|---|---|
Point
|
Point where the left connector attaches to the shape. |
Source code in src/momapy/sbgn/elements.py
left_connector_tip
left_connector_tip() -> Point
Get the tip point of the left connector.
Returns:
| Type | Description |
|---|---|
Point
|
Point at the end of the left connector line. |
Source code in src/momapy/sbgn/elements.py
north
north() -> Point
Get the north (top) anchor point.
Returns:
| Type | Description |
|---|---|
Point
|
Point on the north side of the element. |
Source code in src/momapy/sbgn/elements.py
north_east
north_east() -> Point
Return the north east anchor of the node
Source code in src/momapy/core/layout.py
north_north_east
north_north_east() -> Point
Return the north north east anchor of the node
Source code in src/momapy/core/layout.py
north_north_west
north_north_west() -> Point
Return the north north west anchor of the node
Source code in src/momapy/core/layout.py
north_west
north_west() -> Point
Return the north west anchor of the node
Source code in src/momapy/core/layout.py
own_angle
own_angle(angle: float, unit: Literal['degrees', 'radians'] = 'degrees') -> Point | None
Return the point on the border of the node that intersects the self drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.
Source code in src/momapy/core/layout.py
own_bbox
own_bbox() -> Bbox
Compute and return the bounding box of the self drawing element of the group layout
Source code in src/momapy/core/layout.py
own_border
Return the point on the border of the node that intersects the self drawing elements of the node with the line formed of the center anchor point of the node and the given point. When there are multiple intersection points, the one closest to the given point is returned
Source code in src/momapy/core/layout.py
own_children
own_children() -> list[LayoutElement]
Return the self children of the node. A node has unique child that is its label
own_drawing_elements
own_drawing_elements() -> list[DrawingElement]
Return the node's own drawing elements
Source code in src/momapy/core/layout.py
own_to_geometry
own_to_geometry() -> list[Segment | QuadraticBezierCurve | CubicBezierCurve | EllipticalArc]
Return a list of geometry primitives from the self drawing elements.
Source code in src/momapy/core/layout.py
right_connector_base
right_connector_base() -> Point
Get the base point of the right connector.
Returns:
| Type | Description |
|---|---|
Point
|
Point where the right connector attaches to the shape. |
Source code in src/momapy/sbgn/elements.py
right_connector_tip
right_connector_tip() -> Point
Get the tip point of the right connector.
Returns:
| Type | Description |
|---|---|
Point
|
Point at the end of the right connector line. |
Source code in src/momapy/sbgn/elements.py
size
south
south() -> Point
Get the south (bottom) anchor point.
Returns:
| Type | Description |
|---|---|
Point
|
Point on the south side of the element. |
Source code in src/momapy/sbgn/elements.py
south_east
south_east() -> Point
Return the south east anchor of the node
Source code in src/momapy/core/layout.py
south_south_east
south_south_east() -> Point
Return the south south east anchor of the node
Source code in src/momapy/core/layout.py
south_south_west
south_south_west() -> Point
Return the south south west anchor of the node
Source code in src/momapy/core/layout.py
south_west
south_west() -> Point
Return the south west anchor of the node
Source code in src/momapy/core/layout.py
to_geometry
to_geometry() -> list[Segment | QuadraticBezierCurve | CubicBezierCurve | EllipticalArc]
Return a list of geometry primitives from the drawing elements.
Source code in src/momapy/core/elements.py
west
west() -> Point
Get the west (left) anchor point.
Returns:
| Type | Description |
|---|---|
Point
|
Point on the west side of the element. |
Source code in src/momapy/sbgn/elements.py
west_north_west
west_north_west() -> Point
Return the west north west anchor of the node
Source code in src/momapy/core/layout.py
west_south_west
west_south_west() -> Point
Return the west south west anchor of the node
Source code in src/momapy/core/layout.py
NucleicAcidFeatureUnitOfInformation
dataclass
Bases: UnitOfInformation
Unit of information typing a biological activity as a nucleic acid feature.
Rendered as an SBGN nucleic acid feature glyph embedded in the activity node.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
id_
|
str
|
The id of the map element. This id is purely for the user to keep track of the element, it does not need to be unique and is not part of the identity of the element, i.e., it is not considered when testing for equality between two map elements or when hashing the map element |
'e7e03c2d-87c1-4818-886f-568993bc52ae'
|
label
|
str | None
|
|
None
|
Methods:
| Name | Description |
|---|---|
descendants |
Return every |
descendants
descendants() -> list[ModelElement]
Return every ModelElement reachable from self, excluding self.
Walks scalar ModelElement fields and frozenset/tuple
containers, deduplicating by object identity.
Returns:
| Type | Description |
|---|---|
list[ModelElement]
|
The list of reachable |
list[ModelElement]
|
order, without |
Source code in src/momapy/core/elements.py
NucleicAcidFeatureUnitOfInformationLayout
dataclass
NucleicAcidFeatureUnitOfInformationLayout(fill: NoneValueType | Color | None = white, stroke: NoneValueType | Color | None = black, stroke_width: float | None = 1.25, *, id_: str = make_uuid4_as_str(), layout_elements: tuple[LayoutElement] = tuple(), group_fill: NoneValueType | Color | None = None, group_fill_rule: FillRule | None = None, group_filter: NoneValueType | Filter | None = None, group_font_family: str | None = None, group_font_size: float | None = None, group_font_style: FontStyle | None = None, group_font_weight: FontWeight | float | None = None, group_stroke: NoneValueType | Color | None = None, group_stroke_dasharray: NoneValueType | tuple[float, ...] | None = None, group_stroke_dashoffset: NoneValueType | float | None = None, group_stroke_width: NoneValueType | float | None = None, group_text_anchor: TextAnchor | None = None, group_transform: NoneValueType | tuple[Transformation] | None = None, filter: NoneValueType | Filter | None = None, height: float = 12.0, label: TextLayout | None = None, position: Point, stroke_dasharray: NoneValueType | tuple[float, ...] | None = None, stroke_dashoffset: NoneValueType | float | None = None, transform: NoneValueType | tuple[Transformation] | None = None, width: float = 12.0, rounded_corners: float = 5.0)
Bases: _SimpleMixin, SBGNNode
Layout for nucleic acid feature units of information.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
id_
|
str
|
The id of the map element. This id is purely for the user to keep track of the element, it does not need to be unique and is not part of the identity of the element, i.e., it is not considered when testing for equality between two map elements or when hashing the map element |
'a7f75974-ee1e-4c70-870f-66116ffacb0c'
|
layout_elements
|
tuple[LayoutElement]
|
The sub-layout elements of the group layout. These are part of the children of the group layout |
<dynamic>
|
group_fill
|
NoneValueType | Color | None
|
The fill color of the group layout |
None
|
group_fill_rule
|
FillRule | None
|
The fill rule of the group layout |
None
|
group_filter
|
NoneValueType | Filter | None
|
The filter of the group layout |
None
|
group_font_family
|
str | None
|
The font family of the group layout |
None
|
group_font_size
|
float | None
|
The font size of the group layout |
None
|
group_font_style
|
FontStyle | None
|
The font style of the group layout |
None
|
group_font_weight
|
FontWeight | float | None
|
The font weight of the group layout |
None
|
group_stroke
|
NoneValueType | Color | None
|
The stroke color of the group layout |
None
|
group_stroke_dasharray
|
NoneValueType | tuple[float, ...] | None
|
The stroke dasharray of the group layout |
None
|
group_stroke_dashoffset
|
NoneValueType | float | None
|
The stroke dashoffset of the group layout |
None
|
group_stroke_width
|
NoneValueType | float | None
|
The stroke width of the group layout |
None
|
group_text_anchor
|
TextAnchor | None
|
The text anchor of the group layout |
None
|
group_transform
|
NoneValueType | tuple[Transformation] | None
|
The transform of the group layout |
None
|
fill
|
NoneValueType | Color | None
|
The fill color of the node |
Color(red=255, green=255, blue=255, alpha=1.0)
|
filter
|
NoneValueType | Filter | None
|
The filter of the node |
None
|
height
|
float
|
The height of the node |
12.0
|
label
|
TextLayout | None
|
The label of the node |
None
|
position
|
Point
|
The position of the node |
required |
stroke
|
NoneValueType | Color | None
|
The stroke color of the node |
Color(red=0, green=0, blue=0, alpha=1.0)
|
stroke_dasharray
|
NoneValueType | tuple[float, ...] | None
|
The stroke dasharray of the node |
None
|
stroke_dashoffset
|
NoneValueType | float | None
|
The stroke dashoffset of the node |
None
|
stroke_width
|
float | None
|
The stroke width of the node |
1.25
|
transform
|
NoneValueType | tuple[Transformation] | None
|
The transform of the node |
None
|
width
|
float
|
The width width of the node |
12.0
|
rounded_corners
|
float
|
|
5.0
|
Methods:
| Name | Description |
|---|---|
anchor_point |
Return an anchor point of the layout element |
angle |
Return the point on the border of the node that intersects the drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal. |
bbox |
Compute and return the bounding box of the group layout element |
border |
Return the point on the border of the node that intersects the drawing elements of the node with the line formed of the center anchor point of the node and the given point. |
center |
Return the center anchor of the node |
childless |
Return a copy of the node with no children |
children |
Return the children of the group layout. |
contains |
Return |
descendants |
Return the descendants of the layout element |
drawing_elements |
Return the drawing elements of the group layout. |
east |
Return the east anchor of the node |
east_north_east |
Return the east north east anchor of the node |
east_south_east |
Return the east south east west anchor of the node |
equals |
Return |
flattened |
Return a list containing copy of the layout element with no children and all its descendants with no children |
label_center |
Return the label center anchor of the node |
north |
Return the north anchor of the node |
north_east |
Return the north east anchor of the node |
north_north_east |
Return the north north east anchor of the node |
north_north_west |
Return the north north west anchor of the node |
north_west |
Return the north west anchor of the node |
own_angle |
Return the point on the border of the node that intersects the self drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal. |
own_bbox |
Compute and return the bounding box of the self drawing element of the group layout |
own_border |
Return the point on the border of the node that intersects the self drawing elements of the node with the line formed of the center anchor point of the node and the given point. |
own_children |
Return the self children of the node. A node has unique child that is its label |
own_drawing_elements |
Return the node's own drawing elements |
own_to_geometry |
Return a list of geometry primitives from the self drawing elements. |
size |
Return the size of the node |
south |
Return the south anchor of the node |
south_east |
Return the south east anchor of the node |
south_south_east |
Return the south south east anchor of the node |
south_south_west |
Return the south south west anchor of the node |
south_west |
Return the south west anchor of the node |
to_geometry |
Return a list of geometry primitives from the drawing elements. |
west |
Return the west anchor of the node |
west_north_west |
Return the west north west anchor of the node |
west_south_west |
Return the west south west anchor of the node |
Attributes:
| Name | Type | Description |
|---|---|---|
x |
float
|
Return the x coordinate of the node |
y |
float
|
Return the y coordinate of the node |
anchor_point
anchor_point(anchor_name: str) -> Point
angle
angle(angle: float, unit: Literal['degrees', 'radians'] = 'degrees') -> Point | None
Return the point on the border of the node that intersects the drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.
Source code in src/momapy/core/layout.py
bbox
bbox() -> Bbox
Compute and return the bounding box of the group layout element
Source code in src/momapy/core/layout.py
border
Return the point on the border of the node that intersects the drawing elements of the node with the line formed of the center anchor point of the node and the given point. When there are multiple intersection points, the one closest to the given point is returned
Source code in src/momapy/core/layout.py
center
center() -> Point
childless
children
children() -> list[LayoutElement]
Return the children of the group layout.
These are the self children of the group layout (returned by the own_children method) and the other children of the group layout (given by the layout_elements attribute)
Source code in src/momapy/core/layout.py
contains
contains(other: LayoutElement) -> bool
Return true if another layout element is a descendant of the layout element, false otherwise
drawing_elements
drawing_elements() -> list[DrawingElement]
Return the drawing elements of the group layout. The returned drawing elements are a group drawing element formed of the self drawing elements of the group layout and the drawing elements of its children
Source code in src/momapy/core/layout.py
east
east() -> Point
east_north_east
east_north_east() -> Point
Return the east north east anchor of the node
Source code in src/momapy/core/layout.py
east_south_east
east_south_east() -> Point
Return the east south east west anchor of the node
Source code in src/momapy/core/layout.py
equals
equals(other: LayoutElement, flattened: bool = False, unordered: bool = False) -> bool
Return true if the layout element is equal to another layout element, false otherwise
Source code in src/momapy/core/elements.py
flattened
flattened() -> list[LayoutElement]
Return a list containing copy of the layout element with no children and all its descendants with no children
Source code in src/momapy/core/elements.py
label_center
label_center() -> Point
north
north() -> Point
north_east
north_east() -> Point
Return the north east anchor of the node
Source code in src/momapy/core/layout.py
north_north_east
north_north_east() -> Point
Return the north north east anchor of the node
Source code in src/momapy/core/layout.py
north_north_west
north_north_west() -> Point
Return the north north west anchor of the node
Source code in src/momapy/core/layout.py
north_west
north_west() -> Point
Return the north west anchor of the node
Source code in src/momapy/core/layout.py
own_angle
own_angle(angle: float, unit: Literal['degrees', 'radians'] = 'degrees') -> Point | None
Return the point on the border of the node that intersects the self drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.
Source code in src/momapy/core/layout.py
own_bbox
own_bbox() -> Bbox
Compute and return the bounding box of the self drawing element of the group layout
Source code in src/momapy/core/layout.py
own_border
Return the point on the border of the node that intersects the self drawing elements of the node with the line formed of the center anchor point of the node and the given point. When there are multiple intersection points, the one closest to the given point is returned
Source code in src/momapy/core/layout.py
own_children
own_children() -> list[LayoutElement]
Return the self children of the node. A node has unique child that is its label
own_drawing_elements
own_drawing_elements() -> list[DrawingElement]
Return the node's own drawing elements
Source code in src/momapy/core/layout.py
own_to_geometry
own_to_geometry() -> list[Segment | QuadraticBezierCurve | CubicBezierCurve | EllipticalArc]
Return a list of geometry primitives from the self drawing elements.
Source code in src/momapy/core/layout.py
size
south
south() -> Point
south_east
south_east() -> Point
Return the south east anchor of the node
Source code in src/momapy/core/layout.py
south_south_east
south_south_east() -> Point
Return the south south east anchor of the node
Source code in src/momapy/core/layout.py
south_south_west
south_south_west() -> Point
Return the south south west anchor of the node
Source code in src/momapy/core/layout.py
south_west
south_west() -> Point
Return the south west anchor of the node
Source code in src/momapy/core/layout.py
to_geometry
to_geometry() -> list[Segment | QuadraticBezierCurve | CubicBezierCurve | EllipticalArc]
Return a list of geometry primitives from the drawing elements.
Source code in src/momapy/core/elements.py
west
west() -> Point
west_north_west
west_north_west() -> Point
Return the west north west anchor of the node
Source code in src/momapy/core/layout.py
west_south_west
west_south_west() -> Point
Return the west south west anchor of the node
Source code in src/momapy/core/layout.py
OrOperator
dataclass
OrOperator(*, id_: str = make_uuid4_as_str(), inputs: frozenset[LogicalOperatorInput] = frozenset())
Bases: LogicalOperator
Logical OR operator.
The output is active when at least one input is active.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
id_
|
str
|
The id of the map element. This id is purely for the user to keep track of the element, it does not need to be unique and is not part of the identity of the element, i.e., it is not considered when testing for equality between two map elements or when hashing the map element |
'3584b3c6-1bd6-45df-87d6-1d802f2b2e68'
|
inputs
|
frozenset[LogicalOperatorInput]
|
Build an immutable unordered collection of unique elements. |
<dynamic>
|
Methods:
| Name | Description |
|---|---|
descendants |
Return every |
descendants
descendants() -> list[ModelElement]
Return every ModelElement reachable from self, excluding self.
Walks scalar ModelElement fields and frozenset/tuple
containers, deduplicating by object identity.
Returns:
| Type | Description |
|---|---|
list[ModelElement]
|
The list of reachable |
list[ModelElement]
|
order, without |
Source code in src/momapy/core/elements.py
OrOperatorLayout
dataclass
OrOperatorLayout(fill: NoneValueType | Color | None = white, stroke: NoneValueType | Color | None = black, stroke_width: float | None = 1.25, *, id_: str = make_uuid4_as_str(), layout_elements: tuple[LayoutElement] = tuple(), group_fill: NoneValueType | Color | None = None, group_fill_rule: FillRule | None = None, group_filter: NoneValueType | Filter | None = None, group_font_family: str | None = None, group_font_size: float | None = None, group_font_style: FontStyle | None = None, group_font_weight: FontWeight | float | None = None, group_stroke: NoneValueType | Color | None = None, group_stroke_dasharray: NoneValueType | tuple[float, ...] | None = None, group_stroke_dashoffset: NoneValueType | float | None = None, group_stroke_width: NoneValueType | float | None = None, group_text_anchor: TextAnchor | None = None, group_transform: NoneValueType | tuple[Transformation] | None = None, filter: NoneValueType | Filter | None = None, height: float = 30.0, label: TextLayout | None = None, position: Point, stroke_dasharray: NoneValueType | tuple[float, ...] | None = None, stroke_dashoffset: NoneValueType | float | None = None, transform: NoneValueType | tuple[Transformation] | None = None, width: float = 30.0, text: str = 'OR', font_family: str = DEFAULT_FONT_FAMILY, font_fill: Color | NoneValueType = black, font_stroke: Color | NoneValueType = NoneValue, font_style: FontStyle = NORMAL, font_weight: FontWeight | float = NORMAL, direction: Direction = HORIZONTAL, left_to_right: bool = True, left_connector_length: float = 10.0, right_connector_length: float = 10.0, left_connector_stroke: NoneValueType | Color | None = None, left_connector_stroke_width: float | None = None, left_connector_stroke_dasharray: NoneValueType | tuple[float] | None = None, left_connector_stroke_dashoffset: float | None = None, left_connector_fill: NoneValueType | Color | None = None, left_connector_transform: NoneValueType | tuple[Transformation] | None = None, left_connector_filter: NoneValueType | Filter | None = None, right_connector_stroke: NoneValueType | Color | None = None, right_connector_stroke_width: float | None = None, right_connector_stroke_dasharray: NoneValueType | tuple[float] | None = None, right_connector_stroke_dashoffset: float | None = None, right_connector_fill: NoneValueType | Color | None = None, right_connector_transform: NoneValueType | tuple[Transformation] | None = None, right_connector_filter: NoneValueType | Filter | None = None)
Bases: _ConnectorsMixin, _SimpleMixin, _TextMixin, SBGNNode
Layout for OR operators.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
id_
|
str
|
The id of the map element. This id is purely for the user to keep track of the element, it does not need to be unique and is not part of the identity of the element, i.e., it is not considered when testing for equality between two map elements or when hashing the map element |
'88adf88a-40e8-46b1-b217-209ce2b794af'
|
layout_elements
|
tuple[LayoutElement]
|
The sub-layout elements of the group layout. These are part of the children of the group layout |
<dynamic>
|
group_fill
|
NoneValueType | Color | None
|
The fill color of the group layout |
None
|
group_fill_rule
|
FillRule | None
|
The fill rule of the group layout |
None
|
group_filter
|
NoneValueType | Filter | None
|
The filter of the group layout |
None
|
group_font_family
|
str | None
|
The font family of the group layout |
None
|
group_font_size
|
float | None
|
The font size of the group layout |
None
|
group_font_style
|
FontStyle | None
|
The font style of the group layout |
None
|
group_font_weight
|
FontWeight | float | None
|
The font weight of the group layout |
None
|
group_stroke
|
NoneValueType | Color | None
|
The stroke color of the group layout |
None
|
group_stroke_dasharray
|
NoneValueType | tuple[float, ...] | None
|
The stroke dasharray of the group layout |
None
|
group_stroke_dashoffset
|
NoneValueType | float | None
|
The stroke dashoffset of the group layout |
None
|
group_stroke_width
|
NoneValueType | float | None
|
The stroke width of the group layout |
None
|
group_text_anchor
|
TextAnchor | None
|
The text anchor of the group layout |
None
|
group_transform
|
NoneValueType | tuple[Transformation] | None
|
The transform of the group layout |
None
|
fill
|
NoneValueType | Color | None
|
The fill color of the node |
Color(red=255, green=255, blue=255, alpha=1.0)
|
filter
|
NoneValueType | Filter | None
|
The filter of the node |
None
|
height
|
float
|
The height of the node |
30.0
|
label
|
TextLayout | None
|
The label of the node |
None
|
position
|
Point
|
The position of the node |
required |
stroke
|
NoneValueType | Color | None
|
The stroke color of the node |
Color(red=0, green=0, blue=0, alpha=1.0)
|
stroke_dasharray
|
NoneValueType | tuple[float, ...] | None
|
The stroke dasharray of the node |
None
|
stroke_dashoffset
|
NoneValueType | float | None
|
The stroke dashoffset of the node |
None
|
stroke_width
|
float | None
|
The stroke width of the node |
1.25
|
transform
|
NoneValueType | tuple[Transformation] | None
|
The transform of the node |
None
|
width
|
float
|
The width width of the node |
30.0
|
text
|
str
|
|
'OR'
|
font_family
|
str
|
|
'DejaVu Sans'
|
font_fill
|
Color | NoneValueType
|
|
Color(red=0, green=0, blue=0, alpha=1.0)
|
font_stroke
|
Color | NoneValueType
|
|
<momapy.drawing.NoneValueType object at 0x7fbe12e88d70>
|
font_style
|
FontStyle
|
|
<FontStyle.NORMAL: 0>
|
font_weight
|
FontWeight | float
|
|
<FontWeight.NORMAL: 0>
|
direction
|
Direction
|
|
<Direction.HORIZONTAL: 1>
|
left_to_right
|
bool
|
|
True
|
left_connector_length
|
float
|
|
10.0
|
right_connector_length
|
float
|
|
10.0
|
left_connector_stroke
|
NoneValueType | Color | None
|
|
None
|
left_connector_stroke_width
|
float | None
|
|
None
|
left_connector_stroke_dasharray
|
NoneValueType | tuple[float] | None
|
|
None
|
left_connector_stroke_dashoffset
|
float | None
|
|
None
|
left_connector_fill
|
NoneValueType | Color | None
|
|
None
|
left_connector_transform
|
NoneValueType | tuple[Transformation] | None
|
|
None
|
left_connector_filter
|
NoneValueType | Filter | None
|
|
None
|
right_connector_stroke
|
NoneValueType | Color | None
|
|
None
|
right_connector_stroke_width
|
float | None
|
|
None
|
right_connector_stroke_dasharray
|
NoneValueType | tuple[float] | None
|
|
None
|
right_connector_stroke_dashoffset
|
float | None
|
|
None
|
right_connector_fill
|
NoneValueType | Color | None
|
|
None
|
right_connector_transform
|
NoneValueType | tuple[Transformation] | None
|
|
None
|
right_connector_filter
|
NoneValueType | Filter | None
|
|
None
|
Methods:
| Name | Description |
|---|---|
anchor_point |
Return an anchor point of the layout element |
angle |
Return the point on the border of the node that intersects the drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal. |
bbox |
Compute and return the bounding box of the group layout element |
border |
Return the point on the border of the node that intersects the drawing elements of the node with the line formed of the center anchor point of the node and the given point. |
center |
Return the center anchor of the node |
childless |
Return a copy of the node with no children |
children |
Return the children of the group layout. |
contains |
Return |
descendants |
Return the descendants of the layout element |
drawing_elements |
Return the drawing elements of the group layout. |
east |
Get the east (right) anchor point. |
east_north_east |
Return the east north east anchor of the node |
east_south_east |
Return the east south east west anchor of the node |
equals |
Return |
flattened |
Return a list containing copy of the layout element with no children and all its descendants with no children |
label_center |
Return the label center anchor of the node |
left_connector_base |
Get the base point of the left connector. |
left_connector_tip |
Get the tip point of the left connector. |
north |
Get the north (top) anchor point. |
north_east |
Return the north east anchor of the node |
north_north_east |
Return the north north east anchor of the node |
north_north_west |
Return the north north west anchor of the node |
north_west |
Return the north west anchor of the node |
own_angle |
Return the point on the border of the node that intersects the self drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal. |
own_bbox |
Compute and return the bounding box of the self drawing element of the group layout |
own_border |
Return the point on the border of the node that intersects the self drawing elements of the node with the line formed of the center anchor point of the node and the given point. |
own_children |
Return the self children of the node. A node has unique child that is its label |
own_drawing_elements |
Return the node's own drawing elements |
own_to_geometry |
Return a list of geometry primitives from the self drawing elements. |
right_connector_base |
Get the base point of the right connector. |
right_connector_tip |
Get the tip point of the right connector. |
size |
Return the size of the node |
south |
Get the south (bottom) anchor point. |
south_east |
Return the south east anchor of the node |
south_south_east |
Return the south south east anchor of the node |
south_south_west |
Return the south south west anchor of the node |
south_west |
Return the south west anchor of the node |
to_geometry |
Return a list of geometry primitives from the drawing elements. |
west |
Get the west (left) anchor point. |
west_north_west |
Return the west north west anchor of the node |
west_south_west |
Return the west south west anchor of the node |
Attributes:
| Name | Type | Description |
|---|---|---|
x |
float
|
Return the x coordinate of the node |
y |
float
|
Return the y coordinate of the node |
anchor_point
anchor_point(anchor_name: str) -> Point
angle
angle(angle: float, unit: Literal['degrees', 'radians'] = 'degrees') -> Point | None
Return the point on the border of the node that intersects the drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.
Source code in src/momapy/core/layout.py
bbox
bbox() -> Bbox
Compute and return the bounding box of the group layout element
Source code in src/momapy/core/layout.py
border
Return the point on the border of the node that intersects the drawing elements of the node with the line formed of the center anchor point of the node and the given point. When there are multiple intersection points, the one closest to the given point is returned
Source code in src/momapy/core/layout.py
center
center() -> Point
childless
children
children() -> list[LayoutElement]
Return the children of the group layout.
These are the self children of the group layout (returned by the own_children method) and the other children of the group layout (given by the layout_elements attribute)
Source code in src/momapy/core/layout.py
contains
contains(other: LayoutElement) -> bool
Return true if another layout element is a descendant of the layout element, false otherwise
drawing_elements
drawing_elements() -> list[DrawingElement]
Return the drawing elements of the group layout. The returned drawing elements are a group drawing element formed of the self drawing elements of the group layout and the drawing elements of its children
Source code in src/momapy/core/layout.py
east
east() -> Point
Get the east (right) anchor point.
Returns:
| Type | Description |
|---|---|
Point
|
Point on the east side of the element. |
Source code in src/momapy/sbgn/elements.py
east_north_east
east_north_east() -> Point
Return the east north east anchor of the node
Source code in src/momapy/core/layout.py
east_south_east
east_south_east() -> Point
Return the east south east west anchor of the node
Source code in src/momapy/core/layout.py
equals
equals(other: LayoutElement, flattened: bool = False, unordered: bool = False) -> bool
Return true if the layout element is equal to another layout element, false otherwise
Source code in src/momapy/core/elements.py
flattened
flattened() -> list[LayoutElement]
Return a list containing copy of the layout element with no children and all its descendants with no children
Source code in src/momapy/core/elements.py
label_center
label_center() -> Point
left_connector_base
left_connector_base() -> Point
Get the base point of the left connector.
Returns:
| Type | Description |
|---|---|
Point
|
Point where the left connector attaches to the shape. |
Source code in src/momapy/sbgn/elements.py
left_connector_tip
left_connector_tip() -> Point
Get the tip point of the left connector.
Returns:
| Type | Description |
|---|---|
Point
|
Point at the end of the left connector line. |
Source code in src/momapy/sbgn/elements.py
north
north() -> Point
Get the north (top) anchor point.
Returns:
| Type | Description |
|---|---|
Point
|
Point on the north side of the element. |
Source code in src/momapy/sbgn/elements.py
north_east
north_east() -> Point
Return the north east anchor of the node
Source code in src/momapy/core/layout.py
north_north_east
north_north_east() -> Point
Return the north north east anchor of the node
Source code in src/momapy/core/layout.py
north_north_west
north_north_west() -> Point
Return the north north west anchor of the node
Source code in src/momapy/core/layout.py
north_west
north_west() -> Point
Return the north west anchor of the node
Source code in src/momapy/core/layout.py
own_angle
own_angle(angle: float, unit: Literal['degrees', 'radians'] = 'degrees') -> Point | None
Return the point on the border of the node that intersects the self drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.
Source code in src/momapy/core/layout.py
own_bbox
own_bbox() -> Bbox
Compute and return the bounding box of the self drawing element of the group layout
Source code in src/momapy/core/layout.py
own_border
Return the point on the border of the node that intersects the self drawing elements of the node with the line formed of the center anchor point of the node and the given point. When there are multiple intersection points, the one closest to the given point is returned
Source code in src/momapy/core/layout.py
own_children
own_children() -> list[LayoutElement]
Return the self children of the node. A node has unique child that is its label
own_drawing_elements
own_drawing_elements() -> list[DrawingElement]
Return the node's own drawing elements
Source code in src/momapy/core/layout.py
own_to_geometry
own_to_geometry() -> list[Segment | QuadraticBezierCurve | CubicBezierCurve | EllipticalArc]
Return a list of geometry primitives from the self drawing elements.
Source code in src/momapy/core/layout.py
right_connector_base
right_connector_base() -> Point
Get the base point of the right connector.
Returns:
| Type | Description |
|---|---|
Point
|
Point where the right connector attaches to the shape. |
Source code in src/momapy/sbgn/elements.py
right_connector_tip
right_connector_tip() -> Point
Get the tip point of the right connector.
Returns:
| Type | Description |
|---|---|
Point
|
Point at the end of the right connector line. |
Source code in src/momapy/sbgn/elements.py
size
south
south() -> Point
Get the south (bottom) anchor point.
Returns:
| Type | Description |
|---|---|
Point
|
Point on the south side of the element. |
Source code in src/momapy/sbgn/elements.py
south_east
south_east() -> Point
Return the south east anchor of the node
Source code in src/momapy/core/layout.py
south_south_east
south_south_east() -> Point
Return the south south east anchor of the node
Source code in src/momapy/core/layout.py
south_south_west
south_south_west() -> Point
Return the south south west anchor of the node
Source code in src/momapy/core/layout.py
south_west
south_west() -> Point
Return the south west anchor of the node
Source code in src/momapy/core/layout.py
to_geometry
to_geometry() -> list[Segment | QuadraticBezierCurve | CubicBezierCurve | EllipticalArc]
Return a list of geometry primitives from the drawing elements.
Source code in src/momapy/core/elements.py
west
west() -> Point
Get the west (left) anchor point.
Returns:
| Type | Description |
|---|---|
Point
|
Point on the west side of the element. |
Source code in src/momapy/sbgn/elements.py
west_north_west
west_north_west() -> Point
Return the west north west anchor of the node
Source code in src/momapy/core/layout.py
west_south_west
west_south_west() -> Point
Return the west south west anchor of the node
Source code in src/momapy/core/layout.py
PerturbationUnitOfInformation
dataclass
Bases: UnitOfInformation
Unit of information typing a biological activity as a perturbation.
Denotes an external influence (drug, stimulus, mutation) acting on the system.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
id_
|
str
|
The id of the map element. This id is purely for the user to keep track of the element, it does not need to be unique and is not part of the identity of the element, i.e., it is not considered when testing for equality between two map elements or when hashing the map element |
'0683539b-23ac-4fb6-aa36-afc2c46f9984'
|
label
|
str | None
|
|
None
|
Methods:
| Name | Description |
|---|---|
descendants |
Return every |
descendants
descendants() -> list[ModelElement]
Return every ModelElement reachable from self, excluding self.
Walks scalar ModelElement fields and frozenset/tuple
containers, deduplicating by object identity.
Returns:
| Type | Description |
|---|---|
list[ModelElement]
|
The list of reachable |
list[ModelElement]
|
order, without |
Source code in src/momapy/core/elements.py
PerturbationUnitOfInformationLayout
dataclass
PerturbationUnitOfInformationLayout(fill: NoneValueType | Color | None = white, stroke: NoneValueType | Color | None = black, stroke_width: float | None = 1.25, *, id_: str = make_uuid4_as_str(), layout_elements: tuple[LayoutElement] = tuple(), group_fill: NoneValueType | Color | None = None, group_fill_rule: FillRule | None = None, group_filter: NoneValueType | Filter | None = None, group_font_family: str | None = None, group_font_size: float | None = None, group_font_style: FontStyle | None = None, group_font_weight: FontWeight | float | None = None, group_stroke: NoneValueType | Color | None = None, group_stroke_dasharray: NoneValueType | tuple[float, ...] | None = None, group_stroke_dashoffset: NoneValueType | float | None = None, group_stroke_width: NoneValueType | float | None = None, group_text_anchor: TextAnchor | None = None, group_transform: NoneValueType | tuple[Transformation] | None = None, filter: NoneValueType | Filter | None = None, height: float = 12.0, label: TextLayout | None = None, position: Point, stroke_dasharray: NoneValueType | tuple[float, ...] | None = None, stroke_dashoffset: NoneValueType | float | None = None, transform: NoneValueType | tuple[Transformation] | None = None, width: float = 12.0, angle: float = 70.0)
Bases: _SimpleMixin, SBGNNode
Layout for perturbation units of information.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
id_
|
str
|
The id of the map element. This id is purely for the user to keep track of the element, it does not need to be unique and is not part of the identity of the element, i.e., it is not considered when testing for equality between two map elements or when hashing the map element |
'913579b1-2c1b-48da-99f6-215f1be172aa'
|
layout_elements
|
tuple[LayoutElement]
|
The sub-layout elements of the group layout. These are part of the children of the group layout |
<dynamic>
|
group_fill
|
NoneValueType | Color | None
|
The fill color of the group layout |
None
|
group_fill_rule
|
FillRule | None
|
The fill rule of the group layout |
None
|
group_filter
|
NoneValueType | Filter | None
|
The filter of the group layout |
None
|
group_font_family
|
str | None
|
The font family of the group layout |
None
|
group_font_size
|
float | None
|
The font size of the group layout |
None
|
group_font_style
|
FontStyle | None
|
The font style of the group layout |
None
|
group_font_weight
|
FontWeight | float | None
|
The font weight of the group layout |
None
|
group_stroke
|
NoneValueType | Color | None
|
The stroke color of the group layout |
None
|
group_stroke_dasharray
|
NoneValueType | tuple[float, ...] | None
|
The stroke dasharray of the group layout |
None
|
group_stroke_dashoffset
|
NoneValueType | float | None
|
The stroke dashoffset of the group layout |
None
|
group_stroke_width
|
NoneValueType | float | None
|
The stroke width of the group layout |
None
|
group_text_anchor
|
TextAnchor | None
|
The text anchor of the group layout |
None
|
group_transform
|
NoneValueType | tuple[Transformation] | None
|
The transform of the group layout |
None
|
fill
|
NoneValueType | Color | None
|
The fill color of the node |
Color(red=255, green=255, blue=255, alpha=1.0)
|
filter
|
NoneValueType | Filter | None
|
The filter of the node |
None
|
height
|
float
|
The height of the node |
12.0
|
label
|
TextLayout | None
|
The label of the node |
None
|
position
|
Point
|
The position of the node |
required |
stroke
|
NoneValueType | Color | None
|
The stroke color of the node |
Color(red=0, green=0, blue=0, alpha=1.0)
|
stroke_dasharray
|
NoneValueType | tuple[float, ...] | None
|
The stroke dasharray of the node |
None
|
stroke_dashoffset
|
NoneValueType | float | None
|
The stroke dashoffset of the node |
None
|
stroke_width
|
float | None
|
The stroke width of the node |
1.25
|
transform
|
NoneValueType | tuple[Transformation] | None
|
The transform of the node |
None
|
width
|
float
|
The width width of the node |
12.0
|
angle
|
float
|
Return the point on the border of the node that intersects the drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal. |
70.0
|
Methods:
| Name | Description |
|---|---|
anchor_point |
Return an anchor point of the layout element |
bbox |
Compute and return the bounding box of the group layout element |
border |
Return the point on the border of the node that intersects the drawing elements of the node with the line formed of the center anchor point of the node and the given point. |
center |
Return the center anchor of the node |
childless |
Return a copy of the node with no children |
children |
Return the children of the group layout. |
contains |
Return |
descendants |
Return the descendants of the layout element |
drawing_elements |
Return the drawing elements of the group layout. |
east |
Return the east anchor of the node |
east_north_east |
Return the east north east anchor of the node |
east_south_east |
Return the east south east west anchor of the node |
equals |
Return |
flattened |
Return a list containing copy of the layout element with no children and all its descendants with no children |
label_center |
Return the label center anchor of the node |
north |
Return the north anchor of the node |
north_east |
Return the north east anchor of the node |
north_north_east |
Return the north north east anchor of the node |
north_north_west |
Return the north north west anchor of the node |
north_west |
Return the north west anchor of the node |
own_angle |
Return the point on the border of the node that intersects the self drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal. |
own_bbox |
Compute and return the bounding box of the self drawing element of the group layout |
own_border |
Return the point on the border of the node that intersects the self drawing elements of the node with the line formed of the center anchor point of the node and the given point. |
own_children |
Return the self children of the node. A node has unique child that is its label |
own_drawing_elements |
Return the node's own drawing elements |
own_to_geometry |
Return a list of geometry primitives from the self drawing elements. |
size |
Return the size of the node |
south |
Return the south anchor of the node |
south_east |
Return the south east anchor of the node |
south_south_east |
Return the south south east anchor of the node |
south_south_west |
Return the south south west anchor of the node |
south_west |
Return the south west anchor of the node |
to_geometry |
Return a list of geometry primitives from the drawing elements. |
west |
Return the west anchor of the node |
west_north_west |
Return the west north west anchor of the node |
west_south_west |
Return the west south west anchor of the node |
Attributes:
| Name | Type | Description |
|---|---|---|
angle |
float
|
Return the point on the border of the node that intersects the drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal. |
x |
float
|
Return the x coordinate of the node |
y |
float
|
Return the y coordinate of the node |
anchor_point
anchor_point(anchor_name: str) -> Point
angle
class-attribute
instance-attribute
Return the point on the border of the node that intersects the drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.
bbox
bbox() -> Bbox
Compute and return the bounding box of the group layout element
Source code in src/momapy/core/layout.py
border
Return the point on the border of the node that intersects the drawing elements of the node with the line formed of the center anchor point of the node and the given point. When there are multiple intersection points, the one closest to the given point is returned
Source code in src/momapy/core/layout.py
center
center() -> Point
childless
children
children() -> list[LayoutElement]
Return the children of the group layout.
These are the self children of the group layout (returned by the own_children method) and the other children of the group layout (given by the layout_elements attribute)
Source code in src/momapy/core/layout.py
contains
contains(other: LayoutElement) -> bool
Return true if another layout element is a descendant of the layout element, false otherwise
drawing_elements
drawing_elements() -> list[DrawingElement]
Return the drawing elements of the group layout. The returned drawing elements are a group drawing element formed of the self drawing elements of the group layout and the drawing elements of its children
Source code in src/momapy/core/layout.py
east
east() -> Point
east_north_east
east_north_east() -> Point
Return the east north east anchor of the node
Source code in src/momapy/core/layout.py
east_south_east
east_south_east() -> Point
Return the east south east west anchor of the node
Source code in src/momapy/core/layout.py
equals
equals(other: LayoutElement, flattened: bool = False, unordered: bool = False) -> bool
Return true if the layout element is equal to another layout element, false otherwise
Source code in src/momapy/core/elements.py
flattened
flattened() -> list[LayoutElement]
Return a list containing copy of the layout element with no children and all its descendants with no children
Source code in src/momapy/core/elements.py
label_center
label_center() -> Point
north
north() -> Point
north_east
north_east() -> Point
Return the north east anchor of the node
Source code in src/momapy/core/layout.py
north_north_east
north_north_east() -> Point
Return the north north east anchor of the node
Source code in src/momapy/core/layout.py
north_north_west
north_north_west() -> Point
Return the north north west anchor of the node
Source code in src/momapy/core/layout.py
north_west
north_west() -> Point
Return the north west anchor of the node
Source code in src/momapy/core/layout.py
own_angle
own_angle(angle: float, unit: Literal['degrees', 'radians'] = 'degrees') -> Point | None
Return the point on the border of the node that intersects the self drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.
Source code in src/momapy/core/layout.py
own_bbox
own_bbox() -> Bbox
Compute and return the bounding box of the self drawing element of the group layout
Source code in src/momapy/core/layout.py
own_border
Return the point on the border of the node that intersects the self drawing elements of the node with the line formed of the center anchor point of the node and the given point. When there are multiple intersection points, the one closest to the given point is returned
Source code in src/momapy/core/layout.py
own_children
own_children() -> list[LayoutElement]
Return the self children of the node. A node has unique child that is its label
own_drawing_elements
own_drawing_elements() -> list[DrawingElement]
Return the node's own drawing elements
Source code in src/momapy/core/layout.py
own_to_geometry
own_to_geometry() -> list[Segment | QuadraticBezierCurve | CubicBezierCurve | EllipticalArc]
Return a list of geometry primitives from the self drawing elements.
Source code in src/momapy/core/layout.py
size
south
south() -> Point
south_east
south_east() -> Point
Return the south east anchor of the node
Source code in src/momapy/core/layout.py
south_south_east
south_south_east() -> Point
Return the south south east anchor of the node
Source code in src/momapy/core/layout.py
south_south_west
south_south_west() -> Point
Return the south south west anchor of the node
Source code in src/momapy/core/layout.py
south_west
south_west() -> Point
Return the south west anchor of the node
Source code in src/momapy/core/layout.py
to_geometry
to_geometry() -> list[Segment | QuadraticBezierCurve | CubicBezierCurve | EllipticalArc]
Return a list of geometry primitives from the drawing elements.
Source code in src/momapy/core/elements.py
west
west() -> Point
west_north_west
west_north_west() -> Point
Return the west north west anchor of the node
Source code in src/momapy/core/layout.py
west_south_west
west_south_west() -> Point
Return the west south west anchor of the node
Source code in src/momapy/core/layout.py
Phenotype
dataclass
Phenotype(*, id_: str = make_uuid4_as_str(), label: str | None = None, compartment: Compartment | None = None)
Bases: Activity
Phenotype activity.
Represents an observable characteristic of the system — a system-level outcome produced by the combination of biological activities rather than an individual activity itself.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
id_
|
str
|
The id of the map element. This id is purely for the user to keep track of the element, it does not need to be unique and is not part of the identity of the element, i.e., it is not considered when testing for equality between two map elements or when hashing the map element |
'c38e7f34-a00a-4730-8380-8c797303ba4a'
|
label
|
str | None
|
|
None
|
compartment
|
Compartment | None
|
|
None
|
Methods:
| Name | Description |
|---|---|
descendants |
Return every |
descendants
descendants() -> list[ModelElement]
Return every ModelElement reachable from self, excluding self.
Walks scalar ModelElement fields and frozenset/tuple
containers, deduplicating by object identity.
Returns:
| Type | Description |
|---|---|
list[ModelElement]
|
The list of reachable |
list[ModelElement]
|
order, without |
Source code in src/momapy/core/elements.py
PhenotypeLayout
dataclass
PhenotypeLayout(fill: NoneValueType | Color | None = white, stroke: NoneValueType | Color | None = black, stroke_width: float | None = 1.25, *, id_: str = make_uuid4_as_str(), layout_elements: tuple[LayoutElement] = tuple(), group_fill: NoneValueType | Color | None = None, group_fill_rule: FillRule | None = None, group_filter: NoneValueType | Filter | None = None, group_font_family: str | None = None, group_font_size: float | None = None, group_font_style: FontStyle | None = None, group_font_weight: FontWeight | float | None = None, group_stroke: NoneValueType | Color | None = None, group_stroke_dasharray: NoneValueType | tuple[float, ...] | None = None, group_stroke_dashoffset: NoneValueType | float | None = None, group_stroke_width: NoneValueType | float | None = None, group_text_anchor: TextAnchor | None = None, group_transform: NoneValueType | tuple[Transformation] | None = None, filter: NoneValueType | Filter | None = None, height: float = 30.0, label: TextLayout | None = None, position: Point, stroke_dasharray: NoneValueType | tuple[float, ...] | None = None, stroke_dashoffset: NoneValueType | float | None = None, transform: NoneValueType | tuple[Transformation] | None = None, width: float = 60.0, angle: float = 70.0)
Bases: _SimpleMixin, SBGNNode
Layout for phenotypes.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
id_
|
str
|
The id of the map element. This id is purely for the user to keep track of the element, it does not need to be unique and is not part of the identity of the element, i.e., it is not considered when testing for equality between two map elements or when hashing the map element |
'e6091809-2682-467d-80c4-9b1c9412d4b5'
|
layout_elements
|
tuple[LayoutElement]
|
The sub-layout elements of the group layout. These are part of the children of the group layout |
<dynamic>
|
group_fill
|
NoneValueType | Color | None
|
The fill color of the group layout |
None
|
group_fill_rule
|
FillRule | None
|
The fill rule of the group layout |
None
|
group_filter
|
NoneValueType | Filter | None
|
The filter of the group layout |
None
|
group_font_family
|
str | None
|
The font family of the group layout |
None
|
group_font_size
|
float | None
|
The font size of the group layout |
None
|
group_font_style
|
FontStyle | None
|
The font style of the group layout |
None
|
group_font_weight
|
FontWeight | float | None
|
The font weight of the group layout |
None
|
group_stroke
|
NoneValueType | Color | None
|
The stroke color of the group layout |
None
|
group_stroke_dasharray
|
NoneValueType | tuple[float, ...] | None
|
The stroke dasharray of the group layout |
None
|
group_stroke_dashoffset
|
NoneValueType | float | None
|
The stroke dashoffset of the group layout |
None
|
group_stroke_width
|
NoneValueType | float | None
|
The stroke width of the group layout |
None
|
group_text_anchor
|
TextAnchor | None
|
The text anchor of the group layout |
None
|
group_transform
|
NoneValueType | tuple[Transformation] | None
|
The transform of the group layout |
None
|
fill
|
NoneValueType | Color | None
|
The fill color of the node |
Color(red=255, green=255, blue=255, alpha=1.0)
|
filter
|
NoneValueType | Filter | None
|
The filter of the node |
None
|
height
|
float
|
The height of the node |
30.0
|
label
|
TextLayout | None
|
The label of the node |
None
|
position
|
Point
|
The position of the node |
required |
stroke
|
NoneValueType | Color | None
|
The stroke color of the node |
Color(red=0, green=0, blue=0, alpha=1.0)
|
stroke_dasharray
|
NoneValueType | tuple[float, ...] | None
|
The stroke dasharray of the node |
None
|
stroke_dashoffset
|
NoneValueType | float | None
|
The stroke dashoffset of the node |
None
|
stroke_width
|
float | None
|
The stroke width of the node |
1.25
|
transform
|
NoneValueType | tuple[Transformation] | None
|
The transform of the node |
None
|
width
|
float
|
The width width of the node |
60.0
|
angle
|
float
|
Return the point on the border of the node that intersects the drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal. |
70.0
|
Methods:
| Name | Description |
|---|---|
anchor_point |
Return an anchor point of the layout element |
bbox |
Compute and return the bounding box of the group layout element |
border |
Return the point on the border of the node that intersects the drawing elements of the node with the line formed of the center anchor point of the node and the given point. |
center |
Return the center anchor of the node |
childless |
Return a copy of the node with no children |
children |
Return the children of the group layout. |
contains |
Return |
descendants |
Return the descendants of the layout element |
drawing_elements |
Return the drawing elements of the group layout. |
east |
Return the east anchor of the node |
east_north_east |
Return the east north east anchor of the node |
east_south_east |
Return the east south east west anchor of the node |
equals |
Return |
flattened |
Return a list containing copy of the layout element with no children and all its descendants with no children |
label_center |
Return the label center anchor of the node |
north |
Return the north anchor of the node |
north_east |
Return the north east anchor of the node |
north_north_east |
Return the north north east anchor of the node |
north_north_west |
Return the north north west anchor of the node |
north_west |
Return the north west anchor of the node |
own_angle |
Return the point on the border of the node that intersects the self drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal. |
own_bbox |
Compute and return the bounding box of the self drawing element of the group layout |
own_border |
Return the point on the border of the node that intersects the self drawing elements of the node with the line formed of the center anchor point of the node and the given point. |
own_children |
Return the self children of the node. A node has unique child that is its label |
own_drawing_elements |
Return the node's own drawing elements |
own_to_geometry |
Return a list of geometry primitives from the self drawing elements. |
size |
Return the size of the node |
south |
Return the south anchor of the node |
south_east |
Return the south east anchor of the node |
south_south_east |
Return the south south east anchor of the node |
south_south_west |
Return the south south west anchor of the node |
south_west |
Return the south west anchor of the node |
to_geometry |
Return a list of geometry primitives from the drawing elements. |
west |
Return the west anchor of the node |
west_north_west |
Return the west north west anchor of the node |
west_south_west |
Return the west south west anchor of the node |
Attributes:
| Name | Type | Description |
|---|---|---|
angle |
float
|
Return the point on the border of the node that intersects the drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal. |
x |
float
|
Return the x coordinate of the node |
y |
float
|
Return the y coordinate of the node |
anchor_point
anchor_point(anchor_name: str) -> Point
angle
class-attribute
instance-attribute
Return the point on the border of the node that intersects the drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.
bbox
bbox() -> Bbox
Compute and return the bounding box of the group layout element
Source code in src/momapy/core/layout.py
border
Return the point on the border of the node that intersects the drawing elements of the node with the line formed of the center anchor point of the node and the given point. When there are multiple intersection points, the one closest to the given point is returned
Source code in src/momapy/core/layout.py
center
center() -> Point
childless
children
children() -> list[LayoutElement]
Return the children of the group layout.
These are the self children of the group layout (returned by the own_children method) and the other children of the group layout (given by the layout_elements attribute)
Source code in src/momapy/core/layout.py
contains
contains(other: LayoutElement) -> bool
Return true if another layout element is a descendant of the layout element, false otherwise
drawing_elements
drawing_elements() -> list[DrawingElement]
Return the drawing elements of the group layout. The returned drawing elements are a group drawing element formed of the self drawing elements of the group layout and the drawing elements of its children
Source code in src/momapy/core/layout.py
east
east() -> Point
east_north_east
east_north_east() -> Point
Return the east north east anchor of the node
Source code in src/momapy/core/layout.py
east_south_east
east_south_east() -> Point
Return the east south east west anchor of the node
Source code in src/momapy/core/layout.py
equals
equals(other: LayoutElement, flattened: bool = False, unordered: bool = False) -> bool
Return true if the layout element is equal to another layout element, false otherwise
Source code in src/momapy/core/elements.py
flattened
flattened() -> list[LayoutElement]
Return a list containing copy of the layout element with no children and all its descendants with no children
Source code in src/momapy/core/elements.py
label_center
label_center() -> Point
north
north() -> Point
north_east
north_east() -> Point
Return the north east anchor of the node
Source code in src/momapy/core/layout.py
north_north_east
north_north_east() -> Point
Return the north north east anchor of the node
Source code in src/momapy/core/layout.py
north_north_west
north_north_west() -> Point
Return the north north west anchor of the node
Source code in src/momapy/core/layout.py
north_west
north_west() -> Point
Return the north west anchor of the node
Source code in src/momapy/core/layout.py
own_angle
own_angle(angle: float, unit: Literal['degrees', 'radians'] = 'degrees') -> Point | None
Return the point on the border of the node that intersects the self drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.
Source code in src/momapy/core/layout.py
own_bbox
own_bbox() -> Bbox
Compute and return the bounding box of the self drawing element of the group layout
Source code in src/momapy/core/layout.py
own_border
Return the point on the border of the node that intersects the self drawing elements of the node with the line formed of the center anchor point of the node and the given point. When there are multiple intersection points, the one closest to the given point is returned
Source code in src/momapy/core/layout.py
own_children
own_children() -> list[LayoutElement]
Return the self children of the node. A node has unique child that is its label
own_drawing_elements
own_drawing_elements() -> list[DrawingElement]
Return the node's own drawing elements
Source code in src/momapy/core/layout.py
own_to_geometry
own_to_geometry() -> list[Segment | QuadraticBezierCurve | CubicBezierCurve | EllipticalArc]
Return a list of geometry primitives from the self drawing elements.
Source code in src/momapy/core/layout.py
size
south
south() -> Point
south_east
south_east() -> Point
Return the south east anchor of the node
Source code in src/momapy/core/layout.py
south_south_east
south_south_east() -> Point
Return the south south east anchor of the node
Source code in src/momapy/core/layout.py
south_south_west
south_south_west() -> Point
Return the south south west anchor of the node
Source code in src/momapy/core/layout.py
south_west
south_west() -> Point
Return the south west anchor of the node
Source code in src/momapy/core/layout.py
to_geometry
to_geometry() -> list[Segment | QuadraticBezierCurve | CubicBezierCurve | EllipticalArc]
Return a list of geometry primitives from the drawing elements.
Source code in src/momapy/core/elements.py
west
west() -> Point
west_north_west
west_north_west() -> Point
Return the west north west anchor of the node
Source code in src/momapy/core/layout.py
west_south_west
west_south_west() -> Point
Return the west south west anchor of the node
Source code in src/momapy/core/layout.py
PositiveInfluence
dataclass
PositiveInfluence(*, id_: str = make_uuid4_as_str(), source: BiologicalActivity | LogicalOperator, target: Activity)
Bases: Influence
Positive (stimulating) influence.
The source increases the activity of the target.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
id_
|
str
|
The id of the map element. This id is purely for the user to keep track of the element, it does not need to be unique and is not part of the identity of the element, i.e., it is not considered when testing for equality between two map elements or when hashing the map element |
'37f8fe09-f32a-48eb-a476-5005af13c394'
|
source
|
BiologicalActivity | LogicalOperator
|
|
required |
target
|
Activity
|
|
required |
Methods:
| Name | Description |
|---|---|
descendants |
Return every |
descendants
descendants() -> list[ModelElement]
Return every ModelElement reachable from self, excluding self.
Walks scalar ModelElement fields and frozenset/tuple
containers, deduplicating by object identity.
Returns:
| Type | Description |
|---|---|
list[ModelElement]
|
The list of reachable |
list[ModelElement]
|
order, without |
Source code in src/momapy/core/elements.py
PositiveInfluenceLayout
dataclass
PositiveInfluenceLayout(path_fill: NoneValueType | Color | None = NoneValue, path_stroke: NoneValueType | Color | None = black, path_stroke_width: float | None = 1.25, arrowhead_fill: NoneValueType | Color | None = white, arrowhead_stroke: NoneValueType | Color | None = black, arrowhead_stroke_width: float | None = 1.25, *, id_: str = make_uuid4_as_str(), layout_elements: tuple[LayoutElement] = tuple(), group_fill: NoneValueType | Color | None = None, group_fill_rule: FillRule | None = None, group_filter: NoneValueType | Filter | None = None, group_font_family: str | None = None, group_font_size: float | None = None, group_font_style: FontStyle | None = None, group_font_weight: FontWeight | float | None = None, group_stroke: NoneValueType | Color | None = None, group_stroke_dasharray: NoneValueType | tuple[float, ...] | None = None, group_stroke_dashoffset: NoneValueType | float | None = None, group_stroke_width: NoneValueType | float | None = None, group_text_anchor: TextAnchor | None = None, group_transform: NoneValueType | tuple[Transformation] | None = None, end_shorten: float = 0.0, fill: NoneValueType | Color | None = None, filter: NoneValueType | Filter | None = None, path_filter: NoneValueType | Filter | None = None, path_stroke_dasharray: NoneValueType | tuple[float, ...] | None = None, path_stroke_dashoffset: NoneValueType | float | None = None, path_transform: NoneValueType | tuple[Transformation] | None = None, stroke: NoneValueType | Color | None = None, stroke_dasharray: NoneValueType | tuple[float] | None = None, stroke_dashoffset: NoneValueType | float | None = None, stroke_width: NoneValueType | float | None = None, segments: tuple[Segment | QuadraticBezierCurve | CubicBezierCurve | EllipticalArc] = tuple(), source: LayoutElement | None = None, start_shorten: float = 0.0, target: LayoutElement | None = None, transform: NoneValueType | tuple[Transformation] | None = None, arrowhead_filter: NoneValueType | Filter | None = None, arrowhead_stroke_dasharray: NoneValueType | tuple[float, ...] | None = None, arrowhead_stroke_dashoffset: NoneValueType | float | None = None, arrowhead_transform: NoneValueType | tuple[Transformation] | None = None, arrowhead_height: float = 10.0, arrowhead_width: float = 10.0)
Bases: SBGNSingleHeadedArc
Layout for positive influences.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
id_
|
str
|
The id of the map element. This id is purely for the user to keep track of the element, it does not need to be unique and is not part of the identity of the element, i.e., it is not considered when testing for equality between two map elements or when hashing the map element |
'd4a235f7-64cb-4564-9f7c-f2f6ca61032d'
|
layout_elements
|
tuple[LayoutElement]
|
The sub-layout elements of the group layout. These are part of the children of the group layout |
<dynamic>
|
group_fill
|
NoneValueType | Color | None
|
The fill color of the group layout |
None
|
group_fill_rule
|
FillRule | None
|
The fill rule of the group layout |
None
|
group_filter
|
NoneValueType | Filter | None
|
The filter of the group layout |
None
|
group_font_family
|
str | None
|
The font family of the group layout |
None
|
group_font_size
|
float | None
|
The font size of the group layout |
None
|
group_font_style
|
FontStyle | None
|
The font style of the group layout |
None
|
group_font_weight
|
FontWeight | float | None
|
The font weight of the group layout |
None
|
group_stroke
|
NoneValueType | Color | None
|
The stroke color of the group layout |
None
|
group_stroke_dasharray
|
NoneValueType | tuple[float, ...] | None
|
The stroke dasharray of the group layout |
None
|
group_stroke_dashoffset
|
NoneValueType | float | None
|
The stroke dashoffset of the group layout |
None
|
group_stroke_width
|
NoneValueType | float | None
|
The stroke width of the group layout |
None
|
group_text_anchor
|
TextAnchor | None
|
The text anchor of the group layout |
None
|
group_transform
|
NoneValueType | tuple[Transformation] | None
|
The transform of the group layout |
None
|
end_shorten
|
float
|
The length the end of the arc will be shorten by |
0.0
|
fill
|
NoneValueType | Color | None
|
The fill color of the arc |
None
|
filter
|
NoneValueType | Filter | None
|
The fill filter of the arc |
None
|
path_fill
|
NoneValueType | Color | None
|
The path fill color of the arc |
<momapy.drawing.NoneValueType object at 0x7fbe12e88d70>
|
path_filter
|
NoneValueType | Filter | None
|
The path filter of the arc |
None
|
path_stroke
|
NoneValueType | Color | None
|
The path stroke color of the arc |
Color(red=0, green=0, blue=0, alpha=1.0)
|
path_stroke_dasharray
|
NoneValueType | tuple[float, ...] | None
|
The path stroke dasharray of the arc |
None
|
path_stroke_dashoffset
|
NoneValueType | float | None
|
The path stroke dashoffset of the arc |
None
|
path_stroke_width
|
float | None
|
The path stroke width of the arc |
1.25
|
path_transform
|
NoneValueType | tuple[Transformation] | None
|
The path transform of the arc |
None
|
stroke
|
NoneValueType | Color | None
|
The stroke color of the arc |
None
|
stroke_dasharray
|
NoneValueType | tuple[float] | None
|
The stroke dasharray of the arc |
None
|
stroke_dashoffset
|
NoneValueType | float | None
|
The stroke dashoffset of the arc |
None
|
stroke_width
|
NoneValueType | float | None
|
The stroke width of the arc |
None
|
segments
|
tuple[Segment | QuadraticBezierCurve | CubicBezierCurve | EllipticalArc]
|
The path segments of the arc |
<dynamic>
|
source
|
LayoutElement | None
|
The source of the arc |
None
|
start_shorten
|
float
|
The length the start of the arc will be shorten by |
0.0
|
target
|
LayoutElement | None
|
The target of the arc |
None
|
transform
|
NoneValueType | tuple[Transformation] | None
|
The transform of the arc |
None
|
arrowhead_fill
|
NoneValueType | Color | None
|
The arrowhead fill color of the arc |
Color(red=255, green=255, blue=255, alpha=1.0)
|
arrowhead_filter
|
NoneValueType | Filter | None
|
The arrowhead filter of the arc |
None
|
arrowhead_stroke
|
NoneValueType | Color | None
|
The arrowhead stroke color of the arc |
Color(red=0, green=0, blue=0, alpha=1.0)
|
arrowhead_stroke_dasharray
|
NoneValueType | tuple[float, ...] | None
|
The arrowhead stroke dasharray of the arc |
None
|
arrowhead_stroke_dashoffset
|
NoneValueType | float | None
|
The arrowhead stroke dashoffset of the arc |
None
|
arrowhead_stroke_width
|
float | None
|
The arrowhead stroke width of the arc |
1.25
|
arrowhead_transform
|
NoneValueType | tuple[Transformation] | None
|
The arrowhead transform of the arc |
None
|
arrowhead_height
|
float
|
|
10.0
|
arrowhead_width
|
float
|
|
10.0
|
Methods:
| Name | Description |
|---|---|
anchor_point |
Return an anchor point of the layout element |
arrowhead_base |
Return the arrowhead base anchor point of the single-headed arc |
arrowhead_bbox |
Return the bounding box of the single-headed arc arrowhead |
arrowhead_border |
Return the point at the intersection of the drawing elements of the single-headed arc arrowhead and the line going through the center of these drawing elements and the given point. |
arrowhead_drawing_elements |
Return the drawing elements of the single-headed arc arrowhead |
arrowhead_length |
Return the length of the single-headed arc arrowhead |
arrowhead_tip |
Return the arrowhead tip anchor point of the single-headed arc |
bbox |
Compute and return the bounding box of the group layout element |
childless |
Return a copy of the arc with no children |
children |
Return the children of the group layout. |
contains |
Return |
descendants |
Return the descendants of the layout element |
drawing_elements |
Return the drawing elements of the group layout. |
end_point |
Return the ending point of the arc |
equals |
Return |
flattened |
Return a list containing copy of the layout element with no children and all its descendants with no children |
fraction |
Return the position and angle on the arc at a given fraction (of the total arc length) |
length |
Return the total length of the arc path |
own_bbox |
Compute and return the bounding box of the self drawing element of the group layout |
own_children |
Return the self children of the arc |
own_drawing_elements |
Return the self drawing elements of the single-headed arc |
own_to_geometry |
Return a list of geometry primitives from the self drawing elements. |
path_drawing_elements |
Return the drawing elements of the single-headed arc path |
points |
Return the points of the arc path |
start_point |
Return the starting point of the arc |
to_geometry |
Return a list of geometry primitives from the drawing elements. |
anchor_point
anchor_point(anchor_name: str) -> Point
arrowhead_base
arrowhead_base() -> Point
Return the arrowhead base anchor point of the single-headed arc
Source code in src/momapy/core/layout.py
arrowhead_border
arrowhead_border(point) -> Point
Return the point at the intersection of the drawing elements of the single-headed arc arrowhead and the line going through the center of these drawing elements and the given point. When there are multiple intersection points, the one closest to the given point is returned
Source code in src/momapy/core/layout.py
arrowhead_drawing_elements
arrowhead_drawing_elements() -> list[DrawingElement]
Return the drawing elements of the single-headed arc arrowhead
Source code in src/momapy/core/layout.py
arrowhead_length
Return the length of the single-headed arc arrowhead
Source code in src/momapy/core/layout.py
arrowhead_tip
arrowhead_tip() -> Point
Return the arrowhead tip anchor point of the single-headed arc
Source code in src/momapy/core/layout.py
bbox
bbox() -> Bbox
Compute and return the bounding box of the group layout element
Source code in src/momapy/core/layout.py
childless
children
children() -> list[LayoutElement]
Return the children of the group layout.
These are the self children of the group layout (returned by the own_children method) and the other children of the group layout (given by the layout_elements attribute)
Source code in src/momapy/core/layout.py
contains
contains(other: LayoutElement) -> bool
Return true if another layout element is a descendant of the layout element, false otherwise
drawing_elements
drawing_elements() -> list[DrawingElement]
Return the drawing elements of the group layout. The returned drawing elements are a group drawing element formed of the self drawing elements of the group layout and the drawing elements of its children
Source code in src/momapy/core/layout.py
end_point
end_point() -> Point
equals
equals(other: LayoutElement, flattened: bool = False, unordered: bool = False) -> bool
Return true if the layout element is equal to another layout element, false otherwise
Source code in src/momapy/core/elements.py
flattened
flattened() -> list[LayoutElement]
Return a list containing copy of the layout element with no children and all its descendants with no children
Source code in src/momapy/core/elements.py
fraction
fraction(fraction: float) -> tuple[Point, float]
Return the position and angle on the arc at a given fraction (of the total arc length)
Source code in src/momapy/core/layout.py
length
own_bbox
own_bbox() -> Bbox
Compute and return the bounding box of the self drawing element of the group layout
Source code in src/momapy/core/layout.py
own_children
own_children() -> list[LayoutElement]
own_drawing_elements
own_drawing_elements() -> list[DrawingElement]
Return the self drawing elements of the single-headed arc
Source code in src/momapy/core/layout.py
own_to_geometry
own_to_geometry() -> list[Segment | QuadraticBezierCurve | CubicBezierCurve | EllipticalArc]
Return a list of geometry primitives from the self drawing elements.
Source code in src/momapy/core/layout.py
path_drawing_elements
path_drawing_elements() -> list[Path]
Return the drawing elements of the single-headed arc path
Source code in src/momapy/core/layout.py
points
points() -> list[Point]
start_point
start_point() -> Point
to_geometry
to_geometry() -> list[Segment | QuadraticBezierCurve | CubicBezierCurve | EllipticalArc]
Return a list of geometry primitives from the drawing elements.
Source code in src/momapy/core/elements.py
SBGNAFLayout
dataclass
SBGNAFLayout(*, id_: str = make_uuid4_as_str(), layout_elements: tuple[LayoutElement] = tuple(), group_fill: NoneValueType | Color | None = None, group_fill_rule: FillRule | None = None, group_filter: NoneValueType | Filter | None = None, group_font_family: str | None = None, group_font_size: float | None = None, group_font_style: FontStyle | None = None, group_font_weight: FontWeight | float | None = None, group_stroke: NoneValueType | Color | None = None, group_stroke_dasharray: NoneValueType | tuple[float, ...] | None = None, group_stroke_dashoffset: NoneValueType | float | None = None, group_stroke_width: NoneValueType | float | None = None, group_text_anchor: TextAnchor | None = None, group_transform: NoneValueType | tuple[Transformation] | None = None, fill: NoneValueType | Color | None = white, filter: NoneValueType | Filter | None = None, height: float, label: TextLayout | None = None, position: Point, stroke: NoneValueType | Color | None = None, stroke_dasharray: NoneValueType | tuple[float, ...] | None = None, stroke_dashoffset: NoneValueType | float | None = None, stroke_width: NoneValueType | float | None = None, transform: NoneValueType | tuple[Transformation] | None = None, width: float)
Bases: SBGNLayout
SBGN-AF layout.
Represents the visual layout of an SBGN-AF model.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
id_
|
str
|
The id of the map element. This id is purely for the user to keep track of the element, it does not need to be unique and is not part of the identity of the element, i.e., it is not considered when testing for equality between two map elements or when hashing the map element |
'308b6691-2d28-4eb3-8fbc-7454c18a8d7e'
|
layout_elements
|
tuple[LayoutElement]
|
The sub-layout elements of the group layout. These are part of the children of the group layout |
<dynamic>
|
group_fill
|
NoneValueType | Color | None
|
The fill color of the group layout |
None
|
group_fill_rule
|
FillRule | None
|
The fill rule of the group layout |
None
|
group_filter
|
NoneValueType | Filter | None
|
The filter of the group layout |
None
|
group_font_family
|
str | None
|
The font family of the group layout |
None
|
group_font_size
|
float | None
|
The font size of the group layout |
None
|
group_font_style
|
FontStyle | None
|
The font style of the group layout |
None
|
group_font_weight
|
FontWeight | float | None
|
The font weight of the group layout |
None
|
group_stroke
|
NoneValueType | Color | None
|
The stroke color of the group layout |
None
|
group_stroke_dasharray
|
NoneValueType | tuple[float, ...] | None
|
The stroke dasharray of the group layout |
None
|
group_stroke_dashoffset
|
NoneValueType | float | None
|
The stroke dashoffset of the group layout |
None
|
group_stroke_width
|
NoneValueType | float | None
|
The stroke width of the group layout |
None
|
group_text_anchor
|
TextAnchor | None
|
The text anchor of the group layout |
None
|
group_transform
|
NoneValueType | tuple[Transformation] | None
|
The transform of the group layout |
None
|
fill
|
NoneValueType | Color | None
|
The fill color of the node |
Color(red=255, green=255, blue=255, alpha=1.0)
|
filter
|
NoneValueType | Filter | None
|
The filter of the node |
None
|
height
|
float
|
The height of the node |
required |
label
|
TextLayout | None
|
The label of the node |
None
|
position
|
Point
|
The position of the node |
required |
stroke
|
NoneValueType | Color | None
|
The stroke color of the node |
None
|
stroke_dasharray
|
NoneValueType | tuple[float, ...] | None
|
The stroke dasharray of the node |
None
|
stroke_dashoffset
|
NoneValueType | float | None
|
The stroke dashoffset of the node |
None
|
stroke_width
|
NoneValueType | float | None
|
The stroke width of the node |
None
|
transform
|
NoneValueType | tuple[Transformation] | None
|
The transform of the node |
None
|
width
|
float
|
The width width of the node |
required |
Methods:
| Name | Description |
|---|---|
anchor_point |
Return an anchor point of the layout element |
angle |
Return the point on the border of the node that intersects the drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal. |
bbox |
Compute and return the bounding box of the group layout element |
border |
Return the point on the border of the node that intersects the drawing elements of the node with the line formed of the center anchor point of the node and the given point. |
center |
Return the center anchor of the node |
childless |
Return a copy of the node with no children |
children |
Return the children of the group layout. |
contains |
Return |
descendants |
Return the descendants of the layout element |
drawing_elements |
Return the drawing elements of the group layout. |
east |
Return the east anchor of the node |
east_north_east |
Return the east north east anchor of the node |
east_south_east |
Return the east south east west anchor of the node |
equals |
Return |
flattened |
Return a list containing copy of the layout element with no children and all its descendants with no children |
is_sublayout |
Return |
label_center |
Return the label center anchor of the node |
north |
Return the north anchor of the node |
north_east |
Return the north east anchor of the node |
north_north_east |
Return the north north east anchor of the node |
north_north_west |
Return the north north west anchor of the node |
north_west |
Return the north west anchor of the node |
own_angle |
Return the point on the border of the node that intersects the self drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal. |
own_bbox |
Compute and return the bounding box of the self drawing element of the group layout |
own_border |
Return the point on the border of the node that intersects the self drawing elements of the node with the line formed of the center anchor point of the node and the given point. |
own_children |
Return the self children of the node. A node has unique child that is its label |
own_drawing_elements |
Return the node's own drawing elements |
own_to_geometry |
Return a list of geometry primitives from the self drawing elements. |
size |
Return the size of the node |
south |
Return the south anchor of the node |
south_east |
Return the south east anchor of the node |
south_south_east |
Return the south south east anchor of the node |
south_south_west |
Return the south south west anchor of the node |
south_west |
Return the south west anchor of the node |
to_geometry |
Return a list of geometry primitives from the drawing elements. |
west |
Return the west anchor of the node |
west_north_west |
Return the west north west anchor of the node |
west_south_west |
Return the west south west anchor of the node |
Attributes:
| Name | Type | Description |
|---|---|---|
x |
float
|
Return the x coordinate of the node |
y |
float
|
Return the y coordinate of the node |
anchor_point
anchor_point(anchor_name: str) -> Point
angle
angle(angle: float, unit: Literal['degrees', 'radians'] = 'degrees') -> Point | None
Return the point on the border of the node that intersects the drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.
Source code in src/momapy/core/layout.py
bbox
bbox() -> Bbox
Compute and return the bounding box of the group layout element
Source code in src/momapy/core/layout.py
border
Return the point on the border of the node that intersects the drawing elements of the node with the line formed of the center anchor point of the node and the given point. When there are multiple intersection points, the one closest to the given point is returned
Source code in src/momapy/core/layout.py
center
center() -> Point
childless
children
children() -> list[LayoutElement]
Return the children of the group layout.
These are the self children of the group layout (returned by the own_children method) and the other children of the group layout (given by the layout_elements attribute)
Source code in src/momapy/core/layout.py
contains
contains(other: LayoutElement) -> bool
Return true if another layout element is a descendant of the layout element, false otherwise
drawing_elements
drawing_elements() -> list[DrawingElement]
Return the drawing elements of the group layout. The returned drawing elements are a group drawing element formed of the self drawing elements of the group layout and the drawing elements of its children
Source code in src/momapy/core/layout.py
east
east() -> Point
east_north_east
east_north_east() -> Point
Return the east north east anchor of the node
Source code in src/momapy/core/layout.py
east_south_east
east_south_east() -> Point
Return the east south east west anchor of the node
Source code in src/momapy/core/layout.py
equals
equals(other: LayoutElement, flattened: bool = False, unordered: bool = False) -> bool
Return true if the layout element is equal to another layout element, false otherwise
Source code in src/momapy/core/elements.py
flattened
flattened() -> list[LayoutElement]
Return a list containing copy of the layout element with no children and all its descendants with no children
Source code in src/momapy/core/elements.py
is_sublayout
Return true if another given layout is a sublayout of the layout, false otherwise
Source code in src/momapy/core/layout.py
label_center
label_center() -> Point
north
north() -> Point
north_east
north_east() -> Point
Return the north east anchor of the node
Source code in src/momapy/core/layout.py
north_north_east
north_north_east() -> Point
Return the north north east anchor of the node
Source code in src/momapy/core/layout.py
north_north_west
north_north_west() -> Point
Return the north north west anchor of the node
Source code in src/momapy/core/layout.py
north_west
north_west() -> Point
Return the north west anchor of the node
Source code in src/momapy/core/layout.py
own_angle
own_angle(angle: float, unit: Literal['degrees', 'radians'] = 'degrees') -> Point | None
Return the point on the border of the node that intersects the self drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.
Source code in src/momapy/core/layout.py
own_bbox
own_bbox() -> Bbox
Compute and return the bounding box of the self drawing element of the group layout
Source code in src/momapy/core/layout.py
own_border
Return the point on the border of the node that intersects the self drawing elements of the node with the line formed of the center anchor point of the node and the given point. When there are multiple intersection points, the one closest to the given point is returned
Source code in src/momapy/core/layout.py
own_children
own_children() -> list[LayoutElement]
Return the self children of the node. A node has unique child that is its label
own_drawing_elements
own_drawing_elements() -> list[DrawingElement]
Return the node's own drawing elements
Source code in src/momapy/core/layout.py
own_to_geometry
own_to_geometry() -> list[Segment | QuadraticBezierCurve | CubicBezierCurve | EllipticalArc]
Return a list of geometry primitives from the self drawing elements.
Source code in src/momapy/core/layout.py
size
south
south() -> Point
south_east
south_east() -> Point
Return the south east anchor of the node
Source code in src/momapy/core/layout.py
south_south_east
south_south_east() -> Point
Return the south south east anchor of the node
Source code in src/momapy/core/layout.py
south_south_west
south_south_west() -> Point
Return the south south west anchor of the node
Source code in src/momapy/core/layout.py
south_west
south_west() -> Point
Return the south west anchor of the node
Source code in src/momapy/core/layout.py
to_geometry
to_geometry() -> list[Segment | QuadraticBezierCurve | CubicBezierCurve | EllipticalArc]
Return a list of geometry primitives from the drawing elements.
Source code in src/momapy/core/elements.py
west
west() -> Point
west_north_west
west_north_west() -> Point
Return the west north west anchor of the node
Source code in src/momapy/core/layout.py
west_south_west
west_south_west() -> Point
Return the west south west anchor of the node
Source code in src/momapy/core/layout.py
SBGNAFMap
dataclass
SBGNAFMap(*, id_: str = make_uuid4_as_str(), model: SBGNAFModel | None = None, layout: SBGNAFLayout | None = None, layout_model_mapping: LayoutModelMapping | None = None)
Bases: SBGNMap
SBGN-AF map.
Represents a complete SBGN Activity Flow map with model and layout.
Attributes:
| Name | Type | Description |
|---|
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
id_
|
str
|
The id of the map element. This id is purely for the user to keep track of the element, it does not need to be unique and is not part of the identity of the element, i.e., it is not considered when testing for equality between two map elements or when hashing the map element |
'99cb6672-aa75-41a2-9f35-a1092989067b'
|
model
|
SBGNAFModel | None
|
The model of the map |
None
|
layout
|
SBGNAFLayout | None
|
The layout of the map |
None
|
layout_model_mapping
|
LayoutModelMapping | None
|
The layout model mapping of the map |
None
|
Methods:
| Name | Description |
|---|---|
get_mapping |
Return the layout elements mapped to the given model element |
is_submap |
Return |
get_mapping
get_mapping(map_element: MapElement)
is_submap
Return true if another given map is a submap of the Map, false otherwise
Source code in src/momapy/core/map.py
SBGNAFModel
dataclass
SBGNAFModel(*, id_: str = make_uuid4_as_str(), activities: frozenset[Activity] = frozenset(), compartments: frozenset[Compartment] = frozenset(), influences: frozenset[Influence] = frozenset(), logical_operators: frozenset[LogicalOperator] = frozenset(), submaps: frozenset[Submap] = frozenset(), tags: frozenset[Tag] = frozenset())
Bases: SBGNModel
SBGN-AF model.
Represents a complete SBGN Activity Flow model.
Attributes:
| Name | Type | Description |
|---|
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
id_
|
str
|
The id of the map element. This id is purely for the user to keep track of the element, it does not need to be unique and is not part of the identity of the element, i.e., it is not considered when testing for equality between two map elements or when hashing the map element |
'1a038c0a-9a3b-48c6-ae18-9f64fb358853'
|
activities
|
frozenset[Activity]
|
Build an immutable unordered collection of unique elements. |
<dynamic>
|
compartments
|
frozenset[Compartment]
|
Build an immutable unordered collection of unique elements. |
<dynamic>
|
influences
|
frozenset[Influence]
|
Build an immutable unordered collection of unique elements. |
<dynamic>
|
logical_operators
|
frozenset[LogicalOperator]
|
Build an immutable unordered collection of unique elements. |
<dynamic>
|
submaps
|
frozenset[Submap]
|
Build an immutable unordered collection of unique elements. |
<dynamic>
|
tags
|
frozenset[Tag]
|
Build an immutable unordered collection of unique elements. |
<dynamic>
|
Methods:
| Name | Description |
|---|---|
descendants |
Return every |
is_submodel |
Check if another model is a submodel of this model. |
descendants
descendants() -> list[ModelElement]
Return every ModelElement reachable from this Model.
Walks scalar ModelElement fields and frozenset/tuple
containers of the Model, deduplicating by object identity.
The Model itself is not a ModelElement and is not included.
Returns:
| Type | Description |
|---|---|
list[ModelElement]
|
The list of reachable |
list[ModelElement]
|
order. |
Source code in src/momapy/core/model.py
is_submodel
is_submodel(other: SBGNAFModel) -> bool
Check if another model is a submodel of this model.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
other
|
SBGNAFModel
|
Another SBGN-AF model to compare against. |
required |
Returns:
| Type | Description |
|---|---|
bool
|
True if other is a submodel of this model, False otherwise. |
Source code in src/momapy/sbgn/af/model.py
SimpleChemicalUnitOfInformation
dataclass
Bases: UnitOfInformation
Unit of information typing a biological activity as a simple chemical.
Rendered as an SBGN simple chemical glyph embedded in the activity node.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
id_
|
str
|
The id of the map element. This id is purely for the user to keep track of the element, it does not need to be unique and is not part of the identity of the element, i.e., it is not considered when testing for equality between two map elements or when hashing the map element |
'481b0540-398b-452d-9590-6e09df6510e9'
|
label
|
str | None
|
|
None
|
Methods:
| Name | Description |
|---|---|
descendants |
Return every |
descendants
descendants() -> list[ModelElement]
Return every ModelElement reachable from self, excluding self.
Walks scalar ModelElement fields and frozenset/tuple
containers, deduplicating by object identity.
Returns:
| Type | Description |
|---|---|
list[ModelElement]
|
The list of reachable |
list[ModelElement]
|
order, without |
Source code in src/momapy/core/elements.py
SimpleChemicalUnitOfInformationLayout
dataclass
SimpleChemicalUnitOfInformationLayout(fill: NoneValueType | Color | None = white, stroke: NoneValueType | Color | None = black, stroke_width: float | None = 1.25, *, id_: str = make_uuid4_as_str(), layout_elements: tuple[LayoutElement] = tuple(), group_fill: NoneValueType | Color | None = None, group_fill_rule: FillRule | None = None, group_filter: NoneValueType | Filter | None = None, group_font_family: str | None = None, group_font_size: float | None = None, group_font_style: FontStyle | None = None, group_font_weight: FontWeight | float | None = None, group_stroke: NoneValueType | Color | None = None, group_stroke_dasharray: NoneValueType | tuple[float, ...] | None = None, group_stroke_dashoffset: NoneValueType | float | None = None, group_stroke_width: NoneValueType | float | None = None, group_text_anchor: TextAnchor | None = None, group_transform: NoneValueType | tuple[Transformation] | None = None, filter: NoneValueType | Filter | None = None, height: float = 12.0, label: TextLayout | None = None, position: Point, stroke_dasharray: NoneValueType | tuple[float, ...] | None = None, stroke_dashoffset: NoneValueType | float | None = None, transform: NoneValueType | tuple[Transformation] | None = None, width: float = 12.0)
Bases: _SimpleMixin, SBGNNode
Layout for simple chemical units of information.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
id_
|
str
|
The id of the map element. This id is purely for the user to keep track of the element, it does not need to be unique and is not part of the identity of the element, i.e., it is not considered when testing for equality between two map elements or when hashing the map element |
'f5fc51e7-bb7b-4c11-942b-b76dbb5829c0'
|
layout_elements
|
tuple[LayoutElement]
|
The sub-layout elements of the group layout. These are part of the children of the group layout |
<dynamic>
|
group_fill
|
NoneValueType | Color | None
|
The fill color of the group layout |
None
|
group_fill_rule
|
FillRule | None
|
The fill rule of the group layout |
None
|
group_filter
|
NoneValueType | Filter | None
|
The filter of the group layout |
None
|
group_font_family
|
str | None
|
The font family of the group layout |
None
|
group_font_size
|
float | None
|
The font size of the group layout |
None
|
group_font_style
|
FontStyle | None
|
The font style of the group layout |
None
|
group_font_weight
|
FontWeight | float | None
|
The font weight of the group layout |
None
|
group_stroke
|
NoneValueType | Color | None
|
The stroke color of the group layout |
None
|
group_stroke_dasharray
|
NoneValueType | tuple[float, ...] | None
|
The stroke dasharray of the group layout |
None
|
group_stroke_dashoffset
|
NoneValueType | float | None
|
The stroke dashoffset of the group layout |
None
|
group_stroke_width
|
NoneValueType | float | None
|
The stroke width of the group layout |
None
|
group_text_anchor
|
TextAnchor | None
|
The text anchor of the group layout |
None
|
group_transform
|
NoneValueType | tuple[Transformation] | None
|
The transform of the group layout |
None
|
fill
|
NoneValueType | Color | None
|
The fill color of the node |
Color(red=255, green=255, blue=255, alpha=1.0)
|
filter
|
NoneValueType | Filter | None
|
The filter of the node |
None
|
height
|
float
|
The height of the node |
12.0
|
label
|
TextLayout | None
|
The label of the node |
None
|
position
|
Point
|
The position of the node |
required |
stroke
|
NoneValueType | Color | None
|
The stroke color of the node |
Color(red=0, green=0, blue=0, alpha=1.0)
|
stroke_dasharray
|
NoneValueType | tuple[float, ...] | None
|
The stroke dasharray of the node |
None
|
stroke_dashoffset
|
NoneValueType | float | None
|
The stroke dashoffset of the node |
None
|
stroke_width
|
float | None
|
The stroke width of the node |
1.25
|
transform
|
NoneValueType | tuple[Transformation] | None
|
The transform of the node |
None
|
width
|
float
|
The width width of the node |
12.0
|
Methods:
| Name | Description |
|---|---|
anchor_point |
Return an anchor point of the layout element |
angle |
Return the point on the border of the node that intersects the drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal. |
bbox |
Compute and return the bounding box of the group layout element |
border |
Return the point on the border of the node that intersects the drawing elements of the node with the line formed of the center anchor point of the node and the given point. |
center |
Return the center anchor of the node |
childless |
Return a copy of the node with no children |
children |
Return the children of the group layout. |
contains |
Return |
descendants |
Return the descendants of the layout element |
drawing_elements |
Return the drawing elements of the group layout. |
east |
Return the east anchor of the node |
east_north_east |
Return the east north east anchor of the node |
east_south_east |
Return the east south east west anchor of the node |
equals |
Return |
flattened |
Return a list containing copy of the layout element with no children and all its descendants with no children |
label_center |
Return the label center anchor of the node |
north |
Return the north anchor of the node |
north_east |
Return the north east anchor of the node |
north_north_east |
Return the north north east anchor of the node |
north_north_west |
Return the north north west anchor of the node |
north_west |
Return the north west anchor of the node |
own_angle |
Return the point on the border of the node that intersects the self drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal. |
own_bbox |
Compute and return the bounding box of the self drawing element of the group layout |
own_border |
Return the point on the border of the node that intersects the self drawing elements of the node with the line formed of the center anchor point of the node and the given point. |
own_children |
Return the self children of the node. A node has unique child that is its label |
own_drawing_elements |
Return the node's own drawing elements |
own_to_geometry |
Return a list of geometry primitives from the self drawing elements. |
size |
Return the size of the node |
south |
Return the south anchor of the node |
south_east |
Return the south east anchor of the node |
south_south_east |
Return the south south east anchor of the node |
south_south_west |
Return the south south west anchor of the node |
south_west |
Return the south west anchor of the node |
to_geometry |
Return a list of geometry primitives from the drawing elements. |
west |
Return the west anchor of the node |
west_north_west |
Return the west north west anchor of the node |
west_south_west |
Return the west south west anchor of the node |
Attributes:
| Name | Type | Description |
|---|---|---|
x |
float
|
Return the x coordinate of the node |
y |
float
|
Return the y coordinate of the node |
anchor_point
anchor_point(anchor_name: str) -> Point
angle
angle(angle: float, unit: Literal['degrees', 'radians'] = 'degrees') -> Point | None
Return the point on the border of the node that intersects the drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.
Source code in src/momapy/core/layout.py
bbox
bbox() -> Bbox
Compute and return the bounding box of the group layout element
Source code in src/momapy/core/layout.py
border
Return the point on the border of the node that intersects the drawing elements of the node with the line formed of the center anchor point of the node and the given point. When there are multiple intersection points, the one closest to the given point is returned
Source code in src/momapy/core/layout.py
center
center() -> Point
childless
children
children() -> list[LayoutElement]
Return the children of the group layout.
These are the self children of the group layout (returned by the own_children method) and the other children of the group layout (given by the layout_elements attribute)
Source code in src/momapy/core/layout.py
contains
contains(other: LayoutElement) -> bool
Return true if another layout element is a descendant of the layout element, false otherwise
drawing_elements
drawing_elements() -> list[DrawingElement]
Return the drawing elements of the group layout. The returned drawing elements are a group drawing element formed of the self drawing elements of the group layout and the drawing elements of its children
Source code in src/momapy/core/layout.py
east
east() -> Point
east_north_east
east_north_east() -> Point
Return the east north east anchor of the node
Source code in src/momapy/core/layout.py
east_south_east
east_south_east() -> Point
Return the east south east west anchor of the node
Source code in src/momapy/core/layout.py
equals
equals(other: LayoutElement, flattened: bool = False, unordered: bool = False) -> bool
Return true if the layout element is equal to another layout element, false otherwise
Source code in src/momapy/core/elements.py
flattened
flattened() -> list[LayoutElement]
Return a list containing copy of the layout element with no children and all its descendants with no children
Source code in src/momapy/core/elements.py
label_center
label_center() -> Point
north
north() -> Point
north_east
north_east() -> Point
Return the north east anchor of the node
Source code in src/momapy/core/layout.py
north_north_east
north_north_east() -> Point
Return the north north east anchor of the node
Source code in src/momapy/core/layout.py
north_north_west
north_north_west() -> Point
Return the north north west anchor of the node
Source code in src/momapy/core/layout.py
north_west
north_west() -> Point
Return the north west anchor of the node
Source code in src/momapy/core/layout.py
own_angle
own_angle(angle: float, unit: Literal['degrees', 'radians'] = 'degrees') -> Point | None
Return the point on the border of the node that intersects the self drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.
Source code in src/momapy/core/layout.py
own_bbox
own_bbox() -> Bbox
Compute and return the bounding box of the self drawing element of the group layout
Source code in src/momapy/core/layout.py
own_border
Return the point on the border of the node that intersects the self drawing elements of the node with the line formed of the center anchor point of the node and the given point. When there are multiple intersection points, the one closest to the given point is returned
Source code in src/momapy/core/layout.py
own_children
own_children() -> list[LayoutElement]
Return the self children of the node. A node has unique child that is its label
own_drawing_elements
own_drawing_elements() -> list[DrawingElement]
Return the node's own drawing elements
Source code in src/momapy/core/layout.py
own_to_geometry
own_to_geometry() -> list[Segment | QuadraticBezierCurve | CubicBezierCurve | EllipticalArc]
Return a list of geometry primitives from the self drawing elements.
Source code in src/momapy/core/layout.py
size
south
south() -> Point
south_east
south_east() -> Point
Return the south east anchor of the node
Source code in src/momapy/core/layout.py
south_south_east
south_south_east() -> Point
Return the south south east anchor of the node
Source code in src/momapy/core/layout.py
south_south_west
south_south_west() -> Point
Return the south south west anchor of the node
Source code in src/momapy/core/layout.py
south_west
south_west() -> Point
Return the south west anchor of the node
Source code in src/momapy/core/layout.py
to_geometry
to_geometry() -> list[Segment | QuadraticBezierCurve | CubicBezierCurve | EllipticalArc]
Return a list of geometry primitives from the drawing elements.
Source code in src/momapy/core/elements.py
west
west() -> Point
west_north_west
west_north_west() -> Point
Return the west north west anchor of the node
Source code in src/momapy/core/layout.py
west_south_west
west_south_west() -> Point
Return the west south west anchor of the node
Source code in src/momapy/core/layout.py
Submap
dataclass
Submap(*, id_: str = make_uuid4_as_str(), label: str | None = None, terminals: frozenset[Terminal] = frozenset())
Bases: SBGNModelElement
Submap element.
Submaps represent embedded or referenced sub-diagrams.
Attributes:
| Name | Type | Description |
|---|
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
id_
|
str
|
The id of the map element. This id is purely for the user to keep track of the element, it does not need to be unique and is not part of the identity of the element, i.e., it is not considered when testing for equality between two map elements or when hashing the map element |
'41ef7cfe-317a-4723-9e41-b8df68bb9cb4'
|
label
|
str | None
|
|
None
|
terminals
|
frozenset[Terminal]
|
Build an immutable unordered collection of unique elements. |
<dynamic>
|
Methods:
| Name | Description |
|---|---|
descendants |
Return every |
descendants
descendants() -> list[ModelElement]
Return every ModelElement reachable from self, excluding self.
Walks scalar ModelElement fields and frozenset/tuple
containers, deduplicating by object identity.
Returns:
| Type | Description |
|---|---|
list[ModelElement]
|
The list of reachable |
list[ModelElement]
|
order, without |
Source code in src/momapy/core/elements.py
SubmapLayout
dataclass
SubmapLayout(fill: NoneValueType | Color | None = white, stroke: NoneValueType | Color | None = black, stroke_width: float | None = 1.25, *, id_: str = make_uuid4_as_str(), layout_elements: tuple[LayoutElement] = tuple(), group_fill: NoneValueType | Color | None = None, group_fill_rule: FillRule | None = None, group_filter: NoneValueType | Filter | None = None, group_font_family: str | None = None, group_font_size: float | None = None, group_font_style: FontStyle | None = None, group_font_weight: FontWeight | float | None = None, group_stroke: NoneValueType | Color | None = None, group_stroke_dasharray: NoneValueType | tuple[float, ...] | None = None, group_stroke_dashoffset: NoneValueType | float | None = None, group_stroke_width: NoneValueType | float | None = None, group_text_anchor: TextAnchor | None = None, group_transform: NoneValueType | tuple[Transformation] | None = None, filter: NoneValueType | Filter | None = None, height: float = 80.0, label: TextLayout | None = None, position: Point, stroke_dasharray: NoneValueType | tuple[float, ...] | None = None, stroke_dashoffset: NoneValueType | float | None = None, transform: NoneValueType | tuple[Transformation] | None = None, width: float = 80.0, border_stroke_width: float | None = 2.25)
Bases: _SimpleMixin, SBGNNode
Layout for submaps.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
id_
|
str
|
The id of the map element. This id is purely for the user to keep track of the element, it does not need to be unique and is not part of the identity of the element, i.e., it is not considered when testing for equality between two map elements or when hashing the map element |
'f5f60a5a-b27e-4242-8644-f4ee8d95e361'
|
layout_elements
|
tuple[LayoutElement]
|
The sub-layout elements of the group layout. These are part of the children of the group layout |
<dynamic>
|
group_fill
|
NoneValueType | Color | None
|
The fill color of the group layout |
None
|
group_fill_rule
|
FillRule | None
|
The fill rule of the group layout |
None
|
group_filter
|
NoneValueType | Filter | None
|
The filter of the group layout |
None
|
group_font_family
|
str | None
|
The font family of the group layout |
None
|
group_font_size
|
float | None
|
The font size of the group layout |
None
|
group_font_style
|
FontStyle | None
|
The font style of the group layout |
None
|
group_font_weight
|
FontWeight | float | None
|
The font weight of the group layout |
None
|
group_stroke
|
NoneValueType | Color | None
|
The stroke color of the group layout |
None
|
group_stroke_dasharray
|
NoneValueType | tuple[float, ...] | None
|
The stroke dasharray of the group layout |
None
|
group_stroke_dashoffset
|
NoneValueType | float | None
|
The stroke dashoffset of the group layout |
None
|
group_stroke_width
|
NoneValueType | float | None
|
The stroke width of the group layout |
None
|
group_text_anchor
|
TextAnchor | None
|
The text anchor of the group layout |
None
|
group_transform
|
NoneValueType | tuple[Transformation] | None
|
The transform of the group layout |
None
|
fill
|
NoneValueType | Color | None
|
The fill color of the node |
Color(red=255, green=255, blue=255, alpha=1.0)
|
filter
|
NoneValueType | Filter | None
|
The filter of the node |
None
|
height
|
float
|
The height of the node |
80.0
|
label
|
TextLayout | None
|
The label of the node |
None
|
position
|
Point
|
The position of the node |
required |
stroke
|
NoneValueType | Color | None
|
The stroke color of the node |
Color(red=0, green=0, blue=0, alpha=1.0)
|
stroke_dasharray
|
NoneValueType | tuple[float, ...] | None
|
The stroke dasharray of the node |
None
|
stroke_dashoffset
|
NoneValueType | float | None
|
The stroke dashoffset of the node |
None
|
stroke_width
|
float | None
|
The stroke width of the node |
1.25
|
transform
|
NoneValueType | tuple[Transformation] | None
|
The transform of the node |
None
|
width
|
float
|
The width width of the node |
80.0
|
border_stroke_width
|
float | None
|
|
2.25
|
Methods:
| Name | Description |
|---|---|
anchor_point |
Return an anchor point of the layout element |
angle |
Return the point on the border of the node that intersects the drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal. |
bbox |
Compute and return the bounding box of the group layout element |
border |
Return the point on the border of the node that intersects the drawing elements of the node with the line formed of the center anchor point of the node and the given point. |
center |
Return the center anchor of the node |
childless |
Return a copy of the node with no children |
children |
Return the children of the group layout. |
contains |
Return |
descendants |
Return the descendants of the layout element |
drawing_elements |
Return the drawing elements of the group layout. |
east |
Return the east anchor of the node |
east_north_east |
Return the east north east anchor of the node |
east_south_east |
Return the east south east west anchor of the node |
equals |
Return |
flattened |
Return a list containing copy of the layout element with no children and all its descendants with no children |
label_center |
Return the label center anchor of the node |
north |
Return the north anchor of the node |
north_east |
Return the north east anchor of the node |
north_north_east |
Return the north north east anchor of the node |
north_north_west |
Return the north north west anchor of the node |
north_west |
Return the north west anchor of the node |
own_angle |
Return the point on the border of the node that intersects the self drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal. |
own_bbox |
Compute and return the bounding box of the self drawing element of the group layout |
own_border |
Return the point on the border of the node that intersects the self drawing elements of the node with the line formed of the center anchor point of the node and the given point. |
own_children |
Return the self children of the node. A node has unique child that is its label |
own_drawing_elements |
Return the node's own drawing elements |
own_to_geometry |
Return a list of geometry primitives from the self drawing elements. |
size |
Return the size of the node |
south |
Return the south anchor of the node |
south_east |
Return the south east anchor of the node |
south_south_east |
Return the south south east anchor of the node |
south_south_west |
Return the south south west anchor of the node |
south_west |
Return the south west anchor of the node |
to_geometry |
Return a list of geometry primitives from the drawing elements. |
west |
Return the west anchor of the node |
west_north_west |
Return the west north west anchor of the node |
west_south_west |
Return the west south west anchor of the node |
Attributes:
| Name | Type | Description |
|---|---|---|
x |
float
|
Return the x coordinate of the node |
y |
float
|
Return the y coordinate of the node |
anchor_point
anchor_point(anchor_name: str) -> Point
angle
angle(angle: float, unit: Literal['degrees', 'radians'] = 'degrees') -> Point | None
Return the point on the border of the node that intersects the drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.
Source code in src/momapy/core/layout.py
bbox
bbox() -> Bbox
Compute and return the bounding box of the group layout element
Source code in src/momapy/core/layout.py
border
Return the point on the border of the node that intersects the drawing elements of the node with the line formed of the center anchor point of the node and the given point. When there are multiple intersection points, the one closest to the given point is returned
Source code in src/momapy/core/layout.py
center
center() -> Point
childless
children
children() -> list[LayoutElement]
Return the children of the group layout.
These are the self children of the group layout (returned by the own_children method) and the other children of the group layout (given by the layout_elements attribute)
Source code in src/momapy/core/layout.py
contains
contains(other: LayoutElement) -> bool
Return true if another layout element is a descendant of the layout element, false otherwise
drawing_elements
drawing_elements() -> list[DrawingElement]
Return the drawing elements of the group layout. The returned drawing elements are a group drawing element formed of the self drawing elements of the group layout and the drawing elements of its children
Source code in src/momapy/core/layout.py
east
east() -> Point
east_north_east
east_north_east() -> Point
Return the east north east anchor of the node
Source code in src/momapy/core/layout.py
east_south_east
east_south_east() -> Point
Return the east south east west anchor of the node
Source code in src/momapy/core/layout.py
equals
equals(other: LayoutElement, flattened: bool = False, unordered: bool = False) -> bool
Return true if the layout element is equal to another layout element, false otherwise
Source code in src/momapy/core/elements.py
flattened
flattened() -> list[LayoutElement]
Return a list containing copy of the layout element with no children and all its descendants with no children
Source code in src/momapy/core/elements.py
label_center
label_center() -> Point
north
north() -> Point
north_east
north_east() -> Point
Return the north east anchor of the node
Source code in src/momapy/core/layout.py
north_north_east
north_north_east() -> Point
Return the north north east anchor of the node
Source code in src/momapy/core/layout.py
north_north_west
north_north_west() -> Point
Return the north north west anchor of the node
Source code in src/momapy/core/layout.py
north_west
north_west() -> Point
Return the north west anchor of the node
Source code in src/momapy/core/layout.py
own_angle
own_angle(angle: float, unit: Literal['degrees', 'radians'] = 'degrees') -> Point | None
Return the point on the border of the node that intersects the self drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.
Source code in src/momapy/core/layout.py
own_bbox
own_bbox() -> Bbox
Compute and return the bounding box of the self drawing element of the group layout
Source code in src/momapy/core/layout.py
own_border
Return the point on the border of the node that intersects the self drawing elements of the node with the line formed of the center anchor point of the node and the given point. When there are multiple intersection points, the one closest to the given point is returned
Source code in src/momapy/core/layout.py
own_children
own_children() -> list[LayoutElement]
Return the self children of the node. A node has unique child that is its label
own_drawing_elements
own_drawing_elements() -> list[DrawingElement]
Return the node's own drawing elements
Source code in src/momapy/core/layout.py
own_to_geometry
own_to_geometry() -> list[Segment | QuadraticBezierCurve | CubicBezierCurve | EllipticalArc]
Return a list of geometry primitives from the self drawing elements.
Source code in src/momapy/core/layout.py
size
south
south() -> Point
south_east
south_east() -> Point
Return the south east anchor of the node
Source code in src/momapy/core/layout.py
south_south_east
south_south_east() -> Point
Return the south south east anchor of the node
Source code in src/momapy/core/layout.py
south_south_west
south_south_west() -> Point
Return the south south west anchor of the node
Source code in src/momapy/core/layout.py
south_west
south_west() -> Point
Return the south west anchor of the node
Source code in src/momapy/core/layout.py
to_geometry
to_geometry() -> list[Segment | QuadraticBezierCurve | CubicBezierCurve | EllipticalArc]
Return a list of geometry primitives from the drawing elements.
Source code in src/momapy/core/elements.py
west
west() -> Point
west_north_west
west_north_west() -> Point
Return the west north west anchor of the node
Source code in src/momapy/core/layout.py
west_south_west
west_south_west() -> Point
Return the west south west anchor of the node
Source code in src/momapy/core/layout.py
Tag
dataclass
Tag(*, id_: str = make_uuid4_as_str(), label: str | None = None, refers_to: TagReference | None = None)
Bases: SBGNModelElement
Tag element.
Tags provide identifiers that can be referenced from other locations.
Attributes:
| Name | Type | Description |
|---|
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
id_
|
str
|
The id of the map element. This id is purely for the user to keep track of the element, it does not need to be unique and is not part of the identity of the element, i.e., it is not considered when testing for equality between two map elements or when hashing the map element |
'c595a574-9c7d-47da-b1c1-6f0c5588eaf8'
|
label
|
str | None
|
|
None
|
refers_to
|
TagReference | None
|
|
None
|
Methods:
| Name | Description |
|---|---|
descendants |
Return every |
descendants
descendants() -> list[ModelElement]
Return every ModelElement reachable from self, excluding self.
Walks scalar ModelElement fields and frozenset/tuple
containers, deduplicating by object identity.
Returns:
| Type | Description |
|---|---|
list[ModelElement]
|
The list of reachable |
list[ModelElement]
|
order, without |
Source code in src/momapy/core/elements.py
TagLayout
dataclass
TagLayout(fill: NoneValueType | Color | None = white, stroke: NoneValueType | Color | None = black, stroke_width: float | None = 1.25, *, id_: str = make_uuid4_as_str(), layout_elements: tuple[LayoutElement] = tuple(), group_fill: NoneValueType | Color | None = None, group_fill_rule: FillRule | None = None, group_filter: NoneValueType | Filter | None = None, group_font_family: str | None = None, group_font_size: float | None = None, group_font_style: FontStyle | None = None, group_font_weight: FontWeight | float | None = None, group_stroke: NoneValueType | Color | None = None, group_stroke_dasharray: NoneValueType | tuple[float, ...] | None = None, group_stroke_dashoffset: NoneValueType | float | None = None, group_stroke_width: NoneValueType | float | None = None, group_text_anchor: TextAnchor | None = None, group_transform: NoneValueType | tuple[Transformation] | None = None, filter: NoneValueType | Filter | None = None, height: float = 35.0, label: TextLayout | None = None, position: Point, stroke_dasharray: NoneValueType | tuple[float, ...] | None = None, stroke_dashoffset: NoneValueType | float | None = None, transform: NoneValueType | tuple[Transformation] | None = None, width: float = 35.0, direction: Direction = RIGHT, angle: float = 70.0)
Bases: TagLayout
Layout for tags.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
id_
|
str
|
The id of the map element. This id is purely for the user to keep track of the element, it does not need to be unique and is not part of the identity of the element, i.e., it is not considered when testing for equality between two map elements or when hashing the map element |
'99c43830-0754-4dc3-9c72-07d4d999370c'
|
layout_elements
|
tuple[LayoutElement]
|
The sub-layout elements of the group layout. These are part of the children of the group layout |
<dynamic>
|
group_fill
|
NoneValueType | Color | None
|
The fill color of the group layout |
None
|
group_fill_rule
|
FillRule | None
|
The fill rule of the group layout |
None
|
group_filter
|
NoneValueType | Filter | None
|
The filter of the group layout |
None
|
group_font_family
|
str | None
|
The font family of the group layout |
None
|
group_font_size
|
float | None
|
The font size of the group layout |
None
|
group_font_style
|
FontStyle | None
|
The font style of the group layout |
None
|
group_font_weight
|
FontWeight | float | None
|
The font weight of the group layout |
None
|
group_stroke
|
NoneValueType | Color | None
|
The stroke color of the group layout |
None
|
group_stroke_dasharray
|
NoneValueType | tuple[float, ...] | None
|
The stroke dasharray of the group layout |
None
|
group_stroke_dashoffset
|
NoneValueType | float | None
|
The stroke dashoffset of the group layout |
None
|
group_stroke_width
|
NoneValueType | float | None
|
The stroke width of the group layout |
None
|
group_text_anchor
|
TextAnchor | None
|
The text anchor of the group layout |
None
|
group_transform
|
NoneValueType | tuple[Transformation] | None
|
The transform of the group layout |
None
|
fill
|
NoneValueType | Color | None
|
The fill color of the node |
Color(red=255, green=255, blue=255, alpha=1.0)
|
filter
|
NoneValueType | Filter | None
|
The filter of the node |
None
|
height
|
float
|
The height of the node |
35.0
|
label
|
TextLayout | None
|
The label of the node |
None
|
position
|
Point
|
The position of the node |
required |
stroke
|
NoneValueType | Color | None
|
The stroke color of the node |
Color(red=0, green=0, blue=0, alpha=1.0)
|
stroke_dasharray
|
NoneValueType | tuple[float, ...] | None
|
The stroke dasharray of the node |
None
|
stroke_dashoffset
|
NoneValueType | float | None
|
The stroke dashoffset of the node |
None
|
stroke_width
|
float | None
|
The stroke width of the node |
1.25
|
transform
|
NoneValueType | tuple[Transformation] | None
|
The transform of the node |
None
|
width
|
float
|
The width width of the node |
35.0
|
direction
|
Direction
|
|
<Direction.RIGHT: 4>
|
angle
|
float
|
Return the point on the border of the node that intersects the drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal. |
70.0
|
Methods:
| Name | Description |
|---|---|
anchor_point |
Return an anchor point of the layout element |
bbox |
Compute and return the bounding box of the group layout element |
border |
Return the point on the border of the node that intersects the drawing elements of the node with the line formed of the center anchor point of the node and the given point. |
center |
Return the center anchor of the node |
childless |
Return a copy of the node with no children |
children |
Return the children of the group layout. |
contains |
Return |
descendants |
Return the descendants of the layout element |
drawing_elements |
Return the drawing elements of the group layout. |
east |
Return the east anchor of the node |
east_north_east |
Return the east north east anchor of the node |
east_south_east |
Return the east south east west anchor of the node |
equals |
Return |
flattened |
Return a list containing copy of the layout element with no children and all its descendants with no children |
label_center |
Return the label center anchor of the node |
north |
Return the north anchor of the node |
north_east |
Return the north east anchor of the node |
north_north_east |
Return the north north east anchor of the node |
north_north_west |
Return the north north west anchor of the node |
north_west |
Return the north west anchor of the node |
own_angle |
Return the point on the border of the node that intersects the self drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal. |
own_bbox |
Compute and return the bounding box of the self drawing element of the group layout |
own_border |
Return the point on the border of the node that intersects the self drawing elements of the node with the line formed of the center anchor point of the node and the given point. |
own_children |
Return the self children of the node. A node has unique child that is its label |
own_drawing_elements |
Return the node's own drawing elements |
own_to_geometry |
Return a list of geometry primitives from the self drawing elements. |
size |
Return the size of the node |
south |
Return the south anchor of the node |
south_east |
Return the south east anchor of the node |
south_south_east |
Return the south south east anchor of the node |
south_south_west |
Return the south south west anchor of the node |
south_west |
Return the south west anchor of the node |
to_geometry |
Return a list of geometry primitives from the drawing elements. |
west |
Return the west anchor of the node |
west_north_west |
Return the west north west anchor of the node |
west_south_west |
Return the west south west anchor of the node |
Attributes:
| Name | Type | Description |
|---|---|---|
angle |
float
|
Return the point on the border of the node that intersects the drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal. |
x |
float
|
Return the x coordinate of the node |
y |
float
|
Return the y coordinate of the node |
anchor_point
anchor_point(anchor_name: str) -> Point
angle
class-attribute
instance-attribute
Return the point on the border of the node that intersects the drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.
bbox
bbox() -> Bbox
Compute and return the bounding box of the group layout element
Source code in src/momapy/core/layout.py
border
Return the point on the border of the node that intersects the drawing elements of the node with the line formed of the center anchor point of the node and the given point. When there are multiple intersection points, the one closest to the given point is returned
Source code in src/momapy/core/layout.py
center
center() -> Point
childless
children
children() -> list[LayoutElement]
Return the children of the group layout.
These are the self children of the group layout (returned by the own_children method) and the other children of the group layout (given by the layout_elements attribute)
Source code in src/momapy/core/layout.py
contains
contains(other: LayoutElement) -> bool
Return true if another layout element is a descendant of the layout element, false otherwise
drawing_elements
drawing_elements() -> list[DrawingElement]
Return the drawing elements of the group layout. The returned drawing elements are a group drawing element formed of the self drawing elements of the group layout and the drawing elements of its children
Source code in src/momapy/core/layout.py
east
east() -> Point
east_north_east
east_north_east() -> Point
Return the east north east anchor of the node
Source code in src/momapy/core/layout.py
east_south_east
east_south_east() -> Point
Return the east south east west anchor of the node
Source code in src/momapy/core/layout.py
equals
equals(other: LayoutElement, flattened: bool = False, unordered: bool = False) -> bool
Return true if the layout element is equal to another layout element, false otherwise
Source code in src/momapy/core/elements.py
flattened
flattened() -> list[LayoutElement]
Return a list containing copy of the layout element with no children and all its descendants with no children
Source code in src/momapy/core/elements.py
label_center
label_center() -> Point
north
north() -> Point
north_east
north_east() -> Point
Return the north east anchor of the node
Source code in src/momapy/core/layout.py
north_north_east
north_north_east() -> Point
Return the north north east anchor of the node
Source code in src/momapy/core/layout.py
north_north_west
north_north_west() -> Point
Return the north north west anchor of the node
Source code in src/momapy/core/layout.py
north_west
north_west() -> Point
Return the north west anchor of the node
Source code in src/momapy/core/layout.py
own_angle
own_angle(angle: float, unit: Literal['degrees', 'radians'] = 'degrees') -> Point | None
Return the point on the border of the node that intersects the self drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.
Source code in src/momapy/core/layout.py
own_bbox
own_bbox() -> Bbox
Compute and return the bounding box of the self drawing element of the group layout
Source code in src/momapy/core/layout.py
own_border
Return the point on the border of the node that intersects the self drawing elements of the node with the line formed of the center anchor point of the node and the given point. When there are multiple intersection points, the one closest to the given point is returned
Source code in src/momapy/core/layout.py
own_children
own_children() -> list[LayoutElement]
Return the self children of the node. A node has unique child that is its label
own_drawing_elements
own_drawing_elements() -> list[DrawingElement]
Return the node's own drawing elements
Source code in src/momapy/core/layout.py
own_to_geometry
own_to_geometry() -> list[Segment | QuadraticBezierCurve | CubicBezierCurve | EllipticalArc]
Return a list of geometry primitives from the self drawing elements.
Source code in src/momapy/core/layout.py
size
south
south() -> Point
south_east
south_east() -> Point
Return the south east anchor of the node
Source code in src/momapy/core/layout.py
south_south_east
south_south_east() -> Point
Return the south south east anchor of the node
Source code in src/momapy/core/layout.py
south_south_west
south_south_west() -> Point
Return the south south west anchor of the node
Source code in src/momapy/core/layout.py
south_west
south_west() -> Point
Return the south west anchor of the node
Source code in src/momapy/core/layout.py
to_geometry
to_geometry() -> list[Segment | QuadraticBezierCurve | CubicBezierCurve | EllipticalArc]
Return a list of geometry primitives from the drawing elements.
Source code in src/momapy/core/elements.py
west
west() -> Point
west_north_west
west_north_west() -> Point
Return the west north west anchor of the node
Source code in src/momapy/core/layout.py
west_south_west
west_south_west() -> Point
Return the west south west anchor of the node
Source code in src/momapy/core/layout.py
TagReference
dataclass
TagReference(*, id_: str = make_uuid4_as_str(), element: Activity | Compartment)
Bases: SBGNRole
Reference to a tag.
Attributes:
| Name | Type | Description |
|---|
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
id_
|
str
|
The id of the map element. This id is purely for the user to keep track of the element, it does not need to be unique and is not part of the identity of the element, i.e., it is not considered when testing for equality between two map elements or when hashing the map element |
'ecae9604-c540-40d9-b636-1c67d78d9c51'
|
element
|
Activity | Compartment
|
|
required |
Methods:
| Name | Description |
|---|---|
descendants |
Return every |
descendants
descendants() -> list[ModelElement]
Return every ModelElement reachable from self, excluding self.
Walks scalar ModelElement fields and frozenset/tuple
containers, deduplicating by object identity.
Returns:
| Type | Description |
|---|---|
list[ModelElement]
|
The list of reachable |
list[ModelElement]
|
order, without |
Source code in src/momapy/core/elements.py
Terminal
dataclass
Terminal(*, id_: str = make_uuid4_as_str(), label: str | None = None, refers_to: TerminalReference | None = None)
Bases: SBGNModelElement
Terminal element.
Terminals represent connection points to submaps.
Attributes:
| Name | Type | Description |
|---|
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
id_
|
str
|
The id of the map element. This id is purely for the user to keep track of the element, it does not need to be unique and is not part of the identity of the element, i.e., it is not considered when testing for equality between two map elements or when hashing the map element |
'c2c6a30b-6ec0-4462-b372-00aab7982274'
|
label
|
str | None
|
|
None
|
refers_to
|
TerminalReference | None
|
|
None
|
Methods:
| Name | Description |
|---|---|
descendants |
Return every |
descendants
descendants() -> list[ModelElement]
Return every ModelElement reachable from self, excluding self.
Walks scalar ModelElement fields and frozenset/tuple
containers, deduplicating by object identity.
Returns:
| Type | Description |
|---|---|
list[ModelElement]
|
The list of reachable |
list[ModelElement]
|
order, without |
Source code in src/momapy/core/elements.py
TerminalLayout
dataclass
TerminalLayout(fill: NoneValueType | Color | None = white, stroke: NoneValueType | Color | None = black, stroke_width: float | None = 1.25, *, id_: str = make_uuid4_as_str(), layout_elements: tuple[LayoutElement] = tuple(), group_fill: NoneValueType | Color | None = None, group_fill_rule: FillRule | None = None, group_filter: NoneValueType | Filter | None = None, group_font_family: str | None = None, group_font_size: float | None = None, group_font_style: FontStyle | None = None, group_font_weight: FontWeight | float | None = None, group_stroke: NoneValueType | Color | None = None, group_stroke_dasharray: NoneValueType | tuple[float, ...] | None = None, group_stroke_dashoffset: NoneValueType | float | None = None, group_stroke_width: NoneValueType | float | None = None, group_text_anchor: TextAnchor | None = None, group_transform: NoneValueType | tuple[Transformation] | None = None, filter: NoneValueType | Filter | None = None, height: float = 35.0, label: TextLayout | None = None, position: Point, stroke_dasharray: NoneValueType | tuple[float, ...] | None = None, stroke_dashoffset: NoneValueType | float | None = None, transform: NoneValueType | tuple[Transformation] | None = None, width: float = 35.0, direction: Direction = RIGHT, angle: float = 70.0)
Bases: _SimpleMixin, SBGNNode
Layout for terminals.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
id_
|
str
|
The id of the map element. This id is purely for the user to keep track of the element, it does not need to be unique and is not part of the identity of the element, i.e., it is not considered when testing for equality between two map elements or when hashing the map element |
'b2930a7d-8394-4034-80be-b03ec3fb6ba6'
|
layout_elements
|
tuple[LayoutElement]
|
The sub-layout elements of the group layout. These are part of the children of the group layout |
<dynamic>
|
group_fill
|
NoneValueType | Color | None
|
The fill color of the group layout |
None
|
group_fill_rule
|
FillRule | None
|
The fill rule of the group layout |
None
|
group_filter
|
NoneValueType | Filter | None
|
The filter of the group layout |
None
|
group_font_family
|
str | None
|
The font family of the group layout |
None
|
group_font_size
|
float | None
|
The font size of the group layout |
None
|
group_font_style
|
FontStyle | None
|
The font style of the group layout |
None
|
group_font_weight
|
FontWeight | float | None
|
The font weight of the group layout |
None
|
group_stroke
|
NoneValueType | Color | None
|
The stroke color of the group layout |
None
|
group_stroke_dasharray
|
NoneValueType | tuple[float, ...] | None
|
The stroke dasharray of the group layout |
None
|
group_stroke_dashoffset
|
NoneValueType | float | None
|
The stroke dashoffset of the group layout |
None
|
group_stroke_width
|
NoneValueType | float | None
|
The stroke width of the group layout |
None
|
group_text_anchor
|
TextAnchor | None
|
The text anchor of the group layout |
None
|
group_transform
|
NoneValueType | tuple[Transformation] | None
|
The transform of the group layout |
None
|
fill
|
NoneValueType | Color | None
|
The fill color of the node |
Color(red=255, green=255, blue=255, alpha=1.0)
|
filter
|
NoneValueType | Filter | None
|
The filter of the node |
None
|
height
|
float
|
The height of the node |
35.0
|
label
|
TextLayout | None
|
The label of the node |
None
|
position
|
Point
|
The position of the node |
required |
stroke
|
NoneValueType | Color | None
|
The stroke color of the node |
Color(red=0, green=0, blue=0, alpha=1.0)
|
stroke_dasharray
|
NoneValueType | tuple[float, ...] | None
|
The stroke dasharray of the node |
None
|
stroke_dashoffset
|
NoneValueType | float | None
|
The stroke dashoffset of the node |
None
|
stroke_width
|
float | None
|
The stroke width of the node |
1.25
|
transform
|
NoneValueType | tuple[Transformation] | None
|
The transform of the node |
None
|
width
|
float
|
The width width of the node |
35.0
|
direction
|
Direction
|
|
<Direction.RIGHT: 4>
|
angle
|
float
|
Return the point on the border of the node that intersects the drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal. |
70.0
|
Methods:
| Name | Description |
|---|---|
anchor_point |
Return an anchor point of the layout element |
bbox |
Compute and return the bounding box of the group layout element |
border |
Return the point on the border of the node that intersects the drawing elements of the node with the line formed of the center anchor point of the node and the given point. |
center |
Return the center anchor of the node |
childless |
Return a copy of the node with no children |
children |
Return the children of the group layout. |
contains |
Return |
descendants |
Return the descendants of the layout element |
drawing_elements |
Return the drawing elements of the group layout. |
east |
Return the east anchor of the node |
east_north_east |
Return the east north east anchor of the node |
east_south_east |
Return the east south east west anchor of the node |
equals |
Return |
flattened |
Return a list containing copy of the layout element with no children and all its descendants with no children |
label_center |
Return the label center anchor of the node |
north |
Return the north anchor of the node |
north_east |
Return the north east anchor of the node |
north_north_east |
Return the north north east anchor of the node |
north_north_west |
Return the north north west anchor of the node |
north_west |
Return the north west anchor of the node |
own_angle |
Return the point on the border of the node that intersects the self drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal. |
own_bbox |
Compute and return the bounding box of the self drawing element of the group layout |
own_border |
Return the point on the border of the node that intersects the self drawing elements of the node with the line formed of the center anchor point of the node and the given point. |
own_children |
Return the self children of the node. A node has unique child that is its label |
own_drawing_elements |
Return the node's own drawing elements |
own_to_geometry |
Return a list of geometry primitives from the self drawing elements. |
size |
Return the size of the node |
south |
Return the south anchor of the node |
south_east |
Return the south east anchor of the node |
south_south_east |
Return the south south east anchor of the node |
south_south_west |
Return the south south west anchor of the node |
south_west |
Return the south west anchor of the node |
to_geometry |
Return a list of geometry primitives from the drawing elements. |
west |
Return the west anchor of the node |
west_north_west |
Return the west north west anchor of the node |
west_south_west |
Return the west south west anchor of the node |
Attributes:
| Name | Type | Description |
|---|---|---|
angle |
float
|
Return the point on the border of the node that intersects the drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal. |
x |
float
|
Return the x coordinate of the node |
y |
float
|
Return the y coordinate of the node |
anchor_point
anchor_point(anchor_name: str) -> Point
angle
class-attribute
instance-attribute
Return the point on the border of the node that intersects the drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.
bbox
bbox() -> Bbox
Compute and return the bounding box of the group layout element
Source code in src/momapy/core/layout.py
border
Return the point on the border of the node that intersects the drawing elements of the node with the line formed of the center anchor point of the node and the given point. When there are multiple intersection points, the one closest to the given point is returned
Source code in src/momapy/core/layout.py
center
center() -> Point
childless
children
children() -> list[LayoutElement]
Return the children of the group layout.
These are the self children of the group layout (returned by the own_children method) and the other children of the group layout (given by the layout_elements attribute)
Source code in src/momapy/core/layout.py
contains
contains(other: LayoutElement) -> bool
Return true if another layout element is a descendant of the layout element, false otherwise
drawing_elements
drawing_elements() -> list[DrawingElement]
Return the drawing elements of the group layout. The returned drawing elements are a group drawing element formed of the self drawing elements of the group layout and the drawing elements of its children
Source code in src/momapy/core/layout.py
east
east() -> Point
east_north_east
east_north_east() -> Point
Return the east north east anchor of the node
Source code in src/momapy/core/layout.py
east_south_east
east_south_east() -> Point
Return the east south east west anchor of the node
Source code in src/momapy/core/layout.py
equals
equals(other: LayoutElement, flattened: bool = False, unordered: bool = False) -> bool
Return true if the layout element is equal to another layout element, false otherwise
Source code in src/momapy/core/elements.py
flattened
flattened() -> list[LayoutElement]
Return a list containing copy of the layout element with no children and all its descendants with no children
Source code in src/momapy/core/elements.py
label_center
label_center() -> Point
north
north() -> Point
north_east
north_east() -> Point
Return the north east anchor of the node
Source code in src/momapy/core/layout.py
north_north_east
north_north_east() -> Point
Return the north north east anchor of the node
Source code in src/momapy/core/layout.py
north_north_west
north_north_west() -> Point
Return the north north west anchor of the node
Source code in src/momapy/core/layout.py
north_west
north_west() -> Point
Return the north west anchor of the node
Source code in src/momapy/core/layout.py
own_angle
own_angle(angle: float, unit: Literal['degrees', 'radians'] = 'degrees') -> Point | None
Return the point on the border of the node that intersects the self drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.
Source code in src/momapy/core/layout.py
own_bbox
own_bbox() -> Bbox
Compute and return the bounding box of the self drawing element of the group layout
Source code in src/momapy/core/layout.py
own_border
Return the point on the border of the node that intersects the self drawing elements of the node with the line formed of the center anchor point of the node and the given point. When there are multiple intersection points, the one closest to the given point is returned
Source code in src/momapy/core/layout.py
own_children
own_children() -> list[LayoutElement]
Return the self children of the node. A node has unique child that is its label
own_drawing_elements
own_drawing_elements() -> list[DrawingElement]
Return the node's own drawing elements
Source code in src/momapy/core/layout.py
own_to_geometry
own_to_geometry() -> list[Segment | QuadraticBezierCurve | CubicBezierCurve | EllipticalArc]
Return a list of geometry primitives from the self drawing elements.
Source code in src/momapy/core/layout.py
size
south
south() -> Point
south_east
south_east() -> Point
Return the south east anchor of the node
Source code in src/momapy/core/layout.py
south_south_east
south_south_east() -> Point
Return the south south east anchor of the node
Source code in src/momapy/core/layout.py
south_south_west
south_south_west() -> Point
Return the south south west anchor of the node
Source code in src/momapy/core/layout.py
south_west
south_west() -> Point
Return the south west anchor of the node
Source code in src/momapy/core/layout.py
to_geometry
to_geometry() -> list[Segment | QuadraticBezierCurve | CubicBezierCurve | EllipticalArc]
Return a list of geometry primitives from the drawing elements.
Source code in src/momapy/core/elements.py
west
west() -> Point
west_north_west
west_north_west() -> Point
Return the west north west anchor of the node
Source code in src/momapy/core/layout.py
west_south_west
west_south_west() -> Point
Return the west south west anchor of the node
Source code in src/momapy/core/layout.py
TerminalReference
dataclass
TerminalReference(*, id_: str = make_uuid4_as_str(), element: Activity | Compartment)
Bases: SBGNRole
Reference to a terminal.
Attributes:
| Name | Type | Description |
|---|
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
id_
|
str
|
The id of the map element. This id is purely for the user to keep track of the element, it does not need to be unique and is not part of the identity of the element, i.e., it is not considered when testing for equality between two map elements or when hashing the map element |
'395384aa-2b36-4ff8-851f-0b4a2718e810'
|
element
|
Activity | Compartment
|
|
required |
Methods:
| Name | Description |
|---|---|
descendants |
Return every |
descendants
descendants() -> list[ModelElement]
Return every ModelElement reachable from self, excluding self.
Walks scalar ModelElement fields and frozenset/tuple
containers, deduplicating by object identity.
Returns:
| Type | Description |
|---|---|
list[ModelElement]
|
The list of reachable |
list[ModelElement]
|
order, without |
Source code in src/momapy/core/elements.py
UnitOfInformation
dataclass
Bases: SBGNModelElement
Unit of information for activities and compartments.
Units of information provide additional information about activities or compartments.
Attributes:
| Name | Type | Description |
|---|
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
id_
|
str
|
The id of the map element. This id is purely for the user to keep track of the element, it does not need to be unique and is not part of the identity of the element, i.e., it is not considered when testing for equality between two map elements or when hashing the map element |
'31db5f8b-81ad-45e5-a837-b13967184c36'
|
label
|
str | None
|
|
None
|
Methods:
| Name | Description |
|---|---|
descendants |
Return every |
descendants
descendants() -> list[ModelElement]
Return every ModelElement reachable from self, excluding self.
Walks scalar ModelElement fields and frozenset/tuple
containers, deduplicating by object identity.
Returns:
| Type | Description |
|---|---|
list[ModelElement]
|
The list of reachable |
list[ModelElement]
|
order, without |
Source code in src/momapy/core/elements.py
UnitOfInformationLayout
dataclass
UnitOfInformationLayout(fill: NoneValueType | Color | None = white, stroke: NoneValueType | Color | None = black, stroke_width: float | None = 1.25, *, id_: str = make_uuid4_as_str(), layout_elements: tuple[LayoutElement] = tuple(), group_fill: NoneValueType | Color | None = None, group_fill_rule: FillRule | None = None, group_filter: NoneValueType | Filter | None = None, group_font_family: str | None = None, group_font_size: float | None = None, group_font_style: FontStyle | None = None, group_font_weight: FontWeight | float | None = None, group_stroke: NoneValueType | Color | None = None, group_stroke_dasharray: NoneValueType | tuple[float, ...] | None = None, group_stroke_dashoffset: NoneValueType | float | None = None, group_stroke_width: NoneValueType | float | None = None, group_text_anchor: TextAnchor | None = None, group_transform: NoneValueType | tuple[Transformation] | None = None, filter: NoneValueType | Filter | None = None, height: float = 12.0, label: TextLayout | None = None, position: Point, stroke_dasharray: NoneValueType | tuple[float, ...] | None = None, stroke_dashoffset: NoneValueType | float | None = None, transform: NoneValueType | tuple[Transformation] | None = None, width: float = 12.0)
Bases: _SimpleMixin, SBGNNode
Class for unit of information layouts
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
id_
|
str
|
The id of the map element. This id is purely for the user to keep track of the element, it does not need to be unique and is not part of the identity of the element, i.e., it is not considered when testing for equality between two map elements or when hashing the map element |
'9f1563df-d65e-426b-ace7-8f6ffabfc87f'
|
layout_elements
|
tuple[LayoutElement]
|
The sub-layout elements of the group layout. These are part of the children of the group layout |
<dynamic>
|
group_fill
|
NoneValueType | Color | None
|
The fill color of the group layout |
None
|
group_fill_rule
|
FillRule | None
|
The fill rule of the group layout |
None
|
group_filter
|
NoneValueType | Filter | None
|
The filter of the group layout |
None
|
group_font_family
|
str | None
|
The font family of the group layout |
None
|
group_font_size
|
float | None
|
The font size of the group layout |
None
|
group_font_style
|
FontStyle | None
|
The font style of the group layout |
None
|
group_font_weight
|
FontWeight | float | None
|
The font weight of the group layout |
None
|
group_stroke
|
NoneValueType | Color | None
|
The stroke color of the group layout |
None
|
group_stroke_dasharray
|
NoneValueType | tuple[float, ...] | None
|
The stroke dasharray of the group layout |
None
|
group_stroke_dashoffset
|
NoneValueType | float | None
|
The stroke dashoffset of the group layout |
None
|
group_stroke_width
|
NoneValueType | float | None
|
The stroke width of the group layout |
None
|
group_text_anchor
|
TextAnchor | None
|
The text anchor of the group layout |
None
|
group_transform
|
NoneValueType | tuple[Transformation] | None
|
The transform of the group layout |
None
|
fill
|
NoneValueType | Color | None
|
The fill color of the node |
Color(red=255, green=255, blue=255, alpha=1.0)
|
filter
|
NoneValueType | Filter | None
|
The filter of the node |
None
|
height
|
float
|
The height of the node |
12.0
|
label
|
TextLayout | None
|
The label of the node |
None
|
position
|
Point
|
The position of the node |
required |
stroke
|
NoneValueType | Color | None
|
The stroke color of the node |
Color(red=0, green=0, blue=0, alpha=1.0)
|
stroke_dasharray
|
NoneValueType | tuple[float, ...] | None
|
The stroke dasharray of the node |
None
|
stroke_dashoffset
|
NoneValueType | float | None
|
The stroke dashoffset of the node |
None
|
stroke_width
|
float | None
|
The stroke width of the node |
1.25
|
transform
|
NoneValueType | tuple[Transformation] | None
|
The transform of the node |
None
|
width
|
float
|
The width width of the node |
12.0
|
Methods:
| Name | Description |
|---|---|
anchor_point |
Return an anchor point of the layout element |
angle |
Return the point on the border of the node that intersects the drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal. |
bbox |
Compute and return the bounding box of the group layout element |
border |
Return the point on the border of the node that intersects the drawing elements of the node with the line formed of the center anchor point of the node and the given point. |
center |
Return the center anchor of the node |
childless |
Return a copy of the node with no children |
children |
Return the children of the group layout. |
contains |
Return |
descendants |
Return the descendants of the layout element |
drawing_elements |
Return the drawing elements of the group layout. |
east |
Return the east anchor of the node |
east_north_east |
Return the east north east anchor of the node |
east_south_east |
Return the east south east west anchor of the node |
equals |
Return |
flattened |
Return a list containing copy of the layout element with no children and all its descendants with no children |
label_center |
Return the label center anchor of the node |
north |
Return the north anchor of the node |
north_east |
Return the north east anchor of the node |
north_north_east |
Return the north north east anchor of the node |
north_north_west |
Return the north north west anchor of the node |
north_west |
Return the north west anchor of the node |
own_angle |
Return the point on the border of the node that intersects the self drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal. |
own_bbox |
Compute and return the bounding box of the self drawing element of the group layout |
own_border |
Return the point on the border of the node that intersects the self drawing elements of the node with the line formed of the center anchor point of the node and the given point. |
own_children |
Return the self children of the node. A node has unique child that is its label |
own_drawing_elements |
Return the node's own drawing elements |
own_to_geometry |
Return a list of geometry primitives from the self drawing elements. |
size |
Return the size of the node |
south |
Return the south anchor of the node |
south_east |
Return the south east anchor of the node |
south_south_east |
Return the south south east anchor of the node |
south_south_west |
Return the south south west anchor of the node |
south_west |
Return the south west anchor of the node |
to_geometry |
Return a list of geometry primitives from the drawing elements. |
west |
Return the west anchor of the node |
west_north_west |
Return the west north west anchor of the node |
west_south_west |
Return the west south west anchor of the node |
Attributes:
| Name | Type | Description |
|---|---|---|
x |
float
|
Return the x coordinate of the node |
y |
float
|
Return the y coordinate of the node |
anchor_point
anchor_point(anchor_name: str) -> Point
angle
angle(angle: float, unit: Literal['degrees', 'radians'] = 'degrees') -> Point | None
Return the point on the border of the node that intersects the drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.
Source code in src/momapy/core/layout.py
bbox
bbox() -> Bbox
Compute and return the bounding box of the group layout element
Source code in src/momapy/core/layout.py
border
Return the point on the border of the node that intersects the drawing elements of the node with the line formed of the center anchor point of the node and the given point. When there are multiple intersection points, the one closest to the given point is returned
Source code in src/momapy/core/layout.py
center
center() -> Point
childless
children
children() -> list[LayoutElement]
Return the children of the group layout.
These are the self children of the group layout (returned by the own_children method) and the other children of the group layout (given by the layout_elements attribute)
Source code in src/momapy/core/layout.py
contains
contains(other: LayoutElement) -> bool
Return true if another layout element is a descendant of the layout element, false otherwise
drawing_elements
drawing_elements() -> list[DrawingElement]
Return the drawing elements of the group layout. The returned drawing elements are a group drawing element formed of the self drawing elements of the group layout and the drawing elements of its children
Source code in src/momapy/core/layout.py
east
east() -> Point
east_north_east
east_north_east() -> Point
Return the east north east anchor of the node
Source code in src/momapy/core/layout.py
east_south_east
east_south_east() -> Point
Return the east south east west anchor of the node
Source code in src/momapy/core/layout.py
equals
equals(other: LayoutElement, flattened: bool = False, unordered: bool = False) -> bool
Return true if the layout element is equal to another layout element, false otherwise
Source code in src/momapy/core/elements.py
flattened
flattened() -> list[LayoutElement]
Return a list containing copy of the layout element with no children and all its descendants with no children
Source code in src/momapy/core/elements.py
label_center
label_center() -> Point
north
north() -> Point
north_east
north_east() -> Point
Return the north east anchor of the node
Source code in src/momapy/core/layout.py
north_north_east
north_north_east() -> Point
Return the north north east anchor of the node
Source code in src/momapy/core/layout.py
north_north_west
north_north_west() -> Point
Return the north north west anchor of the node
Source code in src/momapy/core/layout.py
north_west
north_west() -> Point
Return the north west anchor of the node
Source code in src/momapy/core/layout.py
own_angle
own_angle(angle: float, unit: Literal['degrees', 'radians'] = 'degrees') -> Point | None
Return the point on the border of the node that intersects the self drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.
Source code in src/momapy/core/layout.py
own_bbox
own_bbox() -> Bbox
Compute and return the bounding box of the self drawing element of the group layout
Source code in src/momapy/core/layout.py
own_border
Return the point on the border of the node that intersects the self drawing elements of the node with the line formed of the center anchor point of the node and the given point. When there are multiple intersection points, the one closest to the given point is returned
Source code in src/momapy/core/layout.py
own_children
own_children() -> list[LayoutElement]
Return the self children of the node. A node has unique child that is its label
own_drawing_elements
own_drawing_elements() -> list[DrawingElement]
Return the node's own drawing elements
Source code in src/momapy/core/layout.py
own_to_geometry
own_to_geometry() -> list[Segment | QuadraticBezierCurve | CubicBezierCurve | EllipticalArc]
Return a list of geometry primitives from the self drawing elements.
Source code in src/momapy/core/layout.py
size
south
south() -> Point
south_east
south_east() -> Point
Return the south east anchor of the node
Source code in src/momapy/core/layout.py
south_south_east
south_south_east() -> Point
Return the south south east anchor of the node
Source code in src/momapy/core/layout.py
south_south_west
south_south_west() -> Point
Return the south south west anchor of the node
Source code in src/momapy/core/layout.py
south_west
south_west() -> Point
Return the south west anchor of the node
Source code in src/momapy/core/layout.py
to_geometry
to_geometry() -> list[Segment | QuadraticBezierCurve | CubicBezierCurve | EllipticalArc]
Return a list of geometry primitives from the drawing elements.
Source code in src/momapy/core/elements.py
west
west() -> Point
west_north_west
west_north_west() -> Point
Return the west north west anchor of the node
Source code in src/momapy/core/layout.py
west_south_west
west_south_west() -> Point
Return the west south west anchor of the node
Source code in src/momapy/core/layout.py
UnknownInfluence
dataclass
UnknownInfluence(*, id_: str = make_uuid4_as_str(), source: BiologicalActivity | LogicalOperator, target: Activity)
Bases: Influence
Influence of unspecified sign.
Used when the regulatory effect of the source on the target is not known.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
id_
|
str
|
The id of the map element. This id is purely for the user to keep track of the element, it does not need to be unique and is not part of the identity of the element, i.e., it is not considered when testing for equality between two map elements or when hashing the map element |
'8630041c-eb94-40b0-9805-1770505c22c3'
|
source
|
BiologicalActivity | LogicalOperator
|
|
required |
target
|
Activity
|
|
required |
Methods:
| Name | Description |
|---|---|
descendants |
Return every |
descendants
descendants() -> list[ModelElement]
Return every ModelElement reachable from self, excluding self.
Walks scalar ModelElement fields and frozenset/tuple
containers, deduplicating by object identity.
Returns:
| Type | Description |
|---|---|
list[ModelElement]
|
The list of reachable |
list[ModelElement]
|
order, without |
Source code in src/momapy/core/elements.py
UnknownInfluenceLayout
dataclass
UnknownInfluenceLayout(path_fill: NoneValueType | Color | None = NoneValue, path_stroke: NoneValueType | Color | None = black, path_stroke_width: float | None = 1.25, arrowhead_fill: NoneValueType | Color | None = white, arrowhead_stroke: NoneValueType | Color | None = black, arrowhead_stroke_width: float | None = 1.25, *, id_: str = make_uuid4_as_str(), layout_elements: tuple[LayoutElement] = tuple(), group_fill: NoneValueType | Color | None = None, group_fill_rule: FillRule | None = None, group_filter: NoneValueType | Filter | None = None, group_font_family: str | None = None, group_font_size: float | None = None, group_font_style: FontStyle | None = None, group_font_weight: FontWeight | float | None = None, group_stroke: NoneValueType | Color | None = None, group_stroke_dasharray: NoneValueType | tuple[float, ...] | None = None, group_stroke_dashoffset: NoneValueType | float | None = None, group_stroke_width: NoneValueType | float | None = None, group_text_anchor: TextAnchor | None = None, group_transform: NoneValueType | tuple[Transformation] | None = None, end_shorten: float = 0.0, fill: NoneValueType | Color | None = None, filter: NoneValueType | Filter | None = None, path_filter: NoneValueType | Filter | None = None, path_stroke_dasharray: NoneValueType | tuple[float, ...] | None = None, path_stroke_dashoffset: NoneValueType | float | None = None, path_transform: NoneValueType | tuple[Transformation] | None = None, stroke: NoneValueType | Color | None = None, stroke_dasharray: NoneValueType | tuple[float] | None = None, stroke_dashoffset: NoneValueType | float | None = None, stroke_width: NoneValueType | float | None = None, segments: tuple[Segment | QuadraticBezierCurve | CubicBezierCurve | EllipticalArc] = tuple(), source: LayoutElement | None = None, start_shorten: float = 0.0, target: LayoutElement | None = None, transform: NoneValueType | tuple[Transformation] | None = None, arrowhead_filter: NoneValueType | Filter | None = None, arrowhead_stroke_dasharray: NoneValueType | tuple[float, ...] | None = None, arrowhead_stroke_dashoffset: NoneValueType | float | None = None, arrowhead_transform: NoneValueType | tuple[Transformation] | None = None, arrowhead_height: float = 10.0, arrowhead_width: float = 10.0)
Bases: SBGNSingleHeadedArc
Layout for unknown influences.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
id_
|
str
|
The id of the map element. This id is purely for the user to keep track of the element, it does not need to be unique and is not part of the identity of the element, i.e., it is not considered when testing for equality between two map elements or when hashing the map element |
'8f367a75-bed2-4275-b3ec-20298deb7962'
|
layout_elements
|
tuple[LayoutElement]
|
The sub-layout elements of the group layout. These are part of the children of the group layout |
<dynamic>
|
group_fill
|
NoneValueType | Color | None
|
The fill color of the group layout |
None
|
group_fill_rule
|
FillRule | None
|
The fill rule of the group layout |
None
|
group_filter
|
NoneValueType | Filter | None
|
The filter of the group layout |
None
|
group_font_family
|
str | None
|
The font family of the group layout |
None
|
group_font_size
|
float | None
|
The font size of the group layout |
None
|
group_font_style
|
FontStyle | None
|
The font style of the group layout |
None
|
group_font_weight
|
FontWeight | float | None
|
The font weight of the group layout |
None
|
group_stroke
|
NoneValueType | Color | None
|
The stroke color of the group layout |
None
|
group_stroke_dasharray
|
NoneValueType | tuple[float, ...] | None
|
The stroke dasharray of the group layout |
None
|
group_stroke_dashoffset
|
NoneValueType | float | None
|
The stroke dashoffset of the group layout |
None
|
group_stroke_width
|
NoneValueType | float | None
|
The stroke width of the group layout |
None
|
group_text_anchor
|
TextAnchor | None
|
The text anchor of the group layout |
None
|
group_transform
|
NoneValueType | tuple[Transformation] | None
|
The transform of the group layout |
None
|
end_shorten
|
float
|
The length the end of the arc will be shorten by |
0.0
|
fill
|
NoneValueType | Color | None
|
The fill color of the arc |
None
|
filter
|
NoneValueType | Filter | None
|
The fill filter of the arc |
None
|
path_fill
|
NoneValueType | Color | None
|
The path fill color of the arc |
<momapy.drawing.NoneValueType object at 0x7fbe12e88d70>
|
path_filter
|
NoneValueType | Filter | None
|
The path filter of the arc |
None
|
path_stroke
|
NoneValueType | Color | None
|
The path stroke color of the arc |
Color(red=0, green=0, blue=0, alpha=1.0)
|
path_stroke_dasharray
|
NoneValueType | tuple[float, ...] | None
|
The path stroke dasharray of the arc |
None
|
path_stroke_dashoffset
|
NoneValueType | float | None
|
The path stroke dashoffset of the arc |
None
|
path_stroke_width
|
float | None
|
The path stroke width of the arc |
1.25
|
path_transform
|
NoneValueType | tuple[Transformation] | None
|
The path transform of the arc |
None
|
stroke
|
NoneValueType | Color | None
|
The stroke color of the arc |
None
|
stroke_dasharray
|
NoneValueType | tuple[float] | None
|
The stroke dasharray of the arc |
None
|
stroke_dashoffset
|
NoneValueType | float | None
|
The stroke dashoffset of the arc |
None
|
stroke_width
|
NoneValueType | float | None
|
The stroke width of the arc |
None
|
segments
|
tuple[Segment | QuadraticBezierCurve | CubicBezierCurve | EllipticalArc]
|
The path segments of the arc |
<dynamic>
|
source
|
LayoutElement | None
|
The source of the arc |
None
|
start_shorten
|
float
|
The length the start of the arc will be shorten by |
0.0
|
target
|
LayoutElement | None
|
The target of the arc |
None
|
transform
|
NoneValueType | tuple[Transformation] | None
|
The transform of the arc |
None
|
arrowhead_fill
|
NoneValueType | Color | None
|
The arrowhead fill color of the arc |
Color(red=255, green=255, blue=255, alpha=1.0)
|
arrowhead_filter
|
NoneValueType | Filter | None
|
The arrowhead filter of the arc |
None
|
arrowhead_stroke
|
NoneValueType | Color | None
|
The arrowhead stroke color of the arc |
Color(red=0, green=0, blue=0, alpha=1.0)
|
arrowhead_stroke_dasharray
|
NoneValueType | tuple[float, ...] | None
|
The arrowhead stroke dasharray of the arc |
None
|
arrowhead_stroke_dashoffset
|
NoneValueType | float | None
|
The arrowhead stroke dashoffset of the arc |
None
|
arrowhead_stroke_width
|
float | None
|
The arrowhead stroke width of the arc |
1.25
|
arrowhead_transform
|
NoneValueType | tuple[Transformation] | None
|
The arrowhead transform of the arc |
None
|
arrowhead_height
|
float
|
|
10.0
|
arrowhead_width
|
float
|
|
10.0
|
Methods:
| Name | Description |
|---|---|
anchor_point |
Return an anchor point of the layout element |
arrowhead_base |
Return the arrowhead base anchor point of the single-headed arc |
arrowhead_bbox |
Return the bounding box of the single-headed arc arrowhead |
arrowhead_border |
Return the point at the intersection of the drawing elements of the single-headed arc arrowhead and the line going through the center of these drawing elements and the given point. |
arrowhead_drawing_elements |
Return the drawing elements of the single-headed arc arrowhead |
arrowhead_length |
Return the length of the single-headed arc arrowhead |
arrowhead_tip |
Return the arrowhead tip anchor point of the single-headed arc |
bbox |
Compute and return the bounding box of the group layout element |
childless |
Return a copy of the arc with no children |
children |
Return the children of the group layout. |
contains |
Return |
descendants |
Return the descendants of the layout element |
drawing_elements |
Return the drawing elements of the group layout. |
end_point |
Return the ending point of the arc |
equals |
Return |
flattened |
Return a list containing copy of the layout element with no children and all its descendants with no children |
fraction |
Return the position and angle on the arc at a given fraction (of the total arc length) |
length |
Return the total length of the arc path |
own_bbox |
Compute and return the bounding box of the self drawing element of the group layout |
own_children |
Return the self children of the arc |
own_drawing_elements |
Return the self drawing elements of the single-headed arc |
own_to_geometry |
Return a list of geometry primitives from the self drawing elements. |
path_drawing_elements |
Return the drawing elements of the single-headed arc path |
points |
Return the points of the arc path |
start_point |
Return the starting point of the arc |
to_geometry |
Return a list of geometry primitives from the drawing elements. |
anchor_point
anchor_point(anchor_name: str) -> Point
arrowhead_base
arrowhead_base() -> Point
Return the arrowhead base anchor point of the single-headed arc
Source code in src/momapy/core/layout.py
arrowhead_border
arrowhead_border(point) -> Point
Return the point at the intersection of the drawing elements of the single-headed arc arrowhead and the line going through the center of these drawing elements and the given point. When there are multiple intersection points, the one closest to the given point is returned
Source code in src/momapy/core/layout.py
arrowhead_drawing_elements
arrowhead_drawing_elements() -> list[DrawingElement]
Return the drawing elements of the single-headed arc arrowhead
Source code in src/momapy/core/layout.py
arrowhead_length
Return the length of the single-headed arc arrowhead
Source code in src/momapy/core/layout.py
arrowhead_tip
arrowhead_tip() -> Point
Return the arrowhead tip anchor point of the single-headed arc
Source code in src/momapy/core/layout.py
bbox
bbox() -> Bbox
Compute and return the bounding box of the group layout element
Source code in src/momapy/core/layout.py
childless
children
children() -> list[LayoutElement]
Return the children of the group layout.
These are the self children of the group layout (returned by the own_children method) and the other children of the group layout (given by the layout_elements attribute)
Source code in src/momapy/core/layout.py
contains
contains(other: LayoutElement) -> bool
Return true if another layout element is a descendant of the layout element, false otherwise
drawing_elements
drawing_elements() -> list[DrawingElement]
Return the drawing elements of the group layout. The returned drawing elements are a group drawing element formed of the self drawing elements of the group layout and the drawing elements of its children
Source code in src/momapy/core/layout.py
end_point
end_point() -> Point
equals
equals(other: LayoutElement, flattened: bool = False, unordered: bool = False) -> bool
Return true if the layout element is equal to another layout element, false otherwise
Source code in src/momapy/core/elements.py
flattened
flattened() -> list[LayoutElement]
Return a list containing copy of the layout element with no children and all its descendants with no children
Source code in src/momapy/core/elements.py
fraction
fraction(fraction: float) -> tuple[Point, float]
Return the position and angle on the arc at a given fraction (of the total arc length)
Source code in src/momapy/core/layout.py
length
own_bbox
own_bbox() -> Bbox
Compute and return the bounding box of the self drawing element of the group layout
Source code in src/momapy/core/layout.py
own_children
own_children() -> list[LayoutElement]
own_drawing_elements
own_drawing_elements() -> list[DrawingElement]
Return the self drawing elements of the single-headed arc
Source code in src/momapy/core/layout.py
own_to_geometry
own_to_geometry() -> list[Segment | QuadraticBezierCurve | CubicBezierCurve | EllipticalArc]
Return a list of geometry primitives from the self drawing elements.
Source code in src/momapy/core/layout.py
path_drawing_elements
path_drawing_elements() -> list[Path]
Return the drawing elements of the single-headed arc path
Source code in src/momapy/core/layout.py
points
points() -> list[Point]
start_point
start_point() -> Point
to_geometry
to_geometry() -> list[Segment | QuadraticBezierCurve | CubicBezierCurve | EllipticalArc]
Return a list of geometry primitives from the drawing elements.
Source code in src/momapy/core/elements.py
UnspecifiedEntityUnitOfInformation
dataclass
Bases: UnitOfInformation
Unit of information typing a biological activity as an unspecified entity.
Used when the underlying entity class is unknown or deliberately abstract.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
id_
|
str
|
The id of the map element. This id is purely for the user to keep track of the element, it does not need to be unique and is not part of the identity of the element, i.e., it is not considered when testing for equality between two map elements or when hashing the map element |
'28032779-72ca-4d3b-aa55-724f264fb270'
|
label
|
str | None
|
|
None
|
Methods:
| Name | Description |
|---|---|
descendants |
Return every |
descendants
descendants() -> list[ModelElement]
Return every ModelElement reachable from self, excluding self.
Walks scalar ModelElement fields and frozenset/tuple
containers, deduplicating by object identity.
Returns:
| Type | Description |
|---|---|
list[ModelElement]
|
The list of reachable |
list[ModelElement]
|
order, without |
Source code in src/momapy/core/elements.py
UnspecifiedEntityUnitOfInformationLayout
dataclass
UnspecifiedEntityUnitOfInformationLayout(fill: NoneValueType | Color | None = white, stroke: NoneValueType | Color | None = black, stroke_width: float | None = 1.25, *, id_: str = make_uuid4_as_str(), layout_elements: tuple[LayoutElement] = tuple(), group_fill: NoneValueType | Color | None = None, group_fill_rule: FillRule | None = None, group_filter: NoneValueType | Filter | None = None, group_font_family: str | None = None, group_font_size: float | None = None, group_font_style: FontStyle | None = None, group_font_weight: FontWeight | float | None = None, group_stroke: NoneValueType | Color | None = None, group_stroke_dasharray: NoneValueType | tuple[float, ...] | None = None, group_stroke_dashoffset: NoneValueType | float | None = None, group_stroke_width: NoneValueType | float | None = None, group_text_anchor: TextAnchor | None = None, group_transform: NoneValueType | tuple[Transformation] | None = None, filter: NoneValueType | Filter | None = None, height: float = 12.0, label: TextLayout | None = None, position: Point, stroke_dasharray: NoneValueType | tuple[float, ...] | None = None, stroke_dashoffset: NoneValueType | float | None = None, transform: NoneValueType | tuple[Transformation] | None = None, width: float = 12.0)
Bases: _SimpleMixin, SBGNNode
Layout for unspecified entity units of information.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
id_
|
str
|
The id of the map element. This id is purely for the user to keep track of the element, it does not need to be unique and is not part of the identity of the element, i.e., it is not considered when testing for equality between two map elements or when hashing the map element |
'a00b50f6-590e-4172-aefc-5f3c96bf1080'
|
layout_elements
|
tuple[LayoutElement]
|
The sub-layout elements of the group layout. These are part of the children of the group layout |
<dynamic>
|
group_fill
|
NoneValueType | Color | None
|
The fill color of the group layout |
None
|
group_fill_rule
|
FillRule | None
|
The fill rule of the group layout |
None
|
group_filter
|
NoneValueType | Filter | None
|
The filter of the group layout |
None
|
group_font_family
|
str | None
|
The font family of the group layout |
None
|
group_font_size
|
float | None
|
The font size of the group layout |
None
|
group_font_style
|
FontStyle | None
|
The font style of the group layout |
None
|
group_font_weight
|
FontWeight | float | None
|
The font weight of the group layout |
None
|
group_stroke
|
NoneValueType | Color | None
|
The stroke color of the group layout |
None
|
group_stroke_dasharray
|
NoneValueType | tuple[float, ...] | None
|
The stroke dasharray of the group layout |
None
|
group_stroke_dashoffset
|
NoneValueType | float | None
|
The stroke dashoffset of the group layout |
None
|
group_stroke_width
|
NoneValueType | float | None
|
The stroke width of the group layout |
None
|
group_text_anchor
|
TextAnchor | None
|
The text anchor of the group layout |
None
|
group_transform
|
NoneValueType | tuple[Transformation] | None
|
The transform of the group layout |
None
|
fill
|
NoneValueType | Color | None
|
The fill color of the node |
Color(red=255, green=255, blue=255, alpha=1.0)
|
filter
|
NoneValueType | Filter | None
|
The filter of the node |
None
|
height
|
float
|
The height of the node |
12.0
|
label
|
TextLayout | None
|
The label of the node |
None
|
position
|
Point
|
The position of the node |
required |
stroke
|
NoneValueType | Color | None
|
The stroke color of the node |
Color(red=0, green=0, blue=0, alpha=1.0)
|
stroke_dasharray
|
NoneValueType | tuple[float, ...] | None
|
The stroke dasharray of the node |
None
|
stroke_dashoffset
|
NoneValueType | float | None
|
The stroke dashoffset of the node |
None
|
stroke_width
|
float | None
|
The stroke width of the node |
1.25
|
transform
|
NoneValueType | tuple[Transformation] | None
|
The transform of the node |
None
|
width
|
float
|
The width width of the node |
12.0
|
Methods:
| Name | Description |
|---|---|
anchor_point |
Return an anchor point of the layout element |
angle |
Return the point on the border of the node that intersects the drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal. |
bbox |
Compute and return the bounding box of the group layout element |
border |
Return the point on the border of the node that intersects the drawing elements of the node with the line formed of the center anchor point of the node and the given point. |
center |
Return the center anchor of the node |
childless |
Return a copy of the node with no children |
children |
Return the children of the group layout. |
contains |
Return |
descendants |
Return the descendants of the layout element |
drawing_elements |
Return the drawing elements of the group layout. |
east |
Return the east anchor of the node |
east_north_east |
Return the east north east anchor of the node |
east_south_east |
Return the east south east west anchor of the node |
equals |
Return |
flattened |
Return a list containing copy of the layout element with no children and all its descendants with no children |
label_center |
Return the label center anchor of the node |
north |
Return the north anchor of the node |
north_east |
Return the north east anchor of the node |
north_north_east |
Return the north north east anchor of the node |
north_north_west |
Return the north north west anchor of the node |
north_west |
Return the north west anchor of the node |
own_angle |
Return the point on the border of the node that intersects the self drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal. |
own_bbox |
Compute and return the bounding box of the self drawing element of the group layout |
own_border |
Return the point on the border of the node that intersects the self drawing elements of the node with the line formed of the center anchor point of the node and the given point. |
own_children |
Return the self children of the node. A node has unique child that is its label |
own_drawing_elements |
Return the node's own drawing elements |
own_to_geometry |
Return a list of geometry primitives from the self drawing elements. |
size |
Return the size of the node |
south |
Return the south anchor of the node |
south_east |
Return the south east anchor of the node |
south_south_east |
Return the south south east anchor of the node |
south_south_west |
Return the south south west anchor of the node |
south_west |
Return the south west anchor of the node |
to_geometry |
Return a list of geometry primitives from the drawing elements. |
west |
Return the west anchor of the node |
west_north_west |
Return the west north west anchor of the node |
west_south_west |
Return the west south west anchor of the node |
Attributes:
| Name | Type | Description |
|---|---|---|
x |
float
|
Return the x coordinate of the node |
y |
float
|
Return the y coordinate of the node |
anchor_point
anchor_point(anchor_name: str) -> Point
angle
angle(angle: float, unit: Literal['degrees', 'radians'] = 'degrees') -> Point | None
Return the point on the border of the node that intersects the drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.
Source code in src/momapy/core/layout.py
bbox
bbox() -> Bbox
Compute and return the bounding box of the group layout element
Source code in src/momapy/core/layout.py
border
Return the point on the border of the node that intersects the drawing elements of the node with the line formed of the center anchor point of the node and the given point. When there are multiple intersection points, the one closest to the given point is returned
Source code in src/momapy/core/layout.py
center
center() -> Point
childless
children
children() -> list[LayoutElement]
Return the children of the group layout.
These are the self children of the group layout (returned by the own_children method) and the other children of the group layout (given by the layout_elements attribute)
Source code in src/momapy/core/layout.py
contains
contains(other: LayoutElement) -> bool
Return true if another layout element is a descendant of the layout element, false otherwise
drawing_elements
drawing_elements() -> list[DrawingElement]
Return the drawing elements of the group layout. The returned drawing elements are a group drawing element formed of the self drawing elements of the group layout and the drawing elements of its children
Source code in src/momapy/core/layout.py
east
east() -> Point
east_north_east
east_north_east() -> Point
Return the east north east anchor of the node
Source code in src/momapy/core/layout.py
east_south_east
east_south_east() -> Point
Return the east south east west anchor of the node
Source code in src/momapy/core/layout.py
equals
equals(other: LayoutElement, flattened: bool = False, unordered: bool = False) -> bool
Return true if the layout element is equal to another layout element, false otherwise
Source code in src/momapy/core/elements.py
flattened
flattened() -> list[LayoutElement]
Return a list containing copy of the layout element with no children and all its descendants with no children
Source code in src/momapy/core/elements.py
label_center
label_center() -> Point
north
north() -> Point
north_east
north_east() -> Point
Return the north east anchor of the node
Source code in src/momapy/core/layout.py
north_north_east
north_north_east() -> Point
Return the north north east anchor of the node
Source code in src/momapy/core/layout.py
north_north_west
north_north_west() -> Point
Return the north north west anchor of the node
Source code in src/momapy/core/layout.py
north_west
north_west() -> Point
Return the north west anchor of the node
Source code in src/momapy/core/layout.py
own_angle
own_angle(angle: float, unit: Literal['degrees', 'radians'] = 'degrees') -> Point | None
Return the point on the border of the node that intersects the self drawing elements of the node with the line passing through the center anchor point of the node and at a given angle from the horizontal.
Source code in src/momapy/core/layout.py
own_bbox
own_bbox() -> Bbox
Compute and return the bounding box of the self drawing element of the group layout
Source code in src/momapy/core/layout.py
own_border
Return the point on the border of the node that intersects the self drawing elements of the node with the line formed of the center anchor point of the node and the given point. When there are multiple intersection points, the one closest to the given point is returned
Source code in src/momapy/core/layout.py
own_children
own_children() -> list[LayoutElement]
Return the self children of the node. A node has unique child that is its label
own_drawing_elements
own_drawing_elements() -> list[DrawingElement]
Return the node's own drawing elements
Source code in src/momapy/core/layout.py
own_to_geometry
own_to_geometry() -> list[Segment | QuadraticBezierCurve | CubicBezierCurve | EllipticalArc]
Return a list of geometry primitives from the self drawing elements.
Source code in src/momapy/core/layout.py
size
south
south() -> Point
south_east
south_east() -> Point
Return the south east anchor of the node
Source code in src/momapy/core/layout.py
south_south_east
south_south_east() -> Point
Return the south south east anchor of the node
Source code in src/momapy/core/layout.py
south_south_west
south_south_west() -> Point
Return the south south west anchor of the node
Source code in src/momapy/core/layout.py
south_west
south_west() -> Point
Return the south west anchor of the node
Source code in src/momapy/core/layout.py
to_geometry
to_geometry() -> list[Segment | QuadraticBezierCurve | CubicBezierCurve | EllipticalArc]
Return a list of geometry primitives from the drawing elements.
Source code in src/momapy/core/elements.py
west
west() -> Point
west_north_west
west_north_west() -> Point
Return the west north west anchor of the node
Source code in src/momapy/core/layout.py
west_south_west
west_south_west() -> Point
Return the west south west anchor of the node