ScientiaLux
strataquest Glossary Assign Classes to Objects
Measurement Engine

Assign Classes to Objects

Labeling detected events by their classifier or proximity zone

View
Definition
When you need to categorize cells based on a known set of rules, Assign Classes lets you define classification logic directly — if a cell expresses CD3 and CD8, call it a cytotoxic T cell. Unlike machine learning classifiers that learn rules from training data, Assign Classes applies expert-defined logic explicitly: combining marker positivity, gating results, and measurement thresholds into a deterministic classification that is fully transparent and reproducible.
Rule-Based Classification
Expert-defined logic, not learned models
Boolean Logic
AND, OR, NOT combinations
Priority Ordering
Handle overlapping definitions
Downstream Integration
Classes feed spatial analysis

How It Works

Assign Classes applies deterministic classification rules to measurement data:

  1. Define classes — Each class has a name, a color code for visualization, and a set of logical conditions based on measurements or gating results. Example: "Cytotoxic T" = CD3_gate == positive AND CD8_gate == positive.
  2. Priority ordering — Classes are ordered by priority. When a cell matches multiple classes, the highest-priority match is assigned.
  3. Assignment — Each cell is evaluated against all class definitions in priority order. The first matching class is assigned. Cells matching no class receive a default "Unclassified" label.
  4. Output — A classification column is added to the measurement table. Each cell has exactly one class label. Visualization overlays show each class in its assigned color.
Simplified

Assign Classes lets you write rules like "if CD3 positive AND CD8 positive, call it cytotoxic T cell." Each cell is evaluated against your rules in priority order, and the first matching rule determines its class. The result is a color-coded map showing every cell's type.

Science Behind It

Expert systems vs. statistical classification: Assign Classes implements a classic expert system — domain knowledge is encoded as explicit if-then rules. This contrasts with statistical classifiers (Bayesian, SVM, Random Forest) that learn decision boundaries from training data. The tradeoff: expert rules are interpretable and require no training data, but may miss subtle patterns that statistical methods capture. Statistical methods handle ambiguity better but are "black boxes" whose decisions can be hard to explain.

Bayesian classification framework: MIT's Statistical Models chapter shows that optimal classification assigns each observation to the class with the highest posterior probability: P(class|data) ∝ P(data|class) × P(class). Assign Classes implements a simplified version: the gating thresholds define decision boundaries, and the Boolean logic defines the class structure. When gates are set at the population valley (the point where two marker populations are best separated), Assign Classes approximates the Bayes-optimal classifier for well-separated markers.

The hierarchy of classification: In multiplex panels, classification is inherently hierarchical. First distinguish tumor from immune (CK+/−). Within immune, distinguish T cells from B cells (CD3/CD20). Within T cells, distinguish helper from cytotoxic (CD4/CD8). Assign Classes naturally encodes this hierarchy through priority ordering — broader categories (immune) are lower priority than specific ones (cytotoxic T). Cells matching the specific rule are classified there; cells matching only the broad rule fall to the broader category.

Simplified

Assign Classes is an expert system — you encode biological knowledge as rules. This is the opposite of machine learning classifiers that learn from data. The advantage is total transparency: you know exactly why each cell was classified as it was. The disadvantage is that you must know the rules in advance. For well-defined phenotypes with clear marker combinations, explicit rules often work as well as learned models.

Practical Example

Immune cell phenotyping in a 6-marker multiplex panel:

  1. Class 1 (highest priority): Cytotoxic T = CD3+ AND CD8+ AND CK−
  2. Class 2: Helper T = CD3+ AND CD8− AND CK−
  3. Class 3: B cell = CD20+ AND CD3− AND CK−
  4. Class 4: PD-L1+ Tumor = CK+ AND PD-L1+
  5. Class 5: PD-L1− Tumor = CK+ AND PD-L1−
  6. Class 6 (lowest priority): Other = everything else

Priority ordering handles edge cases: a rare CD3+CD20+ double-positive cell is classified as a T cell (higher priority), not a B cell. This deterministic assignment ensures every cell gets exactly one class label for downstream spatial analysis.

Simplified

Define phenotypes using marker combinations: cytotoxic T cells are CD3+CD8+, B cells are CD20+, tumor cells are CK+. Priority ordering resolves ambiguity — if a cell matches multiple rules, the highest-priority one wins. The result is a complete classification of every cell for spatial analysis.

Connected Terms

Share This Term
Term Connections