From 3f8d52266c626fa2ed726ab574f6f1de53c6b964 Mon Sep 17 00:00:00 2001 From: Joshua Hernandez Date: Fri, 3 Oct 2025 10:28:46 -0500 Subject: [PATCH] add unread data --- src/allotropy/allotrope/converter.py | 1 + .../nanodrop_eight_structure.py | 2 + .../testdata/thermo_nanodrop_eight_RNA.json | 33 +++++++++++++++- .../thermo_nanodrop_eight_example01.json | 38 ++++++++++++++++++- .../thermo_nanodrop_eight_example02.json | 38 ++++++++++++++++++- ...rmo_nanodrop_eight_tab_aligned_header.json | 38 ++++++++++++++++++- 6 files changed, 146 insertions(+), 4 deletions(-) diff --git a/src/allotropy/allotrope/converter.py b/src/allotropy/allotrope/converter.py index 28f5a6acf..4ef46868e 100644 --- a/src/allotropy/allotrope/converter.py +++ b/src/allotropy/allotrope/converter.py @@ -112,6 +112,7 @@ "=": "_EQUALS_", "@": "_AT_", "'": "_QUOTE_", + "&": "_AMPERSAND_", # NOTE: this MUST be at the end, or it will break other key replacements. " ": "_", } diff --git a/src/allotropy/parsers/thermo_fisher_nanodrop_eight/nanodrop_eight_structure.py b/src/allotropy/parsers/thermo_fisher_nanodrop_eight/nanodrop_eight_structure.py index 7a8d36dd0..2cf0a03d2 100644 --- a/src/allotropy/parsers/thermo_fisher_nanodrop_eight/nanodrop_eight_structure.py +++ b/src/allotropy/parsers/thermo_fisher_nanodrop_eight/nanodrop_eight_structure.py @@ -103,6 +103,7 @@ def create(data: SeriesData, header: SeriesData) -> SpectroscopyRow: and mass_concentration and unit else None, + custom_info={**data.get_unread(), **header.get_unread()}, ) ) if spectra_data_cube: @@ -113,6 +114,7 @@ def create(data: SeriesData, header: SeriesData) -> SpectroscopyRow: data_cube=spectra_data_cube, sample_identifier=sample_id, location_identifier=location_id, + custom_info={**data.get_unread(), **header.get_unread()}, ) ) diff --git a/tests/parsers/thermo_fisher_nanodrop_eight/testdata/thermo_nanodrop_eight_RNA.json b/tests/parsers/thermo_fisher_nanodrop_eight/testdata/thermo_nanodrop_eight_RNA.json index 6bd50a3fe..cd538833d 100644 --- a/tests/parsers/thermo_fisher_nanodrop_eight/testdata/thermo_nanodrop_eight_RNA.json +++ b/tests/parsers/thermo_fisher_nanodrop_eight/testdata/thermo_nanodrop_eight_RNA.json @@ -25,6 +25,17 @@ "absorbance": { "value": 17.62, "unit": "mAU" + }, + "custom information document": { + "a260/a230": 2.19, + "sample": "ALP096 PBL1", + "username": "GN104564", + "ng/âμl": 704.986, + "weirdextra:": "Blah", + "a260/a280": 2.07, + "andmore": "Blah", + "date": "11/09/2023 14:19", + "serial number": 1234.0 } }, { @@ -75,6 +86,16 @@ "absorbance": { "value": 17.16, "unit": "mAU" + }, + "custom information document": { + "a260/a230": 1.87, + "sample": "ALP111 PBL1", + "username": "GN104564", + "ng/âμl": 686.535, + "weirdextra:": "Blah", + "a260/a280": 2.07, + "andmore": "Blah", + "date": "11/09/2023 14:19" } }, { @@ -125,6 +146,16 @@ "absorbance": { "value": 17.75, "unit": "mAU" + }, + "custom information document": { + "a260/a230": 2.0, + "sample": "651 PBL1", + "username": "GN104564", + "ng/âμl": 710.13, + "weirdextra:": "Blah", + "a260/a280": 2.08, + "andmore": "Blah", + "date": "11/09/2023 14:20" } }, { @@ -162,7 +193,7 @@ "file name": "thermo_nanodrop_eight_RNA.txt", "UNC path": "tests/parsers/thermo_fisher_nanodrop_eight/testdata/thermo_nanodrop_eight_RNA.txt", "ASM converter name": "allotropy_thermo_fisher_scientific_nanodrop_eight", - "ASM converter version": "0.1.62" + "ASM converter version": "0.1.106" }, "calculated data aggregate document": { "calculated data document": [ diff --git a/tests/parsers/thermo_fisher_nanodrop_eight/testdata/thermo_nanodrop_eight_example01.json b/tests/parsers/thermo_fisher_nanodrop_eight/testdata/thermo_nanodrop_eight_example01.json index 1dd0cf4d3..92bbba1c4 100644 --- a/tests/parsers/thermo_fisher_nanodrop_eight/testdata/thermo_nanodrop_eight_example01.json +++ b/tests/parsers/thermo_fisher_nanodrop_eight/testdata/thermo_nanodrop_eight_example01.json @@ -26,6 +26,15 @@ "absorbance": { "value": -0.008245813102050192, "unit": "mAU" + }, + "custom information document": { + "a260/a230": 0.4716429731601753, + "a260/a280": -43.64513059797263, + "sample name": "Sample 1", + "ng/âμl": -0.4122906551025096, + "date & time": "06/16/2022 04:38:28 PM(-07:00)", + "serial number": "NDE8675309", + "user name": "Jenny" } }, { @@ -297,6 +306,13 @@ "absorbance": { "value": -0.01142989429727237, "unit": "mAU" + }, + "custom information document": { + "a260/a230": 0.7474400267787948, + "a260/a280": 3.500264914912444, + "sample name": "Sample 2", + "ng/âμl": -0.5714947148636185, + "date & time": "06/16/2022 04:39:01 PM(-07:00)" } }, { @@ -565,6 +581,13 @@ "absorbance": { "value": -0.009565099990167525, "unit": "mAU" + }, + "custom information document": { + "a260/a230": 1.461831081649615, + "a260/a280": -1.0907398987646264, + "sample name": "Abc 3", + "ng/âμl": -0.47825499950837624, + "date & time": "06/16/2022 04:39:39 PM(-07:00)" } }, { @@ -775,6 +798,13 @@ "absorbance": { "value": -0.008348743142043702, "unit": "mAU" + }, + "custom information document": { + "a260/a230": 4.223068228732775, + "a260/a280": -0.6241776992561424, + "sample name": "Abc", + "ng/âμl": -0.4174371571021851, + "date & time": "06/16/2022 04:40:39 PM(-07:00)" } }, { @@ -964,6 +994,12 @@ "absorbance": { "value": -0.018283710715536472, "unit": "mAU" + }, + "custom information document": { + "a260/a230": 1.340839950170999, + "a260/a280": 2.027763503070494, + "ng/âμl": -0.9141855357768236, + "date & time": "06/16/2022 04:41:11 PM(-07:00)" } }, { @@ -1289,7 +1325,7 @@ "file name": "thermo_nanodrop_eight_example01.txt", "UNC path": "tests/parsers/thermo_fisher_nanodrop_eight/testdata/thermo_nanodrop_eight_example01.txt", "ASM converter name": "allotropy_thermo_fisher_scientific_nanodrop_eight", - "ASM converter version": "0.1.76" + "ASM converter version": "0.1.106" }, "calculated data aggregate document": { "calculated data document": [ diff --git a/tests/parsers/thermo_fisher_nanodrop_eight/testdata/thermo_nanodrop_eight_example02.json b/tests/parsers/thermo_fisher_nanodrop_eight/testdata/thermo_nanodrop_eight_example02.json index 89945eb73..80d6651dc 100644 --- a/tests/parsers/thermo_fisher_nanodrop_eight/testdata/thermo_nanodrop_eight_example02.json +++ b/tests/parsers/thermo_fisher_nanodrop_eight/testdata/thermo_nanodrop_eight_example02.json @@ -26,6 +26,15 @@ "absorbance": { "value": -0.008245813102050192, "unit": "mAU" + }, + "custom information document": { + "a260/a280": -43.64513059797263, + "a260/a230": 0.4716429731601753, + "sample name": "Sample 1", + "date & time": "06/16/2022 04:38:28 PM(-07:00)", + "ng/âμl": -0.4122906551025096, + "serial number": "NDE8675309", + "user name": "Jenny" } }, { @@ -297,6 +306,13 @@ "absorbance": { "value": -0.01142989429727237, "unit": "mAU" + }, + "custom information document": { + "a260/a280": 3.500264914912444, + "a260/a230": 0.7474400267787948, + "sample name": "Sample 2", + "date & time": "06/16/2022 04:39:01 PM(-07:00)", + "ng/âμl": -0.5714947148636185 } }, { @@ -565,6 +581,13 @@ "absorbance": { "value": -0.009565099990167525, "unit": "mAU" + }, + "custom information document": { + "a260/a280": -1.0907398987646264, + "a260/a230": 1.461831081649615, + "sample name": "Abc 3", + "date & time": "06/16/2022 04:39:39 PM(-07:00)", + "ng/âμl": -0.47825499950837624 } }, { @@ -775,6 +798,13 @@ "absorbance": { "value": -0.008348743142043702, "unit": "mAU" + }, + "custom information document": { + "a260/a280": -0.6241776992561424, + "a260/a230": 4.223068228732775, + "sample name": "Abc", + "date & time": "06/16/2022 04:40:39 PM(-07:00)", + "ng/âμl": -0.4174371571021851 } }, { @@ -964,6 +994,12 @@ "absorbance": { "value": -0.018283710715536472, "unit": "mAU" + }, + "custom information document": { + "a260/a280": 2.027763503070494, + "a260/a230": 1.340839950170999, + "date & time": "06/16/2022 04:41:11 PM(-07:00)", + "ng/âμl": -0.9141855357768236 } }, { @@ -1289,7 +1325,7 @@ "file name": "thermo_nanodrop_eight_example02.txt", "UNC path": "tests/parsers/thermo_fisher_nanodrop_eight/testdata/thermo_nanodrop_eight_example02.txt", "ASM converter name": "allotropy_thermo_fisher_scientific_nanodrop_eight", - "ASM converter version": "0.1.76" + "ASM converter version": "0.1.106" }, "calculated data aggregate document": { "calculated data document": [ diff --git a/tests/parsers/thermo_fisher_nanodrop_eight/testdata/thermo_nanodrop_eight_tab_aligned_header.json b/tests/parsers/thermo_fisher_nanodrop_eight/testdata/thermo_nanodrop_eight_tab_aligned_header.json index 56673ff79..1bf2bf28e 100644 --- a/tests/parsers/thermo_fisher_nanodrop_eight/testdata/thermo_nanodrop_eight_tab_aligned_header.json +++ b/tests/parsers/thermo_fisher_nanodrop_eight/testdata/thermo_nanodrop_eight_tab_aligned_header.json @@ -26,6 +26,15 @@ "absorbance": { "value": -0.008245813102050192, "unit": "mAU" + }, + "custom information document": { + "a260/a280": -43.64513059797263, + "a260/a230": 0.4716429731601753, + "date & time": "06/16/2022 04:38:28 PM(-07:00)", + "sample name": "Sample 1", + "ng/âμl": -0.4122906551025096, + "serial number": "NDE8675309", + "user name": "Jenny" } }, { @@ -297,6 +306,13 @@ "absorbance": { "value": -0.01142989429727237, "unit": "mAU" + }, + "custom information document": { + "a260/a280": 3.500264914912444, + "a260/a230": 0.7474400267787948, + "date & time": "06/16/2022 04:39:01 PM(-07:00)", + "sample name": "Sample 2", + "ng/âμl": -0.5714947148636185 } }, { @@ -565,6 +581,13 @@ "absorbance": { "value": -0.009565099990167525, "unit": "mAU" + }, + "custom information document": { + "a260/a280": -1.0907398987646264, + "a260/a230": 1.461831081649615, + "date & time": "06/16/2022 04:39:39 PM(-07:00)", + "sample name": "Abc 3", + "ng/âμl": -0.47825499950837624 } }, { @@ -775,6 +798,13 @@ "absorbance": { "value": -0.008348743142043702, "unit": "mAU" + }, + "custom information document": { + "a260/a280": -0.6241776992561424, + "a260/a230": 4.223068228732775, + "date & time": "06/16/2022 04:40:39 PM(-07:00)", + "sample name": "Abc", + "ng/âμl": -0.4174371571021851 } }, { @@ -964,6 +994,12 @@ "absorbance": { "value": -0.018283710715536472, "unit": "mAU" + }, + "custom information document": { + "a260/a280": 2.027763503070494, + "a260/a230": 1.340839950170999, + "date & time": "06/16/2022 04:41:11 PM(-07:00)", + "ng/âμl": -0.9141855357768236 } }, { @@ -1289,7 +1325,7 @@ "file name": "thermo_nanodrop_eight_tab_aligned_header.txt", "UNC path": "tests/parsers/thermo_fisher_nanodrop_eight/testdata/thermo_nanodrop_eight_tab_aligned_header.txt", "ASM converter name": "allotropy_thermo_fisher_scientific_nanodrop_eight", - "ASM converter version": "0.1.76" + "ASM converter version": "0.1.106" }, "calculated data aggregate document": { "calculated data document": [