src/pybel/struct/graph.py
def neighborhood(self, node: BaseEntity) -> BELGraph:
        """Expand around the neighborhood of a given node.

        >>> from pybel.examples import braf_graph
        >>> from pybel.dsl import Protein
        >>> thpo = Protein(namespace='HGNC', name='THPO', identifier='11795')
        >>> braf = Protein(namespace='HGNC', name='BRAF', identifier='1097')
        >>> raf1 = Protein(namespace='HGNC', name='RAF1', identifier='9829')
        >>> elk1 = Protein(namespace='HGNC', name='ELK1', identifier='3321')
        >>> subgraph_1 = braf_graph.induce.paths([braf, elk1])
        >>> assert thpo not in subgraph_1 and raf1 not in subgraph_1
        >>> subgraph_2 = subgraph_1.expand.neighborhood(braf)
        >>> assert thpo in subgraph_2 and raf1 not in subgraph_2
        """
        from .mutation import expand_node_neighborhood
        cp = self.graph.copy()
        expand_node_neighborhood(universe=self.parent, graph=cp, node=node)
        return cp
Expand around the neighborhood of a given node.

        >>> from pybel.examples import braf_graph
        >>> from pybel.dsl import Protein
        >>> thpo = Protein(namespace='HGNC', name='THPO', identifier='11795')
        >>> braf = Protein(namespace='HGNC', name='BRAF', identifier='1097')
        >>> raf1 = Protein(namespace='HGNC', name='RAF1', identifier='9829')
        >>> elk1 = Protein(namespace='HGNC', name='ELK1', identifier='3321')
        >>> subgraph_1 = braf_graph.induce.paths([braf, elk1])
        >>> assert thpo not in subgraph_1 and raf1 not in subgraph_1
        >>> subgraph_2 = subgraph_1.expand.neighborhood(braf)
        >>> assert thpo in subgraph_2 and raf1 not in subgraph_2
        
Expand around the neighborhood of a given node.
Expand around the neighborhood of a given node .
def neighborhood(self, node: BaseEntity) -> BELGraph:
        from .mutation import expand_node_neighborhood
        cp = self.graph.copy()
        expand_node_neighborhood(universe=self.parent, graph=cp, node=node)
        return cp
def neighborhood ( self , node : BaseEntity ) -> BELGraph : from . mutation import expand_node_neighborhood cp = self . graph . copy ( ) expand_node_neighborhood ( universe = self . parent , graph = cp , node = node ) return cp
Expand around the neighborhood of a given node.
Expand around the neighborhood of a given node .
"""Expand around the neighborhood of a given node.

        >>> from pybel.examples import braf_graph
        >>> from pybel.dsl import Protein
        >>> thpo = Protein(namespace='HGNC', name='THPO', identifier='11795')
        >>> braf = Protein(namespace='HGNC', name='BRAF', identifier='1097')
        >>> raf1 = Protein(namespace='HGNC', name='RAF1', identifier='9829')
        >>> elk1 = Protein(namespace='HGNC', name='ELK1', identifier='3321')
        >>> subgraph_1 = braf_graph.induce.paths([braf, elk1])
        >>> assert thpo not in subgraph_1 and raf1 not in subgraph_1
        >>> subgraph_2 = subgraph_1.expand.neighborhood(braf)
        >>> assert thpo in subgraph_2 and raf1 not in subgraph_2
        """
self
node
BaseEntity