ibaqpy

Absolute quantification package based on quantms.io

https://github.com/bigbio/ibaqpy

Science Score: 67.0%

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

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 4 DOI reference(s) in README
  • Academic publication links
    Links to: pubmed.ncbi, ncbi.nlm.nih.gov, sciencedirect.com, wiley.com, nature.com
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (8.1%) to scientific vocabulary

Keywords

absolute-quantification ibaq mass-spectrometry proteomics quantification
Last synced: 6 months ago · JSON representation ·

Repository

Absolute quantification package based on quantms.io

Basic Info
  • Host: GitHub
  • Owner: bigbio
  • License: mit
  • Language: HTML
  • Default Branch: master
  • Homepage: https://quantms.org
  • Size: 227 MB
Statistics
  • Stars: 15
  • Watchers: 2
  • Forks: 12
  • Open Issues: 2
  • Releases: 4
Topics
absolute-quantification ibaq mass-spectrometry proteomics quantification
Created about 4 years ago · Last pushed 9 months ago
Metadata Files
Readme License Citation

README.md

ibaqpy

Python application Upload Python Package Codacy Badge PyPI version PyPI - Downloads

iBAQ (Intensity-Based Absolute Quantification) determines the abundance of a protein by dividing the total precursor intensities by the number of theoretically observable peptides of the protein manuscript here. ibaqpy is a Python package that computes iBAQ values starting from a feature parquet from quantmsio and a SDRF file. In addition, the package computes other ibaq values including rIBAQ, log2, and ppb.

ibaqpy also allows computing the TPA value (Total Protein Approach), protein copy number, and protein concentration. TPA is determined by summing peptide intensities of each protein and then dividing by the molecular mass to determine the relative concentration of each protein. By using ProteomicRuler, it is possible to calculate the protein copy number and absolute concentration. The OpenMS tool was used to calculate the theoretical molecular mass of each protein. Similar to the calculation of IBAQ, the TPA value of protein-group was the sum of its intensity divided by the sum of the theoretical molecular mass.

The protein copy calculation follows the following formula:

protein copies per cell = protein MS-signal * (avogadro / molecular mass) * (DNA mass / histone MS-signal)

For cellular protein copy number calculation, the uniprot accession of histones was obtained from species first, and the molecular mass of DNA was calculated. Then the dataframe was grouped according to different conditions, and the copy number, molar number and mass of proteins were calculated. In the calculation of protein concentration, the volume is calculated according to the cell protein concentration first, and then the protein mass is divided by the volume to calculate the intracellular protein concentration.

Overview of ibaq-base values computation

As mentioned before, ibaq values are calculated by dividing the total precursor intensities by the number of theoretically observable peptides of the protein. We use the following steps to calculate the iBAQ values:

  • Observable peptides, the protein sequence is digested in silico using a specific enzyme. The current version of this tool uses OpenMS method to load fasta file, and use ProteaseDigestion to enzyme digestion of protein sequences, and finally get the theoretical peptide number of each protein.

  • Total precursor intensities, the total intensity of a protein is calculated by summing the intensity of all peptides that belong to the protein. The intensity values are obtained from the feature parquet file in quantms.io.

Note: If protein-group exists in the peptide intensity dataframe, the intensity of all proteins in the protein-group is summed based on the above steps, and then divided by the number of proteins in the protein-group.

Other values

  • Ibaq - the iBAQ value is calculated as Total precursor intensities / Number of observable peptides

  • IbaqNorm - normalize the ibaq values using the total ibaq of the sample ibaq / sum(ibaq), the sum is applied for proteins in the same sample + condition.

  • IbaqLog - The ibaq log is calculated as 10 + log10(IbaqNorm). This normalized ibaq value was developed by ProteomicsDB Team.

  • IbaqPpb - The resulted IbaqNorm is multiplied by 100M IbaqNorm * 100'000'000. This method was developed originally by PRIDE Team.

  • IbaqBec - Ibaq after Batch effect correction using combat-norm algorithm in inmoose package.

  • TPA - TPA value is calculated as NormIntensity / MolecularWeight

  • CopyNumber - Protein copy number is calculated by a proteomic ruler approach.

  • Concentration[nM] - Protein concentration is calculated using the total weight and a provided concentration per cell (cpc).

From quantms to Ibaq values

Ibaq

The output of quantms is converted into quantms.io feature file. quantms.io provides a unified format for processing report files, including peptide intensity information. In quantms.io, you can use the convert-ibaq command, providing a feature file and an SDRF file, to inject experimental information into the feature file, generating an ibaqpy use case.

```asciidoc

$ quantmsioc convert-feature --sdrffile PXD004452-Hella-trypsin.sdrf.tsv --msstatsfile PXD004452-Hella-trypsin.sdrfopenmsdesignmsstatsin.csv --mztabfile PXD004452-Hella-trypsin.sdrfopenmsdesignopenms.mzTab --filenum 30 --outputfolder res --duckdbmaxmemory 64GB --outputprefixfile PXD004452 $ quantmsioc convert-ibaq --featurefile res/PXD004452-6c224f5a-7c1f-46f9-9dae-1541baeef8fe.feature.parquet --sdrffile PXD004452-Hella-trypsin.sdrf.tsv --outputfolder ibaq --outputprefix_file PXD004452 ```

A feature in quantms.io is the combination of the following columns:

  • ProteinName: Protein name
  • Peptidoform: Peptide sequence including post-translation modifications (e.g. .(Acetyl)ASPDWGYDDKN(Deamidated)GPEQWSK)
  • PEPTIDE_CANONICAL: Canonical peptide sequence
  • PrecursorCharge: Precursor charge
  • Channel: Lable channel
  • Condition: Condition label (e.g. heart)
  • BioReplicate: Biological replicate index (e.g. 1)
  • Run: Run index (e.g. 1)
  • Fraction: Fraction index (e.g. 1)
  • Intensity: Peptide intensity
  • Reference: reference file
  • SampleID: Sample ID (e.g. PXD003947-Sample-3)

In summary, each feature is the unique combination of a peptide sequence including modifications (peptidoform), precursor charge state, condition, biological replicate, run, fraction, referencefilename, sample_accession, and a given intensity. In order to go from these features into protein ibaq values, the package does the following:

Data preprocessing

In this sectionfeatures2peptides, ibaqpy will do:

  • Parse the identifier of proteins and retain only unique peptides.
  • Remove lines where intensity or study condition is empty: This could happen in the following cases:
    • The DIA pipeline sometimes for some features releases intensities with value 0.
    • The quantms.io do not contain feature information for some conditions. This extreme case could happen when not ID/Quant was found for a given condition during the analysis.
  • Filter peptides with less amino acids than min_aa.
  • Low-confidence proteins were removed according to the threshold of unique peptides: We use a thershold of 2 unique peptides to consider a protein as a high-confidence protein. This parameter is applied if not specified by the user, and the default value is 2. If users want to change this threshold, they can use the --min_unique parameter.
  • Filter decoy, contaminants, entrapment: Proteins with the following prefix are removed by default: DECOY, CONTAMINANT, ENTRAPMENT could be removed, by default, the filter is not applied. If users want to remove these proteins, they can use the --remove_decoy_contaminants parameter.
  • Filter user-specified proteins: The user can provide a list of protein identifiers to remove from the analysis using the --remove_ids parameter. The remove ids parameters will remove proteins from the analysis that could be potential to influence the intensity normalization. For example, ALBU_HUMAN could be over expressed in human tissues, and that is why we may want to remove it when analyzing tissue data.
  • Normalize at feature level between ms runs (technical repetitions):
    • When MS runs > 1 in the sample, the mean of all average(mean, median or iqr) in each MS run is calculated(SampleMean)
    • The ratio between SampleMean and the average MS run is used as a reference to scale the original intensity
  • Merge peptidoforms across fractions and technical repetitions: Combine technical replicates and fragments from the same sample.
  • Normalize the data at the sample level:
    • globalMedian: A global median that adjusts the median of all samples.
    • conditionMedian: All samples under the same conditions were adjusted to the median value under the current conditions.
  • Remove peptides with low frequency if sample number > 1: This parameter is applied always unless the user specifies the --remove_low_frequency_peptides parameter. The default value is 20% of the samples. If users want to change this threshold, they can use the --remove_low_frequency_peptides parameter.
  • Assembly peptidoforms to peptides: A peptidoform is a combination of a PeptideSequence(Modifications) + Charge + BioReplicate + Fraction (among other features), and a peptide is a combination of a PeptideSequence(Canonical) + BioReplicate. ibaqpy will do:
    • Select peptidoforms with the highest intensity across different modifications, fractions, and technical replicates
    • Merge peptidoforms across different charges and combined into peptides. In order to merge peptidoforms, the package will applied the sum of the intensity values of the peptidoforms.
  • Intensity transformation to log: The user can specify the --log2 parameter to transform the peptide intensity values to log2 before normalization.

Note: At the moment, ibaqpy computes the ibaq values only based on unique peptides. Shared peptides are discarded. However, if a group of proteins share the same unique peptides (e.g., Pep1 -> Prot1;Prot2 and Pep2 -> Prot1;Prot2), the intensity of the proteins is summed and divided by the number of proteins in the group.

Calculate the IBAQ Value

First, peptide intensity dataframe was grouped according to protein name, sample name and condition. The protein intensity of each group was summed up. Due to the experimental type, the same protein may exhibit missing peptides in different samples, resulting in variations in the number of peptides detected for the protein across different samples. To handle this difference, normalization within the same group can be achieved by using the formula sum(peptides) / n(n represents the number of detected peptide segments). Finally, the normalized intensity of the protein is divided by the number of theoretical peptides.See details in peptides2proteins.

Note: In all scripts and result files, uniprot accession is used as the protein identifier.

How to install ibaqpy

Ibaqpy is available in PyPI and can be installed using pip:

asciidoc pip install ibaqpy

You can install the package from code:

  1. Clone the repository:

```asciidoc

$ git clone https://github.com/bigbio/ibaqpy $ cd ibaqpy ```

  1. Install conda environment:

```asciidoc

$ mamba env create -f conda-environment.yaml ```

  1. Install ibaqpy:

```asciidoc

$ python setup.py install ```

Collecting intensity files from quantms.org

Absolute quantification files have been stored in the following url:

https://ftp.pride.ebi.ac.uk/pub/databases/pride/resources/proteomes/absolute-expression/quantms-data/

Inside each project reanalysis folder, the folder proteomicslfq contains the msstats input file with the structure {Name of the project}.{Random uuid}.feature.parquet.

E.g. http://ftp.pride.ebi.ac.uk/pub/databases/pride/resources/proteomes/absolute-expression/quantms-data/MSV000079033.1/MSV000079033.1-bd44c7e3-654c-444d-9e21-0f701d6dac94.feature.parquet

Major commands

Features to peptides

asciidoc ibaqpy features2peptides -p tests/PXD003947/PXD003947-feature.parquet -s tests/PXD003947/PXD003947.sdrf.tsv --remove_ids data/contaminants_ids.tsv --remove_decoy_contaminants --remove_low_frequency_peptides --output tests/PXD003947/PXD003947-peptides-norm.csv

```asciidoc Usage: features2peptides.py [OPTIONS]

Options: -p, --parquet TEXT Parquet file import generated by quantms.io -s, --sdrf TEXT SDRF file import generated by quantms --minaa INTEGER Minimum number of amino acids to filter peptides --minunique INTEGER Minimum number of unique peptides to filter proteins --removeids TEXT Remove specific protein ids from the analysis using a file with one id per line --removedecoycontaminants Remove decoy and contaminants proteins from the analysis --removelowfrequencypeptides Remove peptides that are present in less than 20% of the samples --output TEXT Peptide intensity file including other all properties for normalization --skipnormalization Skip normalization step --nmethod TEXT Normalization method used to normalize feature intensities for tec (options: mean, median, iqr, none) --pnmethod TEXT Normalization method used to normalize peptides intensities for all samples (options: globalMedian,conditionMedian,none) --log2 Transform to log2 the peptide intensity values before normalization --saveparquet Save normalized peptides to parquet --help Show this message and exit. ```

Compute IBAQ/TPA

asciidoc ibaqpy peptides2protein -f Homo-sapiens-uniprot-reviewed-contaminants-decoy-202210.fasta -p PXD017834-peptides.csv -e Trypsin -n -t -r --ploidy 2 --cpc 200 --organism human --output PXD003947.tsv --verbose

```asciidoc Usage: peptides2protein [OPTIONS]

Options: -f, --fasta TEXT Protein database to compute IBAQ values -p, --peptides TEXT Peptide identifications with intensities following the peptide intensity output -e, --enzyme TEXT Enzyme used during the analysis of the dataset (default: Trypsin) -n, --normalize Normalize IBAQ values using by using the total IBAQ of the experiment --minaa INTEGER Minimum number of amino acids to consider a peptide --maxaa INTEGER Maximum number of amino acids to consider a peptide -t, --tpa Whether calculate TPA (isflag=True) -r, --ruler Whether to use ProteomicRuler (isflag=True) -i, --ploidy Ploidy number (default=2) -m, --organism Organism source of the data (default human) -c, --cpcCellular protein concentration(g/L)(default 200) -o, --output TEXT Output file with the proteins and ibaq values --verbose Print addition information about the distributions of the intensities, number of peptides remove after normalization, etc. --qc_report TEXT PDF file to store multiple QC images --help Show this message and exit. ```

Citation

Zheng P, Audain E, Webel H, Dai C, Klein J, Hitz MP, Sachsenberg T, Bai M, Perez-Riverol Y. ibaqpy: A scalable Python package for baseline quantification in proteomics leveraging SDRF metadata. bioRxiv 2025.02.08.637208; doi: https://doi.org/10.1101/2025.02.08.637208

Other relevant publications:

Wang H, Dai C, Pfeuffer J, Sachsenberg T, Sanchez A, Bai M, Perez-Riverol Y. Tissue-based absolute quantification using large-scale TMT and LFQ experiments. Proteomics. 2023 Oct;23(20):e2300188. doi: 10.1002/pmic.202300188. Epub 2023 Jul 24. PMID: 37488995.

Credits

Owner

  • Name: BigBio Stack
  • Login: bigbio
  • Kind: organization
  • Email: proteomicsstack@gmail.com
  • Location: Cambridge, UK

Provide big data solutions Bioinformatics

Citation (CITATION.cff)

cff-version: 1.2.0
message: "If you use ibaqpy in your research, please cite this work."
title: "ibaqpy: A scalable Python package for baseline quantification in proteomics leveraging SDRF metadata"
authors:
  - family-names: "Zheng"
    given-names: "Ping"
  - family-names: "Audain"
    given-names: "Enrique"
  - family-names: "Webel"
    given-names: "Henry"
  - family-names: "Dai"
    given-names: "Chengxin"
  - family-names: "Klein"
    given-names: "Joshua"
  - family-names: "Hitz"
    given-names: "Marc-Phillip"
  - family-names: "Sachsenberg"
    given-names: "Timo"
  - family-names: "Bai"
    given-names: "Mingze"
  - family-names: "Perez-Riverol"
    given-names: "Yasset"
abstract: "Intensity-based absolute quantification (iBAQ) is essential in proteomics as it allows for the assessment of a protein's absolute abundance in various samples or conditions. However, the computation of these values for increasingly large-scale and high-throughput experiments, such as those using DIA, TMT, or LFQ workflows, poses significant challenges in scalability and reproducibility. Here, we present ibaqpy, a Python package designed to compute iBAQ values efficiently for experiments of any scale."
date-released: "2025-02-08"
doi: "10.1101/2025.02.08.637208"
url: "https://www.biorxiv.org/content/early/2025/02/08/2025.02.08.637208"
journal: "bioRxiv"
publisher: "Cold Spring Harbor Laboratory"
version: "2025.02.08.637208"

GitHub Events

Total
  • Create event: 3
  • Release event: 2
  • Issues event: 11
  • Watch event: 7
  • Delete event: 1
  • Member event: 1
  • Issue comment event: 58
  • Push event: 94
  • Pull request review event: 96
  • Pull request review comment event: 84
  • Pull request event: 53
  • Fork event: 5
Last Year
  • Create event: 3
  • Release event: 2
  • Issues event: 11
  • Watch event: 7
  • Delete event: 1
  • Member event: 1
  • Issue comment event: 58
  • Push event: 94
  • Pull request review event: 96
  • Pull request review comment event: 84
  • Pull request event: 53
  • Fork event: 5

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 0
  • Total pull requests: 18
  • Average time to close issues: N/A
  • Average time to close pull requests: 7 days
  • Total issue authors: 0
  • Total pull request authors: 4
  • Average comments per issue: 0
  • Average comments per pull request: 1.94
  • Merged pull requests: 14
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 18
  • Average time to close issues: N/A
  • Average time to close pull requests: 7 days
  • Issue authors: 0
  • Pull request authors: 4
  • Average comments per issue: 0
  • Average comments per pull request: 1.94
  • Merged pull requests: 14
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • ypriverol (6)
  • timosachsenberg (2)
  • WangHong007 (2)
Pull Request Authors
  • zprobot (23)
  • ypriverol (22)
  • enriquea (3)
  • WangHong007 (2)
  • mobiusklein (2)
Top Labels
Issue Labels
bug (2) enhancement (2)
Pull Request Labels
Review effort [1-5]: 4 (2) Review effort [1-5]: 2 (1) Review effort [1-5]: 3 (1)

Packages

  • Total packages: 1
  • Total downloads:
    • pypi 43 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 0
  • Total versions: 3
  • Total maintainers: 1
pypi.org: ibaqpy

Python package to compute intensity base absolute expression values

  • Versions: 3
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 43 Last month
Rankings
Dependent packages count: 7.3%
Forks count: 17.2%
Average: 24.5%
Stargazers count: 32.5%
Dependent repos count: 40.9%
Maintainers (1)
Last synced: 6 months ago

Dependencies

requirements.txt pypi
  • click *
  • combat *
  • matplotlib *
  • numpy ==1.21
  • pandas *
  • pyopenms *
  • pyteomics *
  • qnorm *
  • scikit_learn *
  • seaborn ==0.10
  • typing_extensions *
.github/workflows/python-app.yml actions
  • actions/checkout v3 composite
  • actions/setup-python v3 composite
.github/workflows/python-package.yml actions
  • actions/checkout v3 composite
  • actions/setup-python v3 composite
setup.py pypi
  • click *
  • matplotlib *
  • missingpy *
  • numpy *
  • pandas *
  • pyopenms *
  • qnorm *
  • scikit-learn *
  • seaborn *
  • typing_extensions *
.github/workflows/python-publish.yml actions
  • actions/checkout v3 composite
  • actions/setup-python v3 composite
  • pypa/gh-action-pypi-publish 27b31702a0e7fc50959f5ad993c78deac1bdfc29 composite