pylimma.get_eawp

pylimma.get_eawp(obj, *, layer=None, weights_layer=None)[source]

Polymorphic input dispatcher - port of R limma’s getEAWP().

Accepts a variety of expression-data containers and returns a plain dict with R-parity keys. The returned dict is consumed by linear-modelling functions; it is deliberately not wrapped in an EList.

Parameters:
  • obj (ndarray, DataFrame, dict, EList, or AnnData) – Expression data. Dict-with-‘E’ is accepted for backwards compatibility and is treated identically to an EList.

  • layer (str, optional) – AnnData-only. Name of an adata.layers[…] entry to use in place of X.

  • weights_layer (str, optional) – AnnData-only. Name of an adata.layers[…] entry to read as observation weights. When None (default) and layer ends in "_E", the companion layer {layer[:-2]}_weights is auto-loaded if it exists (the voom/vooma convention); when set explicitly, the named layer is read instead. Use this when you’ve customised voom()’s weights_layer= output name on the write side and need the read side to match.

Returns:

With keys: exprs (numpy 2D, genes x samples), weights, probes, Amean, design, targets. Missing components are None.

Return type:

dict

Raises:

TypeError – If obj is of an unsupported class. Two-channel microarray wrappers (RGList, MAList, EListRaw) and Bioconductor S4 containers (ExpressionSet, eSet, PLMset, marrayNorm) are deliberately out of scope - see policy_data_class_wrappers in project memory.