INNER CODE UNIT · Python
use_for_mean
scverse/PyDESeq2 · src/pydeseq2/dds.py:462
use_for_mean = gene_dispersions > 10 * self.min_disp
mean_disp = trim_mean(gene_dispersions[use_for_mean], proportiontocut=0.001)
return (
2 * np.arcsinh(np.sqrt(mean_disp * normed_counts))
- np.log(mean_disp)
- np.log(4)
) / np.log(2)
else:
raise NotImplementedError(
f"Found fit_type '{self.vst_fit_type}'. Expected 'parametric' or 'mean'."
)
def deseq2(self, fit_type: Literal["parametric", "mean"] | None = None) -> None:
"""Perform dispersion and log fold-change (LFC) estimation.
Wrapper for the first part of the PyDESeq2 pipeline.