arista.ingest.metadata

Filename + directory-name parsers that recover dimension-table fields.

Two layers:

  • Animal label (the directory name above each session’s Fiji CSVs): WT_02_m → sex=``’m’, animal_number=2, arista_suffix=``None. The leading strain code is captured for sanity-checks but the canonical strain comes from the parent genotype directory (641 / 605 / nomp_C in Alex’s tree), not from this label.

  • Cell label (the Fiji filename stem itself): handled by arista.constants.parse_fiji_filename() — already covers every observed pattern.

The deep HCS layout (<genotype>/<date>/<exp>/Arista_<side>/) is recognised but the full parser is deferred to the next ingest sprint.

Functions

parse_animal_label(label)

Parse an animal-directory name into structured fields.

Classes

AnimalLabel(strain_prefix, animal_number, ...)

Parsed animal-directory components.

class arista.ingest.metadata.AnimalLabel(strain_prefix, animal_number, sex, arista_suffix)[source]

Bases: object

Parsed animal-directory components.

Parameters:
  • strain_prefix (str)

  • animal_number (int)

  • sex (str)

  • arista_suffix (str | None)

strain_prefix

The leading token (e.g. 'WT' / 'nompC') present in the directory name. Informational — the canonical strain comes from the genotype directory one level up.

Type:

str

animal_number

The 1-based animal-of-the-day integer.

Type:

int

sex

'm' / 'f' / 'u'.

Type:

str

arista_suffix

'b' for the second arista on the same fly; None otherwise. Robert’s f02b convention is the inspiration; Alex uses this rarely.

Type:

str | None

animal_number: int
arista_suffix: str | None
sex: str
strain_prefix: str
arista.ingest.metadata.parse_animal_label(label)[source]

Parse an animal-directory name into structured fields.

Returns None if label does not match the expected pattern, so callers can filter() without try/except boilerplate.

Parameters:

label (str) – Directory base-name, e.g. 'WT_02_m' or 'nompC_01_f' or 'WT_02b_m'.

Returns:

An AnimalLabel if the name parses, else None.

Return type:

AnimalLabel | None