Demonstration only. Corollary is a non-commercial research demo — no warranty, no support, not for commercial use or clinical decisions. Read the disclaimer

All use cases

Single-cell and tissue · What you can do here

Deconvolve bulk RNA-seq into cell types

Estimate cell-type proportions in bulk RNA-seq or Visium spots from an annotated single-cell reference using Rectangle, correcting for cell size differences and isolating uncharacterised signal as Unknown.

What this involves

Deconvolution decomposes heterogeneous bulk transcriptomes or multi-cell spatial transcriptomics spots into constituent cell-type proportions. Rectangle accomplishes this by deriving a signature directly from an annotated single-cell reference of the same tissue. It constructs bootstrapped pseudobulks, selects markers using DESeq2, tunes cut-offs on simulated mixtures, and applies a coarse-to-fine deconvolution scheme to prevent closely related cell types from being confounded.

The reference single-cell dataset strictly defines the output. It must be provided as raw counts and originate from the same tissue, species, and biological context. Instead of forcing all transcriptomic signals to sum to one, Rectangle assigns proportions that the reference fails to explain to an Unknown category, and applies an mRNA bias correction by default so that estimates reflect fractions of cells rather than fractions of total RNA.

The analysis runs on an isolated computing environment without requiring local software installation or package configuration. The agent manages marker selection, model fitting, and compositional output retrieval, providing tabular proportions, spatial coordinate overlays where relevant, and diagnostics on unexplained transcriptional residuals.

How it goes

  1. 1Reference validation and inspectionInspect the single-cell reference .h5ad using Python to review annotation granularity, cell counts per label, and verify that raw counts reside in .X, a counts layer, or .raw.
  2. 2Mixture matrix preparationFormat bulk RNA-seq mixtures as linear transcripts per million (TPM), or spatial spot mixtures as raw counts in .h5ad scaled to CPM, ensuring gene identifiers match the reference.
  3. 3Signature construction and deconvolution with RectangleExecute Rectangle to construct bootstrapped pseudobulks, identify cell-type markers with DESeq2, optimise cut-offs, and deconvolve the mixtures coarse-to-fine.
  4. 4Diagnostics and residual inspectionExtract mean and sample-level cell fractions, inspect marker tallies per type, and evaluate genes correlated with the Unknown fraction to spot unmodelled cell populations.
  5. 5Compositional group comparisonRun non-parametric rank tests or statistical models on the resulting fraction table to compare sample cohorts while correcting for multiple testing across cell types.

Start it here

Ask in plain language. The agent works on a Linux machine of its own — it installs and runs what the job needs, keeps every file, and reads the results back with the numbers explained. Nothing to set up, and a long run continues after you close the page.

What to watch for

  • Supplying log-transformed inputs such as log2(TPM+1) violates the linear assumption of deconvolution and produces confident, incorrect proportions.
  • An average Unknown fraction exceeding approximately 15% indicates that the reference dataset lacks one or more cell types present in the bulk mixture.
  • The grid search Pearson r measures consistency on mixtures simulated from the reference itself, not deconvolution accuracy on your biological samples.
  • When Rectangle groups cell types into clusters due to high similarity, the combined sum of those types is significantly more reliable than their individual splits.
  • Providing raw read counts from full-length bulk protocols introduces gene-length bias, which must be prevented by using TPM instead.
  • Estimated proportions below 1% to 2% fall within the baseline noise of the method, meaning non-detection should not be equated with complete biological absence.

What it runs

Questions

Do I need to install anything to deconvolve bulk rna-seq into cell types?

No. The research agent does this work on a Linux machine of its own — it runs Rectangle there, keeps the files, and reads the results back to you. Long runs continue if you close the page.

What input format should I provide for bulk RNA-seq mixtures?

Bulk data must be provided as linear transcripts per million (TPM) values. Full-length raw counts carry gene-length bias into the proportions, and log-transformed values like log2(TPM+1) break the linear deconvolution model.

Can I deconvolve spatial transcriptomics data with this method?

Yes, you can provide an .h5ad file containing up to 20,000 spatial spots, such as 55 µm Visium spots, with raw count data. The resulting fractions reflect the proportion of RNA-producing cells within each spot rather than absolute cell counts.

What does a high Unknown fraction mean?

A high Unknown fraction means the mixture contains RNA that cannot be explained by the cell types in your single-cell reference. Inspecting the reported linked genes often identifies the missing lineage, such as haemoglobin genes indicating unmodelled erythrocytes.

When should deconvolution not be applied?

Do not use deconvolution on single-cell resolution spatial datasets like Xenium, MERFISH, or CosMx where cells are already segmented, on non-transcriptomic mixtures like methylation or proteomics, or when a simple marker-gene expression score is sufficient to address the biological question.

Written from the method the research agent follows for this work and the documentation of the tools listed above. Statements citing a figure that does not appear there are removed before publication. Corollary is a non-commercial research demonstration; results are not for clinical use.