Skip to main content

diff_splice

Function diff_splice 

Source
pub fn diff_splice<T: EdgeFloat>(
    input: &GlmTestInput<'_, T>,
    fit: &GlmFit,
    gene_id: &[usize],
    tested: &Tested,
    ql: Option<&DiffSpliceQl<'_>>,
    params: Option<DiffSpliceParams>,
) -> Result<DiffSpliceResult, EdgeErrors>
Expand description

Tests for differential exon usage.

Port of edgeR’s diffSpliceDGE. Given an exon-level negative binomial GLM:

  1. sum each gene’s exon counts and fit the same design to the totals, giving the gene’s log-fold-change betabar,
  2. fold betabar * design[, coef] into the exon-level offsets,
  3. refit each exon under the reduced design with coef dropped, and
  4. read the deviance difference as evidence that the exon moved by more than its gene did.

Single-exon genes are dropped.

§Params

  • input - Counts, design and recycled matrices behind the fit, with exons as rows: input.n_genes is the exon count, input.counts is n_exons * n_samples
  • fit - The exon-level fit, from glm_fit or glmQLFit. Only its coefficients, deviance and residual degrees of freedom are read
  • gene_id - Gene label per exon, one per row of input.counts
  • tested - Which coefficient carries the comparison. Only one is testable: extra entries of Tested::Coef, and extra columns of Tested::Contrast, are dropped, as edgeR does with a warning
  • ql - Quasi-likelihood quantities from glmQLFit, or None for the likelihood ratio flavour
  • params - Tuning knobs, or DiffSpliceParams::default

§Returns

The exon and gene level tests, or EdgeErrors if a shape disagrees, the design has fewer than two columns, the coefficient is out of range, the contrast is rank deficient, or no gene has more than one exon.

§References

Chen, Lun and Smyth, F1000Research, 2016