src/pybel/dsl/node_classes.py
def with_variants(self, variants: Union[Variant, List[Variant]]) -> 'CentralDogma':
        """Create a new entity with the given variants.

        :param variants: An optional variant or list of variants

        >>> from pybel.dsl import Protein, Fragment
        >>> app = Protein(name='APP', namespace='HGNC')
        >>> ab42 = app.with_variants([Fragment(start=672, stop=713)])
        >>> assert 'p(HGNC:APP, frag(672_713))' == ab42.as_bel()
        """
        return self.__class__(
            namespace=self.namespace,
            name=self.name,
            identifier=self.identifier,
            xrefs=self.xrefs,
            variants=variants,
        )
Create a new entity with the given variants.

        :param variants: An optional variant or list of variants

        >>> from pybel.dsl import Protein, Fragment
        >>> app = Protein(name='APP', namespace='HGNC')
        >>> ab42 = app.with_variants([Fragment(start=672, stop=713)])
        >>> assert 'p(HGNC:APP, frag(672_713))' == ab42.as_bel()
        
Create a new entity with the given variants.
Create a new entity with the given variants .
def with_variants(self, variants: Union[Variant, List[Variant]]) -> 'CentralDogma':
        return self.__class__(
            namespace=self.namespace,
            name=self.name,
            identifier=self.identifier,
            xrefs=self.xrefs,
            variants=variants,
        )
def with_variants ( self , variants : Union [ Variant , List [ Variant ] ] ) -> 'CentralDogma' : return self . __class__ ( namespace = self . namespace , name = self . name , identifier = self . identifier , xrefs = self . xrefs , variants = variants , )
Create a new entity with the given variants.
Create a new entity with the given variants .
"""Create a new entity with the given variants.

        :param variants: An optional variant or list of variants

        >>> from pybel.dsl import Protein, Fragment
        >>> app = Protein(name='APP', namespace='HGNC')
        >>> ab42 = app.with_variants([Fragment(start=672, stop=713)])
        >>> assert 'p(HGNC:APP, frag(672_713))' == ab42.as_bel()
        """
self
variants
Union[Variant, List[Variant]]
An optional variant or list of variants
>>> from pybel.dsl import Protein, Fragment
>>> app = Protein(name='APP', namespace='HGNC')
>>> ab42 = app.with_variants([Fragment(start=672, stop=713)])
>>> assert 'p(HGNC:APP, frag(672_713))' == ab42.as_bel()
An optional variant or list of variants >>> from pybel . dsl import Protein Fragment >>> app = Protein ( name = ' APP ' namespace = ' HGNC ' ) >>> ab42 = app . with_variants ( [ Fragment ( start = 672 stop = 713 ) ] ) >>> assert ' p ( HGNC : APP frag ( 672_713 )) ' == ab42 . as_bel ()