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

feat: Update adapters using 2024/06 Plate Reader schema to include ASM file identifier #695

Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from dataclasses import dataclass
from io import StringIO
import math
from pathlib import Path
import re

import pandas as pd
Expand Down Expand Up @@ -773,14 +774,15 @@ def _get_sources(


def create_metadata(header_data: HeaderData) -> Metadata:
asm_file_identifier = Path(header_data.file_name).with_suffix(".json")
return Metadata(
device_identifier=NOT_APPLICABLE,
model_number=header_data.model_number or NOT_APPLICABLE,
equipment_serial_number=header_data.equipment_serial_number,
software_name=DEFAULT_SOFTWARE_NAME,
software_version=header_data.software_version,
file_name=header_data.file_name,
asm_file_identifier=NOT_APPLICABLE,
asm_file_identifier=asm_file_identifier.name,
data_system_instance_id=NOT_APPLICABLE,
unc_path=NOT_APPLICABLE,
)
Expand Down
4 changes: 3 additions & 1 deletion src/allotropy/parsers/bmg_mars/bmg_mars_structure.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

from dataclasses import dataclass
from enum import Enum
from pathlib import Path
import re

import pandas as pd
Expand Down Expand Up @@ -97,9 +98,10 @@ def create(data: SeriesData, header_content: str) -> Header:


def create_metadata(header: Header, file_name: str) -> Metadata:
asm_file_identifier = Path(file_name).with_suffix(".json")
return Metadata(
file_name=file_name,
asm_file_identifier=NOT_APPLICABLE,
asm_file_identifier=asm_file_identifier.name,
unc_path=header.path,
device_identifier=NOT_APPLICABLE,
model_number=NOT_APPLICABLE,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,10 @@ class MethodicalMindParser(VendorParser[Data, Model]):
def create_data(self, named_file_contents: NamedFileContents) -> Data:
reader = MethodicalMindReader(named_file_contents)
return Data(
create_metadata(Header.create(reader.plate_headers[0])),
create_metadata(
Header.create(reader.plate_headers[0]),
named_file_contents.original_file_name,
),
create_measurement_groups(
[PlateData.create(header, data) for header, data in reader]
),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from __future__ import annotations

from dataclasses import dataclass
from pathlib import Path

import pandas as pd

Expand Down Expand Up @@ -84,7 +85,8 @@ def create(luminescence: int, location_id: str, well_plate_id: str) -> WellData:
)


def create_metadata(header: Header) -> Metadata:
def create_metadata(header: Header, file_name: str) -> Metadata:
asm_file_identifier = Path(file_name).with_suffix(".json")
return Metadata(
file_name=header.file_name.rsplit("\\", 1)[-1],
unc_path=header.file_name,
Expand All @@ -93,7 +95,7 @@ def create_metadata(header: Header) -> Metadata:
device_identifier=NOT_APPLICABLE,
model_number=header.model,
equipment_serial_number=header.serial_number,
asm_file_identifier=NOT_APPLICABLE,
asm_file_identifier=asm_file_identifier.name,
data_system_instance_id=NOT_APPLICABLE,
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
from collections.abc import Iterator
from dataclasses import dataclass
from enum import Enum
from pathlib import Path
from re import search

import numpy as np
Expand Down Expand Up @@ -693,9 +694,10 @@ def create(reader: CsvReader) -> Data:
def create_metadata(
software: Software, instrument: Instrument, file_name: str
) -> Metadata:
asm_file_identifier = Path(file_name).with_suffix(".json")
return Metadata(
file_name=file_name,
asm_file_identifier=NOT_APPLICABLE,
asm_file_identifier=asm_file_identifier.name,
unc_path=NOT_APPLICABLE,
software_name=software.software_name,
software_version=software.software_version,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7208,7 +7208,7 @@
]
},
"data system document": {
"ASM file identifier": "N/A",
"ASM file identifier": "010307_114129_BNCH654563_stdcurve_singleplate01.json",
"data system instance identifier": "N/A",
"file name": "010307_114129_BNCH654563_stdcurve_singleplate01.txt",
"UNC path": "N/A",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4236,7 +4236,7 @@
}
],
"data system document": {
"ASM file identifier": "N/A",
"ASM file identifier": "240411_172731_BNCH2345883_abs450_96well_non_numeric_values.json",
"data system instance identifier": "N/A",
"file name": "240411_172731_BNCH2345883_abs450_96well_non_numeric_values.txt",
"UNC path": "N/A",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21720,12 +21720,12 @@
]
},
"data system document": {
"ASM file identifier": "N/A",
"ASM file identifier": "Kinetic_Analysis_Mean_Slope_and_Standard_Curve_tab.json",
"data system instance identifier": "N/A",
"file name": "Kinetic_Analysis_Mean_Slope_and_Standard_Curve_tab.txt",
"UNC path": "N/A",
"ASM converter name": "allotropy_agilent_gen5",
"ASM converter version": "0.1.53",
"ASM converter version": "0.1.56",
"software name": "Gen5",
"software version": "3.12.08"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37544,7 +37544,7 @@
]
},
"data system document": {
"ASM file identifier": "N/A",
"ASM file identifier": "endpoint_pathlength_correct_singleplate.json",
"data system instance identifier": "N/A",
"file name": "endpoint_pathlength_correct_singleplate.txt",
"UNC path": "N/A",
Expand Down
Loading
Loading