pylimma.diff_splice

pylimma.diff_splice(fit, geneid, exonid=None, robust=False, legacy=False, verbose=True, *, key='pylimma')[source]

Test for differential exon usage from an exon-level fit.

Port of R limma’s diffSplice.MArrayLM (Gordon Smyth and Charity Law, 2013-2025). The input fit must be an exon-resolution fit - either an MArrayLM / dict, or an AnnData whose adata.uns[key] holds the fit (as produced by pylimma.lm_fit(adata_exon, ...)).

Gene and exon identifiers are supplied via geneid and exonid (column names of fit['genes'], or row-aligned arrays). For AnnData-stored fits, geneid / exonid may also be column names of adata.var since lm_fit propagates adata.var into fit['genes'] via get_eawp.

The splice output has a different row count (genes with a single exon are dropped) from the input and carries a mix of per-exon and per-gene slots; it therefore isn’t written back to the AnnData. The returned MArrayLM is the input to top_splice() / plot_splice().

Parameters:
  • fit (AnnData, MArrayLM, or dict) – Exon-level fit.

  • geneid – See R’s diffSplice.

  • exonid – See R’s diffSplice.

  • robust (bool) – See R’s diffSplice.

  • legacy (bool) – See R’s diffSplice.

  • verbose (bool) – See R’s diffSplice.

  • key (str, default "pylimma") – AnnData adata.uns key holding the fit.

Return type:

MArrayLM