API#

Preprocessing#

pp.add_metadata(adata, incoming_metadata, ...)

Add metadata to an AnnData object while checking for matching indices or shape

pp.filter_by_metadata(adata, filter_dict, axis)

Filter based on metadata

pp.filter_data_completeness(adata, max_missing)

Filter features based on missing values

pp.scale_and_center(adata[, scaler, layer, copy])

Scale and center data.

pp.nanlog(data[, base, verbosity, layer, copy])

Logarithmize a data matrix.

pp.detect_special_values(data[, verbosity])

Detect special values such as NaN, zero, negative, and infinite values in the data.

pp.normalize(adata[, layer, strategy, ...])

Normalize measured counts per sample

pp.impute_gaussian(adata[, std_offset, ...])

Impute missing values in each column by random sampling from a gaussian distribution.

pp.impute_median(adata[, group_column, ...])

Impute missing values using median imputation

pp.impute_knn(adata[, group_column, layer, ...])

Impute missing values using median imputation

pp.scanpy_pycombat(adata, batch[, layer, copy])

Wrap scanpy's pp.combat function with error checks and preprocessing suggestions.

Tools#

tl.nan_safe_bh_correction(pvals)

Apply Benjamini-Hochberg correction with NaN-safe handling.

tl.nan_safe_ttest_ind(a, b[, min_valid_values])

NaN-safe wrapper around scipy.stats.ttest_ind.

tl.diff_exp_ttest(adata, between_column, ...)

Calculate ratios of features between two specific groups using t-test.

tl.diff_exp_alphaquant(adata, report, ...[, ...])

Calculate differential expression using AlphaQuant.

tl.pca(adata[, layer, dim_space, ...])

Principal component analysis [].

tl.diff_exp_ebayes(adata, between_column, ...)

Run Limma eBayes moderated ttest for differential expression

Metrics#

metrics.principal_component_regression(...)

Compute principal component regression (PCR) score.

metrics.pooled_median_absolute_deviation(...)

Compute pooled median absolute deviation (PMAD) within sample groups.

Plotting#

pl.Plots([config])

Class for creating figures with matplotlib

pl.add_lines(ax, intercepts[, linetype, ...])

Add a vertical or horizontal line to a matplotlib axes object

pl.label_plot(ax, x_values, y_values, labels)

Add labels to a 2D axes object

pl.BaseColormaps()

Base colormaps for alphapepttools plots

pl.BaseColors()

Base colors for alphapepttools plots

pl.BasePalettes()

Base color palettes for alphapepttools plots

pl.add_legend_to_axes(ax[, levels, legend, ...])

Add a legend to an axis object.

pl.add_legend_to_axes_from_patches(ax, ...)

Make a legend and directly add it to a matplotlib axes object.

pl.create_figure([nrows, ncols, figsize, ...])

Create a figure with a specified number of rows and columns.

pl.label_axes(ax[, xlabel, ylabel, title, ...])

Apply labels to a matplotlib axes object

pl.save_figure(fig, filename, output_dir[, ...])

Save a figure in a publication friendly format

IO#

Reader functions#

io.read_psm_table(file_paths, search_engine)

Read peptide spectrum match tables to the anndata.AnnData format

io.read_pg_table(path, search_engine, *[, ...])

Read protein group table to the anndata.AnnData format

io.AnnDataFactory(psm_df, intensity_column, ...)

Factory class to convert AlphaBase PSM DataFrames to AnnData format.

io.list_available_reader([kind])

Get a list of all available readers, as provided by alphabase

Data#

Example data that can be accessed with the package.

data.available_data()

Get list all available studies

data.get_data(study[, output_dir])

Get data from a specific study