Differential analysis - stjude/proteinpaint GitHub Wiki

The differential analysis app performs analyses tailored to each data type.

How this Plot Works

This plot dynamically selects and displays appropriate visualizations based on the data type being analyzed. Each analysis appears as a dedicated subplot, accessible via tabs along the header.

The plot is not available when:

  1. Its not supported by the dataset.
  2. The total number of samples for each group exceeds 4,000. If running gene expression analysis, the cutoff is 3,000 total samples.
  3. There are overlapping samples in the groups.

How to Launch

Create at least one group in the Groups tab of the mass UI. Then create a custom variable from the Create variable using... button. Click on the new button for the custom term will appear below. Click on the option Differential analysis from the pop-up menu. Note the case and control groups are indicated below the menu option.

Supported Analyses

Gene Expression

When performing differential gene expression analysis, both the volcano plot and gene set enrichment analysis plots are available. For more information, refer to the dedicated wiki pages for each plot.

DNA Methylation

Differential methylation analysis compares element-level M-values between case and control groups using limma. M-values are the logit transform of beta values (M = log2(beta / (1 - beta))) and are approximately normally distributed, making limma's linear modeling framework the statistically appropriate choice.

Element classes

Each data point is a regulatory element, not an individual CpG probe. Which elements are tested is chosen with the Element class control, and a dataset may offer several:

Class What it is
cCRE promoters (PLS) ENCODE promoter-like elements — the CpG-island core, ~349 bp
TSS-window promoters TSS −1500/+500 windows, the Illumina 450K definition, ~2 kb
Distal / proximal enhancers ENCODE dELS and pELS
All cCRE classes every class in one matrix, each row tagged with its own

Hit counts are not comparable across classes. The same contrast can yield an order of magnitude more significant elements on TSS windows than on cCRE promoters, simply because the windows are wider and far more numerous. Always report the element class alongside a count.

The picker only appears when the dataset offers more than one class. The starting class is set per dataset (defaultElementType); datasets that declare nothing start on the legacy promoter matrix.

Effect size

The volcano plots delta-beta — the difference in average beta between case and control, i.e. how much methylation actually changed, on the 0-1 scale. It is signed case - control, so positive means hypermethylated in the case group.

limma tests on M-values, and the p-values come from that fit. But log2(fold-change) on M-values is a difference of logits: it ranks elements correctly while saying nothing interpretable about the size of a methylation change. Delta-beta is therefore what the axis shows and what the Min delta-beta cutoff (default 0.1, a 10-percentage-point change) is applied to.

Key details:

  • Elements are filtered if either group has fewer than 3 non-NA samples (configurable via Min samples per group) or if the element has zero variance.
  • Handling of remaining missing values depends on the platform. On arrays, NAs are structural — 450K, EPIC and EPIC v2 cover different probe sets — so they are imputed. On WGBS (platform: 'wgbs') a missing value only means that sample-element fell below the read-depth threshold, so imputation is skipped and limma fits each row on its finite observations.
  • Empirical Bayes moderation (eBayes) borrows strength across elements for more stable variance estimates.
  • P-values are adjusted using Benjamini-Hochberg FDR correction.
  • Confounding variables (up to 2, continuous or discrete) are supported in the design matrix.
  • Exclude sex chromosomes drops chrX/chrY. Recommended for mixed-sex cohorts, since X-inactivation makes chrX methylation strongly sex-dependent and a sex-imbalanced comparison will report sex rather than the grouping variable.
  • Clicking a data point does not launch a box plot (unlike gene expression).

Reproducing a result

Downloaded p-value tables carry a run provenance line recording the group names and effective sizes, the element class, the axis, confounders, and every threshold. A result quoted without its element class and cutoff cannot be reproduced.

The p-value table shows separate element and Gene(s) columns; the element column is named for the class tested (cCRE promoter, Distal enhancer, and so on).