DE#

Differential expression results returned by Pseudobulk.de().

class brisc.DE(source=None, /, *, table=None, voom_weights=None, voom_plot_data=None)[source]#
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 | None

    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 plot_voom(). Mutually exclusive with source.

Analysis#

get_hits

Get all (or the top) differentially expressed genes.

get_num_hits

Get the number of differentially expressed genes in each cell type.

plot_voom

Generate a voom plot for a cell type that differential expression was calculated for.

plot_volcano

Generate a volcano plot of DE hits.

I/O#

save

Save a DE object to directory (which must not exist unless overwrite=True, and will be created) with the table at table.parquet.

Properties#

groups

a dictionary mapping cell type names to group names used by voomByGroup for that cell type, or None if voomByGroup was not used for that cell type.