Python library for parsing IP2 proteomics file formats (MS2, SQT, DTASelect-filter, Census)
Project description
SereniPy
A Python library for parsing and serializing mass spectrometry file formats used in IP2 proteomics pipelines.
Installation
pip install serenipy
Quick Start
MS2 Files
from serenipy import from_ms2, to_ms2
with open("sample.ms2", "r") as f:
header, spectra = from_ms2(f)
for s in spectra:
print(s.low_scan, s.mz, s.charge, len(s.mz_spectra))
# Write back to MS2 format
ms2_string = to_ms2(header, spectra)
SQT Files
from serenipy import from_sqt, to_sqt
with open("results.sqt", "r") as f:
version, header, s_lines = from_sqt(f)
for s_line in s_lines:
for m_line in s_line.m_lines:
print(m_line.xcorr, m_line.sequence)
# Write back to SQT format
sqt_string = to_sqt(version, header, s_lines)
DTASelect-filter Files
from serenipy import from_dta_select_filter, to_dta_select_filter
with open("DTASelect-filter.txt", "r") as f:
version, head, results, tail = from_dta_select_filter(f)
for result in results:
for protein in result.protein_lines:
print(protein.locus_name, protein.sequence_coverage)
for peptide in result.peptide_lines:
print(peptide.sequence, peptide.x_corr, peptide.charge)
# Write back to DTASelect-filter format
output = to_dta_select_filter(version, head, results, tail)
Census Files
from serenipy import from_census
with open("census.txt", "r") as f:
header, census_lines = from_census(f)
for line in census_lines:
print(line.protein, line.pvalue, len(line.experiment_lines))
Supported Formats
| Format | Versions | Parse | Serialize |
|---|---|---|---|
| MS2 | Standard | from_ms2() |
to_ms2() |
| SQT | V1.4.0, V2.1.0, V2.1.0_ext, V2.1.0_robin_random | from_sqt() |
to_sqt() |
| DTASelect-filter | V2.1.12, V2.1.12_rt, V2.1.12_paser, V2.1.13, V2.1.13_timscore | from_dta_select_filter() |
to_dta_select_filter() |
| Census | Standard | from_census() |
- |
| Census (label-free) | Standard | from_censuslf() |
- |
All parsers accept either a file-like object or a string as input. Format versions are auto-detected during parsing.
Development
git clone https://github.com/pgarrett-scripps/serenipy.git
cd serenipy
pip install -e ".[dev]"
pytest tests -v
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file serenipy-0.4.0.tar.gz.
File metadata
- Download URL: serenipy-0.4.0.tar.gz
- Upload date:
- Size: 24.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6a5a2ff4d31addeb937f8ed0337ba93fd0b5e4f0aaf78c33d9ef6574a3026c64
|
|
| MD5 |
c72e5a0a2c39a6ad10edc13126de0630
|
|
| BLAKE2b-256 |
d22484d6515be1c42aaa4dea3c205d60aae8ca946dd956205413a1f85277e0b6
|
File details
Details for the file serenipy-0.4.0-py3-none-any.whl.
File metadata
- Download URL: serenipy-0.4.0-py3-none-any.whl
- Upload date:
- Size: 23.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a951e00f13e2b153ce4c54934758fd2cee98495758d1e95037c6ad99f1f38428
|
|
| MD5 |
37add383fdc7a76cbe2581b294bb6bd2
|
|
| BLAKE2b-256 |
cf630188ecc2464e891b2339f2e7dfd1d176fb7ef6f3bd5cc130bed75d212f27
|