src/pybel/struct/graph.py
def add_node_from_data(self, node: BaseEntity) -> None:
        """Add an entity to the graph."""
        assert isinstance(node, BaseEntity)

        if node in self:
            return

        self.add_node(node)

        if isinstance(node, CentralDogma) and node.variants:
            self.add_has_variant(node.get_parent(), node)

        elif isinstance(node, ListAbundance):
            for member in node.members:
                self.add_part_of(member, node)

        elif isinstance(node, Reaction):
            for reactant in node.reactants:
                self.add_has_reactant(node, reactant)
            for product in node.products:
                self.add_has_product(node, product)
Add an entity to the graph.
Add an entity to the graph.
Add an entity to the graph .
def add_node_from_data(self, node: BaseEntity) -> None:
        assert isinstance(node, BaseEntity)
        if node in self:
            return
        self.add_node(node)
        if isinstance(node, CentralDogma) and node.variants:
            self.add_has_variant(node.get_parent(), node)
        elif isinstance(node, ListAbundance):
            for member in node.members:
                self.add_part_of(member, node)
        elif isinstance(node, Reaction):
            for reactant in node.reactants:
                self.add_has_reactant(node, reactant)
            for product in node.products:
                self.add_has_product(node, product)
def add_node_from_data ( self , node : BaseEntity ) -> None : assert isinstance ( node , BaseEntity ) if node in self : return self . add_node ( node ) if isinstance ( node , CentralDogma ) and node . variants : self . add_has_variant ( node . get_parent ( ) , node ) elif isinstance ( node , ListAbundance ) : for member in node . members : self . add_part_of ( member , node ) elif isinstance ( node , Reaction ) : for reactant in node . reactants : self . add_has_reactant ( node , reactant ) for product in node . products : self . add_has_product ( node , product )
Add an entity to the graph.
Add an entity to the graph .
"""Add an entity to the graph."""
self
node
BaseEntity