Skip to content

Commit 213bc43

Browse files
Chemometic Nucleoview: support for non-numeric values (#213)
Add support for non-numeric values in fields that are mapped to TQuantity type values.
1 parent a6b0152 commit 213bc43

10 files changed

+372
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
99
- Add calculated data documents to Unchained Labs Lunatic adapter
1010
- Parser for ChemoMetic NucleoView
1111
- Add non numeric options for tQuantityValue value property
12+
- Add support for non-numeric values to ChemoMetic NucleoView
1213
### Fixed
1314
### Changed
1415
- Simplify Moldev Softmax Pro parsing with dataclasses

src/allotropy/parsers/chemometec_nucleoview/nucleoview_parser.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,10 @@
2424
TQuantityValuePercent,
2525
TQuantityValueUnitless,
2626
)
27-
from allotropy.allotrope.models.shared.definitions.definitions import TDateTimeValue
27+
from allotropy.allotrope.models.shared.definitions.definitions import (
28+
TDateTimeValue,
29+
ValueEnum,
30+
)
2831
from allotropy.constants import ASM_CONVERTER_NAME, ASM_CONVERTER_VERSION
2932
from allotropy.named_file_contents import NamedFileContents
3033
from allotropy.parsers.chemometec_nucleoview.constants import (
@@ -60,6 +63,11 @@ def get_property_from_sample(
6063

6164
property_type = _PROPERTY_LOOKUP[property_name]
6265

66+
try:
67+
value = float(value)
68+
except ValueError:
69+
return property_type(value=ValueEnum.NaN)
70+
6371
# if the porperty type is measured in million cells per ml convert cells per ml
6472
if property_type == TQuantityValueMillionCellsPerMilliliter:
6573
return property_type(value=float(value) / 1e6)

src/allotropy/parsers/chemometec_nucleoview/nucleoview_reader.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,9 @@ def read(cls, contents: IOType) -> pd.DataFrame:
3434
raw_data["Date time"] + raw_data["Time zone offset"]
3535
)
3636
raw_data["Sample ID"] = raw_data["Image"].str.split("-", n=3).str[3]
37+
raw_data = raw_data.rename(
38+
{"Estimated cell diameter [um]": "Estimated cell diameter (um)"},
39+
axis=1,
40+
)
3741

3842
return raw_data

tests/parsers/chemometec_nucleoview/chemometec_nucleoview_parser_test.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
"chemometec_nucleoview_example01.csv",
88
"chemometec_nucleoview_example02.csv",
99
"chemometec_nucleoview_example03.csv",
10+
"chemometec_nucleoview_example04.csv",
11+
"chemometec_nucleoview_example05.csv",
12+
"chemometec_nucleoview_example06.csv",
1013
)
1114

1215
VENDOR_TYPE = Vendor.CHEMOMETEC_NUCLEOVIEW
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
Viability and Cell Count Assay - example cell counting; ;
2+
Image;20231120-0012-c-cellsABCD;
3+
Operator;DrScientist;
4+
Viability (%);68.2;
5+
Live (cells/ml);2.45E6;
6+
Dead (cells/ml);1.14E6;
7+
Total (cells/ml);3.58E3 (Out of optimal range);
8+
; ;
9+
Estimated cell diameter [um];Not determined;
10+
Cell diameter standard deviation (um);6.9;
11+
(%) of cells in aggregates with five or more cells;3;
12+
Sample Volume (ul);200.0;
13+
Dilution Volume (ul);0.000;
14+
Multiplication factor;1.000;
15+
;
16+
;
17+
;
18+
;
19+
;
20+
;
21+
;
22+
;
23+
;
24+
;
25+
;
26+
;
27+
;
28+
;
29+
cm filename;20231120-0012-c-cellsABCD.cm
30+
Protocol template title;Viability and Cell Count Assay
31+
Protocol template purpose;Cell Count and Viability with AO and DAPI
32+
Protocol template filename;Viability and Cell Count Assay - NC-200.cmsx
33+
Protocol adaptation title;example cell counting
34+
Protocol adaptation purpose;Cell Count and Viability with AO and DAPI
35+
Protocol adaptation filename;94A29BE3f39d48cd8eb5cb9472add350.cmsu
36+
Instrument type;NucleoView NC-200
37+
Instrument s/n;s/n 9000201099909999
38+
Date time;20231120 163016
39+
Time zone offset;2
40+
Login ID;admin
41+
PC;DESKTOP-A678B9H
42+
Application SW version;1.4.2.0
43+
21 CFR Part 11;disabled
44+
Event log format;Plain text
45+
csv file version;2
46+
47+
//[ECEC5A41]
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
{
2+
"$asm.manifest": "http://purl.allotrope.org/manifests/cell-counting/BENCHLING/2023/11/cell-counting.manifest",
3+
"cell counting aggregate document": {
4+
"cell counting document": [
5+
{
6+
"measurement aggregate document": {
7+
"measurement document": [
8+
{
9+
"measurement time": "2023-11-20T16:30:16+02:00",
10+
"measurement identifier": "8b1c98f3-936b-47ac-aea3-98e1a9d18abb",
11+
"device control aggregate document": {
12+
"device control document": [
13+
{
14+
"device type": "dark field imager (cell counter)",
15+
"detection type": "dark field"
16+
}
17+
]
18+
},
19+
"sample document": {
20+
"sample identifier": "cellsABCD"
21+
},
22+
"processed data aggregate document": {
23+
"processed data document": [
24+
{
25+
"viability (cell counter)": {
26+
"value": 68.2,
27+
"unit": "%"
28+
},
29+
"viable cell density (cell counter)": {
30+
"value": 2.45,
31+
"unit": "10^6 cells/mL"
32+
},
33+
"data processing document": {
34+
"cell density dilution factor": {
35+
"value": 1.0,
36+
"unit": "(unitless)"
37+
}
38+
},
39+
"total cell density (cell counter)": {
40+
"value": "NaN",
41+
"unit": "10^6 cells/mL"
42+
},
43+
"dead cell density (cell counter)": {
44+
"value": 1.14,
45+
"unit": "10^6 cells/mL"
46+
},
47+
"average total cell diameter": {
48+
"value": "NaN",
49+
"unit": "\u03bcm"
50+
}
51+
}
52+
]
53+
}
54+
}
55+
]
56+
},
57+
"analyst": "DrScientist"
58+
}
59+
],
60+
"device system document": {
61+
"model number": "NucleoView NC-200",
62+
"equipment serial number": "s/n 9000201099909999"
63+
},
64+
"data system document": {
65+
"file name": "chemometec_nucleoview_example04.csv",
66+
"software name": "NucleoView",
67+
"ASM converter name": "allotropy",
68+
"ASM converter version": "0.1.12"
69+
}
70+
}
71+
}
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
Viability and Cell Count Assay - example cell counting; ;
2+
Image;20231120-0012-c-cellsABCD;
3+
Operator;DrScientist;
4+
Viability (%);68.2;
5+
Live (cells/ml);2.45E6;
6+
Dead (cells/ml);1.14E6;
7+
Total (cells/ml);3.58E6;
8+
; ;
9+
Estimated cell diameter [um];<8;
10+
Cell diameter standard deviation (um);6.9;
11+
(%) of cells in aggregates with five or more cells;3;
12+
Sample Volume (ul);200.0;
13+
Dilution Volume (ul);0.000;
14+
Multiplication factor;1.000;
15+
;
16+
;
17+
;
18+
;
19+
;
20+
;
21+
;
22+
;
23+
;
24+
;
25+
;
26+
;
27+
;
28+
;
29+
cm filename;20231120-0012-c-cellsABCD.cm
30+
Protocol template title;Viability and Cell Count Assay
31+
Protocol template purpose;Cell Count and Viability with AO and DAPI
32+
Protocol template filename;Viability and Cell Count Assay - NC-200.cmsx
33+
Protocol adaptation title;example cell counting
34+
Protocol adaptation purpose;Cell Count and Viability with AO and DAPI
35+
Protocol adaptation filename;94A29BE3f39d48cd8eb5cb9472add350.cmsu
36+
Instrument type;NucleoView NC-200
37+
Instrument s/n;s/n 9000201099909999
38+
Date time;20231120 163016
39+
Time zone offset;2
40+
Login ID;admin
41+
PC;DESKTOP-A678B9H
42+
Application SW version;1.4.2.0
43+
21 CFR Part 11;disabled
44+
Event log format;Plain text
45+
csv file version;2
46+
47+
//[ECEC5A41]
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
{
2+
"$asm.manifest": "http://purl.allotrope.org/manifests/cell-counting/BENCHLING/2023/11/cell-counting.manifest",
3+
"cell counting aggregate document": {
4+
"cell counting document": [
5+
{
6+
"measurement aggregate document": {
7+
"measurement document": [
8+
{
9+
"measurement time": "2023-11-20T16:30:16+02:00",
10+
"measurement identifier": "08222a88-7587-492c-8812-9a1930bcec98",
11+
"device control aggregate document": {
12+
"device control document": [
13+
{
14+
"device type": "dark field imager (cell counter)",
15+
"detection type": "dark field"
16+
}
17+
]
18+
},
19+
"sample document": {
20+
"sample identifier": "cellsABCD"
21+
},
22+
"processed data aggregate document": {
23+
"processed data document": [
24+
{
25+
"viability (cell counter)": {
26+
"value": 68.2,
27+
"unit": "%"
28+
},
29+
"viable cell density (cell counter)": {
30+
"value": 2.45,
31+
"unit": "10^6 cells/mL"
32+
},
33+
"data processing document": {
34+
"cell density dilution factor": {
35+
"value": 1.0,
36+
"unit": "(unitless)"
37+
}
38+
},
39+
"total cell density (cell counter)": {
40+
"value": 3.58,
41+
"unit": "10^6 cells/mL"
42+
},
43+
"dead cell density (cell counter)": {
44+
"value": 1.14,
45+
"unit": "10^6 cells/mL"
46+
},
47+
"average total cell diameter": {
48+
"value": "NaN",
49+
"unit": "\u03bcm"
50+
}
51+
}
52+
]
53+
}
54+
}
55+
]
56+
},
57+
"analyst": "DrScientist"
58+
}
59+
],
60+
"device system document": {
61+
"model number": "NucleoView NC-200",
62+
"equipment serial number": "s/n 9000201099909999"
63+
},
64+
"data system document": {
65+
"file name": "chemometec_nucleoview_example05.csv",
66+
"software name": "NucleoView",
67+
"ASM converter name": "allotropy",
68+
"ASM converter version": "0.1.12"
69+
}
70+
}
71+
}
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
Viability and Cell Count Assay - example cell counting; ;
2+
Image;20231120-0002-c-cellsABCD;
3+
Operator;DrScientist;
4+
Viability (%);92.8;
5+
Live (cells/ml);1.58E6;
6+
Dead (cells/ml);1.22E5;
7+
Total (cells/ml);1.70E6;
8+
; ;
9+
Estimated cell diameter (um);13.2 (Uncertain
10+
determination);
11+
Cell diameter standard deviation (um);7.7;
12+
(%) of cells in aggregates with five or more cells;5;
13+
Sample Volume (ul);200.0;
14+
Dilution Volume (ul);0.000;
15+
Multiplication factor;1.000;
16+
;
17+
;
18+
;
19+
;
20+
;
21+
;
22+
;
23+
;
24+
;
25+
;
26+
;
27+
;
28+
;
29+
;
30+
cm filename;20231120-0039-c-cellsABCD.cm
31+
Protocol template title;Viability and Cell Count Assay
32+
Protocol template purpose;Cell Count and Viability with AO and DAPI
33+
Protocol template filename;Viability and Cell Count Assay - NC-200.cmsx
34+
Protocol adaptation title;example cell counting
35+
Protocol adaptation purpose;Cell Count and Viability with AO and DAPI
36+
Protocol adaptation filename;287764ADc8824786b882bfc202a12044.cmsu
37+
Instrument type;NucleoView NC-200
38+
Instrument s/n;s/n 9000201099909999
39+
Date time;20231120 110300
40+
Time zone offset;-7
41+
Login ID;admin
42+
PC;ABC0-NBBS-FQ01
43+
Application SW version;1.4.0.0
44+
21 CFR Part 11;disabled
45+
Event log format;Plain text
46+
csv file version;2
47+
48+
//[25FDBA08]

0 commit comments

Comments
 (0)