Writers and controlled vocabulary manager for PSI-MS's mzML and mzIdentML standards
Project description
psims
Prototype work for a unified API for writing PSIMS standardized XML documents, currently just mzML and MzIdentML
See the Documenation for more information
mzML Minimal Example
from psims.mzml.writer import MzMLWriter
# Load the data to write
scans = get_scan_data()
with MzMLWriter(open("out.mzML", 'wb')) as out:
# Add default controlled vocabularies
out.controlled_vocabularies()
# Open the run and spectrum list sections
with out.run(id="my_analysis"):
with out.spectrum_list(count=len(scans)):
for scan, products in scans:
# Write Precursor scan
out.write_spectrum(
scan.mz_array, scan.intensity_array,
id=scan.id, params=[
"MS1 Spectrum",
{"ms level": 1},
{"total ion current": sum(scan.intensity_array)}
])
# Write MSn scans
for prod in products:
out.write_spectrum(
prod.mz_array, prod.intensity_array,
id=prod.id, params=[
"MSn Spectrum",
{"ms level": 2},
{"total ion current": sum(prod.intensity_array)}
],
# Include precursor information
precursor_information={
"mz": prod.precursor_mz,
"intensity": prod.precursor_intensity,
"charge": prod.precursor_charge,
"scan_id": prod.precursor_scan_id
})
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
psims-0.1.19.tar.gz
(5.8 MB
view details)
Built Distributions
psims-0.1.19-py2.7.egg
(798.6 kB
view details)
File details
Details for the file psims-0.1.19.tar.gz
.
File metadata
- Download URL: psims-0.1.19.tar.gz
- Upload date:
- Size: 5.8 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/40.2.0 requests-toolbelt/0.8.0 tqdm/4.23.3 CPython/2.7.14
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 16c222f07ecfef20dcb0ef8ed99fbf93b1e41623d48ff07f1c4cd95648ff0be7 |
|
MD5 | 35f85f1e7dc5b435d7d06aea163fdff7 |
|
BLAKE2b-256 | aeec00c630f6c56270004fa064fa7d10eb6b2d982aa6c9af57a8dedd80493b91 |
File details
Details for the file psims-0.1.19-py3-none-any.whl
.
File metadata
- Download URL: psims-0.1.19-py3-none-any.whl
- Upload date:
- Size: 5.9 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/40.2.0 requests-toolbelt/0.8.0 tqdm/4.23.3 CPython/2.7.14
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4e62f0252331b80728d674250031507e28cb2eb632bfa553de8639011cdb9f16 |
|
MD5 | 96608afe7469b6f132fd94ee7193c02a |
|
BLAKE2b-256 | 09d4d669d3ff5ccff05cf90037496ba055e707661ab1acc8b86200d5b9518b4a |
File details
Details for the file psims-0.1.19-py2.7.egg
.
File metadata
- Download URL: psims-0.1.19-py2.7.egg
- Upload date:
- Size: 798.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/40.2.0 requests-toolbelt/0.8.0 tqdm/4.23.3 CPython/2.7.14
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f03d16584c2de21b053bf4287921b65ed94dc529e68af38593de2f1602791337 |
|
MD5 | c03581b267c55e0163f539b5bef34cb2 |
|
BLAKE2b-256 | 0927c491e5f96c2f50fd181beed02b1c4d048a5db927deace8bac6480b9c4a1f |
File details
Details for the file psims-0.1.19-py2-none-any.whl
.
File metadata
- Download URL: psims-0.1.19-py2-none-any.whl
- Upload date:
- Size: 5.9 MB
- Tags: Python 2
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/40.2.0 requests-toolbelt/0.8.0 tqdm/4.23.3 CPython/2.7.14
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 11fc7f32df236ac977d47e3b220e2a10372ce3b2a805891397ba3baef55741fb |
|
MD5 | 61ffa68acbb0cfdfa76c23918422f267 |
|
BLAKE2b-256 | d7cbecfc9c4eebaafa8a6aab74964fcc612a1643748057cfd49493b07409622b |