Skip to main content

Flexible normalization methods for proteomics quantitative data

Project description

Pronoms Logo

Pronoms: Proteomics Normalization Python Library

Overview

Pronoms is a Python library implementing multiple normalization methods for quantitative proteomics data. Each normalization method is encapsulated within modular, reusable classes. The library includes visualization capabilities that allow users to easily observe the effects of normalization. All normalization methods are implemented in pure Python (NumPy/SciPy/pandas); pronoms has no R or rpy2 dependency.

Documentation

See https://pronoms.readthedocs.io/ for complete documentation.

Installation

You can install Pronoms directly from PyPI using pip:

pip install pronoms

Prerequisites

  • Python 3.9 or higher
  • No R / rpy2 install required.

Installing for Development

# Clone the repository
git clone https://github.com/mriffle/pronoms.git
cd pronoms

# Install in development mode with dev dependencies
pip install -e .[dev]

Usage

Basic Example

import numpy as np
from pronoms.normalizers import MedianNormalizer

# Create sample data
data = np.random.rand(5, 100)  # 5 samples, 100 proteins/features

# Create normalizer and apply normalization
normalizer = MedianNormalizer()
normalized_data = normalizer.normalize(data)

# Visualize the effect of normalization
normalizer.plot_comparison(data, normalized_data)

Available Normalizers

  • DirectLFQNormalizer: Performs protein quantification directly from peptide/ion intensity data using the DirectLFQ algorithm. Ammar C, Schessner JP, Willems S, Michaelis AC, Mann M. Accurate Label-Free Quantification by directLFQ to Compare Unlimited Numbers of Proteomes. Mol Cell Proteomics. 2023 Jul;22(7):100581. doi:10.1016/j.mcpro.2023.100581. PMID: 37225017
  • L1Normalizer: Scales samples to have a unit L1 norm (sum of absolute values).
  • MADNormalizer: Median Absolute Deviation Normalization. Robustly scales samples by subtracting the median and dividing by the Median Absolute Deviation (MAD). Pass scale_to_sigma=True to multiply MAD by 1.4826 so the output is a robust z-score (matches R's mad()).
  • MedianNormalizer: Scales each sample (row) by its median, then rescales by the mean of medians to preserve overall scale.
  • MedianPolishNormalizer: Tukey's Median Polish. Decomposes data (often log-transformed) into overall, row, column, and residual effects by iterative median removal.
  • QuantileNormalizer: Normalizes samples to have the same distribution using quantile mapping.
  • RankNormalizer: Transforms each sample's values to their ranks (1 to N), with tied values receiving the median rank. Optionally normalizes ranks by dividing by N for cross-dataset comparability.
  • SPLMNormalizer: Stable Protein Log-Mean Normalization. Uses stably expressed proteins (lowest linear-space CV, std/mean) to derive scaling factors for normalization in log-space, then transforms back.
  • VSNNormalizer: Variance Stabilizing Normalization. Native NumPy/SciPy implementation of Huber et al.'s arcsinh-based variance-stabilizing transform with LTS-robust parameter estimation; matches Bioconductor's vsn package output to ~1e-6 on realistic proteomics data. Huber W, von Heydebreck A, Sültmann H, Poustka A, Vingron M. Variance stabilization applied to microarray data calibration and to the quantification of differential expression. Bioinformatics. 2002;18 Suppl 1:S96–104. doi:10.1093/bioinformatics/18.suppl_1.s96. PMID: 12169536

Data Format

All normalizers expect data in the format of a 2D numpy array or pandas DataFrame with shape (n_samples, n_features) where:

  • Each row represents a sample
  • Each column represents a protein/feature

This follows the standard convention used in scikit-learn and other Python data science libraries.

Development

Set up a virtual environment and install the dev extras:

python -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"

The pre-flight gate before any commit is:

pytest                          # full test suite (warnings -> errors)
ruff check src tests            # lint
ruff format --check src tests   # formatting (use `ruff format` to apply)
mypy                            # static type check

Coverage:

pytest --cov=src/pronoms --cov-report=term-missing

License

This project is licensed under the Apache License License - see the LICENSE file for details.

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

pronoms-0.4.0.tar.gz (56.5 kB view details)

Uploaded Source

Built Distribution

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

pronoms-0.4.0-py3-none-any.whl (43.7 kB view details)

Uploaded Python 3

File details

Details for the file pronoms-0.4.0.tar.gz.

File metadata

  • Download URL: pronoms-0.4.0.tar.gz
  • Upload date:
  • Size: 56.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pronoms-0.4.0.tar.gz
Algorithm Hash digest
SHA256 c57bbd23de6acbde960db5879753a82668718ab09d6c155ae8e0f4e681bb75b2
MD5 3a4beb2f3bea37cf4a90431b8c9f8e12
BLAKE2b-256 c70ce9a02cef2e0e4a143594b2204ddf264e60f2c4c0b0109979cc9bfaf08da7

See more details on using hashes here.

Provenance

The following attestation bundles were made for pronoms-0.4.0.tar.gz:

Publisher: publish.yml on mriffle/pronoms

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pronoms-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: pronoms-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 43.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pronoms-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2be612ee1eaf3e4bbdb1469d19fa98e0d86e61453a8a343df062d7efed6e182c
MD5 331858109bce08b7ba2060b8dd7c57af
BLAKE2b-256 9967b699309d28ec13af77a6791b250663a5db8f4f30f7a4af6de87591d477cc

See more details on using hashes here.

Provenance

The following attestation bundles were made for pronoms-0.4.0-py3-none-any.whl:

Publisher: publish.yml on mriffle/pronoms

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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