clophfit.prtecan.models#
Prtecan/prtecan.py.
Classes#
Parse a label block. |
|
Parse a Tecan .xls file. |
|
Group labelblocks with compatible metadata. |
|
Group of Tecanfiles containing at least one common Labelblock. |
|
Define buffer, discard, ctrl and unk wells, and ctrl names. |
Module Contents#
- class clophfit.prtecan.models.Labelblock#
Parse a label block.
- Parameters:
lines
- Raises:
ValueError – When data do not correspond to a complete 96-well plate.
TypeError – When normalization parameters are not numerical.
Notes
Logs a warning when it replaces “OVER” with
np.nanfor saturated values.- lines: dataclasses.InitVar[list[list[str | int | float]]]#
Lines to create this Labelblock.
- filename: str = ''#
Path of the corresponding Tecan file.
- metadata: dict[str, clophfit.prtecan.parsers.Metadata]#
Metadata specific for this Labelblock.
- data: dict[str, float]#
Plate data values as {‘well_name’, value}.
- data_nrm: dict[str, float]#
Plate data values normalized as {‘well_name’, value}.
- almost_equal(other)#
Check if two Labelblocks are almost equal (same excitation and emission).
- Parameters:
other (Labelblock)
- Return type:
bool
- class clophfit.prtecan.models.Tecanfile#
Parse a Tecan .xls file.
- Parameters:
path (Path) – Path to .xls file.
- Raises:
FileNotFoundError – When path does not exist.
ValueError – When no Labelblock is found or file format is invalid.
- metadata: dict[str, clophfit.prtecan.parsers.Metadata]#
General metadata for Tecanfile, like Date and Shaking Duration.
- labelblocks: dict[int, Labelblock]#
All labelblocks contained in this file.
- class clophfit.prtecan.models.LabelblocksGroup#
Group labelblocks with compatible metadata.
- Parameters:
labelblocks (list[Labelblock]) – Labelblocks to be grouped.
allequal
- Raises:
Exception – When labelblocks are neither equal nor almost equal.
- allequal: bool = False#
True if labelblocks already tested equal.
- metadata: dict[str, clophfit.prtecan.parsers.Metadata]#
Metadata shared by all labelblocks.
- property data: dict[str, list[float]]#
Grouped data if labelblocks are equal, otherwise empty.
- Return type:
dict[str, list[float]]
- property data_nrm: dict[str, list[float]]#
Normalized data by number of flashes, integration time and gain.
- Return type:
dict[str, list[float]]
- class clophfit.prtecan.models.TecanfilesGroup#
Group of Tecanfiles containing at least one common Labelblock.
- Parameters:
tecanfiles (list[Tecanfile]) – List of Tecanfiles.
- Raises:
ValueError – When no common Labelblock is found across all Tecanfiles.
Notes
Logs a warning if the Tecanfiles do not contain the same number of Labelblocks that can be merged in the same order. In such cases, fewer LabelblocksGroup may be created.
- labelblocksgroups: dict[int, LabelblocksGroup]#
Each group contains its own data like a titration.
- metadata: dict[str, clophfit.prtecan.parsers.Metadata]#
Metadata shared by all tecanfiles.
- class clophfit.prtecan.models.PlateScheme#
Define buffer, discard, ctrl and unk wells, and ctrl names.
- Parameters:
file (Path) – File path to the scheme file [<well Id, sample name>].
- property nofit_keys: set[str]#
Buffer and discarded wells.
- Return type:
set[str]
- property buffer: list[str]#
List of buffer wells.
- Return type:
list[str]
- property discard: list[str]#
List of discard wells.
- Return type:
list[str]
- property ctrl: list[str]#
List of CTR wells.
- Return type:
list[str]
- property names: dict[str, set[str]]#
A dictionary mapping sample names to their associated list of wells.
- Return type:
dict[str, set[str]]