Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions src/allotropy/parsers/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,17 @@
POSSIBLE_WELL_COUNTS = [1, 2, 4, 6, 8, 12, 24, 48, 72, 96, 384, 1536, 3456]


def round_to_nearest_well_count(well_count: int) -> int | None:
for possible_count in POSSIBLE_WELL_COUNTS:
def round_to_nearest_well_count(
well_count: int, possible_well_counts: list[int] | None = None
) -> int | None:
"""
Round the well count to the nearest well count in the list of possible well counts. If a list
of possible well counts is not provided, use the default list of possible well counts.
If the well count is not in the list of possible well counts, return None.
"""
well_counts = possible_well_counts or POSSIBLE_WELL_COUNTS
well_counts.sort()
for possible_count in well_counts:
if well_count > possible_count:
continue
return possible_count
Expand Down
51 changes: 51 additions & 0 deletions src/allotropy/parsers/luminex_xponent/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
EXPECTED_CALIBRATION_RESULT_LEN = 2
EXPECTED_HEADER_COLUMNS = 7
REQUIRED_SECTIONS = ["Count", "Units", "Dilution Factor"]
POSSIBLE_WELL_COUNTS_LUMINEX = [96, 384]


@dataclass(frozen=True)
Expand Down Expand Up @@ -69,3 +70,53 @@ class StatisticSectionConfig:
"% Recovery": "(unitless)",
"%CV of Replicates": "(unitless)",
}

# Known metric names in the columns of the single dataset results table
SINGLE_DATASET_RESULTS_METRIC_WORDS: set[str] = {
"MEAN",
"MEDIAN",
"COUNT",
"PEAK",
"STDEV",
"STANDARD",
"DEVIATION",
"%CV",
"TRIMMED",
"NET",
"MFI",
"AVERAGE",
"AVG",
"RMS",
"MODE",
"TRMEAN",
"TRIMSTDEV",
"NORMALIZED",
"DILUTION",
"FACTOR",
"SETTING",
"UNITS",
}

# Allowed section names for Luminex Xponent reports. Any other name should raise an error upstream.
ALLOWED_SECTION_NAMES: set[str] = {
"Median",
"Test Result",
"Range",
"Net MFI",
"Count",
"Mean",
"Avg Net MFI",
"Peak",
"Trimmed Peak",
"Trimmed Count",
"Trimmed Std Dev",
"Std Dev",
"% CV",
"Expected Result",
"Units",
"Per Bead Count",
"Dilution Factor",
"Analysis Types",
"Audit Logs",
"Warnings/Errors",
}
Loading
Loading