scbulkde.DEResult#

class scbulkde.DEResult(results, query, reference, design, engine, used_pseudoreplicates=False, used_single_cell=False, n_repetitions=1, repetition_results=<factory>, repetition_stats=<factory>)#

Container for differential expression results.

results#

DE results table with columns: log2FoldChange, pvalue, padj, stat, stat_sign.

Type:

pd.DataFrame

query#

Query condition name.

Type:

str

reference#

Reference condition name(s).

Type:

str or list[str]

design#

Design formula used for testing.

Type:

str

engine#

Name of the DE engine used (e.g. 'anova', 'pydeseq2').

Type:

str

used_pseudoreplicates#

Whether pseudoreplicates were generated to meet the minimum sample requirement.

Type:

bool

used_single_cell#

Whether single-cell level testing was performed as a fallback.

Type:

bool

n_repetitions#

Number of pseudoreplicate iterations run. 1 for direct testing, >1 when pseudoreplicates are used.

Type:

int

repetition_results#

Per-repetition DE results. Only populated when pseudoreplicates are used.

Type:

dict[str, pd.DataFrame]

repetition_stats#

Per-repetition sample statistics. Only populated when pseudoreplicates are used.

Type:

dict[str, pd.DataFrame]

Attributes table#

DEResult.fallback_used

Return which fallback was used, if any.

DEResult.n_genes

Number of genes tested.

DEResult.n_repetitions: int = 1
DEResult.n_significant

Number of significant genes (padj < 0.05).

DEResult.used_pseudoreplicates: bool = False
DEResult.used_single_cell: bool = False
DEResult.results: DataFrame
DEResult.query: str
DEResult.reference: str | list[str]
DEResult.design: str
DEResult.engine: str
DEResult.repetition_results: dict[str, DataFrame]
DEResult.repetition_stats: dict[str, DataFrame]

Methods table#

get_repetition_results(repetition)

Get DE results for a specific repetition.

get_repetition_stats(repetition)

Get sample statistics for a specific repetition.

summary()

Return the main results table.

Attributes#

DEResult.fallback_used#

Return which fallback was used, if any.

DEResult.n_genes#

Number of genes tested.

DEResult.n_repetitions: int = 1#
DEResult.n_significant#

Number of significant genes (padj < 0.05).

DEResult.used_pseudoreplicates: bool = False#
DEResult.used_single_cell: bool = False#
DEResult.results: DataFrame#
DEResult.query: str#
DEResult.reference: str | list[str]#
DEResult.design: str#
DEResult.engine: str#
DEResult.repetition_results: dict[str, DataFrame]#
DEResult.repetition_stats: dict[str, DataFrame]#

Methods#

DEResult.get_repetition_results(repetition)#

Get DE results for a specific repetition.

Parameters:

repetition (int or str) – The repetition index or key to retrieve.

Return type:

DataFrame

Returns:

pd.DataFrame DE results for the requested repetition.

Raises:
  • ValueError – If no pseudoreplicates were used.

  • KeyError – If the specified repetition is not found.

DEResult.get_repetition_stats(repetition)#

Get sample statistics for a specific repetition.

Parameters:

repetition (int or str) – The repetition index or key to retrieve.

Return type:

DataFrame

Returns:

pd.DataFrame Sample statistics for the requested repetition.

Raises:
  • ValueError – If no pseudoreplicates were used.

  • KeyError – If the specified repetition is not found.

DEResult.summary()#

Return the main results table.

Return type:

DataFrame