diff --git a/PyEnzyme/__init__.py b/PyEnzyme/__init__.py deleted file mode 100644 index 0c47eac..0000000 --- a/PyEnzyme/__init__.py +++ /dev/null @@ -1,3 +0,0 @@ - -__URL__ = "https://github.com/EnzymeML/enzymeml-specifications" -__COMMIT__ = "8246809f84df365e1152d10d4e0335e1c0db90b7" diff --git a/PyEnzyme/core/__init__.py b/PyEnzyme/core/__init__.py deleted file mode 100644 index 9b5b43f..0000000 --- a/PyEnzyme/core/__init__.py +++ /dev/null @@ -1,38 +0,0 @@ -from .enzymemldocument import EnzymeMLDocument -from .creator import Creator -from .vessel import Vessel -from .abstractspecies import AbstractSpecies -from .protein import Protein -from .complex import Complex -from .reactant import Reactant -from .reaction import Reaction -from .reactionelement import ReactionElement -from .kineticmodel import KineticModel -from .kineticparameter import KineticParameter -from .measurement import Measurement -from .measurementdata import MeasurementData -from .replicate import Replicate -from .file import File -from .sboterm import SBOTerm -from .datatypes import DataTypes - -__doc__ = "" -__all__ = [ - "EnzymeMLDocument", - "Creator", - "Vessel", - "AbstractSpecies", - "Protein", - "Complex", - "Reactant", - "Reaction", - "ReactionElement", - "KineticModel", - "KineticParameter", - "Measurement", - "MeasurementData", - "Replicate", - "File", - "SBOTerm", - "DataTypes", -] diff --git a/PyEnzyme/core/abstractspecies.py b/PyEnzyme/core/abstractspecies.py deleted file mode 100644 index a20607d..0000000 --- a/PyEnzyme/core/abstractspecies.py +++ /dev/null @@ -1,102 +0,0 @@ -import sdRDM - -from typing import Optional, Union -from pydantic import PrivateAttr, Field, validator -from sdRDM.base.utils import forge_signature, IDGenerator -from .vessel import Vessel - - -@forge_signature -class AbstractSpecies(sdRDM.DataModel): - """This object is used to inherit basic attributes common to all species used in the data model.""" - - id: Optional[str] = Field( - description="Unique identifier of the given object.", - default_factory=IDGenerator("abstractspeciesINDEX"), - xml="@id", - ) - - name: str = Field( - ..., - description="None", - ) - - vessel_id: Union[Vessel, str] = Field( - ..., - reference="Vessel.id", - description="None", - ) - - init_conc: Optional[float] = Field( - default=None, - description="None", - ) - - constant: bool = Field( - ..., - description="None", - ) - - unit: Optional[str] = Field( - default=None, - description="None", - ) - - uri: Optional[str] = Field( - default=None, - description="None", - ) - - creator_id: Optional[str] = Field( - default=None, - description="None", - ) - __repo__: Optional[str] = PrivateAttr( - default="https://github.com/EnzymeML/enzymeml-specifications" - ) - __commit__: Optional[str] = PrivateAttr( - default="8246809f84df365e1152d10d4e0335e1c0db90b7" - ) - - @validator("vessel_id") - def get_vessel_id_reference(cls, value): - """Extracts the ID from a given object to create a reference""" - from .vessel import Vessel - - if isinstance(value, Vessel): - return value.id - elif isinstance(value, str): - return value - else: - raise TypeError( - f"Expected types [Vessel, str] got '{type(value).__name__}' instead." - ) - - @validator("vessel_id") - def get_vessel_id_reference(cls, value): - """Extracts the ID from a given object to create a reference""" - from .vessel import Vessel - - if isinstance(value, Vessel): - return value.id - elif isinstance(value, str): - return value - else: - raise TypeError( - f"Expected types [Vessel, str] got '{type(value).__name__}' instead." - ) - - @validator("vessel_id") - def get_vessel_id_reference(cls, value): - """Extracts the ID from a given object to create a reference""" - - from .vessel import Vessel - - if isinstance(value, Vessel): - return value.id - elif isinstance(value, str): - return value - else: - raise TypeError( - f"Expected types [Vessel, str] got '{type(value).__name__}' instead." - ) diff --git a/PyEnzyme/core/complex.py b/PyEnzyme/core/complex.py deleted file mode 100644 index abdeeb2..0000000 --- a/PyEnzyme/core/complex.py +++ /dev/null @@ -1,35 +0,0 @@ - -from typing import List, Optional -from pydantic import Field, PrivateAttr -from sdRDM.base.listplus import ListPlus -from sdRDM.base.utils import forge_signature, IDGenerator -from .sboterm import SBOTerm -from .abstractspecies import AbstractSpecies - - -@forge_signature -class Complex(AbstractSpecies): - """This object describes complexes made of reactants and/or proteins that were used or produced in the course of the experiment.""" - - id: Optional[str] = Field( - description="Unique identifier of the given object.", - default_factory=IDGenerator("complexINDEX"), - xml="@id", - ) - - participants: List[str] = Field( - default_factory=ListPlus, - multiple=True, - description="Array of IDs the complex contains", - ) - - ontology: SBOTerm = Field( - description="None", - default=SBOTerm.MACROMOLECULAR_COMPLEX, - ) - __repo__: Optional[str] = PrivateAttr( - default="https://github.com/EnzymeML/enzymeml-specifications" - ) - __commit__: Optional[str] = PrivateAttr( - default="8246809f84df365e1152d10d4e0335e1c0db90b7" - ) diff --git a/PyEnzyme/core/creator.py b/PyEnzyme/core/creator.py deleted file mode 100644 index afb1bd2..0000000 --- a/PyEnzyme/core/creator.py +++ /dev/null @@ -1,37 +0,0 @@ -import sdRDM - -from typing import Optional -from pydantic import Field, PrivateAttr -from sdRDM.base.utils import forge_signature, IDGenerator - - -@forge_signature -class Creator(sdRDM.DataModel): - """The creator object contains all information about authors that contributed to the resulting document.""" - - id: Optional[str] = Field( - description="Unique identifier of the given object.", - default_factory=IDGenerator("creatorINDEX"), - xml="@id", - ) - - given_name: str = Field( - ..., - description="Given name of the author or contributor.", - ) - - family_name: str = Field( - ..., - description="Family name of the author or contributor.", - ) - - mail: str = Field( - ..., - description="Email address of the author or contributor.", - ) - __repo__: Optional[str] = PrivateAttr( - default="https://github.com/EnzymeML/enzymeml-specifications" - ) - __commit__: Optional[str] = PrivateAttr( - default="8246809f84df365e1152d10d4e0335e1c0db90b7" - ) diff --git a/PyEnzyme/core/datatypes.py b/PyEnzyme/core/datatypes.py deleted file mode 100644 index 92b2754..0000000 --- a/PyEnzyme/core/datatypes.py +++ /dev/null @@ -1,10 +0,0 @@ -from enum import Enum - - -class DataTypes(Enum): - CONCENTRATION = "conc" - ABSORPTION = "abs" - FEED = "feed" - BIOMASS = "biomass" - CONVERSION = "conversion" - PEAK_AREA = "peak-area" diff --git a/PyEnzyme/core/enzymemldocument.py b/PyEnzyme/core/enzymemldocument.py deleted file mode 100644 index b4ba32e..0000000 --- a/PyEnzyme/core/enzymemldocument.py +++ /dev/null @@ -1,495 +0,0 @@ -import sdRDM - -from typing import List, Optional -from pydantic import Field, PrivateAttr -from sdRDM.base.listplus import ListPlus -from sdRDM.base.utils import forge_signature, IDGenerator -from datetime import datetime as Datetime -from pydantic.types import PositiveFloat -from .reactionelement import ReactionElement -from .reaction import Reaction -from .file import File -from .kineticmodel import KineticModel -from .measurementdata import MeasurementData -from .creator import Creator -from .measurement import Measurement -from .sboterm import SBOTerm -from .kineticparameter import KineticParameter -from .vessel import Vessel -from .protein import Protein -from .complex import Complex -from .reactant import Reactant - - -@forge_signature -class EnzymeMLDocument(sdRDM.DataModel): - """This is the root object that composes all objects found in an EnzymeML document. It also includes general metadata such as the name of the document, when it was created/modified and references to publications, databases and arbitrary links to the web.""" - - id: Optional[str] = Field( - description="Unique identifier of the given object.", - default_factory=IDGenerator("enzymemldocumentINDEX"), - xml="@id", - ) - - name: str = Field( - ..., - description="Title of the EnzymeML Document.", - ) - - pubmedid: Optional[str] = Field( - default=None, - description="Pubmed ID reference.", - ) - - url: Optional[str] = Field( - default=None, - description="Arbitrary type of URL that is related to the EnzymeML document.", - ) - - doi: Optional[str] = Field( - default=None, - description=( - "Digital Object Identifier of the referenced publication or the EnzymeML" - " document." - ), - ) - - created: Optional[Datetime] = Field( - default=None, - description="Date the EnzymeML document was created.", - ) - - modified: Optional[Datetime] = Field( - default=None, - description="Date the EnzymeML document was modified.", - ) - - creators: List[Creator] = Field( - default_factory=ListPlus, - multiple=True, - description="Contains all authors that are part of the experiment.", - ) - - vessels: List[Vessel] = Field( - default_factory=ListPlus, - multiple=True, - description="Contains all vessels that are part of the experiment.", - ) - - proteins: List[Protein] = Field( - default_factory=ListPlus, - multiple=True, - description="Contains all proteins that are part of the experiment.", - ) - - complexes: List[Complex] = Field( - default_factory=ListPlus, - multiple=True, - description="Contains all complexes that are part of the experiment.", - ) - - reactants: List[Reactant] = Field( - default_factory=ListPlus, - multiple=True, - description="Contains all reactants that are part of the experiment.", - ) - - reactions: List[Reaction] = Field( - default_factory=ListPlus, - multiple=True, - description=( - "Dictionary mapping from reaction IDs to reaction describing objects." - ), - ) - - measurements: List[Measurement] = Field( - default_factory=ListPlus, - multiple=True, - description="Contains measurements that describe outcomes of an experiment.", - ) - - files: List[File] = Field( - default_factory=ListPlus, - multiple=True, - description="Contains files attached to the data model.", - ) - - global_parameters: List[KineticParameter] = Field( - default_factory=ListPlus, - multiple=True, - description=( - "Dictionary mapping from parameter IDs to global kinetic parameter" - " describing objects." - ), - ) - __repo__: Optional[str] = PrivateAttr( - default="https://github.com/EnzymeML/enzymeml-specifications" - ) - __commit__: Optional[str] = PrivateAttr( - default="8246809f84df365e1152d10d4e0335e1c0db90b7" - ) - - def add_to_creators( - self, given_name: str, family_name: str, mail: str, id: Optional[str] = None - ) -> None: - """ - This method adds an object of type 'Creator' to attribute creators - - Args: - id (str): Unique identifier of the 'Creator' object. Defaults to 'None'. - given_name (): Given name of the author or contributor.. - family_name (): Family name of the author or contributor.. - mail (): Email address of the author or contributor.. - """ - params = {"given_name": given_name, "family_name": family_name, "mail": mail} - if id is not None: - params["id"] = id - self.creators.append(Creator(**params)) - return self.creators[-1] - - def add_to_vessels( - self, - name: str, - volume: PositiveFloat, - unit: str, - constant: bool = True, - uri: Optional[str] = None, - creator_id: Optional[str] = None, - id: Optional[str] = None, - ) -> None: - """ - This method adds an object of type 'Vessel' to attribute vessels - - Args: - id (str): Unique identifier of the 'Vessel' object. Defaults to 'None'. - name (): Name of the used vessel.. - volume (): Volumetric value of the vessel.. - unit (): Volumetric unit of the vessel.. - constant (): Whether the volume of the vessel is constant or not.. Defaults to True - uri (): URI of the vessel.. Defaults to None - creator_id (): Unique identifier of the author.. Defaults to None - """ - params = { - "name": name, - "volume": volume, - "unit": unit, - "constant": constant, - "uri": uri, - "creator_id": creator_id, - } - if id is not None: - params["id"] = id - self.vessels.append(Vessel(**params)) - return self.vessels[-1] - - def add_to_proteins( - self, - sequence: str, - name: str, - vessel_id: Vessel, - constant: bool, - ecnumber: Optional[str] = None, - organism: Optional[str] = None, - organism_tax_id: Optional[str] = None, - uniprotid: Optional[str] = None, - ontology: SBOTerm = SBOTerm.PROTEIN, - init_conc: Optional[float] = None, - unit: Optional[str] = None, - uri: Optional[str] = None, - creator_id: Optional[str] = None, - id: Optional[str] = None, - ) -> None: - """ - This method adds an object of type 'Protein' to attribute proteins - - Args: - id (str): Unique identifier of the 'Protein' object. Defaults to 'None'. - sequence (): Amino acid sequence of the protein. - name (): None. - vessel_id (): None. - constant (): None. - ecnumber (): EC number of the protein.. Defaults to None - organism (): Organism the protein was expressed in.. Defaults to None - organism_tax_id (): Taxonomy identifier of the expression host.. Defaults to None - uniprotid (): Unique identifier referencing a protein entry at UniProt. Use this identifier to initialize the object from the UniProt database.. Defaults to None - ontology (): None. Defaults to SBOTerm.PROTEIN - init_conc (): None. Defaults to None - unit (): None. Defaults to None - uri (): None. Defaults to None - creator_id (): None. Defaults to None - """ - params = { - "sequence": sequence, - "name": name, - "vessel_id": vessel_id, - "constant": constant, - "ecnumber": ecnumber, - "organism": organism, - "organism_tax_id": organism_tax_id, - "uniprotid": uniprotid, - "ontology": ontology, - "init_conc": init_conc, - "unit": unit, - "uri": uri, - "creator_id": creator_id, - } - if id is not None: - params["id"] = id - self.proteins.append(Protein(**params)) - return self.proteins[-1] - - def add_to_complexes( - self, - name: str, - vessel_id: Vessel, - constant: bool, - participants: List[str] = ListPlus(), - ontology: SBOTerm = SBOTerm.MACROMOLECULAR_COMPLEX, - init_conc: Optional[float] = None, - unit: Optional[str] = None, - uri: Optional[str] = None, - creator_id: Optional[str] = None, - id: Optional[str] = None, - ) -> None: - """ - This method adds an object of type 'Complex' to attribute complexes - - Args: - id (str): Unique identifier of the 'Complex' object. Defaults to 'None'. - name (): None. - vessel_id (): None. - constant (): None. - participants (): Array of IDs the complex contains. Defaults to ListPlus() - ontology (): None. Defaults to SBOTerm.MACROMOLECULAR_COMPLEX - init_conc (): None. Defaults to None - unit (): None. Defaults to None - uri (): None. Defaults to None - creator_id (): None. Defaults to None - """ - params = { - "name": name, - "vessel_id": vessel_id, - "constant": constant, - "participants": participants, - "ontology": ontology, - "init_conc": init_conc, - "unit": unit, - "uri": uri, - "creator_id": creator_id, - } - if id is not None: - params["id"] = id - self.complexes.append(Complex(**params)) - return self.complexes[-1] - - def add_to_reactants( - self, - name: str, - vessel_id: Vessel, - constant: bool, - smiles: Optional[str] = None, - inchi: Optional[str] = None, - chebi_id: Optional[str] = None, - ontology: SBOTerm = SBOTerm.SMALL_MOLECULE, - init_conc: Optional[float] = None, - unit: Optional[str] = None, - uri: Optional[str] = None, - creator_id: Optional[str] = None, - id: Optional[str] = None, - ) -> None: - """ - This method adds an object of type 'Reactant' to attribute reactants - - Args: - id (str): Unique identifier of the 'Reactant' object. Defaults to 'None'. - name (): None. - vessel_id (): None. - constant (): None. - smiles (): Simplified Molecular Input Line Entry System (SMILES) encoding of the reactant.. Defaults to None - inchi (): International Chemical Identifier (InChI) encoding of the reactant.. Defaults to None - chebi_id (): Unique identifier of the CHEBI database. Use this identifier to initialize the object from the CHEBI database.. Defaults to None - ontology (): None. Defaults to SBOTerm.SMALL_MOLECULE - init_conc (): None. Defaults to None - unit (): None. Defaults to None - uri (): None. Defaults to None - creator_id (): None. Defaults to None - """ - params = { - "name": name, - "vessel_id": vessel_id, - "constant": constant, - "smiles": smiles, - "inchi": inchi, - "chebi_id": chebi_id, - "ontology": ontology, - "init_conc": init_conc, - "unit": unit, - "uri": uri, - "creator_id": creator_id, - } - if id is not None: - params["id"] = id - self.reactants.append(Reactant(**params)) - return self.reactants[-1] - - def add_to_reactions( - self, - name: str, - reversible: bool = False, - temperature: Optional[float] = None, - temperature_unit: Optional[str] = None, - ph: Optional[float] = None, - ontology: SBOTerm = SBOTerm.BIOCHEMICAL_REACTION, - uri: Optional[str] = None, - creator_id: Optional[str] = None, - model: Optional[KineticModel] = None, - educts: List[ReactionElement] = ListPlus(), - products: List[ReactionElement] = ListPlus(), - modifiers: List[ReactionElement] = ListPlus(), - id: Optional[str] = None, - ) -> None: - """ - This method adds an object of type 'Reaction' to attribute reactions - - Args: - id (str): Unique identifier of the 'Reaction' object. Defaults to 'None'. - name (): Name of the reaction.. - reversible (): Whether the reaction is reversible or irreversible. Defaults to False - temperature (): Numeric value of the temperature of the reaction.. Defaults to None - temperature_unit (): Unit of the temperature of the reaction.. Defaults to None - ph (): PH value of the reaction.. Defaults to None - ontology (): Ontology defining the role of the given species.. Defaults to SBOTerm.BIOCHEMICAL_REACTION - uri (): URI of the reaction.. Defaults to None - creator_id (): Unique identifier of the author.. Defaults to None - model (): Kinetic model decribing the reaction.. Defaults to None - educts (): List of educts containing ReactionElement objects.. Defaults to ListPlus() - products (): List of products containing ReactionElement objects.. Defaults to ListPlus() - modifiers (): List of modifiers (Proteins, snhibitors, stimulators) containing ReactionElement objects.. Defaults to ListPlus() - """ - params = { - "name": name, - "reversible": reversible, - "temperature": temperature, - "temperature_unit": temperature_unit, - "ph": ph, - "ontology": ontology, - "uri": uri, - "creator_id": creator_id, - "model": model, - "educts": educts, - "products": products, - "modifiers": modifiers, - } - if id is not None: - params["id"] = id - self.reactions.append(Reaction(**params)) - return self.reactions[-1] - - def add_to_measurements( - self, - name: str, - temperature: float, - temperature_unit: str, - ph: float, - global_time_unit: str, - species: List[MeasurementData] = ListPlus(), - global_time: List[float] = ListPlus(), - uri: Optional[str] = None, - creator_id: Optional[str] = None, - id: Optional[str] = None, - ) -> None: - """ - This method adds an object of type 'Measurement' to attribute measurements - - Args: - id (str): Unique identifier of the 'Measurement' object. Defaults to 'None'. - name (): Name of the measurement. - temperature (): Numeric value of the temperature of the reaction.. - temperature_unit (): Unit of the temperature of the reaction.. - ph (): PH value of the reaction.. - global_time_unit (): Unit of the global time.. - species (): Species of the measurement.. Defaults to ListPlus() - global_time (): Global time of the measurement all replicates agree on.. Defaults to ListPlus() - uri (): URI of the reaction.. Defaults to None - creator_id (): Unique identifier of the author.. Defaults to None - """ - params = { - "name": name, - "temperature": temperature, - "temperature_unit": temperature_unit, - "ph": ph, - "global_time_unit": global_time_unit, - "species": species, - "global_time": global_time, - "uri": uri, - "creator_id": creator_id, - } - if id is not None: - params["id"] = id - self.measurements.append(Measurement(**params)) - return self.measurements[-1] - - def add_to_files( - self, name: str, content: bytes, filetype: str, id: Optional[str] = None - ) -> None: - """ - This method adds an object of type 'File' to attribute files - - Args: - id (str): Unique identifier of the 'File' object. Defaults to 'None'. - name (): Name of the file. - content (): Contents of the file. - filetype (): Type of the file such as .xml, .json and so on. - """ - params = {"name": name, "content": content, "filetype": filetype} - if id is not None: - params["id"] = id - self.files.append(File(**params)) - return self.files[-1] - - def add_to_global_parameters( - self, - name: str, - value: float, - unit: str, - initial_value: Optional[float] = None, - upper: Optional[float] = None, - lower: Optional[float] = None, - is_global: bool = False, - stdev: Optional[float] = None, - constant: bool = False, - ontology: Optional[SBOTerm] = None, - id: Optional[str] = None, - ) -> None: - """ - This method adds an object of type 'KineticParameter' to attribute global_parameters - - Args: - id (str): Unique identifier of the 'KineticParameter' object. Defaults to 'None'. - name (): Name of the estimated parameter.. - value (): Numerical value of the estimated parameter.. - unit (): Unit of the estimated parameter.. - initial_value (): Initial value that was used for the parameter estimation.. Defaults to None - upper (): Upper bound of the estimated parameter.. Defaults to None - lower (): Lower bound of the estimated parameter.. Defaults to None - is_global (): Specifies if this parameter is a global parameter.. Defaults to False - stdev (): Standard deviation of the estimated parameter.. Defaults to None - constant (): Specifies if this parameter is constant. Defaults to False - ontology (): Type of the estimated parameter.. Defaults to None - """ - params = { - "name": name, - "value": value, - "unit": unit, - "initial_value": initial_value, - "upper": upper, - "lower": lower, - "is_global": is_global, - "stdev": stdev, - "constant": constant, - "ontology": ontology, - } - if id is not None: - params["id"] = id - self.global_parameters.append(KineticParameter(**params)) - return self.global_parameters[-1] diff --git a/PyEnzyme/core/file.py b/PyEnzyme/core/file.py deleted file mode 100644 index fb9767e..0000000 --- a/PyEnzyme/core/file.py +++ /dev/null @@ -1,37 +0,0 @@ -import sdRDM - -from typing import Optional -from pydantic import Field, PrivateAttr -from sdRDM.base.utils import forge_signature, IDGenerator - - -@forge_signature -class File(sdRDM.DataModel): - """This objects contains a files that has been attached to the document.""" - - id: Optional[str] = Field( - description="Unique identifier of the given object.", - default_factory=IDGenerator("fileINDEX"), - xml="@id", - ) - - name: str = Field( - ..., - description="Name of the file", - ) - - content: bytes = Field( - ..., - description="Contents of the file", - ) - - filetype: str = Field( - ..., - description="Type of the file such as .xml, .json and so on", - ) - __repo__: Optional[str] = PrivateAttr( - default="https://github.com/EnzymeML/enzymeml-specifications" - ) - __commit__: Optional[str] = PrivateAttr( - default="8246809f84df365e1152d10d4e0335e1c0db90b7" - ) diff --git a/PyEnzyme/core/kineticmodel.py b/PyEnzyme/core/kineticmodel.py deleted file mode 100644 index 87c7c01..0000000 --- a/PyEnzyme/core/kineticmodel.py +++ /dev/null @@ -1,93 +0,0 @@ -import sdRDM - -from typing import List, Optional -from pydantic import Field, PrivateAttr -from sdRDM.base.listplus import ListPlus -from sdRDM.base.utils import forge_signature, IDGenerator -from .sboterm import SBOTerm -from .kineticparameter import KineticParameter - - -@forge_signature -class KineticModel(sdRDM.DataModel): - """This object describes a kinetic model that was derived from the experiment.""" - - id: Optional[str] = Field( - description="Unique identifier of the given object.", - default_factory=IDGenerator("kineticmodelINDEX"), - xml="@id", - ) - - name: str = Field( - ..., - description="Name of the kinetic law.", - ) - - equation: str = Field( - ..., - description="Equation for the kinetic law.", - ) - - parameters: List[KineticParameter] = Field( - default_factory=ListPlus, - multiple=True, - description="List of estimated parameters.", - ) - - ontology: Optional[SBOTerm] = Field( - default=None, - description="Type of the estimated parameter.", - ) - __repo__: Optional[str] = PrivateAttr( - default="https://github.com/EnzymeML/enzymeml-specifications" - ) - __commit__: Optional[str] = PrivateAttr( - default="8246809f84df365e1152d10d4e0335e1c0db90b7" - ) - - def add_to_parameters( - self, - name: str, - value: float, - unit: str, - initial_value: Optional[float] = None, - upper: Optional[float] = None, - lower: Optional[float] = None, - is_global: bool = False, - stdev: Optional[float] = None, - constant: bool = False, - ontology: Optional[SBOTerm] = None, - id: Optional[str] = None, - ) -> None: - """ - This method adds an object of type 'KineticParameter' to attribute parameters - - Args: - id (str): Unique identifier of the 'KineticParameter' object. Defaults to 'None'. - name (): Name of the estimated parameter.. - value (): Numerical value of the estimated parameter.. - unit (): Unit of the estimated parameter.. - initial_value (): Initial value that was used for the parameter estimation.. Defaults to None - upper (): Upper bound of the estimated parameter.. Defaults to None - lower (): Lower bound of the estimated parameter.. Defaults to None - is_global (): Specifies if this parameter is a global parameter.. Defaults to False - stdev (): Standard deviation of the estimated parameter.. Defaults to None - constant (): Specifies if this parameter is constant. Defaults to False - ontology (): Type of the estimated parameter.. Defaults to None - """ - params = { - "name": name, - "value": value, - "unit": unit, - "initial_value": initial_value, - "upper": upper, - "lower": lower, - "is_global": is_global, - "stdev": stdev, - "constant": constant, - "ontology": ontology, - } - if id is not None: - params["id"] = id - self.parameters.append(KineticParameter(**params)) - return self.parameters[-1] diff --git a/PyEnzyme/core/kineticparameter.py b/PyEnzyme/core/kineticparameter.py deleted file mode 100644 index f7d0cbe..0000000 --- a/PyEnzyme/core/kineticparameter.py +++ /dev/null @@ -1,73 +0,0 @@ -import sdRDM - -from typing import Optional -from pydantic import Field, PrivateAttr -from sdRDM.base.utils import forge_signature, IDGenerator -from .sboterm import SBOTerm - - -@forge_signature -class KineticParameter(sdRDM.DataModel): - """This object describes the parameters of the kinetic model and can include all estimated values.""" - - id: Optional[str] = Field( - description="Unique identifier of the given object.", - default_factory=IDGenerator("kineticparameterINDEX"), - xml="@id", - ) - - name: str = Field( - ..., - description="Name of the estimated parameter.", - ) - - value: float = Field( - ..., - description="Numerical value of the estimated parameter.", - ) - - unit: str = Field( - ..., - description="Unit of the estimated parameter.", - ) - - initial_value: Optional[float] = Field( - default=None, - description="Initial value that was used for the parameter estimation.", - ) - - upper: Optional[float] = Field( - default=None, - description="Upper bound of the estimated parameter.", - ) - - lower: Optional[float] = Field( - default=None, - description="Lower bound of the estimated parameter.", - ) - - is_global: bool = Field( - description="Specifies if this parameter is a global parameter.", - default=False, - ) - - stdev: Optional[float] = Field( - default=None, - description="Standard deviation of the estimated parameter.", - ) - - constant: bool = Field( - description="Specifies if this parameter is constant", - default=False, - ) - - ontology: Optional[SBOTerm] = Field( - default=None, - description="Type of the estimated parameter.", - ) - __repo__: Optional[str] = PrivateAttr( - default="https://github.com/EnzymeML/enzymeml-specifications" - ) - __commit__: Optional[str] = PrivateAttr( - default="8246809f84df365e1152d10d4e0335e1c0db90b7" - ) diff --git a/PyEnzyme/core/measurement.py b/PyEnzyme/core/measurement.py deleted file mode 100644 index 2721a3c..0000000 --- a/PyEnzyme/core/measurement.py +++ /dev/null @@ -1,109 +0,0 @@ -import sdRDM - -from typing import List, Optional -from pydantic import Field, PrivateAttr -from sdRDM.base.listplus import ListPlus -from sdRDM.base.utils import forge_signature, IDGenerator -from .abstractspecies import AbstractSpecies -from .measurementdata import MeasurementData -from .replicate import Replicate - - -@forge_signature -class Measurement(sdRDM.DataModel): - """This object describes the result of a measurement, which includes time course data of any type defined in DataTypes. It includes initial concentrations of all species used in a single measurement.""" - - id: Optional[str] = Field( - description="Unique identifier of the given object.", - default_factory=IDGenerator("measurementINDEX"), - xml="@id", - ) - - name: str = Field( - ..., - description="Name of the measurement", - ) - - temperature: float = Field( - ..., - description="Numeric value of the temperature of the reaction.", - template_alias="Temperature value", - ) - - temperature_unit: str = Field( - ..., - description="Unit of the temperature of the reaction.", - pattern="kelvin|Kelvin|k|K|celsius|Celsius|C|c", - ) - - ph: float = Field( - ..., - description="PH value of the reaction.", - inclusiveminimum=0, - inclusivemaximum=14, - ) - - species: List[MeasurementData] = Field( - default_factory=ListPlus, - multiple=True, - description="Species of the measurement.", - ) - - global_time: List[float] = Field( - multiple=True, - description="Global time of the measurement all replicates agree on.", - default_factory=ListPlus, - ) - - global_time_unit: str = Field( - ..., - description="Unit of the global time.", - ) - - uri: Optional[str] = Field( - default=None, - description="URI of the reaction.", - ) - - creator_id: Optional[str] = Field( - default=None, - description="Unique identifier of the author.", - ) - __repo__: Optional[str] = PrivateAttr( - default="https://github.com/EnzymeML/enzymeml-specifications" - ) - __commit__: Optional[str] = PrivateAttr( - default="8246809f84df365e1152d10d4e0335e1c0db90b7" - ) - - def add_to_species( - self, - init_conc: float, - unit: str, - measurement_id: str, - species_id: Optional[AbstractSpecies] = None, - replicates: List[Replicate] = ListPlus(), - id: Optional[str] = None, - ) -> None: - """ - This method adds an object of type 'MeasurementData' to attribute species - - Args: - id (str): Unique identifier of the 'MeasurementData' object. Defaults to 'None'. - init_conc (): Initial concentration of the measurement data.. - unit (): The unit of the measurement data.. - measurement_id (): Unique measurement identifier this dataset belongs to.. - species_id (): The identifier for the described reactant.. Defaults to None - replicates (): A list of replicate objects holding raw data of the measurement.. Defaults to ListPlus() - """ - params = { - "init_conc": init_conc, - "unit": unit, - "measurement_id": measurement_id, - "species_id": species_id, - "replicates": replicates, - } - if id is not None: - params["id"] = id - self.species.append(MeasurementData(**params)) - return self.species[-1] diff --git a/PyEnzyme/core/measurementdata.py b/PyEnzyme/core/measurementdata.py deleted file mode 100644 index 50e0ee4..0000000 --- a/PyEnzyme/core/measurementdata.py +++ /dev/null @@ -1,152 +0,0 @@ -import sdRDM - -from typing import Optional, Union, List -from pydantic import PrivateAttr, Field, validator -from sdRDM.base.listplus import ListPlus -from sdRDM.base.utils import forge_signature, IDGenerator -from .abstractspecies import AbstractSpecies -from .datatypes import DataTypes -from .replicate import Replicate - - -@forge_signature -class MeasurementData(sdRDM.DataModel): - """This object describes a single entity of a measurement, which corresponds to one species. It also holds replicates which contain time course data.""" - - id: Optional[str] = Field( - description="Unique identifier of the given object.", - default_factory=IDGenerator("measurementdataINDEX"), - xml="@id", - ) - - init_conc: float = Field( - ..., - description="Initial concentration of the measurement data.", - ) - - unit: str = Field( - ..., - description="The unit of the measurement data.", - ) - - measurement_id: str = Field( - ..., - description="Unique measurement identifier this dataset belongs to.", - ) - - species_id: Union[AbstractSpecies, str, None] = Field( - default=None, - reference="AbstractSpecies.id", - description="The identifier for the described reactant.", - ) - - replicates: List[Replicate] = Field( - default_factory=ListPlus, - multiple=True, - description="A list of replicate objects holding raw data of the measurement.", - ) - __repo__: Optional[str] = PrivateAttr( - default="https://github.com/EnzymeML/enzymeml-specifications" - ) - __commit__: Optional[str] = PrivateAttr( - default="8246809f84df365e1152d10d4e0335e1c0db90b7" - ) - - def add_to_replicates( - self, - species_id: AbstractSpecies, - measurement_id: str, - data_unit: str, - time_unit: str, - data_type: DataTypes = DataTypes.CONCENTRATION, - time: List[float] = ListPlus(), - data: List[float] = ListPlus(), - is_calculated: bool = False, - uri: Optional[str] = None, - creator_id: Optional[str] = None, - id: Optional[str] = None, - ) -> None: - """ - This method adds an object of type 'Replicate' to attribute replicates - - Args: - id (str): Unique identifier of the 'Replicate' object. Defaults to 'None'. - species_id (): Unique identifier of the species that has been measured.. - measurement_id (): Unique identifier of the measurement that the replicate is part of.. - data_unit (): SI unit of the data that was measured.. - time_unit (): Time unit of the replicate.. - data_type (): Type of data that was measured (e.g. concentration). Defaults to DataTypes.CONCENTRATION - time (): Time steps of the replicate.. Defaults to ListPlus() - data (): Data that was measured.. Defaults to ListPlus() - is_calculated (): Whether or not the data has been generated by simulation.. Defaults to False - uri (): URI of the protein.. Defaults to None - creator_id (): Unique identifier of the author.. Defaults to None - """ - params = { - "species_id": species_id, - "measurement_id": measurement_id, - "data_unit": data_unit, - "time_unit": time_unit, - "data_type": data_type, - "time": time, - "data": data, - "is_calculated": is_calculated, - "uri": uri, - "creator_id": creator_id, - } - if id is not None: - params["id"] = id - self.replicates.append(Replicate(**params)) - return self.replicates[-1] - - @validator("species_id") - def get_species_id_reference(cls, value): - """Extracts the ID from a given object to create a reference""" - from .abstractspecies import AbstractSpecies - - if isinstance(value, AbstractSpecies): - return value.id - elif isinstance(value, str): - return value - elif value is None: - return value - else: - raise TypeError( - f"Expected types [AbstractSpecies, str] got '{type(value).__name__}'" - " instead." - ) - - @validator("species_id") - def get_species_id_reference(cls, value): - """Extracts the ID from a given object to create a reference""" - from .abstractspecies import AbstractSpecies - - if isinstance(value, AbstractSpecies): - return value.id - elif isinstance(value, str): - return value - elif value is None: - return value - else: - raise TypeError( - f"Expected types [AbstractSpecies, str] got '{type(value).__name__}'" - " instead." - ) - - @validator("species_id") - def get_species_id_reference(cls, value): - """Extracts the ID from a given object to create a reference""" - - from .abstractspecies import AbstractSpecies - - if isinstance(value, AbstractSpecies): - return value.id - elif isinstance(value, str): - return value - elif value is None: - return value - else: - raise TypeError( - f"Expected types [AbstractSpecies, str] got '{type(value).__name__}'" - " instead." - ) diff --git a/PyEnzyme/core/protein.py b/PyEnzyme/core/protein.py deleted file mode 100644 index 2946dc4..0000000 --- a/PyEnzyme/core/protein.py +++ /dev/null @@ -1,61 +0,0 @@ - -from typing import Optional -from pydantic import Field, PrivateAttr -from sdRDM.base.utils import forge_signature, IDGenerator -from .sboterm import SBOTerm -from .abstractspecies import AbstractSpecies - - -@forge_signature -class Protein(AbstractSpecies): - """This objects describes the proteins that were used or produced in the course of the experiment.""" - - id: Optional[str] = Field( - description="Unique identifier of the given object.", - default_factory=IDGenerator("proteinINDEX"), - xml="@id", - ) - - sequence: str = Field( - ..., - description="Amino acid sequence of the protein", - template_alias="Sequence", - ) - - ecnumber: Optional[str] = Field( - default=None, - description="EC number of the protein.", - pattern="(\\d+.)(\\d+.)(\\d+.)(\\d+)", - template_alias="EC Number", - ) - - organism: Optional[str] = Field( - default=None, - description="Organism the protein was expressed in.", - template_alias="Source organism", - ) - - organism_tax_id: Optional[str] = Field( - default=None, - description="Taxonomy identifier of the expression host.", - ) - - uniprotid: Optional[str] = Field( - default=None, - description=( - "Unique identifier referencing a protein entry at UniProt. Use this" - " identifier to initialize the object from the UniProt database." - ), - template_alias="UniProt ID", - ) - - ontology: SBOTerm = Field( - description="None", - default=SBOTerm.PROTEIN, - ) - __repo__: Optional[str] = PrivateAttr( - default="https://github.com/EnzymeML/enzymeml-specifications" - ) - __commit__: Optional[str] = PrivateAttr( - default="8246809f84df365e1152d10d4e0335e1c0db90b7" - ) diff --git a/PyEnzyme/core/reactant.py b/PyEnzyme/core/reactant.py deleted file mode 100644 index 78fb67f..0000000 --- a/PyEnzyme/core/reactant.py +++ /dev/null @@ -1,53 +0,0 @@ - -from typing import Optional -from pydantic import Field, PrivateAttr -from sdRDM.base.utils import forge_signature, IDGenerator -from .sboterm import SBOTerm -from .abstractspecies import AbstractSpecies - - -@forge_signature -class Reactant(AbstractSpecies): - """This objects describes the reactants that were used or produced in the course of the experiment.""" - - id: Optional[str] = Field( - description="Unique identifier of the given object.", - default_factory=IDGenerator("reactantINDEX"), - xml="@id", - ) - - smiles: Optional[str] = Field( - default=None, - description=( - "Simplified Molecular Input Line Entry System (SMILES) encoding of the" - " reactant." - ), - template_alias="SMILES", - ) - - inchi: Optional[str] = Field( - default=None, - description=( - "International Chemical Identifier (InChI) encoding of the reactant." - ), - template_alias="InCHI", - ) - - chebi_id: Optional[str] = Field( - default=None, - description=( - "Unique identifier of the CHEBI database. Use this identifier to initialize" - " the object from the CHEBI database." - ), - ) - - ontology: SBOTerm = Field( - description="None", - default=SBOTerm.SMALL_MOLECULE, - ) - __repo__: Optional[str] = PrivateAttr( - default="https://github.com/EnzymeML/enzymeml-specifications" - ) - __commit__: Optional[str] = PrivateAttr( - default="8246809f84df365e1152d10d4e0335e1c0db90b7" - ) diff --git a/PyEnzyme/core/reaction.py b/PyEnzyme/core/reaction.py deleted file mode 100644 index c9ac868..0000000 --- a/PyEnzyme/core/reaction.py +++ /dev/null @@ -1,192 +0,0 @@ -import sdRDM - -from typing import List, Optional -from pydantic import Field, PrivateAttr -from sdRDM.base.listplus import ListPlus -from sdRDM.base.utils import forge_signature, IDGenerator -from pydantic.types import PositiveFloat -from .kineticmodel import KineticModel -from .sboterm import SBOTerm -from .abstractspecies import AbstractSpecies -from .reactionelement import ReactionElement - - -@forge_signature -class Reaction(sdRDM.DataModel): - """This object describes a chemical or enzymatic reaction that was investigated in the course of the experiment. All species used within this object need to be part of the data model.""" - - id: Optional[str] = Field( - description="Unique identifier of the given object.", - default_factory=IDGenerator("reactionINDEX"), - xml="@id", - ) - - name: str = Field( - ..., - description="Name of the reaction.", - template_alias="Name", - ) - - reversible: bool = Field( - description="Whether the reaction is reversible or irreversible", - default=False, - template_alias="Reversible", - ) - - temperature: Optional[float] = Field( - default=None, - description="Numeric value of the temperature of the reaction.", - template_alias="Temperature value", - ) - - temperature_unit: Optional[str] = Field( - default=None, - description="Unit of the temperature of the reaction.", - pattern="kelvin|Kelvin|k|K|celsius|Celsius|C|c", - template_alias="Temperature unit", - ) - - ph: Optional[float] = Field( - default=None, - description="PH value of the reaction.", - template_alias="pH value", - inclusiveminimum=0, - inclusivemaximum=14, - ) - - ontology: SBOTerm = Field( - default=SBOTerm.BIOCHEMICAL_REACTION, - description="Ontology defining the role of the given species.", - ) - - uri: Optional[str] = Field( - default=None, - description="URI of the reaction.", - ) - - creator_id: Optional[str] = Field( - default=None, - description="Unique identifier of the author.", - ) - - model: Optional[KineticModel] = Field( - default=None, - description="Kinetic model decribing the reaction.", - ) - - educts: List[ReactionElement] = Field( - default_factory=ListPlus, - multiple=True, - description="List of educts containing ReactionElement objects.", - template_alias="Educts", - ) - - products: List[ReactionElement] = Field( - default_factory=ListPlus, - multiple=True, - description="List of products containing ReactionElement objects.", - template_alias="Products", - ) - - modifiers: List[ReactionElement] = Field( - default_factory=ListPlus, - multiple=True, - description=( - "List of modifiers (Proteins, snhibitors, stimulators) containing" - " ReactionElement objects." - ), - template_alias="Modifiers", - ) - __repo__: Optional[str] = PrivateAttr( - default="https://github.com/EnzymeML/enzymeml-specifications" - ) - __commit__: Optional[str] = PrivateAttr( - default="8246809f84df365e1152d10d4e0335e1c0db90b7" - ) - - def add_to_educts( - self, - species_id: AbstractSpecies, - stoichiometry: PositiveFloat = 1.0, - constant: bool = False, - ontology: Optional[SBOTerm] = None, - id: Optional[str] = None, - ) -> None: - """ - This method adds an object of type 'ReactionElement' to attribute educts - - Args: - id (str): Unique identifier of the 'ReactionElement' object. Defaults to 'None'. - species_id (): Internal identifier to either a protein or reactant defined in the EnzymeMLDocument.. - stoichiometry (): Positive float number representing the associated stoichiometry.. Defaults to 1.0 - constant (): Whether or not the concentration of this species remains constant.. Defaults to False - ontology (): Ontology defining the role of the given species.. Defaults to None - """ - params = { - "species_id": species_id, - "stoichiometry": stoichiometry, - "constant": constant, - "ontology": ontology, - } - if id is not None: - params["id"] = id - self.educts.append(ReactionElement(**params)) - return self.educts[-1] - - def add_to_products( - self, - species_id: AbstractSpecies, - stoichiometry: PositiveFloat = 1.0, - constant: bool = False, - ontology: Optional[SBOTerm] = None, - id: Optional[str] = None, - ) -> None: - """ - This method adds an object of type 'ReactionElement' to attribute products - - Args: - id (str): Unique identifier of the 'ReactionElement' object. Defaults to 'None'. - species_id (): Internal identifier to either a protein or reactant defined in the EnzymeMLDocument.. - stoichiometry (): Positive float number representing the associated stoichiometry.. Defaults to 1.0 - constant (): Whether or not the concentration of this species remains constant.. Defaults to False - ontology (): Ontology defining the role of the given species.. Defaults to None - """ - params = { - "species_id": species_id, - "stoichiometry": stoichiometry, - "constant": constant, - "ontology": ontology, - } - if id is not None: - params["id"] = id - self.products.append(ReactionElement(**params)) - return self.products[-1] - - def add_to_modifiers( - self, - species_id: AbstractSpecies, - stoichiometry: PositiveFloat = 1.0, - constant: bool = False, - ontology: Optional[SBOTerm] = None, - id: Optional[str] = None, - ) -> None: - """ - This method adds an object of type 'ReactionElement' to attribute modifiers - - Args: - id (str): Unique identifier of the 'ReactionElement' object. Defaults to 'None'. - species_id (): Internal identifier to either a protein or reactant defined in the EnzymeMLDocument.. - stoichiometry (): Positive float number representing the associated stoichiometry.. Defaults to 1.0 - constant (): Whether or not the concentration of this species remains constant.. Defaults to False - ontology (): Ontology defining the role of the given species.. Defaults to None - """ - params = { - "species_id": species_id, - "stoichiometry": stoichiometry, - "constant": constant, - "ontology": ontology, - } - if id is not None: - params["id"] = id - self.modifiers.append(ReactionElement(**params)) - return self.modifiers[-1] diff --git a/PyEnzyme/core/reactionelement.py b/PyEnzyme/core/reactionelement.py deleted file mode 100644 index 73bc879..0000000 --- a/PyEnzyme/core/reactionelement.py +++ /dev/null @@ -1,98 +0,0 @@ -import sdRDM - -from typing import Optional, Union -from pydantic import PrivateAttr, Field, validator -from sdRDM.base.utils import forge_signature, IDGenerator -from pydantic.types import PositiveFloat -from .abstractspecies import AbstractSpecies -from .sboterm import SBOTerm - - -@forge_signature -class ReactionElement(sdRDM.DataModel): - """This object is part of the Reaction object and describes either an educt, product or modifier. The latter includes buffers, counter-ions as well as proteins/enzymes.""" - - id: Optional[str] = Field( - description="Unique identifier of the given object.", - default_factory=IDGenerator("reactionelementINDEX"), - xml="@id", - ) - - species_id: Union[AbstractSpecies, str] = Field( - ..., - reference="AbstractSpecies.id", - description=( - "Internal identifier to either a protein or reactant defined in the" - " EnzymeMLDocument." - ), - references="EnzymeMLDocument.reactants.id", - ) - - stoichiometry: PositiveFloat = Field( - description="Positive float number representing the associated stoichiometry.", - default=1.0, - ) - - constant: bool = Field( - description=( - "Whether or not the concentration of this species remains constant." - ), - default=False, - ) - - ontology: Optional[SBOTerm] = Field( - default=None, - description="Ontology defining the role of the given species.", - ) - __repo__: Optional[str] = PrivateAttr( - default="https://github.com/EnzymeML/enzymeml-specifications" - ) - __commit__: Optional[str] = PrivateAttr( - default="8246809f84df365e1152d10d4e0335e1c0db90b7" - ) - - @validator("species_id") - def get_species_id_reference(cls, value): - """Extracts the ID from a given object to create a reference""" - from .abstractspecies import AbstractSpecies - - if isinstance(value, AbstractSpecies): - return value.id - elif isinstance(value, str): - return value - else: - raise TypeError( - f"Expected types [AbstractSpecies, str] got '{type(value).__name__}'" - " instead." - ) - - @validator("species_id") - def get_species_id_reference(cls, value): - """Extracts the ID from a given object to create a reference""" - from .abstractspecies import AbstractSpecies - - if isinstance(value, AbstractSpecies): - return value.id - elif isinstance(value, str): - return value - else: - raise TypeError( - f"Expected types [AbstractSpecies, str] got '{type(value).__name__}'" - " instead." - ) - - @validator("species_id") - def get_species_id_reference(cls, value): - """Extracts the ID from a given object to create a reference""" - - from .abstractspecies import AbstractSpecies - - if isinstance(value, AbstractSpecies): - return value.id - elif isinstance(value, str): - return value - else: - raise TypeError( - f"Expected types [AbstractSpecies, str] got '{type(value).__name__}'" - " instead." - ) diff --git a/PyEnzyme/core/replicate.py b/PyEnzyme/core/replicate.py deleted file mode 100644 index ec045f4..0000000 --- a/PyEnzyme/core/replicate.py +++ /dev/null @@ -1,126 +0,0 @@ -import sdRDM - -from typing import Optional, Union, List -from pydantic import PrivateAttr, Field, validator -from sdRDM.base.listplus import ListPlus -from sdRDM.base.utils import forge_signature, IDGenerator -from .abstractspecies import AbstractSpecies -from .datatypes import DataTypes - - -@forge_signature -class Replicate(sdRDM.DataModel): - """This object contains the measured time course data as well as metadata to the replicate itself.""" - - id: Optional[str] = Field( - description="Unique identifier of the given object.", - default_factory=IDGenerator("replicateINDEX"), - xml="@id", - ) - - species_id: Union[AbstractSpecies, str] = Field( - ..., - reference="AbstractSpecies.id", - description="Unique identifier of the species that has been measured.", - ) - - measurement_id: str = Field( - ..., - description=( - "Unique identifier of the measurement that the replicate is part of." - ), - ) - - data_type: DataTypes = Field( - description="Type of data that was measured (e.g. concentration)", - default=DataTypes.CONCENTRATION, - ) - - data_unit: str = Field( - ..., - description="SI unit of the data that was measured.", - ) - - time_unit: str = Field( - ..., - description="Time unit of the replicate.", - ) - - time: List[float] = Field( - multiple=True, - description="Time steps of the replicate.", - default_factory=ListPlus, - ) - - data: List[float] = Field( - multiple=True, - description="Data that was measured.", - default_factory=ListPlus, - ) - - is_calculated: bool = Field( - description="Whether or not the data has been generated by simulation.", - default=False, - ) - - uri: Optional[str] = Field( - default=None, - description="URI of the protein.", - ) - - creator_id: Optional[str] = Field( - default=None, - description="Unique identifier of the author.", - ) - __repo__: Optional[str] = PrivateAttr( - default="https://github.com/EnzymeML/enzymeml-specifications" - ) - __commit__: Optional[str] = PrivateAttr( - default="8246809f84df365e1152d10d4e0335e1c0db90b7" - ) - - @validator("species_id") - def get_species_id_reference(cls, value): - """Extracts the ID from a given object to create a reference""" - from .abstractspecies import AbstractSpecies - - if isinstance(value, AbstractSpecies): - return value.id - elif isinstance(value, str): - return value - else: - raise TypeError( - f"Expected types [AbstractSpecies, str] got '{type(value).__name__}'" - " instead." - ) - - @validator("species_id") - def get_species_id_reference(cls, value): - """Extracts the ID from a given object to create a reference""" - from .abstractspecies import AbstractSpecies - - if isinstance(value, AbstractSpecies): - return value.id - elif isinstance(value, str): - return value - else: - raise TypeError( - f"Expected types [AbstractSpecies, str] got '{type(value).__name__}'" - " instead." - ) - - @validator("species_id") - def get_species_id_reference(cls, value): - """Extracts the ID from a given object to create a reference""" - - from .abstractspecies import AbstractSpecies - - if isinstance(value, AbstractSpecies): - return value.id - elif isinstance(value, str): - return value - else: - raise TypeError( - f"Expected types [AbstractSpecies, str] got '{type(value).__name__}'" - " instead." - ) diff --git a/PyEnzyme/core/sboterm.py b/PyEnzyme/core/sboterm.py deleted file mode 100644 index 74d2eb6..0000000 --- a/PyEnzyme/core/sboterm.py +++ /dev/null @@ -1,35 +0,0 @@ -from enum import Enum - - -class SBOTerm(Enum): - BIOCHEMICAL_REACTION = "SBO:0000176" - ACID_BASE_REACTION = "SBO:0000208" - CONFORMATIONAL_TRANSITION = "SBO:0000181" - CONVERSION = "SBO:0000182" - DEGRADATION = "SBO:0000179" - DISSOCIATION = "SBO:0000180" - IONISATION = "SBO:0000209" - ISOMERISATION = "SBO:0000377" - NON_COVALENT_BINDING = "SBO:0000177" - REDOX_REACTION = "SBO:0000200" - SPONTANEOUS_REACTION = "SBO:0000672" - PROTEIN = "SBO:0000252" - GENE = "SBO:0000251" - SMALL_MOLECULE = "SBO:0000247" - ION = "SBO:0000327" - RADICAL = "SBO:0000328" - INTERACTOR = "SBO:0000336" - SUBSTRATE = "SBO:0000015" - PRODUCT = "SBO:0000011" - CATALYST = "SBO:0000013" - INHIBITOR = "SBO:0000020" - ESSENTIAL_ACTIVATOR = "SBO:0000461" - NON_ESSENTIAL_ACTIVATOR = "SBO:0000462" - POTENTIATOR = "SBO:0000021" - MACROMOLECULAR_COMPLEX = "SBO:0000296" - PROTEIN_COMPLEX = "SBO:0000297" - DIMER = "SBO:0000607" - MICHAELIS_MENTEN = "SBO:0000028" - K_CAT = "SBO:0000025" - K_M = "SBO:0000027" - V_MAX = "SBO:0000186" diff --git a/PyEnzyme/core/vessel.py b/PyEnzyme/core/vessel.py deleted file mode 100644 index efdc66f..0000000 --- a/PyEnzyme/core/vessel.py +++ /dev/null @@ -1,56 +0,0 @@ -import sdRDM - -from typing import Optional -from pydantic import Field, PrivateAttr -from sdRDM.base.utils import forge_signature, IDGenerator -from pydantic.types import PositiveFloat - - -@forge_signature -class Vessel(sdRDM.DataModel): - """This object describes vessels in which the experiment has been carried out. These can include any type of vessel used in biocatalytic experiments.""" - - id: Optional[str] = Field( - description="Unique identifier of the given object.", - default_factory=IDGenerator("vesselINDEX"), - xml="@id", - ) - - name: str = Field( - ..., - description="Name of the used vessel.", - template_alias="Name", - ) - - volume: PositiveFloat = Field( - ..., - description="Volumetric value of the vessel.", - template_alias="Volume value", - ) - - unit: str = Field( - ..., - description="Volumetric unit of the vessel.", - template_alias="Volume unit", - ) - - constant: bool = Field( - description="Whether the volume of the vessel is constant or not.", - default=True, - ) - - uri: Optional[str] = Field( - default=None, - description="URI of the vessel.", - ) - - creator_id: Optional[str] = Field( - default=None, - description="Unique identifier of the author.", - ) - __repo__: Optional[str] = PrivateAttr( - default="https://github.com/EnzymeML/enzymeml-specifications" - ) - __commit__: Optional[str] = PrivateAttr( - default="8246809f84df365e1152d10d4e0335e1c0db90b7" - ) diff --git a/PyEnzyme/schemes/pyenzyme_schema.md b/PyEnzyme/schemes/pyenzyme_schema.md deleted file mode 100644 index 342982c..0000000 --- a/PyEnzyme/schemes/pyenzyme_schema.md +++ /dev/null @@ -1,223 +0,0 @@ -```mermaid -classDiagram - AbstractSpecies <-- Protein - AbstractSpecies <-- Complex - AbstractSpecies <-- Reactant - EnzymeMLDocument *-- Creator - EnzymeMLDocument *-- Vessel - EnzymeMLDocument *-- Protein - EnzymeMLDocument *-- Complex - EnzymeMLDocument *-- Reactant - EnzymeMLDocument *-- Reaction - EnzymeMLDocument *-- KineticParameter - EnzymeMLDocument *-- Measurement - EnzymeMLDocument *-- File - AbstractSpecies *-- Vessel - Protein *-- SBOTerm - Complex *-- SBOTerm - Reactant *-- SBOTerm - Reaction *-- SBOTerm - Reaction *-- ReactionElement - Reaction *-- KineticModel - ReactionElement *-- SBOTerm - ReactionElement *-- AbstractSpecies - KineticModel *-- SBOTerm - KineticModel *-- KineticParameter - KineticParameter *-- SBOTerm - Measurement *-- MeasurementData - MeasurementData *-- AbstractSpecies - MeasurementData *-- Replicate - Replicate *-- DataTypes - Replicate *-- AbstractSpecies - - class EnzymeMLDocument { - +string name* - +string pubmedid - +string url - +string doi - +datetime created - +datetime modified - +Creator[0..*] creators - +Vessel[0..*] vessels - +Protein[0..*] proteins - +Complex[0..*] complexes - +Reactant[0..*] reactants - +Reaction[0..*] reactions - +Measurement[0..*] measurements - +File[0..*] files - +KineticParameter[0..*] global_parameters - } - - class Creator { - +string given_name* - +string family_name* - +string mail* - } - - class Vessel { - +string name* - +posfloat volume* - +string unit* - +boolean constant* - +string uri - +string creator_id - } - - class AbstractSpecies { - +string name* - +Vessel vessel_id* - +float init_conc - +boolean constant* - +string unit - +string uri - +string creator_id - } - - class Protein { - +string sequence* - +string ecnumber - +string organism - +string organism_tax_id - +string uniprotid - +SBOTerm ontology* - } - - class Complex { - +string[0..*] participants - +SBOTerm ontology* - } - - class Reactant { - +string smiles - +string inchi - +string chebi_id - +SBOTerm ontology* - } - - class Reaction { - +string name* - +bool reversible* - +float temperature - +string temperature_unit - +float ph - +SBOTerm ontology* - +string uri - +string creator_id - +KineticModel model - +ReactionElement[0..*] educts - +ReactionElement[0..*] products - +ReactionElement[0..*] modifiers - } - - class ReactionElement { - +AbstractSpecies species_id* - +posfloat stoichiometry* - +bool constant* - +SBOTerm ontology - } - - class KineticModel { - +string name* - +string equation* - +KineticParameter[0..*] parameters - +SBOTerm ontology - } - - class KineticParameter { - +string name* - +float value* - +string unit* - +float initial_value - +float upper - +float lower - +bool is_global* - +float stdev - +bool constant* - +SBOTerm ontology - } - - class Measurement { - +string name* - +float temperature* - +string temperature_unit* - +float ph* - +MeasurementData[0..*] species - +float[0..*] global_time* - +string global_time_unit* - +string uri - +string creator_id - } - - class MeasurementData { - +float init_conc* - +string unit* - +string measurement_id* - +AbstractSpecies species_id - +Replicate[0..*] replicates - } - - class Replicate { - +AbstractSpecies species_id* - +string measurement_id* - +DataTypes data_type* - +string data_unit* - +string time_unit* - +float[0..*] time* - +float[0..*] data* - +bool is_calculated* - +string uri - +string creator_id - } - - class File { - +string name* - +bytes content* - +string filetype* - } - - class SBOTerm { - << Enumeration >> - +BIOCHEMICAL_REACTION - +ACID_BASE_REACTION - +CONFORMATIONAL_TRANSITION - +CONVERSION - +DEGRADATION - +DISSOCIATION - +IONISATION - +ISOMERISATION - +NON_COVALENT_BINDING - +REDOX_REACTION - +SPONTANEOUS_REACTION - +PROTEIN - +GENE - +SMALL_MOLECULE - +ION - +RADICAL - +INTERACTOR - +SUBSTRATE - +PRODUCT - +CATALYST - +INHIBITOR - +ESSENTIAL_ACTIVATOR - +NON_ESSENTIAL_ACTIVATOR - +POTENTIATOR - +MACROMOLECULAR_COMPLEX - +PROTEIN_COMPLEX - +DIMER - +MICHAELIS_MENTEN - +K_CAT - +K_M - +V_MAX - } - - class DataTypes { - << Enumeration >> - +CONCENTRATION - +ABSORPTION - +FEED - +BIOMASS - +CONVERSION - +PEAK_AREA - } - -``` \ No newline at end of file