Skip to content

Commit de42c0a

Browse files
move spot data to processed data document
1 parent 231ac5e commit de42c0a

6 files changed

Lines changed: 3578 additions & 2122 deletions

File tree

src/allotropy/allotrope/schema_mappers/adm/plate_reader/benchling/_2023/_09/plate_reader.py

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,6 @@ class ImageFeature:
8686
feature: str
8787
result: float | InvalidJsonFloat
8888
data_sources: list[DataSource] | None = None
89-
custom_info: dict[str, Any] | None = None
9089

9190

9291
@dataclass(frozen=True)
@@ -562,18 +561,15 @@ def _get_processed_data_aggregate_document(
562561
processed_data_identifier=data.identifier,
563562
image_feature_aggregate_document=ImageFeatureAggregateDocument(
564563
image_feature_document=[
565-
add_custom_information_document(
566-
ImageFeatureDocumentItem(
567-
image_feature_identifier=image_feature.identifier,
568-
image_feature_name=image_feature.feature,
569-
image_feature_result=TQuantityValueUnitless(
570-
value=image_feature.result
571-
),
572-
data_source_aggregate_document=self._get_data_source_aggregate_document(
573-
image_feature.data_sources
574-
),
564+
ImageFeatureDocumentItem(
565+
image_feature_identifier=image_feature.identifier,
566+
image_feature_name=image_feature.feature,
567+
image_feature_result=TQuantityValueUnitless(
568+
value=image_feature.result
569+
),
570+
data_source_aggregate_document=self._get_data_source_aggregate_document(
571+
image_feature.data_sources
575572
),
576-
image_feature.custom_info,
577573
)
578574
for image_feature in data.features
579575
]

src/allotropy/parsers/ctl_immunospot/ctl_immunospot_structure.py

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,6 @@ def _create_measurement(
3636
header_data: dict[str, float | str | None],
3737
) -> Measurement:
3838
location_identifier = f"{well_row}{well_col}"
39-
image_custom_info = {
40-
"Min. SpotSize": header_data.pop("Min. SpotSize", None),
41-
"Max. SpotSize": header_data.pop("Max. SpotSize", None),
42-
"Spot Separation": header_data.pop("Spot Separation", None),
43-
}
4439
return Measurement(
4540
type_=MeasurementType.OPTICAL_IMAGING,
4641
device_type=constants.DEVICE_TYPE,
@@ -51,12 +46,16 @@ def _create_measurement(
5146
detection_type=constants.DETECTION_TYPE,
5247
processed_data=ProcessedData(
5348
identifier=random_uuid_str(),
49+
data_processing_document={
50+
"Min. SpotSize": header_data.pop("Min. SpotSize", None),
51+
"Max. SpotSize": header_data.pop("Max. SpotSize", None),
52+
"Spot Separation": header_data.pop("Spot Separation", None),
53+
},
5454
features=[
5555
ImageFeature(
5656
identifier=random_uuid_str(),
5757
feature=name,
5858
result=float(data[well_col][well_row]),
59-
custom_info=image_custom_info,
6059
)
6160
for name, data in plate_data.items()
6261
],
@@ -115,7 +114,12 @@ def create_measurement_groups(
115114
analyst=analyst,
116115
measurements=[
117116
_create_measurement(
118-
row, col, well_plate_identifier, plate_data, histograms, header_data
117+
row,
118+
col,
119+
well_plate_identifier,
120+
plate_data,
121+
histograms,
122+
header_data.copy(),
119123
)
120124
],
121125
custom_info=custom_info,

0 commit comments

Comments
 (0)