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

Tutorial: Analysis Workflow ​

Core Feature

This tutorial covers features available in all Portrai Explorer deployments.

This tutorial demonstrates how to use advanced subsetting and analysis features to investigate specific biological questions in your spatial transcriptomics data.

Scenario ​

You want to:

  1. Find cells that meet multiple criteria
  2. Use signatures to analyze pathway activity
  3. Combine spatial and transcriptional subsets
  4. Save complex subset configurations for reuse

Prerequisites ​

Step 1: Define Your Question ​

Example Question ​

"Find T cells in the tumor region that have high immune checkpoint expression."

This requires:

  • Cell type subset (T cells)
  • Spatial subset (tumor region)
  • Expression subset (checkpoint genes)

Step 2: Create a Signature ​

First, create a signature for immune checkpoint genes.

Open Signatures ​

  1. In Explorer sidebar, click Signatures tab
  2. Click the + button (Create Signature) in the Features panel header

Define the Gene Set ​

  1. Name: "Immune Checkpoints"
  2. Description: "Key immune checkpoint molecules"
  3. Variables:
    PDCD1
    CTLA4
    LAG3
    HAVCR2
    TIGIT
  4. Click Create Signature

Verify Matches ​

  1. View the created signature
  2. Check how many genes matched your data
  3. Note any unmatched genes

Step 3: Define Tumor Region ​

Use lasso selection to define the tumor region.

Switch to Spatial View ​

  1. Ensure you're in Spatial projection
  2. Color by a relevant marker to identify tumor region
  3. Navigate to see the full tissue

Draw Tumor Region ​

  1. Click the Lasso tool
  2. Draw a lasso around the tumor region
  3. Note the selected cell count

Save to Subset ​

  1. Click Items dropdown
  2. Select Add selection to subset
  3. The lasso becomes a condition in the subset

Step 4: Build the Complex Subset ​

Now combine all criteria in the Subset.

Open Subset ​

  1. Open the Subset Panel
  2. You should see your lasso condition already added

Add Cell Type Condition ​

  1. Click Add Condition in the same group
  2. In the new condition, choose the cell type column
  3. Select "T cell" category
  4. Ensure operator is AND

Add Signature Condition ​

  1. Click Add Condition
  2. In the new condition's column selector, open the Signatures tab
  3. Choose "Immune Checkpoints"
  4. Set combination method to Max
  5. Set the comparison to Greater than (>) and the value to 1.0

Review the Subset ​

Your subset should now read:

(Tumor Region Lasso) AND (cell_type = T cell) AND (Immune Checkpoints Max > 1.0)

Step 5: Apply and Analyze ​

Apply the Subset ​

  1. With Auto apply on (the default) the subset is already applied; otherwise click Apply
  2. View the subset population
  3. Note the final cell count

Explore the Results ​

  1. Color by individual checkpoint genes
  2. Compare expression levels
  3. Examine spatial distribution within the tumor

View in UMAP ​

  1. Switch to UMAP projection
  2. See where these cells fall in transcriptional space
  3. Check if they cluster together

Step 6: Refine the Analysis ​

Adjust Thresholds ​

If results are too few or too many:

  1. Edit the signature condition
  2. Adjust the threshold (e.g., > 0.5 or > 2.0)
  3. Re-apply and check results

Add Additional Conditions ​

To further refine:

  1. Add more expression criteria
  2. Adjust spatial region
  3. Change combination method

Step 7: Save Your Subset ​

Save as Saved Subset ​

  1. Click Save
  2. Name: "Tumor T cells - High Checkpoint"
  3. Press Enter to confirm

Verify Saved Subset ​

  1. Clear the subset with the Reset control in the subset input field (see Reset)
  2. Click the saved subset under Saved Subsets to load it
  3. Confirm subset is restored

Step 8: Export Results ​

Export Subset Data ​

  1. With subset active, export feature data
  2. Download cell IDs and features
  3. Use in downstream analysis

Document Analysis ​

Record your analysis:

  • Subset configuration
  • Signature contents
  • Result counts
  • Screenshots

Advanced Techniques ​

Using OR Logic ​

Find cells matching any of several criteria:

Group 1 (OR):
├── High PDCD1 (> 2.0)
├── High CTLA4 (> 2.0)
└── High LAG3 (> 2.0)

Combining Regions ​

Compare cells across multiple regions:

Subset (OR):
├── Group 1: Tumor Region AND T cell
└── Group 2: Stroma Region AND T cell

Nested Logic ​

Complex queries with groups:

Subset (AND):
├── Group 1 (OR):
│   ├── T cell
│   └── NK cell
└── Group 2 (AND):
    ├── Tumor Region
    └── High Checkpoint

Summary ​

In this tutorial, you learned to:

StepSkill
1-2Create signatures for gene groups
3Define spatial regions with lasso
4Build multi-condition subsets
5-6Apply, analyze, and refine results
7-8Save presets and export data

Next Steps ​

Portrai Explorer Documentation