AlphaPeptDeep (PeptDeep)

repository·main·Indexed 41 days ago

https://github.com/mannlabs/alphapeptdeep

A deep learning framework for shotgun proteomics designed to predict peptide retention time (RT), collision cross section (CCS), and tandem mass spectra (MS2). It enables the generation of predicted spectral libraries from FASTA files and provides tools for transfer learning, DDA PSM rescoring via Percolator, and mass calibration. The framework is available as a Python package (peptdeep), a standalone GUI, and a Docker image.

Tokens
55K
Snippets
181
Records
205
Agent score
50%

What's inside AlphaPeptDeep

  1. Use the peptdeep.pipeline_api for high-level proteomics tasks

    main

    The peptdeep.pipeline_api module provides high-level entry points for common deep learning workflows in proteomics. It currently supports:

    • Transfer Learning: Use transfer_learn to fine-tune models.
    • Library Prediction: Use generate_library to predict properties for a peptide library.
    • Rescoring: Use rescore to improve peptide identifications using deep learning models.

    Note that the default parameters for these functions are controlled globally via peptdeep.settings.global_settings.

  2. Use the legacy FDR rescoring module

    main
    The peptdeep.rescore.fdr module is a legacy component for False Discovery Rate (FDR) rescoring. It is slated for replacement by the alphabase.scoring.fdr module. If you are starting a new project, it is recommended to use the alphabase implementation instead.
  3. Install AlphaPeptDeep via One-click GUI

    main

    For users who want a standalone tool without Python or CLI knowledge, you can download pre-compiled installers from the GitHub releases page.

    Platform Specifics:

    • Windows: Download the .exe (e.g., peptdeep-X.Y.Z-windows-amd64.exe) and run it. Always install into a new folder, as the installer does not overwrite existing installations properly.
    • Linux: Download the .deb file and install via dpkg -i.
    • MacOS: Download the .pkg matching your architecture (arm64 for M1/M2/M3, x64 for Intel).
      • Note: On newer macOS versions, you may need to allow the app in System Settings > Privacy & Security > Security by clicking Open Anyway if it is blocked.
  4. Install AlphaPeptDeep via Pip

    main

    To use peptdeep as a Python package in an existing environment (e.g., a Jupyter notebook), use pip. Recommended Python versions are 3.8 or 3.9.

    Standard installation: Installs the core package. This avoids strict versioning conflicts with other tools but does not guarantee dependency compatibility if new versions are released.

    Stable installation: Forces peptdeep to use dependency versions known to be compatible.

    GUI installation: Installs the Graphical User Interface version via pip.

    Note on Raw Data: To access Thermo or Sciex raw data, you must also install AlphaRaw (which depends on Mono for Mac/Linux).

    # Standard installation
    pip install peptdeep
    
    # Stable installation
    pip install "peptdeep[stable]"
    
    # Install GUI version
    pip install "peptdeep[gui]"
    
    # Install stable GUI version
    pip install "peptdeep[stable,gui-stable]"
  5. Install and run pre-commit hooks for development

    main

    If you are contributing to the repository, it is highly recommended to use the provided pre-commit hooks. The CI pipeline enforces these checks before any branch can be merged.

    To install the hooks once:

    pre-commit install

    To manually run all checks on all files:

    pre-commit run --all-files
    pre-commit install
    pre-commit run --all-files
  6. Enable GPU support for AlphaPeptDeep

    main

    To enable GPU acceleration, use the Pip or Developer installation methods and manually upgrade to a GPU-enabled version of PyTorch. Ensure your NVIDIA drivers are compatible by checking nvidia-smi.

    pip install torch --extra-index-url https://download.pytorch.org/whl/cu116 --upgrade
  7. Translate alphabase spectral libraries to TSV format

    main

    Use peptdeep.spec_lib.translate to convert alphabase spectral libraries into TSV formats compatible with tools like DiaNN, OpenSWATH, and Spectronaut.

    Note: This module is considered legacy and will be replaced by alphabase.spectral_library.translate. For the most up-to-date implementation, refer to the alphabase repository.

    For a detailed walkthrough, see the tutorial: Tutorial: translate spectral libraries <../nbs/alphapeptdeep_hdf_to_tsv>.

  8. Install AlphaPeptDeep for Development

    main

    To modify the source code or access all features, install in "editable" mode using a Conda environment. This is recommended for high-throughput experiments as the developer version often outperforms precompiled versions.

    1. Clone the repository.
    2. Create and activate a Conda environment (Python 3.9 recommended).
    3. Install with the [development] extra to include development dependencies.
    # Clone the repo
    git clone https://github.com/MannLabs/alphapeptdeep.git && cd alphapeptdeep
    
    # Setup Conda environment
    conda create --name peptdeep python=3.9 -y
    conda activate peptdeep
    
    # Install in editable mode with development dependencies
    pip install -e ".[development]"
  9. Predict spectral libraries from FASTA files using peptdeep.protein.fasta

    main

    The peptdeep.protein.fasta module provides the primary API for generating spectral libraries directly from FASTA files (peptide lists). This allows you to predict properties for a set of peptides derived from a protein sequence database.

    For a complete walkthrough of the workflow, refer to the Tutorial: spectral library from fasta notebook.