diff --git a/docs/model.md b/docs/model.md index e08cff7..dc635b1 100644 --- a/docs/model.md +++ b/docs/model.md @@ -75,8 +75,8 @@ This page provides comprehensive information about the structure and components ## Ontologies -- [schema](https://schema.org/) - [OBO](http://purl.obolibrary.org/obo/) +- [schema](https://schema.org/) ## Types @@ -497,12 +497,7 @@ __species_id__* `string` - The identifier for the described reactant. -__init_conc__* `float` - -- Initial concentration of the measurement data. This must be the same as the first data point in the - - -__conc_unit__* [`UnitDefinition`](#unitdefinition) +__data_unit__* [`UnitDefinition`](#unitdefinition) - SI unit of the data that was measured. @@ -517,9 +512,14 @@ __data_type__* `string` - Type of data that was measured (e.g. concentration) -__prep_conc__ `float` +__prepared__ `float` + +- Amount of the reactant before the measurement. This field should be used for specifying the prepared amount of a species in the reaction mix. Not to be confused with + + +__initial__ `float` -- Concentration of the reactant before the measurement. This field should be used for specifying the prepared concentration of a species in the reaction mix. Not to be confused with init_conc, specifying the concentration at the first data point from the +- Initial amount of the measurement data. This must be the same as the first data point in the __data__* `list[float]` diff --git a/python/pyenzyme/dataclass_models.py b/python/pyenzyme/dataclass_models.py index e0eab13..7001626 100644 --- a/python/pyenzyme/dataclass_models.py +++ b/python/pyenzyme/dataclass_models.py @@ -721,11 +721,11 @@ class Measurement: def add_to_species_data( self, species_id: str, - init_conc: float, - conc_unit: UnitDefinition, + data_unit: UnitDefinition, time_unit: UnitDefinition, data_type: str, - prep_conc: Optional[float] = None, + prepared: Optional[float] = None, + initial: Optional[float] = None, data: list[float] = [], time: list[float] = [], is_simulated: bool = False, @@ -733,11 +733,11 @@ def add_to_species_data( ): params = { "species_id": species_id, - "init_conc": init_conc, - "conc_unit": conc_unit, + "data_unit": data_unit, "time_unit": time_unit, "data_type": data_type, - "prep_conc": prep_conc, + "prepared": prepared, + "initial": initial, "data": data, "time": time, "is_simulated": is_simulated, @@ -755,11 +755,13 @@ def add_to_species_data( @dataclass class MeasurementData: species_id: str - init_conc: float - conc_unit: UnitDefinition + data_unit: UnitDefinition time_unit: UnitDefinition data_type: str - prep_conc: Optional[float] = field( + prepared: Optional[float] = field( + default=None, metadata=config(exclude=lambda x: x is None) + ) + initial: Optional[float] = field( default=None, metadata=config(exclude=lambda x: x is None) ) data: List[float] = field(default_factory=list) diff --git a/python/pyenzyme/pydantic_models.py b/python/pyenzyme/pydantic_models.py index e73eff9..9c3b412 100644 --- a/python/pyenzyme/pydantic_models.py +++ b/python/pyenzyme/pydantic_models.py @@ -104,8 +104,8 @@ class EnzymeMLDocument(BaseModel): serialization_alias="@context", default_factory=lambda: { "enzml": "http://www.enzymeml.org/v2/", - "schema": "https://schema.org/", "OBO": "http://purl.obolibrary.org/obo/", + "schema": "https://schema.org/", "name": "schema:title", "references": { "@id": "schema:citation", @@ -505,8 +505,8 @@ class Creator(BaseModel): serialization_alias="@context", default_factory=lambda: { "enzml": "http://www.enzymeml.org/v2/", - "schema": "https://schema.org/", "OBO": "http://purl.obolibrary.org/obo/", + "schema": "https://schema.org/", "given_name": "schema:givenName", "family_name": "schema:familyName", "mail": "schema:email", @@ -603,8 +603,8 @@ class Vessel(BaseModel): serialization_alias="@context", default_factory=lambda: { "enzml": "http://www.enzymeml.org/v2/", - "schema": "https://schema.org/", "OBO": "http://purl.obolibrary.org/obo/", + "schema": "https://schema.org/", "id": { "@id": "schema:identifier", "@type": "@id", @@ -708,8 +708,8 @@ class Protein(BaseModel): serialization_alias="@context", default_factory=lambda: { "enzml": "http://www.enzymeml.org/v2/", - "schema": "https://schema.org/", "OBO": "http://purl.obolibrary.org/obo/", + "schema": "https://schema.org/", "id": { "@type": "@id", }, @@ -821,8 +821,8 @@ class Complex(BaseModel): serialization_alias="@context", default_factory=lambda: { "enzml": "http://www.enzymeml.org/v2/", - "schema": "https://schema.org/", "OBO": "http://purl.obolibrary.org/obo/", + "schema": "https://schema.org/", "id": { "@id": "schema:identifier", "@type": "@id", @@ -929,8 +929,8 @@ class SmallMolecule(BaseModel): serialization_alias="@context", default_factory=lambda: { "enzml": "http://www.enzymeml.org/v2/", - "schema": "https://schema.org/", "OBO": "http://purl.obolibrary.org/obo/", + "schema": "https://schema.org/", "id": { "@id": "schema:identifier", "@type": "@id", @@ -1040,8 +1040,8 @@ class Reaction(BaseModel): serialization_alias="@context", default_factory=lambda: { "enzml": "http://www.enzymeml.org/v2/", - "schema": "https://schema.org/", "OBO": "http://purl.obolibrary.org/obo/", + "schema": "https://schema.org/", "id": { "@id": "schema:identifier", "@type": "@id", @@ -1168,8 +1168,8 @@ class ReactionElement(BaseModel): serialization_alias="@context", default_factory=lambda: { "enzml": "http://www.enzymeml.org/v2/", - "schema": "https://schema.org/", "OBO": "http://purl.obolibrary.org/obo/", + "schema": "https://schema.org/", "species_id": { "@type": "@id", }, @@ -1269,8 +1269,8 @@ class Equation(BaseModel): serialization_alias="@context", default_factory=lambda: { "enzml": "http://www.enzymeml.org/v2/", - "schema": "https://schema.org/", "OBO": "http://purl.obolibrary.org/obo/", + "schema": "https://schema.org/", "species_id": { "@type": "@id", }, @@ -1430,8 +1430,8 @@ class Parameter(BaseModel): serialization_alias="@context", default_factory=lambda: { "enzml": "http://www.enzymeml.org/v2/", - "schema": "https://schema.org/", "OBO": "http://purl.obolibrary.org/obo/", + "schema": "https://schema.org/", "id": { "@id": "schema:identifier", "@type": "@id", @@ -1533,8 +1533,8 @@ class Measurement(BaseModel): serialization_alias="@context", default_factory=lambda: { "enzml": "http://www.enzymeml.org/v2/", - "schema": "https://schema.org/", "OBO": "http://purl.obolibrary.org/obo/", + "schema": "https://schema.org/", "id": { "@id": "schema:identifier", "@type": "@id", @@ -1625,11 +1625,11 @@ def add_type_term( def add_to_species_data( self, species_id: str, - init_conc: float, - conc_unit: UnitDefinition, + data_unit: UnitDefinition, time_unit: UnitDefinition, data_type: str, - prep_conc: Optional[float] = None, + prepared: Optional[float] = None, + initial: Optional[float] = None, data: list[float] = [], time: list[float] = [], is_simulated: bool = False, @@ -1637,11 +1637,11 @@ def add_to_species_data( ): params = { "species_id": species_id, - "init_conc": init_conc, - "conc_unit": conc_unit, + "data_unit": data_unit, "time_unit": time_unit, "data_type": data_type, - "prep_conc": prep_conc, + "prepared": prepared, + "initial": initial, "data": data, "time": time, "is_simulated": is_simulated, @@ -1661,11 +1661,11 @@ class MeasurementData(BaseModel): ) # type: ignore species_id: str - init_conc: float - conc_unit: UnitDefinition + data_unit: UnitDefinition time_unit: UnitDefinition data_type: str - prep_conc: Optional[float] = Field(default=None) + prepared: Optional[float] = Field(default=None) + initial: Optional[float] = Field(default=None) data: list[float] = Field(default_factory=list) time: list[float] = Field(default_factory=list) is_simulated: bool = False @@ -1685,8 +1685,8 @@ class MeasurementData(BaseModel): serialization_alias="@context", default_factory=lambda: { "enzml": "http://www.enzymeml.org/v2/", - "schema": "https://schema.org/", "OBO": "http://purl.obolibrary.org/obo/", + "schema": "https://schema.org/", "species_id": { "@type": "@id", }, @@ -1786,8 +1786,8 @@ class UnitDefinition(BaseModel): serialization_alias="@context", default_factory=lambda: { "enzml": "http://www.enzymeml.org/v2/", - "schema": "https://schema.org/", "OBO": "http://purl.obolibrary.org/obo/", + "schema": "https://schema.org/", }, ) @@ -1916,8 +1916,8 @@ class BaseUnit(BaseModel): serialization_alias="@context", default_factory=lambda: { "enzml": "http://www.enzymeml.org/v2/", - "schema": "https://schema.org/", "OBO": "http://purl.obolibrary.org/obo/", + "schema": "https://schema.org/", }, ) @@ -2011,8 +2011,8 @@ class EqVariable(BaseModel): serialization_alias="@context", default_factory=lambda: { "enzml": "http://www.enzymeml.org/v2/", - "schema": "https://schema.org/", "OBO": "http://purl.obolibrary.org/obo/", + "schema": "https://schema.org/", "id": { "@type": "@id", }, @@ -2110,8 +2110,8 @@ class EqParameter(BaseModel): serialization_alias="@context", default_factory=lambda: { "enzml": "http://www.enzymeml.org/v2/", - "schema": "https://schema.org/", "OBO": "http://purl.obolibrary.org/obo/", + "schema": "https://schema.org/", "id": { "@type": "@id", }, diff --git a/schemes/enzymeml.json b/schemes/enzymeml.json index afbc7fc..2fa9d0e 100644 --- a/schemes/enzymeml.json +++ b/schemes/enzymeml.json @@ -82,62 +82,6 @@ }, "description": "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.", "definitions": { - "Complex": { - "title": "Complex", - "type": "object", - "properties": { - "id": { - "title": "id", - "description": "Unique identifier of the complex.", - "term": "schema:identifier", - "type": "string" - }, - "name": { - "title": "name", - "term": "schema:name", - "type": "string" - }, - "constant": { - "title": "constant", - "type": "boolean" - }, - "participants": { - "title": "participants", - "description": "Array of IDs the complex contains", - "type": "array", - "items": { - "type": "string" - } - } - }, - "description": "This object describes complexes made of reactants and/or proteins that were used or produced in the course of the experiment." - }, - "Creator": { - "title": "Creator", - "type": "object", - "properties": { - "given_name": { - "title": "given_name", - "description": "Given name of the author or contributor.", - "term": "schema:givenName", - "type": "string" - }, - "family_name": { - "title": "family_name", - "description": "Family name of the author or contributor.", - "term": "schema:familyName", - "type": "string" - }, - "mail": { - "title": "mail", - "description": "Email address of the author or contributor.", - "term": "schema:email", - "type": "string" - } - }, - "description": "The creator object contains all information about authors that contributed to the resulting document.", - "term": "schema:person" - }, "Measurement": { "title": "Measurement", "type": "object", @@ -218,6 +162,62 @@ }, "description": "This object describes an ordinary differential equation that is part of the kinetic model." }, + "Complex": { + "title": "Complex", + "type": "object", + "properties": { + "id": { + "title": "id", + "description": "Unique identifier of the complex.", + "term": "schema:identifier", + "type": "string" + }, + "name": { + "title": "name", + "term": "schema:name", + "type": "string" + }, + "constant": { + "title": "constant", + "type": "boolean" + }, + "participants": { + "title": "participants", + "description": "Array of IDs the complex contains", + "type": "array", + "items": { + "type": "string" + } + } + }, + "description": "This object describes complexes made of reactants and/or proteins that were used or produced in the course of the experiment." + }, + "Creator": { + "title": "Creator", + "type": "object", + "properties": { + "given_name": { + "title": "given_name", + "description": "Given name of the author or contributor.", + "term": "schema:givenName", + "type": "string" + }, + "family_name": { + "title": "family_name", + "description": "Family name of the author or contributor.", + "term": "schema:familyName", + "type": "string" + }, + "mail": { + "title": "mail", + "description": "Email address of the author or contributor.", + "term": "schema:email", + "type": "string" + } + }, + "description": "The creator object contains all information about authors that contributed to the resulting document.", + "term": "schema:person" + }, "SmallMolecule": { "title": "SmallMolecule", "type": "object", @@ -270,6 +270,46 @@ }, "description": "This object describes the reactants that were used or produced in the course of the experiment." }, + "Reaction": { + "title": "Reaction", + "type": "object", + "properties": { + "id": { + "title": "id", + "description": "Unique identifier of the reaction.", + "term": "schema:identifier", + "type": "string" + }, + "name": { + "title": "name", + "description": "Name of the reaction.", + "type": "string" + }, + "reversible": { + "title": "reversible", + "description": "Whether the reaction is reversible or irreversible", + "type": "boolean" + }, + "kinetic_law": { + "$ref": "#/definitions/Equation" + }, + "species": { + "type": "array", + "items": { + "$ref": "#/definitions/ReactionElement" + } + }, + "modifiers": { + "title": "modifiers", + "description": "List of reaction elements that are not part of the reaction but influence it.", + "type": "array", + "items": { + "type": "string" + } + } + }, + "description": "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." + }, "Protein": { "title": "Protein", "type": "object", @@ -363,46 +403,6 @@ }, "description": "This object describes vessels in which the experiment has been carried out. These can include any type of vessel used in biocatalytic experiments.", "term": "OBO:OBI_0400081" - }, - "Reaction": { - "title": "Reaction", - "type": "object", - "properties": { - "id": { - "title": "id", - "description": "Unique identifier of the reaction.", - "term": "schema:identifier", - "type": "string" - }, - "name": { - "title": "name", - "description": "Name of the reaction.", - "type": "string" - }, - "reversible": { - "title": "reversible", - "description": "Whether the reaction is reversible or irreversible", - "type": "boolean" - }, - "kinetic_law": { - "$ref": "#/definitions/Equation" - }, - "species": { - "type": "array", - "items": { - "$ref": "#/definitions/ReactionElement" - } - }, - "modifiers": { - "title": "modifiers", - "description": "List of reaction elements that are not part of the reaction but influence it.", - "type": "array", - "items": { - "type": "string" - } - } - }, - "description": "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." } } } \ No newline at end of file diff --git a/schemes/enzymeml.shex b/schemes/enzymeml.shex index abe70a4..814188c 100644 --- a/schemes/enzymeml.shex +++ b/schemes/enzymeml.shex @@ -1,7 +1,7 @@ PREFIX xsd: PREFIX enzml: -PREFIX schema: PREFIX OBO: +PREFIX schema: enzml:EnzymeMLDocument { schema:title xsd:string { diff --git a/schemes/enzymeml.xsd b/schemes/enzymeml.xsd index 18dd692..62afc51 100644 --- a/schemes/enzymeml.xsd +++ b/schemes/enzymeml.xsd @@ -616,14 +616,7 @@ - - - - Initial concentration of the measurement data. This must be the same as the first data point in the - - - - + SI unit of the data that was measured. @@ -644,10 +637,17 @@ - + + + + Amount of the reactant before the measurement. This field should be used for specifying the prepared amount of a species in the reaction mix. Not to be confused with + + + + - Concentration of the reactant before the measurement. This field should be used for specifying the prepared concentration of a species in the reaction mix. Not to be confused with init_conc, specifying the concentration at the first data point from the + Initial amount of the measurement data. This must be the same as the first data point in the diff --git a/typescript/src/index.ts b/typescript/src/index.ts index 50f686c..4dc27de 100644 --- a/typescript/src/index.ts +++ b/typescript/src/index.ts @@ -390,27 +390,25 @@ export const MeasurementCodec = D.lazy("Measurement", () => D.struct({ time course data. * @param species_id - The identifier for the described reactant. - * @param init_conc - Initial concentration of the measurement data. This must be the same - as the first data point in the - * @param conc_unit - SI unit of the data that was measured. + * @param data_unit - SI unit of the data that was measured. * @param time_unit - Time unit of the replicate. * @param data_type - Type of data that was measured (e.g. concentration) - * @param prep_conc - Concentration of the reactant before the measurement. This field - should be used for specifying the prepared concentration - of a species in the reaction mix. Not to be confused with - init_conc, specifying the concentration at the first data - point from the + * @param prepared - Amount of the reactant before the measurement. This field should be + used for specifying the prepared amount of a species in + the reaction mix. Not to be confused with + * @param initial - Initial amount of the measurement data. This must be the same as the + first data point in the * @param data - Data that was measured. * @param time - Time steps of the replicate. * @param is_simulated - Whether or not the data has been generated by simulation. **/ export interface MeasurementData extends JsonLd { species_id: string; - init_conc: number; - conc_unit: UnitDefinition; + data_unit: UnitDefinition; time_unit: UnitDefinition; data_type: string; - prep_conc?: number | null; + prepared?: number | null; + initial?: number | null; data: number[]; time: number[]; is_simulated: boolean; @@ -418,11 +416,11 @@ export interface MeasurementData extends JsonLd { export const MeasurementDataCodec = D.lazy("MeasurementData", () => D.struct({ species_id: D.string, - init_conc: D.number, - conc_unit: UnitDefinitionCodec, + data_unit: UnitDefinitionCodec, time_unit: UnitDefinitionCodec, data_type: D.string, - prep_conc: D.nullable(D.number), + prepared: D.nullable(D.number), + initial: D.nullable(D.number), data: D.array(D.number), time: D.array(D.number), is_simulated: D.boolean,