epiout.result

Module Contents

Classes

EpiOutResult

EpiOut result class for outlier detection to calculate statistics and

class epiout.result.EpiOutResult(counts: pandas.DataFrame, counts_mean: numpy.array, multipletests_method='fdr_by', pval_threshold=0.05, l2fc_threshold=0.5, min_count_threshold=50)
EpiOut result class for outlier detection to calculate statistics and

visualize results.

Parameters
  • counts (pd.DataFrame) – Counts data.

  • counts_mean (np.array) – Mean counts data.

  • multipletests_method (str) – Method for multiple testing correction.

  • pval_threshold (float) – P-value threshold for outlier detection.

  • l2fc_threshold (float) – Log2 fold change threshold for outlier detection.

  • min_count_threshold (int) – Minimum count threshold for outlier detection.

counts

Counts data.

Type

pd.DataFrame

counts_mean

Mean counts data.

Type

np.array

nb

Negative binomial distribution.

Type

NegativeBinomial

pval

P-values.

Type

pd.DataFrame

padj

Adjusted p-values.

Type

pd.DataFrame

l2fc

Log2 fold change.

Type

pd.DataFrame

zscore

Z-score.

Type

pd.DataFrame

outlier

Outlier detection.

Type

pd.DataFrame

log_padj

-log10 adjusted p-values.

Type

pd.DataFrame

Examples

>>> from epiout import EpiOutResult
>>> result = EpiOutResult.load('result.h5ad')
>>> result.outlier
>>> result.log_padj
>>> df_results = result.results()
>>> result.qq_plot('chr1:100-200')
>>> result.plot_counts('chr1:100-200')
>>> result.plot_volcona('chr1:100-200')
_df(self, mat)
property counts(self)
property counts_mean(self)
property nb(self)
property pval(self)
property padj(self)
property l2fc(self)
property zscore(self)
property outlier(self)
property log_padj(self)
results(self)
Results of outlier detection for statistically significant outliers

as dataframe with columns: peak, sample, count, count_expected, pval, padj, l2fc.

results_all(self)
Results of utlier detection for all samples and peaks

regardless of statistical significance as dataframe with columns: peak, sample, count, count_expected, pval, padj, l2fc.

qq_plot(self, peak, ci=0.95, eps=1e-14)

QQ-plot for p-values of a peak.

Parameters

peak (str) – Peak name across samples.

plot_counts(self, peak)

Counts plot for a peak across samples.

Parameters

peak (str) – Peak name.

plot_rank(self, peak, stats='l2fc')

Rank plot for a peak across samples.

Parameters

peak (str) – Peak name.

plot_volcona(self, peak, zscore_cutoff=(- 1, 1))

Volcano plot for a peak across samples.

Parameters

peak (str) – Peak name.

plot_umap(self, color=None, legend_title='color')

UMAP plot for samples.

Parameters

color (str) – Column name of color.

plot_corr_heatmap(self, count_type='raw', row_var=None, cbar_pos=(- 0.06, 0.45, 0.03, 0.2), cmap='twilight_shifted', vmin=- 1, vmax=1)

Correlation heatmap between samples.

Parameters
  • count_typeraw, corrected

  • row_var (str) – Row variable name.

  • cbar_pos (tuple) – Colorbar position.

  • cmap (str) – Colormap name.

  • vmin (float) – Minimum value for colormap.

  • vmax (float) – Maximum value for colormap.

save(self, filename)

Save result to h5ad file.

Parameters

filename (str) – File name.

classmethod load(cls, filename)

Save result to h5ad file.

Parameters

filename (str) – File name.