Thermo .raw LC-MS/MS acquisition files: 4 subcellular fractions of Leishmania infantum promastigotes with the protein identification report: sample notebook

A worked notebook for Thermo .raw LC-MS/MS acquisition files: 4 subcellular fractions of Leishmania infantum promastigotes with the protein identification report, with 3 code cells and the output each one printed. On Scigantic it opens in a hosted JupyterLab with the dataset already mounted, so nothing is downloaded first.

Provider
Jose Maria Requena Rolania (CBM Severo Ochoa, Madrid); mirrored by Scigantic
License
CC-BY-4.0
Size
5 files, 2,460,065,972 bytes
Stored at
Amazon S3, s3://scigantic-zenodo-18639527 (us-east-1)
Access
Free and public. No account with the data provider is needed.

The notebook

Thermo RAW acquisitions with their protein identifications

Four LC-MS/MS runs, one per subcellular fraction of *Leishmania infantum* JPCM5 promastigotes (F1 cytoplasmic, F2 membranous, F3 nuclear soluble, F4 chromatin-bound), as the Orbitrap Velos Pro MS wrote them (method Top20_CID_180min_220nL.meth), 532 to 659 MB each. Beside them, protein.html is the PEAKS Studio report: 2,843 identified proteins in 2,567 groups, plus one peptide table per protein.

Source: Requena Rolania, Zenodo 10.5281/zenodo.18639527, CC BY 4.0, mounted read-only at /mnt/archive.

Start here. Click the grey cell below and press Shift+Enter. It reads the first 64 KB of one RAW file, not the 600 MB, and prints the instrument and method recorded in it. Then change FRACTION to F2, F3 or F4 and run it again.

import os, re
ROOT = os.environ.get("SCIGANTIC_MOUNT_PATH", "/mnt/archive")
FRACTION = "F1"

path = f"{ROOT}/050723_JAdan_{FRACTION}.raw"
head = open(path, "rb").read(65536)
text = head.decode("utf-16-le", errors="ignore")
tokens = re.findall(r"[A-Za-z0-9][A-Za-z0-9 _.:/\\-]{3,}", text)
print(os.path.basename(path), f"{os.path.getsize(path) / 1e6:,.0f} MB", "| signature:", head[2:18].decode("utf-16-le"))
print("instrument:", next(t for t in tokens if "Orbitrap" in t))
print("method    :", next(t.split("\\")[-1] for t in tokens if t.endswith(".meth")))

The identified proteins

The report is a 32 MB HTML page with 2,874 tables. pd.read_html cannot read it in this image (it needs lxml or html5lib), so the cell uses BeautifulSoup's built-in parser, which takes about 30 seconds. The protein table is the one with the most rows.

import pandas as pd
from bs4 import BeautifulSoup

soup = BeautifulSoup(open(f"{ROOT}/protein.html", encoding="utf-8", errors="replace"), "html.parser")
rows_of = lambda tb: tb.find_all("tr", recursive=False) + [tr for t2 in tb.find_all(["thead", "tbody"], recursive=False) for tr in t2.find_all("tr", recursive=False)]
big = max(soup.find_all("table"), key=lambda t: len(rows_of(t)))
cells = [[c.get_text(strip=True) for c in tr.find_all(["th", "td"], recursive=False)] for tr in rows_of(big)]
proteins = pd.DataFrame(cells[1:], columns=cells[0])
numeric = [c for c in proteins.columns if c not in ("Accession", "PTM", "Description")]
proteins[numeric] = proteins[numeric].apply(pd.to_numeric, errors="coerce")
print(proteins.shape[0], "proteins")
proteins.sort_values("-10lgP", ascending=False)[["Accession", "-10lgP", "Coverage (%)", "#Peptides", "#Unique"]].head(8)

Output:

2843 proteins
         Accession  -10lgP  Coverage (%)  #Peptides  #Unique
0   LINF_330015200  385.12            86        197        3
1   LINF_330015100  385.12            86        197        3
2   LINF_330015000  385.00            86        196        3
3   LINF_130022000  340.52            25        113      112
4   LINF_250015700  331.94            23         98       95
10  LINF_280036000  315.24            64         69       62
12  LINF_280035400  315.24            64         69       62
11  LINF_280035500  315.24            64         69       62
import matplotlib.pyplot as plt
spec = [c for c in proteins.columns if c.startswith("#Spec ")]
detected = (proteins[spec] > 0).sum().rename(lambda c: c.replace("#Spec ", ""))
fig, ax = plt.subplots(figsize=(6, 2.6), dpi=80)
detected.plot.barh(ax=ax, color="#043874")
ax.set_xlabel("proteins with at least one spectrum"); ax.invert_yaxis()
plt.tight_layout(); plt.show()

Notes

Run it

Open this notebook to run it, see the dataset page for the full description, or browse the full catalog.