The SCEPTRE algorithm. First, the gene expressions are regressed onto the perturbation indicators and technical factors, and the z -score (z_obs) corresponding to the perturbation indicator is computed. Second, the perturbation indicators are permuted (while the gene expressions and technical factors are held fixed) and the z -score is recomputed, yielding B null z -values. Third, a smooth density is fit to the histogram of the null z -values. Fourth, a p -value is computed by evaluating the tail probability of the fitted density at (z_obs).