Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update spectrophotometry schema for fluorescence measurements #469

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Added github enforcement that CHANGELOG.md is updated
- Added test files Agilent TapeStation Analysis
- Add Alphalisa assay support to Gen5 adapter
- Add fluorescence point detection measurement extension to Spectrophotometry BENCHLING/2023/12 schema

### Fixed

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# generated by datamodel-codegen:
# filename: spectrophotometry.schema.json
# timestamp: 2024-06-04T03:30:29+00:00
# timestamp: 2024-06-20T15:46:58+00:00

from __future__ import annotations

Expand All @@ -20,6 +20,7 @@
TQuantityValueNanogramPerMilliliter,
TQuantityValueNanometer,
TQuantityValuePicogramPerMilliliter,
TQuantityValueRelativeFluorescenceUnit,
TQuantityValueSecondTime,
TQuantityValueSquareCentimetersPerGram,
)
Expand Down Expand Up @@ -421,11 +422,47 @@ class UltravioletAbsorbancePointDetectionMeasurementDocumentItems:
compartment_temperature: TQuantityValueDegreeCelsius | None = None


@dataclass(kw_only=True)
class FluorescencePointDetectionDeviceControlDocumentItem(DeviceControlDocument):
detector_wavelength_setting: TQuantityValueNanometer | None = None
detector_bandwidth_setting: TQuantityValueNanometer | None = None
wavelength_filter_cutoff_setting: TQuantityValueNanometer | None = None
excitation_bandwidth_setting: TQuantityValueNanometer | None = None
excitation_wavelength_setting: TQuantityValueNanometer | None = None
field_index: int | None = None


FluorescencePointDetectionDeviceControlDocument = list[
FluorescencePointDetectionDeviceControlDocumentItem
]


@dataclass(kw_only=True)
class FluorescencePointDetectionDeviceControlAggregateDocument:
device_control_document: FluorescencePointDetectionDeviceControlDocument


@dataclass(kw_only=True)
class FluorescencePointDetectionMeasurementDocumentItems:
measurement_identifier: TStringValue
device_control_aggregate_document: FluorescencePointDetectionDeviceControlAggregateDocument
sample_document: SampleDocument
fluorescence: TQuantityValueRelativeFluorescenceUnit
measurement_time: TDateTimeStampValue | None = None
detection_type: TStringValue | None = None
processed_data_aggregate_document: ProcessedDataAggregateDocument | None = None
calculated_data_aggregate_document: CalculatedDataAggregateDocument | None = None
statistics_aggregate_document: StatisticsAggregateDocument | None = None
compartment_temperature: TQuantityValueDegreeCelsius | None = None
mass_concentration: TQuantityValuePicogramPerMilliliter | None = None


@dataclass(kw_only=True)
class MeasurementAggregateDocument:
measurement_time: TDateTimeStampValue
measurement_document: list[
UltravioletAbsorbancePointDetectionMeasurementDocumentItems
FluorescencePointDetectionMeasurementDocumentItems
| UltravioletAbsorbancePointDetectionMeasurementDocumentItems
]
experiment_type: TStringValue | None = None
container_type: ContainerType | None = None
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"properties": {
"spectrophotometry aggregate document": {
"type": "object",
"$asm.property-class": "TO DO",
"$asm.property-class": "http://purl.allotrope.org/ontologies/result#AFR_0002937",
"$asm.pattern": "aggregate datum",
"properties": {
"device system document": {
Expand Down Expand Up @@ -316,9 +316,12 @@
"$asm.array-mixed": false,
"$asm.pattern": "indexed datum",
"items": {
"anyOf": [
"oneOf": [
{
"$ref": "#/$defs/ultravioletAbsorbancePointDetectionMeasurementDocumentItems"
},
{
"$ref": "#/$defs/fluorescencePointDetectionMeasurementDocumentItems"
}
]
},
Expand Down Expand Up @@ -1130,6 +1133,135 @@
}
}
},
"fluorescencePointDetectionDeviceControlDocument": {
"type": "array",
"$asm.array-ordered": true,
"$asm.array-mixed": false,
"$asm.pattern": "indexed datum",
"items": {
"allOf": [
{
"type": "object",
"$asm.property-class": "http://purl.allotrope.org/ontologies/result#AFR_0002723",
"$asm.pattern": "aggregate datum",
"properties": {
"detector wavelength setting": {
"$asm.property-class": "http://purl.allotrope.org/ontologies/result#AFR_0002456",
"$asm.pattern": "quantity datum",
"$ref": "#/$custom/tQuantityValueNanometer"
},
"detector bandwidth setting": {
"$asm.property-class": "http://purl.allotrope.org/ontologies/result#AFR_0002477",
"$asm.pattern": "quantity datum",
"$ref": "#/$custom/tQuantityValueNanometer"
},
"wavelength filter cutoff setting": {
"$asm.property-class": "http://purl.allotrope.org/ontologies/result#AFR_0002478",
"$asm.pattern": "quantity datum",
"$ref": "#/$custom/tQuantityValueNanometer"
},
"excitation bandwidth setting": {
"$asm.property-class": "http://purl.allotrope.org/ontologies/result#AFR_0002548",
"$asm.pattern": "quantity datum",
"$ref": "#/$custom/tQuantityValueNanometer"
},
"excitation wavelength setting": {
"$asm.property-class": "http://purl.allotrope.org/ontologies/result#AFR_0002479",
"$asm.pattern": "quantity datum",
"$ref": "#/$custom/tQuantityValueNanometer"
}
}
},
{
"$ref": "#/$defs/deviceControlDocument"
},
{
"properties": {
"@index": {
"type": "integer",
"minimum": 1,
"maximum": 2147483647
}
}
}
]
},
"minItems": 1
},
"fluorescencePointDetectionDeviceControlAggregateDocument": {
"type": "object",
"$asm.property-class": "http://purl.allotrope.org/ontologies/result#AFR_0002722",
"$asm.pattern": "aggregate datum",
"required": [
"device control document"
],
"properties": {
"device control document": {
"$ref": "#/$defs/fluorescencePointDetectionDeviceControlDocument"
}
}
},
"fluorescencePointDetectionMeasurementDocumentItems": {
"type": "object",
"$asm.property-class": "http://purl.allotrope.org/ontologies/result#AFR_0002375",
"$asm.pattern": "aggregate datum",
"required": [
"fluorescence",
"sample document",
"device control aggregate document",
"measurement identifier"
],
"properties": {
"measurement time": {
"$asm.property-class": "http://purl.allotrope.org/ontologies/result#AFR_0000952",
"$asm.pattern": "value datum",
"$asm.type": "http://www.w3.org/2001/XMLSchema#dateTimeStamp",
"$ref": "#/$defs/tDateTimeStampValue"
},
"measurement identifier": {
"$asm.property-class": "http://purl.allotrope.org/ontologies/result#AFR_0001121",
"$asm.pattern": "value datum",
"$asm.type": "http://www.w3.org/2001/XMLSchema#string",
"$ref": "#/$defs/tStringValue"
},
"device control aggregate document": {
"$ref": "#/$defs/fluorescencePointDetectionDeviceControlAggregateDocument"
},
"sample document": {
"$ref": "#/$defs/sampleDocument"
},
"detection type": {
"$asm.property-class": "http://purl.allotrope.org/ontologies/result#AFR_0002534",
"$asm.pattern": "value datum",
"$asm.type": "http://www.w3.org/2001/XMLSchema#string",
"$ref": "#/$defs/tStringValue"
},
"processed data aggregate document": {
"$ref": "#/$defs/processedDataAggregateDocument"
},
"calculated data aggregate document": {
"$ref": "#/$defs/calculatedDataAggregateDocument"
},
"statistics aggregate document": {
"$ref": "#/$defs/statisticsAggregateDocument"
},
"compartment temperature": {
"$asm.property-class": "http://purl.allotrope.org/ontologies/result#AFR_0002549",
"$asm.pattern": "quantity datum",
"$ref": "#/$custom/tQuantityValueDegreeCelsius"
},
"fluorescence": {
"$asm.property-class": "http://purl.allotrope.org/ontologies/result#AFR_0002408",
"$asm.pattern": "quantity datum",
"$ref": "#/$custom/tQuantityValueRelativeFluorescenceUnit"
},
"mass concentration": {
"$asm.property-class": "http://purl.allotrope.org/ontologies/result#AFR_0001661",
"$asm.pattern": "quantity datum",
"$ref": "#/$custom/tQuantityValuePicogramPerMilliliter"
}
}
},
"asm": {
"properties": {
"$asm.manifest": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
DataSourceDocumentItem,
DataSystemDocument,
DeviceSystemDocument,
FluorescencePointDetectionMeasurementDocumentItems,
MeasurementAggregateDocument,
Model,
ProcessedDataAggregateDocument,
Expand Down Expand Up @@ -242,7 +243,14 @@ def _get_spectrophotometry_document_item(

def _get_measurement_document(
self, data: pd.DataFrame, row: int
) -> list[UltravioletAbsorbancePointDetectionMeasurementDocumentItems]:
) -> list[
FluorescencePointDetectionMeasurementDocumentItems
| UltravioletAbsorbancePointDetectionMeasurementDocumentItems
]:
measurement_docs: list[
FluorescencePointDetectionMeasurementDocumentItems
| UltravioletAbsorbancePointDetectionMeasurementDocumentItems
]
measurement_docs = []
na_type = _get_str_or_none(data, row, "na type")
concentration_col = self._get_concentration_col(data)
Expand Down
Loading