Exercise: Data Analysis PXD070899

Exercise: Data Analysis PXD070899#

Plan

  • read data and log2 transform intensity values

  • aggregate peptide intensities to protein intensities

  • format data from long to wide format

  • remove contaminant proteins

  • check for missing values

  • Clustermap of sample and proteins

  • differential analysis (Volcano Plots)

  • Enrichment Analysis

  • check for maltose update pathway (Fig. 3 in paper)

%pip install acore vuecore "pingouin<0.6.0"

Hide code cell output

Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: acore in /home/runner/.local/lib/python3.12/site-packages (0.2.2)
Requirement already satisfied: vuecore in /home/runner/.local/lib/python3.12/site-packages (0.1.1)
Requirement already satisfied: pingouin<0.6.0 in /home/runner/.local/lib/python3.12/site-packages (0.5.5)
Requirement already satisfied: numpy in /home/runner/.local/lib/python3.12/site-packages (from acore) (2.4.6)
Requirement already satisfied: pandas in /home/runner/.local/lib/python3.12/site-packages (from acore) (2.3.3)
Requirement already satisfied: dsp-pandas in /home/runner/.local/lib/python3.12/site-packages (from acore) (0.0.5)
Requirement already satisfied: scipy in /home/runner/.local/lib/python3.12/site-packages (from acore) (1.17.1)
Requirement already satisfied: scikit-learn>=1.5 in /home/runner/.local/lib/python3.12/site-packages (from acore) (1.9.0)
Requirement already satisfied: networkx in /home/runner/.local/lib/python3.12/site-packages (from acore) (3.6.1)
Requirement already satisfied: biopython in /home/runner/.local/lib/python3.12/site-packages (from acore) (1.87)
Requirement already satisfied: combat in /home/runner/.local/lib/python3.12/site-packages (from acore) (0.3.3)
Requirement already satisfied: gseapy!=1.1.5 in /home/runner/.local/lib/python3.12/site-packages (from acore) (1.2.1)
Requirement already satisfied: kmapper in /home/runner/.local/lib/python3.12/site-packages (from acore) (2.1.0)
Requirement already satisfied: lifelines in /home/runner/.local/lib/python3.12/site-packages (from acore) (0.30.3)
Requirement already satisfied: python-louvain in /home/runner/.local/lib/python3.12/site-packages (from acore) (0.16)
Requirement already satisfied: PyWGCNA!=2.2.0 in /home/runner/.local/lib/python3.12/site-packages (from acore) (1.16.0)
Requirement already satisfied: snfpy in /home/runner/.local/lib/python3.12/site-packages (from acore) (0.2.2)
Requirement already satisfied: umap-learn in /home/runner/.local/lib/python3.12/site-packages (from acore) (0.5.12)
Requirement already satisfied: statsmodels in /home/runner/.local/lib/python3.12/site-packages (from acore) (0.14.6)
Requirement already satisfied: inmoose in /home/runner/.local/lib/python3.12/site-packages (from acore) (0.9.1)
Requirement already satisfied: requests in /usr/lib/python3/dist-packages (from acore) (2.31.0)
Requirement already satisfied: rarfile in /home/runner/.local/lib/python3.12/site-packages (from acore) (4.2)
Requirement already satisfied: pandera in /home/runner/.local/lib/python3.12/site-packages (from acore) (0.31.1)
Requirement already satisfied: plotly in /home/runner/.local/lib/python3.12/site-packages (from vuecore) (5.24.1)
Requirement already satisfied: beautifulsoup4 in /home/runner/.local/lib/python3.12/site-packages (from vuecore) (4.15.0)
Requirement already satisfied: dash in /home/runner/.local/lib/python3.12/site-packages (from vuecore) (4.2.0)
Requirement already satisfied: matplotlib in /home/runner/.local/lib/python3.12/site-packages (from vuecore) (3.10.9)
Requirement already satisfied: kaleido in /home/runner/.local/lib/python3.12/site-packages (from vuecore) (0.2.1)
Requirement already satisfied: pyvis in /home/runner/.local/lib/python3.12/site-packages (from vuecore) (0.3.2)
Requirement already satisfied: wordcloud in /home/runner/.local/lib/python3.12/site-packages (from vuecore) (1.9.6)
Requirement already satisfied: cyjupyter in /home/runner/.local/lib/python3.12/site-packages (from vuecore) (0.2.0)
Requirement already satisfied: nltk in /home/runner/.local/lib/python3.12/site-packages (from vuecore) (3.9.4)
Requirement already satisfied: webweb in /home/runner/.local/lib/python3.12/site-packages (from vuecore) (0.0.37)
Requirement already satisfied: dash-cytoscape in /home/runner/.local/lib/python3.12/site-packages (from vuecore) (1.0.2)
Requirement already satisfied: pydantic in /home/runner/.local/lib/python3.12/site-packages (from vuecore) (2.13.4)
Requirement already satisfied: nbformat>=4.2.0 in /home/runner/.local/lib/python3.12/site-packages (from vuecore) (5.10.4)
Requirement already satisfied: pandas-flavor in /home/runner/.local/lib/python3.12/site-packages (from pingouin<0.6.0) (0.8.1)
Requirement already satisfied: seaborn in /home/runner/.local/lib/python3.12/site-packages (from pingouin<0.6.0) (0.13.2)
Requirement already satisfied: tabulate in /home/runner/.local/lib/python3.12/site-packages (from pingouin<0.6.0) (0.10.0)
Requirement already satisfied: contourpy>=1.0.1 in /home/runner/.local/lib/python3.12/site-packages (from matplotlib->vuecore) (1.3.3)
Requirement already satisfied: cycler>=0.10 in /home/runner/.local/lib/python3.12/site-packages (from matplotlib->vuecore) (0.12.1)
Requirement already satisfied: fonttools>=4.22.0 in /home/runner/.local/lib/python3.12/site-packages (from matplotlib->vuecore) (4.63.0)
Requirement already satisfied: kiwisolver>=1.3.1 in /home/runner/.local/lib/python3.12/site-packages (from matplotlib->vuecore) (1.5.0)
Requirement already satisfied: packaging>=20.0 in /home/runner/.local/lib/python3.12/site-packages (from matplotlib->vuecore) (26.2)
Requirement already satisfied: pillow>=8 in /home/runner/.local/lib/python3.12/site-packages (from matplotlib->vuecore) (12.2.0)
Requirement already satisfied: pyparsing>=3 in /usr/lib/python3/dist-packages (from matplotlib->vuecore) (3.1.1)
Requirement already satisfied: python-dateutil>=2.7 in /usr/lib/python3/dist-packages (from matplotlib->vuecore) (2.8.2)
Requirement already satisfied: fastjsonschema>=2.15 in /home/runner/.local/lib/python3.12/site-packages (from nbformat>=4.2.0->vuecore) (2.21.2)
Requirement already satisfied: jsonschema>=2.6 in /home/runner/.local/lib/python3.12/site-packages (from nbformat>=4.2.0->vuecore) (4.26.0)
Requirement already satisfied: jupyter-core!=5.0.*,>=4.12 in /home/runner/.local/lib/python3.12/site-packages (from nbformat>=4.2.0->vuecore) (5.9.1)
Requirement already satisfied: traitlets>=5.1 in /home/runner/.local/lib/python3.12/site-packages (from nbformat>=4.2.0->vuecore) (5.15.1)
Requirement already satisfied: pytz>=2020.1 in /usr/lib/python3/dist-packages (from pandas->acore) (2024.1)
Requirement already satisfied: tzdata>=2022.7 in /home/runner/.local/lib/python3.12/site-packages (from pandas->acore) (2026.2)
Requirement already satisfied: anndata>=0.8.0 in /home/runner/.local/lib/python3.12/site-packages (from PyWGCNA!=2.2.0->acore) (0.12.16)
Requirement already satisfied: biomart>=0.9.2 in /home/runner/.local/lib/python3.12/site-packages (from PyWGCNA!=2.2.0->acore) (0.9.2)
Requirement already satisfied: reactome2py>=3.0.0 in /home/runner/.local/lib/python3.12/site-packages (from PyWGCNA!=2.2.0->acore) (3.0.0)
Requirement already satisfied: rsrc>=0.1.3 in /home/runner/.local/lib/python3.12/site-packages (from PyWGCNA!=2.2.0->acore) (0.1.3)
Requirement already satisfied: setuptools>=59.8.0 in /usr/lib/python3/dist-packages (from PyWGCNA!=2.2.0->acore) (68.1.2)
Requirement already satisfied: ipython>=5.3.0 in /home/runner/.local/lib/python3.12/site-packages (from pyvis->vuecore) (9.14.1)
Requirement already satisfied: jinja2>=2.9.6 in /usr/lib/python3/dist-packages (from pyvis->vuecore) (3.1.2)
Requirement already satisfied: jsonpickle>=1.4.1 in /home/runner/.local/lib/python3.12/site-packages (from pyvis->vuecore) (4.1.2)
Requirement already satisfied: joblib>=1.4.0 in /home/runner/.local/lib/python3.12/site-packages (from scikit-learn>=1.5->acore) (1.5.3)
Requirement already satisfied: narwhals>=2.0.1 in /home/runner/.local/lib/python3.12/site-packages (from scikit-learn>=1.5->acore) (2.22.1)
Requirement already satisfied: threadpoolctl>=3.5.0 in /home/runner/.local/lib/python3.12/site-packages (from scikit-learn>=1.5->acore) (3.6.0)
Requirement already satisfied: patsy>=0.5.6 in /home/runner/.local/lib/python3.12/site-packages (from statsmodels->acore) (1.0.2)
Requirement already satisfied: soupsieve>=1.6.1 in /home/runner/.local/lib/python3.12/site-packages (from beautifulsoup4->vuecore) (2.8.4)
Requirement already satisfied: typing-extensions>=4.0.0 in /home/runner/.local/lib/python3.12/site-packages (from beautifulsoup4->vuecore) (4.15.0)
Requirement already satisfied: mpmath>=1.1.0 in /home/runner/.local/lib/python3.12/site-packages (from combat->acore) (1.4.1)
Requirement already satisfied: ipywidgets>=7.0.0 in /home/runner/.local/lib/python3.12/site-packages (from cyjupyter->vuecore) (8.1.8)
Requirement already satisfied: Flask<3.2,>=1.0.4 in /home/runner/.local/lib/python3.12/site-packages (from dash->vuecore) (3.1.3)
Requirement already satisfied: Werkzeug<3.2 in /home/runner/.local/lib/python3.12/site-packages (from dash->vuecore) (3.1.8)
Requirement already satisfied: importlib-metadata in /home/runner/.local/lib/python3.12/site-packages (from dash->vuecore) (9.0.0)
Requirement already satisfied: retrying in /home/runner/.local/lib/python3.12/site-packages (from dash->vuecore) (1.4.2)
Requirement already satisfied: nest-asyncio in /home/runner/.local/lib/python3.12/site-packages (from dash->vuecore) (1.6.0)
Requirement already satisfied: janus>=1.0.0 in /home/runner/.local/lib/python3.12/site-packages (from dash->vuecore) (2.0.0)
Requirement already satisfied: tenacity>=6.2.0 in /home/runner/.local/lib/python3.12/site-packages (from plotly->vuecore) (9.1.4)
Requirement already satisfied: openpyxl in /home/runner/.local/lib/python3.12/site-packages (from dsp-pandas->acore) (3.1.5)
Requirement already satisfied: fastcluster in /home/runner/.local/lib/python3.12/site-packages (from inmoose->acore) (1.3.0)
Requirement already satisfied: autograd>=1.5 in /home/runner/.local/lib/python3.12/site-packages (from lifelines->acore) (1.8.0)
Requirement already satisfied: autograd-gamma>=0.3 in /home/runner/.local/lib/python3.12/site-packages (from lifelines->acore) (0.5.0)
Requirement already satisfied: formulaic>=0.2.2 in /home/runner/.local/lib/python3.12/site-packages (from lifelines->acore) (1.2.2)
Requirement already satisfied: click in /usr/lib/python3/dist-packages (from nltk->vuecore) (8.1.6)
Requirement already satisfied: regex>=2021.8.3 in /home/runner/.local/lib/python3.12/site-packages (from nltk->vuecore) (2026.5.9)
Requirement already satisfied: tqdm in /home/runner/.local/lib/python3.12/site-packages (from nltk->vuecore) (4.68.1)
Requirement already satisfied: xarray in /home/runner/.local/lib/python3.12/site-packages (from pandas-flavor->pingouin<0.6.0) (2026.4.0)
Requirement already satisfied: typeguard in /home/runner/.local/lib/python3.12/site-packages (from pandera->acore) (4.5.2)
Requirement already satisfied: typing_inspect>=0.6.0 in /home/runner/.local/lib/python3.12/site-packages (from pandera->acore) (0.9.0)
Requirement already satisfied: annotated-types>=0.6.0 in /home/runner/.local/lib/python3.12/site-packages (from pydantic->vuecore) (0.7.0)
Requirement already satisfied: pydantic-core==2.46.4 in /home/runner/.local/lib/python3.12/site-packages (from pydantic->vuecore) (2.46.4)
Requirement already satisfied: typing-inspection>=0.4.2 in /home/runner/.local/lib/python3.12/site-packages (from pydantic->vuecore) (0.4.2)
Requirement already satisfied: numba>=0.51.2 in /home/runner/.local/lib/python3.12/site-packages (from umap-learn->acore) (0.65.1)
Requirement already satisfied: pynndescent>=0.5 in /home/runner/.local/lib/python3.12/site-packages (from umap-learn->acore) (0.6.0)
Requirement already satisfied: array-api-compat>=1.7.1 in /home/runner/.local/lib/python3.12/site-packages (from anndata>=0.8.0->PyWGCNA!=2.2.0->acore) (1.15.0)
Requirement already satisfied: h5py>=3.8 in /home/runner/.local/lib/python3.12/site-packages (from anndata>=0.8.0->PyWGCNA!=2.2.0->acore) (3.16.0)
Requirement already satisfied: legacy-api-wrap in /home/runner/.local/lib/python3.12/site-packages (from anndata>=0.8.0->PyWGCNA!=2.2.0->acore) (1.5)
Requirement already satisfied: natsort in /home/runner/.local/lib/python3.12/site-packages (from anndata>=0.8.0->PyWGCNA!=2.2.0->acore) (8.4.0)
Requirement already satisfied: scverse-misc>=0.0.3 in /home/runner/.local/lib/python3.12/site-packages (from anndata>=0.8.0->PyWGCNA!=2.2.0->acore) (0.0.8)
Requirement already satisfied: zarr!=3.0.*,>=2.18.7 in /home/runner/.local/lib/python3.12/site-packages (from anndata>=0.8.0->PyWGCNA!=2.2.0->acore) (3.2.1)
Requirement already satisfied: blinker>=1.9.0 in /home/runner/.local/lib/python3.12/site-packages (from Flask<3.2,>=1.0.4->dash->vuecore) (1.9.0)
Requirement already satisfied: itsdangerous>=2.2.0 in /home/runner/.local/lib/python3.12/site-packages (from Flask<3.2,>=1.0.4->dash->vuecore) (2.2.0)
Requirement already satisfied: markupsafe>=2.1.1 in /usr/lib/python3/dist-packages (from Flask<3.2,>=1.0.4->dash->vuecore) (2.1.5)
Requirement already satisfied: interface-meta>=1.2.0 in /home/runner/.local/lib/python3.12/site-packages (from formulaic>=0.2.2->lifelines->acore) (2.0.1)
Requirement already satisfied: wrapt>=1.0 in /home/runner/.local/lib/python3.12/site-packages (from formulaic>=0.2.2->lifelines->acore) (2.2.1)
Requirement already satisfied: decorator>=5.1.0 in /home/runner/.local/lib/python3.12/site-packages (from ipython>=5.3.0->pyvis->vuecore) (5.3.1)
Requirement already satisfied: ipython-pygments-lexers>=1.0.0 in /home/runner/.local/lib/python3.12/site-packages (from ipython>=5.3.0->pyvis->vuecore) (1.1.1)
Requirement already satisfied: jedi>=0.18.2 in /home/runner/.local/lib/python3.12/site-packages (from ipython>=5.3.0->pyvis->vuecore) (0.20.0)
Requirement already satisfied: matplotlib-inline>=0.1.6 in /home/runner/.local/lib/python3.12/site-packages (from ipython>=5.3.0->pyvis->vuecore) (0.2.2)
Requirement already satisfied: pexpect>4.6 in /usr/lib/python3/dist-packages (from ipython>=5.3.0->pyvis->vuecore) (4.9.0)
Requirement already satisfied: prompt_toolkit<3.1.0,>=3.0.41 in /home/runner/.local/lib/python3.12/site-packages (from ipython>=5.3.0->pyvis->vuecore) (3.0.52)
Requirement already satisfied: psutil>=7 in /home/runner/.local/lib/python3.12/site-packages (from ipython>=5.3.0->pyvis->vuecore) (7.2.2)
Requirement already satisfied: pygments>=2.14.0 in /usr/lib/python3/dist-packages (from ipython>=5.3.0->pyvis->vuecore) (2.17.2)
Requirement already satisfied: stack_data>=0.6.0 in /home/runner/.local/lib/python3.12/site-packages (from ipython>=5.3.0->pyvis->vuecore) (0.6.3)
Requirement already satisfied: comm>=0.1.3 in /home/runner/.local/lib/python3.12/site-packages (from ipywidgets>=7.0.0->cyjupyter->vuecore) (0.2.3)
Requirement already satisfied: widgetsnbextension~=4.0.14 in /home/runner/.local/lib/python3.12/site-packages (from ipywidgets>=7.0.0->cyjupyter->vuecore) (4.0.15)
Requirement already satisfied: jupyterlab_widgets~=3.0.15 in /home/runner/.local/lib/python3.12/site-packages (from ipywidgets>=7.0.0->cyjupyter->vuecore) (3.0.16)
Requirement already satisfied: attrs>=22.2.0 in /usr/lib/python3/dist-packages (from jsonschema>=2.6->nbformat>=4.2.0->vuecore) (23.2.0)
Requirement already satisfied: jsonschema-specifications>=2023.03.6 in /home/runner/.local/lib/python3.12/site-packages (from jsonschema>=2.6->nbformat>=4.2.0->vuecore) (2025.9.1)
Requirement already satisfied: referencing>=0.28.4 in /home/runner/.local/lib/python3.12/site-packages (from jsonschema>=2.6->nbformat>=4.2.0->vuecore) (0.37.0)
Requirement already satisfied: rpds-py>=0.25.0 in /home/runner/.local/lib/python3.12/site-packages (from jsonschema>=2.6->nbformat>=4.2.0->vuecore) (2026.5.1)
Requirement already satisfied: platformdirs>=2.5 in /usr/local/lib/python3.12/dist-packages (from jupyter-core!=5.0.*,>=4.12->nbformat>=4.2.0->vuecore) (4.9.6)
Requirement already satisfied: llvmlite<0.48,>=0.47.0dev0 in /home/runner/.local/lib/python3.12/site-packages (from numba>=0.51.2->umap-learn->acore) (0.47.0)
Requirement already satisfied: json5>=0.8.4 in /home/runner/.local/lib/python3.12/site-packages (from reactome2py>=3.0.0->PyWGCNA!=2.2.0->acore) (0.14.0)
Requirement already satisfied: memoir>=0.0.3 in /home/runner/.local/lib/python3.12/site-packages (from rsrc>=0.1.3->PyWGCNA!=2.2.0->acore) (0.0.3)
Requirement already satisfied: reprit>=0.3.0 in /home/runner/.local/lib/python3.12/site-packages (from rsrc>=0.1.3->PyWGCNA!=2.2.0->acore) (0.9.0)
Requirement already satisfied: mypy-extensions>=0.3.0 in /home/runner/.local/lib/python3.12/site-packages (from typing_inspect>=0.6.0->pandera->acore) (1.1.0)
Requirement already satisfied: zipp>=3.20 in /home/runner/.local/lib/python3.12/site-packages (from importlib-metadata->dash->vuecore) (4.1.0)
Requirement already satisfied: et-xmlfile in /home/runner/.local/lib/python3.12/site-packages (from openpyxl->dsp-pandas->acore) (2.0.0)
Requirement already satisfied: parso<0.9.0,>=0.8.6 in /home/runner/.local/lib/python3.12/site-packages (from jedi>=0.18.2->ipython>=5.3.0->pyvis->vuecore) (0.8.7)
Requirement already satisfied: wcwidth in /home/runner/.local/lib/python3.12/site-packages (from prompt_toolkit<3.1.0,>=3.0.41->ipython>=5.3.0->pyvis->vuecore) (0.8.1)
Requirement already satisfied: session-info2 in /home/runner/.local/lib/python3.12/site-packages (from scverse-misc>=0.0.3->anndata>=0.8.0->PyWGCNA!=2.2.0->acore) (0.4.1)
Requirement already satisfied: executing>=1.2.0 in /home/runner/.local/lib/python3.12/site-packages (from stack_data>=0.6.0->ipython>=5.3.0->pyvis->vuecore) (2.2.1)
Requirement already satisfied: asttokens>=2.1.0 in /home/runner/.local/lib/python3.12/site-packages (from stack_data>=0.6.0->ipython>=5.3.0->pyvis->vuecore) (3.0.1)
Requirement already satisfied: pure-eval in /home/runner/.local/lib/python3.12/site-packages (from stack_data>=0.6.0->ipython>=5.3.0->pyvis->vuecore) (0.2.3)
Requirement already satisfied: donfig>=0.8 in /home/runner/.local/lib/python3.12/site-packages (from zarr!=3.0.*,>=2.18.7->anndata>=0.8.0->PyWGCNA!=2.2.0->acore) (0.8.1.post1)
Requirement already satisfied: google-crc32c>=1.5 in /home/runner/.local/lib/python3.12/site-packages (from zarr!=3.0.*,>=2.18.7->anndata>=0.8.0->PyWGCNA!=2.2.0->acore) (1.8.0)
Requirement already satisfied: numcodecs>=0.14 in /home/runner/.local/lib/python3.12/site-packages (from zarr!=3.0.*,>=2.18.7->anndata>=0.8.0->PyWGCNA!=2.2.0->acore) (0.16.5)
Requirement already satisfied: pyyaml in /home/runner/.local/lib/python3.12/site-packages (from donfig>=0.8->zarr!=3.0.*,>=2.18.7->anndata>=0.8.0->PyWGCNA!=2.2.0->acore) (6.0.3)
Note: you may need to restart the kernel to use updated packages.
from pathlib import Path

import acore.differential_regulation
import acore.enrichment_analysis
import acore.normalization
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import plotly.express as px
import scipy.stats
import seaborn as sns
import vuecore
from acore.io.uniprot import fetch_annotations, process_annotations
from vuecore.viz import get_enrichment_plots

Paramters#

  • file_in: input file with the quantified peptide data in MSstats format as provided by quantms

  • out_dir: output directory for the results of the data analysis, which will be used later for the report generation with VueGen.

The file will be loaded from the online repository if it is not present.

file_in: str = Path(
    "data/PXD070899/processed/report.pg_matrix.tsv"
) # input file with the quantified peptide data in MSstats format as provided by quantms
out_dir = "data/PXD070899/report/" # output directory for the results of the data analysis, which will be used later for the report generation with VueGen.
min_obs_per_group:int = 3 # minimum number of observations per group for a protein to be included in the differential regulation analysis

Create output directory if it does not exist

out_dir = Path(out_dir)
out_dir.mkdir(parents=True, exist_ok=True)
print(f"Output directory: {out_dir}")
Output directory: data/PXD070899/report

We have the following columns in the data:

if not file_in.exists():
    file_in = (
        "https://raw.githubusercontent.com/biosustain/dsp_course_proteomics_intro/HEAD"
        "/data/PXD070899/processed/report.pg_matrix.tsv"
    )
df = pd.read_csv(file_in, sep="\t", header=0, index_col=0)  # .set_index([])
df.head()
Protein.Names Genes First.Protein.Description N.Sequences N.Proteotypic.Sequences SB_4_64_SH_AYa2022_R1.raw SB_4_64_SH_AYa2022_R2.raw SB_4_64_SH_AYa2022_R3.raw SB_4_64_SH_WT_R1.raw SB_4_64_SH_WT_R2.raw SB_4_64_SH_WT_R3.raw SB_4_64_SH_AY_R1.raw SB_4_64_SH_AY_R2.raw SB_4_64_SH_AY_R3.raw SB_4_64_SH_AYa18_R1.raw SB_4_64_SH_AYa18_R2.raw SB_4_64_SH_AYa18_R3.raw
Protein.Group
A5Z2X5 YP010_YEAST YPR010C-A NaN 4 4 196,213,000.000 201,658,000.000 224,749,000.000 220,341,000.000 210,709,000.000 269,670,000.000 163,279,000.000 137,780,000.000 225,286,000.000 197,233,000.000 150,317,000.000 193,584,000.000
D6VTK4 STE2_YEAST STE2 NaN 6 6 8,340,980.000 5,193,640.000 2,078,550.000 9,899,680.000 4,052,790.000 NaN 20,108,400.000 8,787,580.000 2,464,330.000 8,628,820.000 11,099,400.000 2,842,180.000
O13329 FOB1_YEAST FOB1 NaN 1 1 NaN 58,997.800 NaN NaN NaN NaN NaN 45,124.500 NaN NaN NaN NaN
O13516 RS9A_YEAST RPS9A NaN 17 1 194,925,000.000 142,185,000.000 170,798,000.000 210,142,000.000 124,835,000.000 157,529,000.000 305,432,000.000 113,893,000.000 127,791,000.000 188,020,000.000 150,662,000.000 85,463,000.000
O13525 COQ4_YEAST COQ4 NaN 17 17 50,320,900.000 58,710,400.000 61,916,400.000 64,847,800.000 70,983,700.000 66,808,300.000 66,351,200.000 60,963,000.000 51,681,200.000 57,557,100.000 64,895,400.000 41,240,700.000

Potentiall clean filepath names in DIANN output

df.columns = df.columns.str.split(r"/|\\").str[-1]
df.head()
Protein.Names Genes First.Protein.Description N.Sequences N.Proteotypic.Sequences SB_4_64_SH_AYa2022_R1.raw SB_4_64_SH_AYa2022_R2.raw SB_4_64_SH_AYa2022_R3.raw SB_4_64_SH_WT_R1.raw SB_4_64_SH_WT_R2.raw SB_4_64_SH_WT_R3.raw SB_4_64_SH_AY_R1.raw SB_4_64_SH_AY_R2.raw SB_4_64_SH_AY_R3.raw SB_4_64_SH_AYa18_R1.raw SB_4_64_SH_AYa18_R2.raw SB_4_64_SH_AYa18_R3.raw
Protein.Group
A5Z2X5 YP010_YEAST YPR010C-A NaN 4 4 196,213,000.000 201,658,000.000 224,749,000.000 220,341,000.000 210,709,000.000 269,670,000.000 163,279,000.000 137,780,000.000 225,286,000.000 197,233,000.000 150,317,000.000 193,584,000.000
D6VTK4 STE2_YEAST STE2 NaN 6 6 8,340,980.000 5,193,640.000 2,078,550.000 9,899,680.000 4,052,790.000 NaN 20,108,400.000 8,787,580.000 2,464,330.000 8,628,820.000 11,099,400.000 2,842,180.000
O13329 FOB1_YEAST FOB1 NaN 1 1 NaN 58,997.800 NaN NaN NaN NaN NaN 45,124.500 NaN NaN NaN NaN
O13516 RS9A_YEAST RPS9A NaN 17 1 194,925,000.000 142,185,000.000 170,798,000.000 210,142,000.000 124,835,000.000 157,529,000.000 305,432,000.000 113,893,000.000 127,791,000.000 188,020,000.000 150,662,000.000 85,463,000.000
O13525 COQ4_YEAST COQ4 NaN 17 17 50,320,900.000 58,710,400.000 61,916,400.000 64,847,800.000 70,983,700.000 66,808,300.000 66,351,200.000 60,963,000.000 51,681,200.000 57,557,100.000 64,895,400.000 41,240,700.000

The first 6 columns contain the meta information about the peptides, while the remaining columns contain the intensities.

proteins_meta = df.iloc[:,:5]
proteins_meta 
Protein.Names Genes First.Protein.Description N.Sequences N.Proteotypic.Sequences
Protein.Group
A5Z2X5 YP010_YEAST YPR010C-A NaN 4 4
D6VTK4 STE2_YEAST STE2 NaN 6 6
O13329 FOB1_YEAST FOB1 NaN 1 1
O13516 RS9A_YEAST RPS9A NaN 17 1
O13525 COQ4_YEAST COQ4 NaN 17 17
... ... ... ... ... ...
cRAP-P02769 cRAP-ALBU_BOVIN cRAP-ALB NaN 44 44
cRAP-P04264 cRAP-K2C1_HUMAN cRAP-KRT1 NaN 16 16
cRAP-P13645 cRAP-K1C10_HUMAN cRAP-KRT10 NaN 18 16
cRAP-P35527 cRAP-K1C9_HUMAN cRAP-KRT9 NaN 14 14
cRAP-P35908 cRAP-K22E_HUMAN cRAP-KRT2 NaN 12 11

3586 rows × 5 columns

proteins = df.iloc[:,5:].T
proteins.index.name = "SampleID"
proteins.columns.name = "ProteinName"
proteins.head()
ProteinName A5Z2X5 D6VTK4 O13329 O13516 O13525 O13563 O13585 O14455 O14467 O14468 ... cRAP-P02662 cRAP-P02663 cRAP-P02666 cRAP-P02668 cRAP-P02768 cRAP-P02769 cRAP-P04264 cRAP-P13645 cRAP-P35527 cRAP-P35908
SampleID
SB_4_64_SH_AYa2022_R1.raw 196,213,000.000 8,340,980.000 NaN 194,925,000.000 50,320,900.000 2,871,670.000 2,240,990.000 325,647,000.000 53,770,700.000 1,341,650.000 ... 1,293,560.000 8,061,300.000 NaN NaN 5,591,100.000 2,954,770,000.000 10,837,100.000 4,622,900.000 9,769,450.000 3,494,090.000
SB_4_64_SH_AYa2022_R2.raw 201,658,000.000 5,193,640.000 58,997.800 142,185,000.000 58,710,400.000 2,695,290.000 1,323,580.000 224,329,000.000 49,659,900.000 1,710,070.000 ... 105,439,000.000 41,599,900.000 67,757,800.000 22,124,200.000 11,533,200.000 5,289,410,000.000 8,067,970.000 4,010,270.000 6,966,230.000 3,496,160.000
SB_4_64_SH_AYa2022_R3.raw 224,749,000.000 2,078,550.000 NaN 170,798,000.000 61,916,400.000 1,364,950.000 NaN 114,717,000.000 27,135,000.000 729,509.000 ... 2,417,300.000 NaN 600,944.000 NaN 3,634,230.000 2,255,610,000.000 5,640,980.000 1,964,420.000 6,998,510.000 2,408,860.000
SB_4_64_SH_WT_R1.raw 220,341,000.000 9,899,680.000 NaN 210,142,000.000 64,847,800.000 3,740,660.000 1,978,800.000 377,715,000.000 82,570,700.000 2,985,240.000 ... 1,934,850.000 NaN NaN NaN 10,806,300.000 3,734,340,000.000 19,107,400.000 10,082,500.000 9,497,230.000 7,434,660.000
SB_4_64_SH_WT_R2.raw 210,709,000.000 4,052,790.000 NaN 124,835,000.000 70,983,700.000 2,623,000.000 931,863.000 197,967,000.000 42,563,700.000 803,845.000 ... 22,855,800.000 13,385,900.000 12,795,200.000 6,610,350.000 10,679,100.000 4,302,160,000.000 11,455,700.000 6,321,750.000 11,779,100.000 5,144,510.000

5 rows × 3586 columns

Log2 transform the intensity values and remove contaminant proteins

to_drop = proteins.filter(regex="cRAP-|CON_", axis=1).columns
to_drop
Index(['cRAP-P00698', 'cRAP-P00722', 'cRAP-P00761', 'cRAP-P02662',
       'cRAP-P02663', 'cRAP-P02666', 'cRAP-P02668', 'cRAP-P02768',
       'cRAP-P02769', 'cRAP-P04264', 'cRAP-P13645', 'cRAP-P35527',
       'cRAP-P35908'],
      dtype='object', name='ProteinName')
proteins = np.log2(proteins).drop(to_drop, axis=1)
proteins
ProteinName A5Z2X5 D6VTK4 O13329 O13516 O13525 O13563 O13585 O14455 O14467 O14468 ... Q99325 Q99332 Q99369 Q99373 Q99382 Q99383 Q99385 Q99394 Q9P305 Q9URQ5
SampleID
SB_4_64_SH_AYa2022_R1.raw 27.548 22.992 NaN 27.538 25.585 21.453 21.096 28.279 25.680 20.356 ... 22.768 22.297 21.419 19.735 24.338 22.629 26.505 19.170 21.049 21.062
SB_4_64_SH_AYa2022_R2.raw 27.587 22.308 15.848 27.083 25.807 21.362 20.336 27.741 25.566 20.706 ... 22.218 21.849 22.326 20.254 24.351 21.473 26.856 19.296 21.207 21.121
SB_4_64_SH_AYa2022_R3.raw 27.744 20.987 NaN 27.348 25.884 20.380 NaN 26.774 24.694 19.477 ... 21.923 21.204 22.882 20.540 23.441 21.457 25.224 18.182 18.071 19.924
SB_4_64_SH_WT_R1.raw 27.715 23.239 NaN 27.647 25.951 21.835 20.916 28.493 26.299 21.509 ... 23.027 22.554 21.419 19.827 24.763 22.968 26.934 18.237 21.557 22.068
SB_4_64_SH_WT_R2.raw 27.651 21.950 NaN 26.895 26.081 21.323 19.830 27.561 25.343 19.617 ... 22.508 20.940 21.690 19.798 23.834 21.887 26.248 17.966 21.011 21.815
SB_4_64_SH_WT_R3.raw 28.007 NaN NaN 27.231 25.994 NaN NaN 26.694 23.840 NaN ... 20.278 NaN 21.579 19.640 22.274 21.557 24.698 17.095 NaN NaN
SB_4_64_SH_AY_R1.raw 27.283 24.261 NaN 28.186 25.984 22.298 21.508 28.702 26.291 20.260 ... 22.419 23.165 23.174 19.862 24.227 23.309 27.179 18.961 21.864 21.818
SB_4_64_SH_AY_R2.raw 27.038 23.067 15.462 26.763 25.861 20.989 20.437 26.949 25.445 20.282 ... 22.981 22.215 22.402 20.017 24.341 21.198 27.059 17.872 20.540 19.814
SB_4_64_SH_AY_R3.raw 27.747 21.233 NaN 26.929 25.623 NaN NaN 26.262 24.292 19.950 ... 20.805 21.183 23.328 20.166 21.834 21.081 25.173 17.889 18.187 19.127
SB_4_64_SH_AYa18_R1.raw 27.555 23.041 NaN 27.486 25.778 21.611 21.384 28.405 25.903 20.551 ... 22.940 22.038 22.308 19.885 24.329 22.955 26.574 19.529 21.309 22.649
SB_4_64_SH_AYa18_R2.raw 27.163 23.404 NaN 27.167 25.952 21.216 20.952 27.579 25.254 NaN ... 22.893 22.278 22.526 19.705 24.568 21.738 26.625 19.872 21.077 18.024
SB_4_64_SH_AYa18_R3.raw 27.528 21.439 NaN 26.349 25.298 NaN NaN 25.744 23.759 NaN ... 21.374 NaN 23.046 20.261 22.105 20.897 24.539 18.876 NaN NaN

12 rows × 3573 columns

Add label encoding

# label_encoding = {"WT": 0, "AYa2022": 1, "AYa18": 2, "AY": 3}
label_suf = pd.Series(
    proteins.index.str.split("_").str[-2],
    index=proteins.index,
    name="condition",
)
label_suf
SampleID
SB_4_64_SH_AYa2022_R1.raw    AYa2022
SB_4_64_SH_AYa2022_R2.raw    AYa2022
SB_4_64_SH_AYa2022_R3.raw    AYa2022
SB_4_64_SH_WT_R1.raw              WT
SB_4_64_SH_WT_R2.raw              WT
SB_4_64_SH_WT_R3.raw              WT
SB_4_64_SH_AY_R1.raw              AY
SB_4_64_SH_AY_R2.raw              AY
SB_4_64_SH_AY_R3.raw              AY
SB_4_64_SH_AYa18_R1.raw        AYa18
SB_4_64_SH_AYa18_R2.raw        AYa18
SB_4_64_SH_AYa18_R3.raw        AYa18
Name: condition, dtype: object

Homework#

Repeat the analysis based on the tutorial from the course.

Small adjustments are needed.

  • copy bit by bit