Skip to main content

PROTRIDER - Protein outlier detection method

Project description

PROTRIDER

Tests PyPI License: MIT Python 3.10+

PROTRIDER is an autoencoder-based method to call protein outliers from mass spectrometry-based proteomics datasets.

Have a look at our paper for information about our work.

Table of Contents

🚀 Quickstart

# 1. Install
pip install protrider

# 2. Run on the included sample data
protrider run --config config.yaml

# 3. Plot results
protrider plot --config config.yaml all

Results are written to the directory specified by out_dir in config.yaml (default: output/). The key output file is protrider_summary.csv, which contains outlier calls with p-values, z-scores, and fold changes for every sample–protein pair.

⚙️ Installation

PROTRIDER was tested using Python 3.14 on Linux. We recommend a dedicated conda environment:

conda create --name protrider_env python=3.14
conda activate protrider_env
pip install protrider

Verify the installation:

protrider --help

More information on conda environments can be found in Conda's user guide.

📖 Usage

🗂️ Configuration

All parameters are set in a YAML configuration file. A template is provided as config.yaml.

Input files are specified in the config:

  • input_intensities: CSV, TSV, or Parquet file with protein intensities (columns = samples, rows = proteins)
  • sample_annotation (optional): CSV or TSV file with sample covariates (one row per sample)

An example dataset is included under sample_data/.

Configuration parameters
Parameter Description
out_dir Output directory
input_intensities Path to protein intensities file
sample_annotation Path to sample annotations file (optional)
index_col Column name containing protein IDs
cov_used List of covariate column names from the annotation file (optional)
find_q_method Method to determine latent dimension: OHT (default), gs, bs (binary search), or an integer
pval_dist Distribution for p-value calculation: t (default) or gaussian
n_epochs Number of training epochs (default: 100)
checkpoint_path Path to save/load model checkpoint (optional)

📤 Output

The key output file is protrider_summary.csv, which contains outlier calls with p-values, z-scores, and fold changes for every sample–protein pair.

Output files
File Description
protrider_summary.csv Long-format summary with outlier calls for all sample–protein pairs
pvals.csv Two-sided p-values (samples × proteins)
pvals_adj.csv BH/BY-adjusted p-values
pvals_one_sided.csv Left-sided p-values
zscores.csv Z-scores
residuals.csv Model residuals (observed − predicted)
log2fc.csv Log2 fold changes
fc.csv Fold changes
output.csv Autoencoder reconstructed values
processed_input.csv Preprocessed input passed to the autoencoder
additional_info.csv Model metadata (latent dimension, learning rate, loss)
train_losses.csv Per-epoch training loss
fit_parameters.csv Per-protein distribution fit parameters
config.yaml Saved configuration for reproducibility

▶️ Run

Run the pipeline:

protrider run --config config.yaml

Generate plots:

# All plots
protrider plot --config config.yaml all

# Individual plot types
protrider plot --config config.yaml pvals
protrider plot --config config.yaml aberrant_per_sample
protrider plot --config config.yaml training_loss
protrider plot --config config.yaml encoding_dim

# Expected vs observed for a specific protein
protrider plot --config config.yaml expected_vs_observed --protein_id <protein_id>
Model checkpointing

PROTRIDER automatically saves trained models and reuses them in subsequent runs, skipping retraining if a checkpoint exists. By default the model is saved to <out_dir>/model.pt.

To use a custom checkpoint location, set checkpoint_path in your config:

checkpoint_path: models/my_model.pt

To force retraining, delete the checkpoint file or point to a new path.

Python API
import protrider

config = protrider.ProtriderConfig(
    out_dir='output/',
    input_intensities='data/protein_intensities.csv',
    sample_annotation='data/sample_annotations.csv',
    index_col='protein_ID',
    cov_used=['AGE', 'SEX'],
    n_epochs=100,
)

# Run
result, model_info, fit_params, gs_result = protrider.run(config)

# Save results
result.save(config.out_dir, format='wide')   # individual CSV files
result.save(config.out_dir, format='long')   # protrider_summary.csv
model_info.save(config.out_dir)
config.save(config.out_dir)

# Generate plots (omit out_dir to get plot objects without saving)
model_info.plot_training_loss(config.out_dir)
result.plot_aberrant_per_sample(config.out_dir)
hist_plot, qq_plot = result.plot_pvals(config.out_dir)
result.plot_expected_vs_observed('protein_123', config.out_dir)

# Access results as DataFrames
result.df_pvals        # p-values
result.df_pvals_adj    # adjusted p-values
result.df_Z            # z-scores
result.df_res          # residuals
result.log2fc          # log2 fold changes
result.fc              # fold changes

📄 License

This project is licensed under the MIT License.

📚 Citation

If you use PROTRIDER, please cite:

@article{10.1093/bioinformatics/btaf628,
    author = {Klaproth-Andrade, Daniela and Scheller, Ines F and Tsitsiridis, Georgios and Loipfinger, Stefan and Mertes, Christian and Smirnov, Dmitrii and Prokisch, Holger and Yépez, Vicente A and Gagneur, Julien},
    title = {PROTRIDER: Protein abundance outlier detection from mass spectrometry-based proteomics data with a conditional autoencoder},
    journal = {Bioinformatics},
    pages = {btaf628},
    year = {2025},
    month = {11},
    issn = {1367-4811},
    doi = {10.1093/bioinformatics/btaf628},
    url = {https://doi.org/10.1093/bioinformatics/btaf628},
}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

protrider-0.9.3.tar.gz (283.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

protrider-0.9.3-py3-none-any.whl (37.2 kB view details)

Uploaded Python 3

File details

Details for the file protrider-0.9.3.tar.gz.

File metadata

  • Download URL: protrider-0.9.3.tar.gz
  • Upload date:
  • Size: 283.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.6 {"installer":{"name":"uv","version":"0.11.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for protrider-0.9.3.tar.gz
Algorithm Hash digest
SHA256 4a96cf306bff0d82fa9370760c82da5846a242372f4259937e15b469ee5e69be
MD5 297ddc65ebaf7e32a03f342b7b236cc3
BLAKE2b-256 86afe0390df5b7e87b8cb13bf90ace72cd740d0adcdb6ac27f41f834fb3682b9

See more details on using hashes here.

File details

Details for the file protrider-0.9.3-py3-none-any.whl.

File metadata

  • Download URL: protrider-0.9.3-py3-none-any.whl
  • Upload date:
  • Size: 37.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.6 {"installer":{"name":"uv","version":"0.11.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for protrider-0.9.3-py3-none-any.whl
Algorithm Hash digest
SHA256 c0c6abce33c3f6d7950ec358467115ce7cf89951b6a746e5a9cd386c648042cf
MD5 0637b73cbd38facd5120552f3971a1aa
BLAKE2b-256 40359ea68e3f9b1a3475a8762155237640f3d26734dbaa460c2429979305ed9d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page