__init__#

DE.__init__(source=None, /, *, table, voom_weights=None, voom_plot_data=None)[source]#

Initialize the DE object.

Parameters:
  • source : str | Path | None

    a directory containing a DE object saved with save(). Mutually exclusive with table, voom_weights, and voom_plot_data.

  • table : DataFrame

    a polars DataFrame containing the DE results, with columns:

    • cell_type: the cell type in which DE was tested

    • coefficient: the coefficient (or contrast) for which DE

      was tested

    • gene: the gene for which DE was tested

    • logFC: the log2 fold change of the gene, i.e. its effect

      size

    • SE: the standard error of the effect size

    • LCI: the lower 95% confidence interval of the effect size

    • UCI: the upper 95% confidence interval of the effect size

    • AveExpr: the gene’s average expression in this cell type,

      in log CPM

    • p: the DE p-value

    • Bonferroni: the Bonferroni-corrected DE p-value

    • FDR: the FDR q-value for the DE

    Mutually exclusive with source.

  • voom_weights : dict[str, DataFrame] | None

    an optional {cell_type: DataFrame} dictionary of voom weights, where rows are genes and columns are samples. The first column of each cell type’s DataFrame, ‘gene’, contains the gene names. Mutually exclusive with source.

  • voom_plot_data : dict[str, DataFrame] | None

    an optional {cell_type: DataFrame} dictionary of info necessary to construct a voom plot with DE.plot_voom(). Mutually exclusive with source.

Return type:

None