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
Metadata
Release files for serenipy 0.4.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| serenipy-0.4.0.tar.gz | 24.1 kB | Without provenance | Details for serenipy-0.4.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| serenipy-0.4.0-py3-none-any.whl | Python 3 | none | any | Details for serenipy-0.4.0-py3-none-any.whl |
Total release size: 47.7 kB
Release files / serenipy-0.4.0.tar.gz
| Download URL | serenipy-0.4.0.tar.gz |
|---|---|
| Size | 24.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6a5a2ff4d31addeb937f8ed0337ba93fd0b5e4f0aaf78c33d9ef6574a3026c64
|
|
BLAKE2b-256 checksum How to use checksums |
d22484d6515be1c42aaa4dea3c205d60aae8ca946dd956205413a1f85277e0b6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Release files / serenipy-0.4.0-py3-none-any.whl
| Download URL | serenipy-0.4.0-py3-none-any.whl |
|---|---|
| Size | 23.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a951e00f13e2b153ce4c54934758fd2cee98495758d1e95037c6ad99f1f38428
|
|
BLAKE2b-256 checksum How to use checksums |
cf630188ecc2464e891b2339f2e7dfd1d176fb7ef6f3bd5cc130bed75d212f27
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Security for serenipy 0.4.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.