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:
- sum each gene’s exon counts and fit the same design to the totals, giving
the gene’s log-fold-change
betabar, - fold
betabar * design[, coef]into the exon-level offsets, - refit each exon under the reduced design with
coefdropped, and - 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_genesis the exon count,input.countsisn_exons * n_samplesfit- The exon-level fit, fromglm_fitorglmQLFit. Only its coefficients, deviance and residual degrees of freedom are readgene_id- Gene label per exon, one per row ofinput.countstested- Which coefficient carries the comparison. Only one is testable: extra entries ofTested::Coef, and extra columns ofTested::Contrast, are dropped, as edgeR does with a warningql- Quasi-likelihood quantities fromglmQLFit, orNonefor the likelihood ratio flavourparams- Tuning knobs, orDiffSpliceParams::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