alphapept

A modular, python-based framework for mass spectrometry. Powered by nbdev.

https://github.com/mannlabs/alphapept

Science Score: 49.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 8 DOI reference(s) in README
  • Academic publication links
  • Committers with academic emails
    3 of 21 committers (14.3%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (14.7%) to scientific vocabulary

Keywords

alphapept-ecosystem bioinformatics mass-spectrometry proteomics

Keywords from Contributors

hack mesh data-profiling interpretability standardization dynamic pde pinn bridges robust
Last synced: 6 months ago · JSON representation

Repository

A modular, python-based framework for mass spectrometry. Powered by nbdev.

Basic Info
Statistics
  • Stars: 178
  • Watchers: 11
  • Forks: 33
  • Open Issues: 26
  • Releases: 23
Topics
alphapept-ecosystem bioinformatics mass-spectrometry proteomics
Created almost 6 years ago · Last pushed almost 2 years ago
Metadata Files
Readme Changelog Contributing License Citation

README.md

AlphaPept

nbdev
CI launch -
renku DOI:10.1038/s41467-024-46485-4

AlphaPept: a modern and open framework for MS-based proteomics

Nature Communications.

Be sure to check out other packages of our ecosystem:

Windows Quickstart

  1. Download the latest installer here, install and click the shortcut on the desktop. A browser window with the AlphaPept interface should open. In the case of Windows Firewall asking for network access for AlphaPept, please allow.
  2. In the New Experiment, select a folder with raw files and FASTA files.
  3. Specify additional settings such as modifications with Settings.
  4. Click Start and run the analysis.

See also below for more detailed instructions.

Current functionality

| Feature | Implemented | |-----------------|----------------| | Type | DDA | | Filetypes | Bruker, Thermo | | Quantification | LFQ | | Isobaric labels | None | | Platform | Windows |

Linux and macOS should, in principle, work but are not heavily tested and might require additional work to set up (see detailed instructions below). To read Thermo files, we use Mono, which can be used on Mac and Linux. For Bruker files, we can use Linux but not yet macOS.

Python Installation Instructions

Requirements

We highly recommend the Anaconda or Miniconda Python distribution, which comes with a powerful package manager. See below for additional instructions for Linux and Mac as they require additional installation of Mono to use the RawFileReader.

AlphaPept can be used as an application as a whole or as a Python Package where individual modules are called. Depending on the use case, AlphaPept will need different requirements, and you might not want to install all of them.

Currently, we have the default requirements.txt, additional requirements to run the GUI gui and packages used for developing develop.

Therefore, you can install AlphaPept in multiple ways:

  • The default alphapept
  • With GUI-packages alphapept[gui]
  • With pacakges for development alphapept[develop] (alphapept[develop,gui]) respectively

The requirements typically contain pinned versions and will be automatically upgraded and tested with dependabot. This stable version allows having a reproducible workflow. However, in order to avoid conflicts with package versions that are too strict, the requirements are not pinned when being installed. To use the strict version use the -stable-flag, e.g.alphapept[stable].

For end-users that want to set up a processing environment in Python, the "alphapept[stable,gui-stable]" is the batteries-included-version that you want to use.

Python

It is strongly recommended to install AlphaPept in its own environment. 1. Open the console and create a new conda environment: conda create --name alphapept python=3.8 2. Activate the environment: conda activate alphapept 3. Install AlphaPept via pip: pip install "alphapept[stable,gui-stable]". If you want to use AlphaPept as a package without the GUI dependencies and without strict version dependencies, use pip install alphapept.

If AlphaPept is installed correctly, you should be able to import AlphaPept as a package within the environment; see below.


Linux

  1. Install the build-essentials: sudo apt-get install build-essential.
  2. Install AlphaPept via pip: pip install "alphapept[stable,gui-stable]". If you want to use AlphaPept as a package withouth the GUI dependencies and strict version dependencies use pip install alphapept.
  3. Install libgomp.1 with sudo apt-get install libgomp1.
Bruker Support
  1. Copy-paste the Bruker library for feature finding to your /usr/lib folder with sudo cp alphapept/ext/bruker/FF/linux64/alphapeptlibtbb.so.2 /usr/lib/libtbb.so.2.
Thermo Support
  1. Install Mono from mono-project website Mono Linux. NOTE, the installed mono version should be at least 6.10, which requires you to add the ppa to your trusted sources!
  2. Install pythonnet with pip install pythonnet>=2.5.2

Mac

  1. Install AlphaPept via pip: pip install "alphapept[stable,gui-stable]". If you want to use AlphaPept as a package withouth the GUI dependencies and strict version dependencies use pip install alphapept.
Bruker Support

Only supported for preprocessed files.

Thermo Support
  1. Install brew and pkg-config: brew install pkg-config
  2. Install Mono from mono-project website Mono Mac
  3. Register the Mono-Path to your system: For macOS Catalina, open the configuration of zsh via the terminal:
  • Type in cd to navigate to the home directory.
  • Type nano ~/.zshrc to open the configuration of the terminal
  • Add the path to your mono installation: export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/usr/lib/pkgconfig:/Library/Frameworks/Mono.framework/Versions/Current/lib/pkgconfig:$PKG_CONFIG_PATH. Make sure that the Path matches to your version (Here 6.12.0)
  • Save everything and execute . ~/.zshrc
  1. Install pythonnet with pip install pythonnet>=2.5.2

Developer

  1. Redirect to the folder of choice and clone the repository: git clone https://github.com/MannLabs/alphapept.git
  2. Navigate to the alphapept folder with cd alphapept and install the package with pip install . (default users) or with pip install -e . to enable developers mode. Note that you can use the different requirements here aswell (e.g.pip install ".[gui-stable]")

GPU Support

Some functionality of AlphaPept is GPU optimized that uses Nvidias CUDA. To enable this, additional packages need to be installed.

  1. Make sure to have a working CUDA toolkit installation that is compatible with CuPy. To check type nvcc --version in your terminal.
  2. Install cupy. Make sure to install the cupy version matching your CUDA toolkit (e.g.pip install cupy-cuda110 for CUDA toolkit 11.0.

Additional Notes

To access Thermo files, we have integrated RawFileReader into AlphaPept. We rely on Mono for Linux/Mac systems.

To access Bruker files, we rely on the timsdata-library. Currently, only Windows is supported. For feature finding, we use the Bruker Feature Finder, which can be found in the ext folder of this repository.

Notes for NBDEV

  • For developing with the notebooks, install the nbdev package (see the development requirements)
  • To facilitate navigating the notebooks, use jupyter notebook extensions. They can be called from a running jupyter instance like so: http://localhost:8888/nbextensions. The extensions collapsible headings and toc2 are very beneficial.

Standalone Windows Installer

To use AlphaPept as a stand-alone program for end-users, it can be installed on Windows machines via a one-click installer. Download the latest version here.

Docker

It is possible to run AlphaPept in a docker container. For this, we provide two Dockerfiles: Dockerfile_thermo and Dockerfile_bruker, depending on which filetypes you want to analyse. They are split because of drastically different requirements.

To run, navigate to the AlphaPept repository and rename the dockerfile you want to use, e.g.Dockerfile_thermo to Dockerfile.

  • Build the image with: docker build -t docker-alphapept:latest .
  • To run use docker run -p 8505:8505 -v /Users/username/Desktop/docker:/home/alphapept/ docker-alphapept:latest alphapept gui (Note that -v maps a local folder for convient file transfer)
  • Access the AlphaPept GUI via localhost:8505 in your browser.
  • Note 1: The Thermo Dockerfile is built on a Jupyter image, so you can also start a jupyter instance: docker run -p 8888:8888 -v /Users/username/Desktop/docker:/home/jovyan/ docker-alphapept:latest jupyter notebook --allow-root

Docker Troubleshooting on M1-Mac

  • The Thermo dockerfile was tested on an M1-Mac. Resources were set to 18GB RAM and 2 CPUs, 200 GB disk
  • It was possible to build the Bruker dockerfile with the platform tag --platform linux/amd64. However, it was very slow and the Bruker file is not recommended for an M1-Mac. Windows worked nicely.

Additional Documentation

The documentation is automatically built based on the jupyter notebooks (nbs/index.ipynb) and can be found here:

Version Performance

An overview of the performance of different versions can be found here. We re-run multiple tests on datasets for different versions so that users can assess what changes from version to version. Feel free to suggest a test set in case.

How to use

AlphaPept is meant to be a framework to implement and test new ideas quickly but also to serve as a performant processing pipeline. In principle, there are three use-cases:

  • GUI: Use the graphical user interface to select settings and process files manually.
  • CMD: Use the command-line interface to process files. Useful when building automatic pipelines.
  • Python: Use python modules to build individual workflows. Useful when building customized pipelines and using Python as a scripting language or when implementing new ideas.

Windows Standalone Installation

For the windows installation, simply click on the shortcut after installation. The windows installation also installs the command-line tool so that you can call alphapept via alphapept in the command line.

Python Package

Once AlphaPept is correctly installed, you can use it like any other python module.

``` python from alphapept.fasta import getfragdict, parse from alphapept import constants

peptide = 'PEPT'

getfragdict(parse(peptide), constants.mass_dict) ```

{'b1': 98.06004032687,
 'b2': 227.10263342687,
 'b3': 324.15539728686997,
 'y1': 120.06551965033,
 'y2': 217.11828351033,
 'y3': 346.16087661033}

Using as a tool

If alphapept is installed an a conda or virtual environment, launch this environment first.

To launch the command line interface use: * alphapept

This allows us to select different modules. To start the GUI use: * alphapept gui

To run a workflow, use: * alphapept workflow your_own_workflow.yaml An example workflow is easily generated by running the GUI once and saving the settings which can be modified on a per-project basis.

CMD / Python

  1. Create a settings-file. This can be done by changing the default_settings.yaml in the repository or using the GUI.
  2. Run the analysis with the new settings file. alphapept run new_settings.yaml

Within Python (i.e., Jupyter notebook) the following code would be required)

from alphapept.settings import load_settings
import alphapept.interface
settings = load_settings('new_settings.yaml')
r = alphapept.interface.run_complete_workflow(settings)

This also allows you to break the workflow down in indiviudal steps, e.g.:

settings = alphapept.interface.import_raw_data(settings)
settings = alphapept.interface.feature_finding(settings)

Notebooks

Within the notebooks, we try to cover most aspects of a proteomics workflow:

  • Settings: General settings to define a workflow
  • Chem: Chemistry related functions, e.g., for calculating isotope distributions
  • Input / Output: Everything related to importing and exporting and the file formats used
  • FASTA: Generating theoretical databases from FASTA files
  • Feature Finding: How to extract MS1 features for quantification
  • Search: Comparing theoretical databases to experimental spectra and getting Peptide-Spectrum-Matches (PSMs)
  • Score: Scoring PSMs
  • Recalibration: Recalibration of data based on identified peptides
  • Quantification: Functions for quantification, e.g., LFQ
  • Matching: Functions for Match-between-runs
  • Constants: A collection of constants
  • Interface: Code that generates the command-line-interface (CLI) and makes workflow steps callable
  • Performance: Helper functions to speed up code with CPU / GPU
  • Export: Helper functions to make exports compatbile to other Software tools
  • Label: Code for support isobaric label search
  • Display: Code related to displaying in the streamlit gui
  • Additional code: Overview of additional code not covered by the notebooks
  • How to contribute: Contribution guidelines
  • AlphaPept workflow and files: Overview of the worfklow, files and column names

Contributing

If you have a feature request or a bug report, please post it either as an idea in the discussions or as an issue on the GitHub issue tracker. Upvoting features in the discussions page will help to prioritize what to implement next. If you want to contribute, put a PR for it. You can find more guidelines for contributing and how to get started here. We will gladly guide you through the codebase and credit you accordingly. Additionally, you can check out the Projects page on GitHub. You can also contact us via opensource@alphapept.com.

If you like the project, consider starring it!

Cite us

If you use this project in your research, please cite:

Strauss, M.T., Bludau, I., Zeng, WF. et al.AlphaPept: a modern and open framework for MS-based proteomics. Nat Commun 15, 2168 (2024). https://doi.org/10.1038/s41467-024-46485-4

Owner

  • Name: Mann Labs
  • Login: MannLabs
  • Kind: organization

GitHub Events

Total
  • Watch event: 10
  • Member event: 6
  • Issue comment event: 3
  • Fork event: 4
Last Year
  • Watch event: 10
  • Member event: 6
  • Issue comment event: 3
  • Fork event: 4

Committers

Last synced: about 2 years ago

All Time
  • Total Commits: 1,618
  • Total Committers: 21
  • Avg Commits per committer: 77.048
  • Development Distribution Score (DDS): 0.268
Past Year
  • Commits: 55
  • Committers: 2
  • Avg Commits per committer: 27.5
  • Development Distribution Score (DDS): 0.055
Top Committers
Name Email Commits
Maximilian Strauss s****n@g****m 1,184
Sander Willems s****9@h****m 115
Maximilian Strauss s****n@g****m 68
dependabot[bot] 4****] 53
dependabot-preview[bot] 2****] 53
Zeng, Wen-Feng w****g@b****e 40
ammarcsj 7****j 38
Isabell Bludau i****u@g****m 24
VK v****k@i****m 8
Sander Willems s****s 7
hugokitano h****5@g****m 5
voytik j****k@g****m 4
Zeng, Wen-Feng j****8@g****m 4
mgleeming m****g@g****m 3
github-actions[bot] 4****] 3
mschwoer 8****r 2
Cyril Matthey-Doret c****t@g****m 2
elena-krismer e****r@h****m 2
mschwoer s****r@o****m 1
Roman Zenka z****n@m****u 1
mgleeming m****g@s****u 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 40
  • Total pull requests: 73
  • Average time to close issues: 8 months
  • Average time to close pull requests: 28 days
  • Total issue authors: 29
  • Total pull request authors: 6
  • Average comments per issue: 1.8
  • Average comments per pull request: 1.51
  • Merged pull requests: 37
  • Bot issues: 0
  • Bot pull requests: 55
Past Year
  • Issues: 6
  • Pull requests: 0
  • Average time to close issues: 1 day
  • Average time to close pull requests: N/A
  • Issue authors: 6
  • Pull request authors: 0
  • Average comments per issue: 1.33
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • straussmaximilian (6)
  • JuliaS92 (3)
  • ibludau (3)
  • mschwoer (2)
  • grandrea (2)
  • davidhoover (1)
  • lazear (1)
  • eliseneedham (1)
  • swillems (1)
  • lnelllwj (1)
  • tommasomari (1)
  • RobbinBouwmeester (1)
  • yc386 (1)
  • jalew188 (1)
  • DoerigC (1)
Pull Request Authors
  • dependabot[bot] (55)
  • straussmaximilian (13)
  • swillems (2)
  • mschwoer (1)
  • jalew188 (1)
  • elena-krismer (1)
Top Labels
Issue Labels
enhancement (2) bug (1)
Pull Request Labels

Packages

  • Total packages: 1
  • Total downloads:
    • pypi 216 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 0
  • Total versions: 18
  • Total maintainers: 1
pypi.org: alphapept

A modular, python-based framework for mass spectrometry.

  • Versions: 18
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 216 Last month
Rankings
Stargazers count: 6.1%
Forks count: 7.3%
Dependent packages count: 10.1%
Downloads: 13.1%
Average: 20.8%
Dependent repos count: 67.3%
Maintainers (1)
Last synced: 6 months ago

Dependencies

.github/workflows/gpu_test.yml actions
  • actions/checkout v2 composite
.github/workflows/nbdev.yaml actions
  • fastai/workflows/nbdev-ci master composite
.github/workflows/performance_test_installer.yml actions
  • actions/checkout v2 composite
.github/workflows/publish_on_pypi.yml actions
  • actions/checkout v2 composite
  • conda-incubator/setup-miniconda v2 composite
  • pypa/gh-action-pypi-publish master composite
.github/workflows/quick_test.yml actions
  • actions/checkout v2 composite
.github/workflows/release.yml actions
  • actions/checkout v2 composite
  • actions/create-release v1 composite
  • actions/upload-release-asset v1 composite
requirements/requirements.txt pypi
  • SQLAlchemy ==1.4.39
  • biopython ==1.79
  • click >=7.1.2
  • fastcore ==1.5.26
  • h5py ==3.7.0
  • matplotlib ==3.6.1
  • networkx ==2.8.6
  • numba ==0.55.2
  • numpy ==1.20.3
  • pandas ==1.4.3
  • psutil ==5.9.1
  • pyteomics ==4.5.5
  • pyyaml ==6.0
  • scikit-learn ==1.1.2
  • scipy ==1.8.1
  • tables ==3.6.1
  • tqdm ==4.64.0
requirements/requirements_develop.txt pypi
  • bumpversion >=0.6.0 development
  • jupyter >=1.0.0 development
  • jupyter_contrib_nbextensions >=0.5.1 development
  • nbdev >=2.0.0 development
  • pyinstaller ==5.2 development
  • twine >=3.4.1 development
  • wget ==3.2 development
requirements/requirements_gui.txt pypi
  • plotly_express ==0.4.1
  • streamlit >=1.13
  • streamlit-aggrid ==0.2.3.post2
  • watchdog ==2.1.9
  • wget ==3.2