ip_runs¶
ip_runs
¶
Read IP coordinates from the lab's "Overview of IP runs" sheet.
The sheet (Overview of IP runs TV(Overview).csv, exported from Excel
as ;-separated cp1252) is the only source of IPR/IPRP.
Columns N (IP run #) and O (Plate #) are the true coordinates
and are unique per plate. Column P (Combined*) is the old RxxPxx
label that some files and sample names still carry; it is not unique
(R08P01/R08P02 each name two plates) and is kept here only so
records named under the old scheme can be looked up.
N is a merged cell in the workbook, so the export fills it on the first plate of each run only; it is carried down to the plates below.
load_plates
¶
Return every plate in the sheet with its canonical IP coordinates.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
str | Path
|
The Overview CSV export. |
required |
encoding
|
str
|
File encoding; Excel writes cp1252 on the lab machines. |
'cp1252'
|
Returns:
| Type | Description |
|---|---|
list[IPPlate]
|
One [ |
list[IPPlate]
|
number, in sheet order. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If the header row is missing, a plate has no run to inherit, or two rows share the same run and plate. |
Source code in src/noxdb/ip_runs.py
by_old_label
¶
Group plates by the RxxPxx label files were named under.
A plate with no Combined* entry was named with its true
coordinates. Most labels map to one plate; a list longer than one is
a clash the caller has to settle by other evidence (e.g. project).
Source code in src/noxdb/ip_runs.py
coords_for_old_name
¶
coords_for_old_name(index: dict[str, list[IPPlate]], sample_name: str, projects: set[str] | frozenset[str] = frozenset()) -> list[tuple[str, str]]
Translate a name carrying an old RxxPxx label to sheet coordinates.
This is a lookup of the label in the sheet's Combined* column,
for records named before the sheet became the source: the
coordinates returned are the sheet's, never the name's.
A label the sheet gives to several plates is narrowed to the plates
whose description names one of projects. A run-only name
(R31_input1_..) maps to the true run of every plate labelled
under that old run, with an empty plate.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
index
|
dict[str, list[IPPlate]]
|
|
required |
sample_name
|
str
|
Name as stored or as written on the files. |
required |
projects
|
set[str] | frozenset[str]
|
Projects the record belongs to, to settle clashes. |
frozenset()
|
Returns:
| Type | Description |
|---|---|
list[tuple[str, str]]
|
Candidate |
list[tuple[str, str]]
|
means the label is not in the sheet; several is a clash the |
list[tuple[str, str]]
|
caller must not guess at. |