pylimma.voom_with_quality_weights

pylimma.voom_with_quality_weights(counts, design=None, lib_size=None, normalize_method='none', plot=False, span=0.5, adaptive_span=True, var_design=None, var_group=None, method='genebygene', maxiter=50, tol=1e-05, trace=False, col=None, *, out_layer='voom_E', weights_layer='voom_weights', key='voom', layer=None, **voom_kwargs)[source]

voom transformation with sample-specific quality weights.

Combines the voom mean-variance modelling with sample-specific quality weights estimated by array_weights(). This can improve power when some samples have higher technical variability than others.

Parameters:
  • counts (ndarray) – Matrix of counts, shape (n_genes, n_samples).

  • design (ndarray, optional) – Design matrix. If None, uses an intercept-only model.

  • lib_size (ndarray, optional) – Library sizes. If None, computed as column sums.

  • normalize_method (str, default "none") – Normalization method (passed to voom).

  • var_design (ndarray, optional) – Design matrix for variance model.

  • var_group (ndarray, optional) – Factor defining variance groups.

  • method (str, default "genebygene") – Method for array weights estimation.

  • maxiter (int, default 50) – Maximum iterations for array weights.

  • tol (float, default 1e-5) – Convergence tolerance for array weights.

  • trace (bool, default False) – If True, print iteration progress to stdout during the second array_weights() estimation (matches R behaviour).

  • span (float, default 0.5) – LOWESS span (used if adaptive_span=False).

  • adaptive_span (bool, default True) – If True, choose span adaptively.

  • plot (bool)

  • out_layer (str)

  • weights_layer (str)

  • key (str)

  • layer (str | None)

Returns:

Same keys as voom(), with one addition:

sample_weightsndarray

Per-sample quality weights.

Return type:

dict

Notes

The R col argument (bar colour for the array-weight plot) is not exposed; matplotlib defaults are used when plot=True.

See also

voom

Basic voom transformation.

array_weights

Estimate sample quality weights.