ts_ids_components.flow_cytometry package#

Submodules#

Module contents#

This module contains components for flow cytometry IDSs.

Flow Cytometry#

Flow cytometry is a laser-based technique for measuring the physical and chemical characteristics of cells or particles as they flow in a fluid stream through a beam of light. It is widely used in life sciences for cell counting, cell sorting, biomarker detection, and protein engineering.

Each cell or particle that passes the laser generates signals (scatter and fluorescence) that are recorded as individual events. These events are then grouped into populations by applying gates — geometric regions drawn on two-dimensional scatter or fluorescence plots — and organized into hierarchical gating strategies.

This component is designed to be generic across flow cytometry software and instruments.

Gating components#

The Gate component (defined in ts_ids_components.flow_cytometry.gate) represents a single gate definition in a gating strategy. Gates can be hierarchical (child gates referencing parent gates), and common gate types include polygon, rectangle, and ellipsoid gates.

Population components#

The Population component (defined in ts_ids_components.flow_cytometry.population) represents a subset of cells selected by applying a gate to a sample. Populations are linked to their parent sample and the gate used to define them, and can be organized into hierarchical analysis paths.

Statistic components#

The Statistic component (defined in ts_ids_components.flow_cytometry.statistic) represents a computed measurement for a given population, such as count, mean fluorescence intensity, or frequency of parent. Statistics are linked to both a sample and a population.

Model Gate[source]#

Bases: IdsElement

A gate definition used in flow cytometry gating strategies.

Gates define regions on flow cytometry plots to select cell populations. Gates can be hierarchical, with child gates referencing parent gates via parent_gate_id. Gate types include PolygonGate, RectangleGate, EllipsoidGate, and others.

Show JSON schema
{
   "description": "A gate definition used in flow cytometry gating strategies.\n\nGates define regions on flow cytometry plots to select cell populations.\nGates can be hierarchical, with child gates referencing parent gates via parent_gate_id.\nGate types include PolygonGate, RectangleGate, EllipsoidGate, and others.",
   "type": "object",
   "properties": {
      "pk": {
         "description": "Primary key UUID for this gate.",
         "type": "string"
      },
      "id": {
         "description": "The unique identifier of the gate from the source system.",
         "type": [
            "string",
            "null"
         ]
      },
      "parent_gate_id": {
         "description": "The identifier of the parent gate, establishing the gating hierarchy.",
         "type": [
            "string",
            "null"
         ]
      },
      "type_": {
         "description": "The type of gate (e.g., 'PolygonGate', 'RectangleGate', 'EllipsoidGate').",
         "type": [
            "string",
            "null"
         ]
      },
      "x_axis_name": {
         "description": "The name of the x-axis parameter used for this gate.",
         "type": [
            "string",
            "null"
         ]
      },
      "y_axis_name": {
         "description": "The name of the y-axis parameter used for this gate.",
         "type": [
            "string",
            "null"
         ]
      },
      "minimum_x_coordinate": {
         "description": "The minimum x-coordinate boundary of the gate (for rectangle gates).",
         "type": [
            "number",
            "null"
         ]
      },
      "maximum_x_coordinate": {
         "description": "The maximum x-coordinate boundary of the gate (for rectangle gates).",
         "type": [
            "number",
            "null"
         ]
      },
      "minimum_y_coordinate": {
         "description": "The minimum y-coordinate boundary of the gate (for rectangle gates).",
         "type": [
            "number",
            "null"
         ]
      },
      "maximum_y_coordinate": {
         "description": "The maximum y-coordinate boundary of the gate (for rectangle gates).",
         "type": [
            "number",
            "null"
         ]
      },
      "vertices_x": {
         "description": "List of x-coordinates for polygon and ellipsoid gate vertices.",
         "items": {
            "type": "number"
         },
         "type": "array"
      },
      "vertices_y": {
         "description": "List of y-coordinates for polygon and ellipsoid gate vertices.",
         "items": {
            "type": "number"
         },
         "type": "array"
      },
      "ellipsoid_focal_points_x": {
         "description": "List of x-coordinates for ellipsoid gate focal points.",
         "items": {
            "type": "number"
         },
         "type": "array"
      },
      "ellipsoid_focal_points_y": {
         "description": "List of y-coordinates for ellipsoid gate focal points.",
         "items": {
            "type": "number"
         },
         "type": "array"
      },
      "distance": {
         "description": "The distance parameter of the ellipsoid gate.",
         "type": [
            "number",
            "null"
         ]
      }
   },
   "additionalProperties": false
}

Validators:

field distance: Decimal | None#

The distance parameter of the ellipsoid gate.

field ellipsoid_focal_points_x: List[float]#

List of x-coordinates for ellipsoid gate focal points.

field ellipsoid_focal_points_y: List[float]#

List of y-coordinates for ellipsoid gate focal points.

field id_: str | None (alias 'id')#

The unique identifier of the gate from the source system.

field maximum_x_coordinate: float | None#

The maximum x-coordinate boundary of the gate (for rectangle gates).

field maximum_y_coordinate: float | None#

The maximum y-coordinate boundary of the gate (for rectangle gates).

field minimum_x_coordinate: float | None#

The minimum x-coordinate boundary of the gate (for rectangle gates).

field minimum_y_coordinate: float | None#

The minimum y-coordinate boundary of the gate (for rectangle gates).

field parent_gate_id: str | None#

The identifier of the parent gate, establishing the gating hierarchy.

field pk: UUID#

Primary key UUID for this gate.

field type_: str | None#

The type of gate (e.g., ‘PolygonGate’, ‘RectangleGate’, ‘EllipsoidGate’).

field vertices_x: List[float]#

List of x-coordinates for polygon and ellipsoid gate vertices.

field vertices_y: List[float]#

List of y-coordinates for polygon and ellipsoid gate vertices.

field x_axis_name: str | None#

The name of the x-axis parameter used for this gate.

field y_axis_name: str | None#

The name of the y-axis parameter used for this gate.

Model Population[source]#

Bases: IdsElement

A population representing a subset of cells selected by gating in flow cytometry.

Populations are created by applying gates to samples and can be hierarchical. Each population references its parent sample and the gate method used to define it.

Show JSON schema
{
   "description": "A population representing a subset of cells selected by gating in flow cytometry.\n\nPopulations are created by applying gates to samples and can be hierarchical.\nEach population references its parent sample and the gate method used to define it.",
   "type": "object",
   "properties": {
      "pk": {
         "description": "Primary key UUID for this population.",
         "type": "string"
      },
      "name": {
         "description": "The name of the cellular/particle population (e.g., CD4+, CD8+, etc).",
         "type": [
            "string",
            "null"
         ]
      },
      "count_": {
         "description": "The number of events (cells/particles) in this population.",
         "type": [
            "integer",
            "null"
         ]
      },
      "analysis_path": {
         "description": "The full hierarchical path to this population (e.g., 'Lymphocytes/CD4+/CD8-').",
         "type": [
            "string",
            "null"
         ]
      },
      "parent_analysis_path": {
         "description": "The analysis path of the parent population.",
         "type": [
            "string",
            "null"
         ]
      },
      "fk_sample": {
         "description": "Foreign key UUID linking to the sample this population belongs to.",
         "type": "string"
      },
      "fk_method_gate": {
         "description": "Foreign key UUID linking to the gate method used to define this population.",
         "type": [
            "string",
            "null"
         ]
      }
   },
   "additionalProperties": false
}

Validators:

field analysis_path: str | None#

The full hierarchical path to this population (e.g., ‘Lymphocytes/CD4+/CD8-‘).

field count_: int | None#

The number of events (cells/particles) in this population.

field fk_method_gate: UUID | None#

Foreign key UUID linking to the gate method used to define this population.

field fk_sample: UUID#

Foreign key UUID linking to the sample this population belongs to.

field name: str | None#

The name of the cellular/particle population (e.g., CD4+, CD8+, etc).

field parent_analysis_path: str | None#

The analysis path of the parent population.

field pk: UUID#

Primary key UUID for this population.

Model Statistic[source]#

Bases: IdsElement

A statistic value calculated for a population in flow cytometry analysis.

Statistics represent computed measurements such as count, frequency, mean, median, CV, etc. for a given population.

Show JSON schema
{
   "description": "A statistic value calculated for a population in flow cytometry analysis.\n\nStatistics represent computed measurements such as count, frequency, mean,\nmedian, CV, etc. for a given population.",
   "type": "object",
   "properties": {
      "pk": {
         "description": "Primary key UUID for this statistic.",
         "type": "string"
      },
      "name": {
         "description": "The name of the statistic (e.g., 'Mean', 'Count', 'Frequency of Parent').",
         "type": [
            "string",
            "null"
         ]
      },
      "value": {
         "$ref": "#/definitions/RawValueUnit",
         "description": "The numeric value of the statistic with unit and raw value preservation."
      },
      "fk_sample": {
         "description": "Foreign key UUID linking to the sample.",
         "type": "string"
      },
      "fk_population": {
         "description": "Foreign key UUID linking to the population this statistic belongs to.",
         "type": "string"
      },
      "ancestor_analysis_path": {
         "description": "The analysis path of the ancestor population for frequency-of calculations.",
         "type": [
            "string",
            "null"
         ]
      }
   },
   "additionalProperties": false,
   "definitions": {
      "RawValueUnit": {
         "additionalProperties": false,
         "description": "A value with a unit, including the raw representation of the value from the primary data.",
         "properties": {
            "value": {
               "description": "A numerical value.",
               "type": [
                  "number",
                  "null"
               ]
            },
            "unit": {
               "description": "Unit for the numerical value.",
               "type": [
                  "string",
                  "null"
               ]
            },
            "raw_value": {
               "description": "The raw, untransformed value from the primary data.",
               "type": [
                  "string",
                  "null"
               ]
            }
         },
         "required": [
            "value",
            "unit",
            "raw_value"
         ],
         "type": "object"
      }
   }
}

Validators:

field ancestor_analysis_path: str | None#

The analysis path of the ancestor population for frequency-of calculations.

field fk_population: UUID#

Foreign key UUID linking to the population this statistic belongs to.

field fk_sample: UUID#

Foreign key UUID linking to the sample.

field name: str | None#

The name of the statistic (e.g., ‘Mean’, ‘Count’, ‘Frequency of Parent’).

field pk: UUID#

Primary key UUID for this statistic.

field value: RawValueUnit#

The numeric value of the statistic with unit and raw value preservation.