Skip to content

Commit f69003c

Browse files
authored
feat: Luminex IntelliFlex - Added support for single table files (#1061)
1 parent 185e540 commit f69003c

7 files changed

Lines changed: 4273 additions & 15 deletions

File tree

src/allotropy/parsers/constants.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,17 @@
1010
POSSIBLE_WELL_COUNTS = [1, 2, 4, 6, 8, 12, 24, 48, 72, 96, 384, 1536, 3456]
1111

1212

13-
def round_to_nearest_well_count(well_count: int) -> int | None:
14-
for possible_count in POSSIBLE_WELL_COUNTS:
13+
def round_to_nearest_well_count(
14+
well_count: int, possible_well_counts: list[int] | None = None
15+
) -> int | None:
16+
"""
17+
Round the well count to the nearest well count in the list of possible well counts. If a list
18+
of possible well counts is not provided, use the default list of possible well counts.
19+
If the well count is not in the list of possible well counts, return None.
20+
"""
21+
well_counts = possible_well_counts or POSSIBLE_WELL_COUNTS
22+
well_counts.sort()
23+
for possible_count in well_counts:
1524
if well_count > possible_count:
1625
continue
1726
return possible_count

src/allotropy/parsers/luminex_xponent/constants.py

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
EXPECTED_CALIBRATION_RESULT_LEN = 2
1616
EXPECTED_HEADER_COLUMNS = 7
1717
REQUIRED_SECTIONS = ["Count", "Units", "Dilution Factor"]
18+
POSSIBLE_WELL_COUNTS_LUMINEX = [96, 384]
1819

1920

2021
@dataclass(frozen=True)
@@ -69,3 +70,53 @@ class StatisticSectionConfig:
6970
"% Recovery": "(unitless)",
7071
"%CV of Replicates": "(unitless)",
7172
}
73+
74+
# Known metric names in the columns of the single dataset results table
75+
SINGLE_DATASET_RESULTS_METRIC_WORDS: set[str] = {
76+
"MEAN",
77+
"MEDIAN",
78+
"COUNT",
79+
"PEAK",
80+
"STDEV",
81+
"STANDARD",
82+
"DEVIATION",
83+
"%CV",
84+
"TRIMMED",
85+
"NET",
86+
"MFI",
87+
"AVERAGE",
88+
"AVG",
89+
"RMS",
90+
"MODE",
91+
"TRMEAN",
92+
"TRIMSTDEV",
93+
"NORMALIZED",
94+
"DILUTION",
95+
"FACTOR",
96+
"SETTING",
97+
"UNITS",
98+
}
99+
100+
# Allowed section names for Luminex Xponent reports. Any other name should raise an error upstream.
101+
ALLOWED_SECTION_NAMES: set[str] = {
102+
"Median",
103+
"Test Result",
104+
"Range",
105+
"Net MFI",
106+
"Count",
107+
"Mean",
108+
"Avg Net MFI",
109+
"Peak",
110+
"Trimmed Peak",
111+
"Trimmed Count",
112+
"Trimmed Std Dev",
113+
"Std Dev",
114+
"% CV",
115+
"Expected Result",
116+
"Units",
117+
"Per Bead Count",
118+
"Dilution Factor",
119+
"Analysis Types",
120+
"Audit Logs",
121+
"Warnings/Errors",
122+
}

0 commit comments

Comments
 (0)