Skip to content

Commit

Permalink
Fixes #33
Browse files Browse the repository at this point in the history
  • Loading branch information
JR-1991 committed Mar 16, 2022
1 parent 0441f29 commit 2629df0
Show file tree
Hide file tree
Showing 35 changed files with 211 additions and 322 deletions.
16 changes: 5 additions & 11 deletions pyenzyme/__init__.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,8 @@
"""
File: __init__.py
Project: pyenzyme
Author: Jan Range
License: BSD-2 clause
-----
Last Modified: Tuesday June 22nd 2021 10:16:57 pm
Modified By: Jan Range (<jan.range@simtech.uni-stuttgart.de>)
-----
Copyright (c) 2021 Institute of Biochemistry and Technical Biochemistry Stuttgart
"""
# File: __init__.py
# Project: pyenzyme
# Author: Jan Range
# License: BSD-2 clause
# Copyright (c) 2022 Institute of Biochemistry and Technical Biochemistry Stuttgart

from pyenzyme.enzymeml.core import EnzymeMLDocument
from pyenzyme.enzymeml.core import Vessel
Expand Down
16 changes: 5 additions & 11 deletions pyenzyme/enzymeml/__init__.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,8 @@
'''
File: __init__.py
Project: enzymeml
Author: Jan Range
License: BSD-2 clause
-----
Last Modified: Tuesday June 22nd 2021 10:15:34 pm
Modified By: Jan Range (<jan.range@simtech.uni-stuttgart.de>)
-----
Copyright (c) 2021 Institute of Biochemistry and Technical Biochemistry Stuttgart
'''
# File: __init__.py
# Project: enzymeml
# Author: Jan Range
# License: BSD-2 clause
# Copyright (c) 2022 Institute of Biochemistry and Technical Biochemistry Stuttgart

from pyenzyme.enzymeml.core import EnzymeMLDocument
from pyenzyme.enzymeml.core import Creator
Expand Down
16 changes: 5 additions & 11 deletions pyenzyme/enzymeml/core/__init__.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,8 @@
"""
File: __init__.py
Project: core
Author: Jan Range
License: BSD-2 clause
-----
Last Modified: Tuesday June 15th 2021 7:32:36 pm
Modified By: Jan Range (<jan.range@simtech.uni-stuttgart.de>)
-----
Copyright (c) 2021 Institute of Biochemistry and Technical Biochemistry Stuttgart
"""
# File: __init__.py
# Project: core
# Author: Jan Range
# License: BSD-2 clause
# Copyright (c) 2022 Institute of Biochemistry and Technical Biochemistry Stuttgart

from pyenzyme.enzymeml.core.creator import Creator
from pyenzyme.enzymeml.core.enzymemldocument import EnzymeMLDocument
Expand Down
17 changes: 5 additions & 12 deletions pyenzyme/enzymeml/core/abstract_classes.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,11 @@
"""
File: creator.py
Project: core
Author: Jan Range
License: BSD-2 clause
-----
Last Modified: Tuesday June 15th 2021 6:28:16 pm
Modified By: Jan Range (<jan.range@simtech.uni-stuttgart.de>)
-----
Copyright (c) 2021 Institute of Biochemistry and Technical Biochemistry Stuttgart
"""
# File: creator.py
# Project: core
# Author: Jan Range
# License: BSD-2 clause
# Copyright (c) 2022 Institute of Biochemistry and Technical Biochemistry Stuttgart

from pydantic import BaseModel, PrivateAttr, validator
from typing import Optional
from enum import Enum
from abc import ABC, abstractmethod

from pyenzyme.enzymeml.core.ontology import SBOTerm
Expand Down
16 changes: 5 additions & 11 deletions pyenzyme/enzymeml/core/complex.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,8 @@
"""
File: complex.py
Project: core
Author: Jan Range
License: BSD-2 clause
-----
Last Modified: Tuesday June 22nd 2021 9:53:42 pm
Modified By: Jan Range (<jan.range@simtech.uni-stuttgart.de>)
-----
Copyright (c) 2021 Institute of Biochemistry and Technical Biochemistry Stuttgart
"""
# File: complex.py
# Project: core
# Author: Jan Range
# License: BSD-2 clause
# Copyright (c) 2022 Institute of Biochemistry and Technical Biochemistry Stuttgart

import re

Expand Down
16 changes: 5 additions & 11 deletions pyenzyme/enzymeml/core/creator.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,8 @@
"""
File: creator.py
Project: core
Author: Jan Range
License: BSD-2 clause
-----
Last Modified: Tuesday June 15th 2021 6:28:16 pm
Modified By: Jan Range (<jan.range@simtech.uni-stuttgart.de>)
-----
Copyright (c) 2021 Institute of Biochemistry and Technical Biochemistry Stuttgart
"""
# File: creator.py
# Project: core
# Author: Jan Range
# License: BSD-2 clause
# Copyright (c) 2022 Institute of Biochemistry and Technical Biochemistry Stuttgart

from pydantic import Field, validator, ValidationError
from typing import TYPE_CHECKING, Optional
Expand Down
16 changes: 5 additions & 11 deletions pyenzyme/enzymeml/core/enzymemlbase.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,8 @@
"""
File: baseclass.py
Project: core
Author: Jan Range
License: BSD-2 clause
-----
Last Modified: Tuesday June 15th 2021 7:48:31 pm
Modified By: Jan Range (<jan.range@simtech.uni-stuttgart.de>)
-----
Copyright (c) 2021 Institute of Biochemistry and Technical Biochemistry Stuttgart
"""
# File: baseclass.py
# Project: core
# Author: Jan Range
# License: BSD-2 clause
# Copyright (c) 2022 Institute of Biochemistry and Technical Biochemistry Stuttgart

import json
import logging
Expand Down
17 changes: 5 additions & 12 deletions pyenzyme/enzymeml/core/enzymemldocument.py
Original file line number Diff line number Diff line change
@@ -1,20 +1,13 @@
"""
File: enzymemldocument.py
Project: core
Author: Jan Range
License: BSD-2 clause
-----
Last Modified: Thursday July 15th 2021 1:00:05 am
Modified By: Jan Range (<jan.range@simtech.uni-stuttgart.de>)
-----
Copyright (c) 2021 Institute of Biochemistry and Technical Biochemistry Stuttgart
"""
# File: enzymemldocument.py
# Project: core
# Author: Jan Range
# License: BSD-2 clause
# Copyright (c) 2022 Institute of Biochemistry and Technical Biochemistry Stuttgart

import os
import re
import ast
import json
from tkinter import TRUE
import yaml
import logging
import pandas as pd
Expand Down
32 changes: 20 additions & 12 deletions pyenzyme/enzymeml/core/enzymereaction.py
Original file line number Diff line number Diff line change
@@ -1,20 +1,14 @@
"""
File: enzymereaction.py
Project: core
Author: Jan Range
License: BSD-2 clause
-----
Last Modified: Wednesday June 23rd 2021 9:06:54 pm
Modified By: Jan Range (<jan.range@simtech.uni-stuttgart.de>)
-----
Copyright (c) 2021 Institute of Biochemistry and Technical Biochemistry Stuttgart
"""
# File: enzymereaction.py
# Project: core
# Author: Jan Range
# License: BSD-2 clause
# Copyright (c) 2022 Institute of Biochemistry and Technical Biochemistry Stuttgart

import logging
import re
import ast

from typing import List, Dict, Optional, TYPE_CHECKING
from typing import List, Dict, Union, Optional, TYPE_CHECKING
from dataclasses import dataclass
from pydantic import (
BaseModel,
Expand Down Expand Up @@ -574,6 +568,7 @@ def fromEquation(
equation: str,
name: str,
enzmldoc,
modifiers: Union[List[str], str] = [],
temperature: Optional[float] = None,
temperature_unit: Optional[str] = None,
ph: Optional[float] = None,
Expand All @@ -595,6 +590,10 @@ def fromEquation(
enzmldoc ([type]): Used to validate species IDs.
"""

if isinstance(modifiers, str):
# Catch single modifiers
modifiers = [modifiers]

if "=" in equation:
reversible = True
elif "->" in equation:
Expand All @@ -613,6 +612,15 @@ def fromEquation(
ph=ph,
)

for modifier in modifiers:
# Add modifiers
reaction.addModifier(
species_id=enzmldoc.getAny(modifier).id,
constant=True,
stoichiometry=1.0,
enzmldoc=enzmldoc,
)

# Parse the reaction equation
reaction._addFromEquation(equation, enzmldoc)

Expand Down
16 changes: 5 additions & 11 deletions pyenzyme/enzymeml/core/exceptions.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,8 @@
"""
File: functionalities.py
Project: core
Author: Jan Range
License: BSD-2 clause
-----
Last Modified: Tuesday June 15th 2021 6:43:34 pm
Modified By: Jan Range (<jan.range@simtech.uni-stuttgart.de>)
-----
Copyright (c) 2021 Institute of Biochemistry and Technical Biochemistry Stuttgart
"""
# File: functionalities.py
# Project: core
# Author: Jan Range
# License: BSD-2 clause
# Copyright (c) 2022 Institute of Biochemistry and Technical Biochemistry Stuttgart

import yaml

Expand Down
16 changes: 5 additions & 11 deletions pyenzyme/enzymeml/core/measurement.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,8 @@
"""
File: measurement.py
Project: core
Author: Jan Range
License: BSD-2 clause
-----
Last Modified: Thursday July 15th 2021 1:19:51 am
Modified By: Jan Range (<jan.range@simtech.uni-stuttgart.de>)
-----
Copyright (c) 2021 Institute of Biochemistry and Technical Biochemistry Stuttgart
"""
# File: measurement.py
# Project: core
# Author: Jan Range
# License: BSD-2 clause
# Copyright (c) 2022 Institute of Biochemistry and Technical Biochemistry Stuttgart

import copy
import logging
Expand Down
16 changes: 5 additions & 11 deletions pyenzyme/enzymeml/core/measurementData.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,8 @@
"""
File: measurementData.py
Project: core
Author: Jan Range
License: BSD-2 clause
-----
Last Modified: Thursday July 15th 2021 1:19:51 am
Modified By: Jan Range (<jan.range@simtech.uni-stuttgart.de>)
-----
Copyright (c) 2021 Institute of Biochemistry and Technical Biochemistry Stuttgart
"""
# File: measurementData.py
# Project: core
# Author: Jan Range
# License: BSD-2 clause
# Copyright (c) 2022 Institute of Biochemistry and Technical Biochemistry Stuttgart

from pydantic import PositiveFloat, validate_arguments, validator, Field, PrivateAttr
from dataclasses import dataclass
Expand Down
7 changes: 7 additions & 0 deletions pyenzyme/enzymeml/core/ontology.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# File: ontology.py
# Project: core
# Author: Jan Range
# License: BSD-2 clause
# Copyright (c) 2022 Institute of Biochemistry and Technical Biochemistry Stuttgart


from enum import Enum


Expand Down
16 changes: 5 additions & 11 deletions pyenzyme/enzymeml/core/protein.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,8 @@
"""
File: protein.py
Project: core
Author: Jan Range
License: BSD-2 clause
-----
Last Modified: Tuesday June 22nd 2021 9:53:42 pm
Modified By: Jan Range (<jan.range@simtech.uni-stuttgart.de>)
-----
Copyright (c) 2021 Institute of Biochemistry and Technical Biochemistry Stuttgart
"""
# File: protein.py
# Project: core
# Author: Jan Range
# License: BSD-2 clause
# Copyright (c) 2022 Institute of Biochemistry and Technical Biochemistry Stuttgart

import re

Expand Down
16 changes: 5 additions & 11 deletions pyenzyme/enzymeml/core/reactant.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,8 @@
"""
File: reactant.py
Project: core
Author: Jan Range
License: BSD-2 clause
-----
Last Modified: Tuesday June 15th 2021 8:40:52 pm
Modified By: Jan Range (<jan.range@simtech.uni-stuttgart.de>)
-----
Copyright (c) 2021 Institute of Biochemistry and Technical Biochemistry Stuttgart
"""
# File: reactant.py
# Project: core
# Author: Jan Range
# License: BSD-2 clause
# Copyright (c) 2022 Institute of Biochemistry and Technical Biochemistry Stuttgart

from pydantic import Field
from typing import Dict, TYPE_CHECKING, Optional, Union, Any
Expand Down
16 changes: 5 additions & 11 deletions pyenzyme/enzymeml/core/replicate.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,8 @@
"""
File: replicate.py
Project: core
Author: Jan Range
License: BSD-2 clause
-----
Last Modified: Thursday July 15th 2021 1:00:51 am
Modified By: Jan Range (<jan.range@simtech.uni-stuttgart.de>)
-----
Copyright (c) 2021 Institute of Biochemistry and Technical Biochemistry Stuttgart
"""
# File: replicate.py
# Project: core
# Author: Jan Range
# License: BSD-2 clause
# Copyright (c) 2022 Institute of Biochemistry and Technical Biochemistry Stuttgart

from pydantic import Field, validator, PrivateAttr
from typing import List, TYPE_CHECKING, Optional
Expand Down
16 changes: 5 additions & 11 deletions pyenzyme/enzymeml/core/unitdef.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,8 @@
"""
File: unitdef.py
Project: core
Author: Jan Range
License: BSD-2 clause
-----
Last Modified: Tuesday June 15th 2021 7:48:57 pm
Modified By: Jan Range (<jan.range@simtech.uni-stuttgart.de>)
-----
Copyright (c) 2021 Institute of Biochemistry and Technical Biochemistry Stuttgart
"""
# File: unitdef.py
# Project: core
# Author: Jan Range
# License: BSD-2 clause
# Copyright (c) 2022 Institute of Biochemistry and Technical Biochemistry Stuttgart

from pydantic import Field, validator, validate_arguments
from typing import List, TYPE_CHECKING, Optional
Expand Down

0 comments on commit 2629df0

Please sign in to comment.