Skip to content
Written for v1.5.0· Last updated: Oct 15, 2026

Subset ​

Core Feature

This feature is available in all Portrai Explorer deployments.

The Subset feature allows you to build subset queries by combining multiple conditions with logical operators. This powerful tool enables precise data selection based on features, lasso selections, brush regions, and signatures.

Subset Editor full view

Opening the Subset Editor ​

Access the Subset Editor from the Explorer view:

  1. Click the subset input field in the map viewer toolbar
  2. The Subset Panel opens

Subset Structure ​

Subsets use a hierarchical structure:

Subset
├── Group 1
│   ├── Condition A  ─┬─ AND/OR
│   ├── Condition B  ─┤
│   └── Condition C  ─┘
│
├── AND/OR (group operator)
│
└── Group 2
    ├── Condition D  ─┬─ AND/OR
    └── Condition E  ─┘
  • Conditions - Individual subset rules
  • Groups - Collections of conditions combined with AND/OR
  • Group Operator - Combines multiple groups with AND/OR

Subsets Narrow, Selections Mark ​

The Subset, together with the cutoff if one is set, decides which points exist on the map at all. A lasso or a brush region decides which of those points are marked as chosen: they are drawn at full strength and the rest stay on screen, dimmed.

Subset and cutoff   ->  hidden if excluded
Lasso and brush     ->  dimmed if not selected

This is why adding a lasso or a brush region to a Subset changes the picture: the same shape moves from the marking channel to the narrowing channel, so points that were dimmed a moment ago disappear. The selection is unchanged; what changed is the question it answers.

Counts, histograms, the plots other than the scatter plot, and Download Selected Data report the points that pass everything: the Subset, the cutoff and the selection together. Dimmed points are not included, and facet panels hide them. The map, the scatter plots and PNG captures show the dimmed points as they appear on screen.

The map and the scatter plots show a change first. The item count, the Detail Panel, the other plots and Download Selected Data follow within about half a second. While you draw several lassos or brush strokes in a row, the other plots and Download Selected Data wait until you pause, so the next stroke stays smooth. If you export right after a change, wait until the item count shows the new total: an export started earlier still holds the previous points.

Condition Types ​

Column Condition ​

Select by feature values from your dataset.

Column condition example

The column picker searches column notes as well as column names, marks annotated columns with a note icon, and offers a Has note checkbox in its search field. A caveat such as "below limit of detection in this run" is worth seeing here, at the moment you are about to filter on the column.

For Categorical Columns:

  • Select one or more categories to include
  • Points matching any selected category pass the subset

For Continuous Columns:

  • Set a value range or comparison
  • Available operators:
    OperatorMeaningExample
    Rangemin ≤ value ≤ maxExpression between 0.5 and 2.0
    >Greater thanExpression > 1.0
    ≥Greater or equalExpression ≥ 1.0
    <Less thanExpression < 0.5
    ≤Less or equalExpression ≤ 0.5

Lasso Condition ​

Select by saved lasso selections.

Lasso condition example

Lasso conditions are created by:

  1. Drawing a lasso selection on the map or scatter plot
  2. Clicking "Add selection to subset"

Each lasso condition includes:

  • Name - Descriptive name (auto-generated or custom)
  • Source - Where it was drawn (Spatial, UMAP, t-SNE, or Scatter Plot)
  • Polygon - The boundary coordinates (stored internally)

Brush Condition ​

Select by a region painted with the brush. Unlike a lasso, a brush region is a sequence of edits, so it can hold several disconnected areas and have holes erased out of it.

Brush conditions are created by:

  1. Painting a region on the map with the Brush and Eraser
  2. Clicking "Add selection to subset"

Each brush condition includes:

  • Name - Descriptive name (auto-generated or custom)
  • Source - The projection it was painted on (Spatial, UMAP, t-SNE)
  • Elements - How many strokes and polygons it holds

See Brush Selection for painting and editing.

Signature Condition ​

Select by computed signature scores.

Signature condition example

Configure:

  • Signature - Select from your created signatures
  • Combination Method - How to compute the score
    MethodDescription
    MaxMaximum value across variables
    MinMinimum value across variables
    SumSum of all variable values
    AvgAverage of all variable values
    UMI CountNormalized: ln(10000 × sum/totalUMI + 1)
  • Comparison - Range or comparison operator with threshold

Creating Conditions ​

Add a New Condition ​

  1. Click Add Condition within a group
  2. A column condition is added. It becomes a Signature condition if you pick a signature from the Signatures tab of its column selector
  3. Configure the condition parameters
  4. The subset updates preview automatically

Lasso and Brush conditions are not created here. They are made on the map and handed to the subset, as described below.

Add condition button

Configure Column Condition ​

  1. Click the column selector dropdown
  2. Choose a feature column
  3. For categorical: select categories from the list
  4. For continuous: set operator and value(s)

Configure Lasso Condition ​

Lasso conditions are added from the map viewer:

  1. Draw a lasso selection
  2. Click "Add selection to subset" from the Items dropdown
  3. The lasso appears as a condition in the subset editor

Configure Brush Condition ​

Brush conditions are added from the map viewer:

  1. Paint a region with the Brush, refining it with the Eraser
  2. Click "Add selection to subset" from the Items dropdown, or use the Add to subset button on the Subset Panel banner
  3. The region appears as a condition in the subset editor

Configure Signature Condition ​

  1. Select a signature from the dropdown
  2. Choose the combination method
  3. Set the comparison operator and value

Working with Groups ​

Add a New Group ​

  1. Click Add Subset Group at the subset level
  2. A new empty group appears
  3. Add conditions to the group

Set Group Operator ​

Choose how conditions within a group combine:

  • AND - All conditions must match (intersection)
  • OR - Any condition can match (union)

Group operator selector

Set Subset Group Operator ​

Choose how multiple groups combine:

  • AND - Points must match all groups
  • OR - Points can match any group

Logical Operators Explained ​

AND Logic ​

Condition A AND Condition B

Result: Only points that satisfy both conditions

Example: Cell type = "T cell" AND CD3E > 1.0 → Shows only T cells with high CD3E expression

OR Logic ​

Condition A OR Condition B

Result: Points that satisfy either or both conditions

Example: Cell type = "T cell" OR Cell type = "NK cell" → Shows all T cells and NK cells

Combining Groups ​

(A AND B) OR (C AND D)

Result: Points matching Group 1 OR points matching Group 2

Example:

  • Group 1: Region A AND high expression
  • Group 2: Region B AND low expression → Shows high expressors in Region A plus low expressors in Region B

Managing Conditions ​

Edit a Condition ​

Click on any condition parameter to modify it:

  • Change the column/signature selection
  • Adjust values or operators
  • The subset recalculates automatically

Lasso and Brush conditions hold a shape rather than parameters, so only their name can be changed here. A Brush condition can also be reopened on the map with its pencil button: see Editing a saved region. A lasso shape cannot be edited; delete the condition and draw again.

Remove a Condition ​

  1. Locate the condition to remove
  2. Click the X or delete button
  3. The condition is removed from the group

Remove a Group ​

  1. Remove all conditions from the group, or
  2. Click the group's delete button
  3. The entire group is removed

Applying Subsets ​

Auto Apply ​

The Auto apply checkbox in the Subset Panel controls when changes take effect:

  • Enabled (default) - The map view updates automatically as you build the subset, so you can preview matching points immediately. The point count indicates how many items pass the subset.
  • Disabled - Changes are held until you apply them manually.

Apply ​

When Auto apply is turned off, an Apply button appears. Click it to apply your pending changes; the subset view then becomes active. The button is enabled only when there are unapplied changes.

Reset ​

Click the Reset (✕) control in the subset input field, or remove all conditions, to clear the subset and show all points.

Complex Subset Examples ​

Example 1: Specific Cell Type in Region ​

Goal: Find B cells in a specific tissue region

Group 1 (AND):
├── Column: cell_type = "B cell"
└── Lasso: "Germinal Center" (spatial selection)

Example 2: High Expression of Gene Set ​

Goal: Find cells highly expressing immune genes

Group 1 (AND):
├── Signature: "Immune Markers" (Max)
└── Comparison: > 2.0

Example 3: Multiple Regions Comparison ​

Goal: Compare two tissue regions

Subset (OR):
├── Group 1 (AND):
│   ├── Lasso: "Region A"
│   └── Column: n_genes > 1000
│
└── Group 2 (AND):
    ├── Lasso: "Region B"
    └── Column: n_genes > 1000

Tips and Best Practices ​

  1. Start simple - Begin with one condition, then add complexity
  2. Use preview - Check results as you build the subset
  3. Name your selections - Use descriptive names for saved lasso and brush regions
  4. Save subsets - Store frequently used subsets for reuse
  5. Consider performance - Very complex subsets may take longer to compute

Troubleshooting ​

No Points Match ​

  • Check if conditions are too restrictive
  • Verify AND logic isn't excluding everything
  • Try relaxing value ranges

Unexpected Results ​

  • Review the logical operators (AND vs OR)
  • Check group operator setting
  • Verify column values are correct

Subset Not Updating ​

  • Ensure changes are applied
  • Check for loading indicators
  • Refresh if necessary

Portrai Explorer Documentation