:py:mod:`cobra.core.species` ============================ .. py:module:: cobra.core.species .. autoapi-nested-parse:: Define the Species class, used as a base for Gene and Metabolite. Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: cobra.core.species.Species .. py:class:: Species(id: Optional[str] = None, name: Optional[str] = None, **kwargs) Bases: :py:obj:`cobra.core.object.Object` Species is a base class in Cobrapy. Species is a class for holding information regarding a chemical Species :param id: An identifier for the chemical species :type id: string :param name: A human readable name. :type name: string .. py:property:: reactions :type: FrozenSet Return a frozenset of reactions. :returns: A frozenset that includes the reactions of the species. :rtype: FrozenSet .. py:property:: model :type: Optional[cobra.Model] Return the model. :returns: Returns the cobra model that the species is associated with. None if there is no model associated with this species. :rtype: model .. py:method:: __getstate__() -> dict Return the state of the species. Remove the references to container reactions when serializing to avoid problems associated with recursion. :returns: A dictionary describing the state, without the self._reaction to avoid recursion. :rtype: dict .. py:method:: copy() -> Species Copy a species. When copying a reaction, it is necessary to deepcopy the components so the list references aren't carried over. Additionally, a copy of a reaction is no longer in a cobra.Model. This should be fixed with self.__deepcopy__ if possible :returns: A copy of the species. :rtype: Species