Skip to content

Commit

Permalink
Minor bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
torogi94 committed Sep 25, 2023
1 parent e168661 commit 1fcefb7
Show file tree
Hide file tree
Showing 9 changed files with 33 additions and 166 deletions.
12 changes: 0 additions & 12 deletions nmrpy/datamodel/core/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,10 @@
from .publication import Publication
from .cv import CV
from .term import Term
from .vessel import Vessel
from .abstractspecies import AbstractSpecies
from .protein import Protein
from .reactant import Reactant
from .fileformats import FileFormats
from .subjects import Subjects
from .publicationtypes import PublicationTypes
from .identifiertypes import IdentifierTypes
from .sboterm import SBOTerm
from .datatypes import DataTypes

__doc__ = ""

Expand All @@ -36,14 +30,8 @@
"Publication",
"CV",
"Term",
"Vessel",
"AbstractSpecies",
"Protein",
"Reactant",
"FileFormats",
"Subjects",
"PublicationTypes",
"IdentifierTypes",
"SBOTerm",
"DataTypes",
]
8 changes: 4 additions & 4 deletions nmrpy/datamodel/core/citation.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
from sdRDM.base.listplus import ListPlus
from sdRDM.base.utils import forge_signature, IDGenerator

from typing import Any
from pydantic import AnyUrl
from typing import Any

from .publication import Publication
from .term import Term
from .publicationtypes import PublicationTypes
from .identifiertypes import IdentifierTypes
from .publication import Publication
from .subjects import Subjects
from .publicationtypes import PublicationTypes
from .person import Person
from .identifiertypes import IdentifierTypes


@forge_signature
Expand Down
15 changes: 11 additions & 4 deletions nmrpy/datamodel/core/experiment.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,18 @@
from sdRDM.base.utils import forge_signature, IDGenerator


from .fidarray import FIDArray
from .fid import FID
from .parameters import Parameters
from .processingsteps import ProcessingSteps
from .identity import Identity
from .parameters import Parameters
from .fid import FID
from .fidarray import FIDArray


@forge_signature
class Experiment(sdRDM.DataModel):
"""Rohdaten -> Zwischenschritte nur nennen + interessante Parameter -> Endergebnis; Peaklist + Rangelist; rapidly pulsed (if then +calibration factor) vs fully relaxed
Also preparation of EnzymeML doc"""
Also preparation of EnzymeML doc https://github.com/EnzymeML/enzymeml-specifications/@AbstractSpecies, https://github.com/EnzymeML/enzymeml-specifications/@Protein, https://github.com/EnzymeML/enzymeml-specifications/@Reactant
"""

id: Optional[str] = Field(
description="Unique identifier of the given object.",
Expand All @@ -29,6 +30,12 @@ class Experiment(sdRDM.DataModel):
description="A descriptive name for the overarching experiment.",
)

enzymeml_species: List[str] = Field(
description="A species object from an EnzymeML document.",
default_factory=ListPlus,
multiple=True,
)

fid: List[FID] = Field(
description="A single NMR spectrum.",
default_factory=ListPlus,
Expand Down
15 changes: 6 additions & 9 deletions nmrpy/datamodel/core/fid.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,9 @@

from pydantic.types import FrozenSet

from .parameters import Parameters
from .processingsteps import ProcessingSteps
from .abstractspecies import AbstractSpecies
from .protein import Protein
from .identity import Identity
from .parameters import Parameters
from .reactant import Reactant


@forge_signature
Expand Down Expand Up @@ -64,8 +61,8 @@ class FID(sdRDM.DataModel):

def add_to_peak_identities(
self,
name: str,
enzymeml_species: Union[AbstractSpecies, Protein, Reactant, None] = None,
name: Optional[str] = None,
species_id: Optional[str] = None,
associated_peaks: List[float] = ListPlus(),
associated_ranges: List[FrozenSet] = ListPlus(),
associated_integrals: List[float] = ListPlus(),
Expand All @@ -76,16 +73,16 @@ def add_to_peak_identities(
Args:
id (str): Unique identifier of the 'Identity' object. Defaults to 'None'.
name (): Descriptive name for the species.
enzymeml_species (): A species object from an EnzymeML document.. Defaults to None
name (): Descriptive name for the species. Defaults to None
species_id (): ID of an EnzymeML species. Defaults to None
associated_peaks (): Peaks belonging to the given species. Defaults to ListPlus()
associated_ranges (): Sets of ranges belonging to the given peaks. Defaults to ListPlus()
associated_integrals (): Integrals resulting from the given peaks and ranges of a species. Defaults to ListPlus()
"""

params = {
"name": name,
"enzymeml_species": enzymeml_species,
"species_id": species_id,
"associated_peaks": associated_peaks,
"associated_ranges": associated_ranges,
"associated_integrals": associated_integrals,
Expand Down
14 changes: 5 additions & 9 deletions nmrpy/datamodel/core/identity.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
import sdRDM

from typing import Optional, Union, List
from typing import List, Optional
from pydantic import Field
from sdRDM.base.listplus import ListPlus
from sdRDM.base.utils import forge_signature, IDGenerator

from pydantic.types import FrozenSet

from .abstractspecies import AbstractSpecies
from .protein import Protein
from .reactant import Reactant


@forge_signature
class Identity(sdRDM.DataModel):
Expand All @@ -22,14 +18,14 @@ class Identity(sdRDM.DataModel):
xml="@id",
)

name: str = Field(
...,
name: Optional[str] = Field(
default=None,
description="Descriptive name for the species",
)

enzymeml_species: Union[AbstractSpecies, Protein, Reactant, None] = Field(
species_id: Optional[str] = Field(
default=None,
description="A species object from an EnzymeML document.",
description="ID of an EnzymeML species",
)

associated_peaks: List[float] = Field(
Expand Down
2 changes: 1 addition & 1 deletion nmrpy/datamodel/core/nmrpy.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

from datetime import datetime as Datetime

from .citation import Citation
from .experiment import Experiment
from .citation import Citation


@forge_signature
Expand Down
2 changes: 1 addition & 1 deletion nmrpy/datamodel/core/publication.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@

from pydantic import AnyUrl

from .identifiertypes import IdentifierTypes
from .publicationtypes import PublicationTypes
from .person import Person
from .identifiertypes import IdentifierTypes


@forge_signature
Expand Down
127 changes: 3 additions & 124 deletions nmrpy/datamodel/schemes/datamodel_schema.md
Original file line number Diff line number Diff line change
@@ -1,56 +1,19 @@
```mermaid
classDiagram
AbstractSpecies <-- Protein
AbstractSpecies <-- Complex
AbstractSpecies <-- Reactant
AbstractSpecies <-- Protein
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
NMRpy *-- Experiment
NMRpy *-- Citation
Experiment *-- FID
Experiment *-- FIDArray
FID *-- Parameters
FID *-- ProcessingSteps
FID *-- Identity
Identity *-- AbstractSpecies
Identity *-- Protein
Identity *-- Reactant
Citation *-- Subjects
Citation *-- Person
Citation *-- Publication
Citation *-- Term
Person *-- IdentifierTypes
Publication *-- PublicationTypes
Publication *-- Person
AbstractSpecies *-- Vessel
Protein *-- SBOTerm
Reactant *-- SBOTerm
class NMRpy {
+datetime datetime_created*
Expand All @@ -61,6 +24,7 @@ classDiagram
class Experiment {
+string name*
+string[0..*] enzymeml_species
+FID[0..*] fid
+FIDArray fid_array
}
Expand Down Expand Up @@ -103,8 +67,8 @@ classDiagram
}
class Identity {
+string name*
+AbstractSpecies, Protein, Reactant enzymeml_species
+string name
+string species_id
+float[0..*] associated_peaks
+frozenset[0..*] associated_ranges
+float[0..*] associated_integrals
Expand Down Expand Up @@ -159,41 +123,6 @@ classDiagram
+any value
}
class Vessel {
+string name*
+posfloat volume*
+string unit*
+StrictBool constant*
+string uri
+string creator_id
}
class AbstractSpecies {
+string name*
+Vessel vessel_id*
+float init_conc
+StrictBool 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 Reactant {
+string smiles
+string inchi
+string chebi_id
+SBOTerm ontology*
}
class FileFormats {
<< Enumeration >>
+VARIAN
Expand All @@ -219,54 +148,4 @@ classDiagram
+ORCID
}
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
}
class https://github.com/EnzymeML/enzymeml-specifications/ {
<< External Object >>
+Repository <sdRDM.markdown.markdownparser.MarkdownParser object at 0x13ede0cd0>
}
```
4 changes: 2 additions & 2 deletions specifications/nmrpy.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ Root element of the NMRpy data model.
### Experiment

Rohdaten -> Zwischenschritte nur nennen + interessante Parameter -> Endergebnis; Peaklist + Rangelist; rapidly pulsed (if then +calibration factor) vs fully relaxed
Also preparation of EnzymeML doc
Also preparation of EnzymeML doc https://github.com/EnzymeML/enzymeml-specifications/@AbstractSpecies, https://github.com/EnzymeML/enzymeml-specifications/@Protein, https://github.com/EnzymeML/enzymeml-specifications/@Reactant

- __name__
- Type: string
- Description: A descriptive name for the overarching experiment.
- enzymeml_species
- Type: https://github.com/EnzymeML/enzymeml-specifications/@AbstractSpecies, https://github.com/EnzymeML/enzymeml-specifications/@Protein, https://github.com/EnzymeML/enzymeml-specifications/@Reactant
- Type: string
- Description: A species object from an EnzymeML document.
- Multiple: True
- fid
Expand Down

0 comments on commit 1fcefb7

Please sign in to comment.