pyrawr
Python wrapper around the ThermoRawFileParser command line interface.
This Python module uses the ThermoRawFileParser CLI to retrieve general run metadata, specific spectra, or specific XICs, directly as Python lists and dictionaries from mass spectrometry raw files. Parsing raw files to other file formats is also supported.
Installation
-
Install pyrawr with pip
$ pip install pyrawr
-
Install ThermoRawFileParser or Docker.
For Docker, the current user must be
added to the Docker group,
that is, be callable as docker run, instead of sudo docker run.
Usage
See full API documentation for all pyrawr functionality.
Parse raw file to any supported output format:
>>> from pyrawr import ThermoRawFileParser
>>> trfp = ThermoRawFileParser(
... executable="thermorawfileparser",
... docker_image="quay.io/biocontainers/thermorawfileparser:1.3.3--ha8f3691_1"
... )
>>> trfp.parse("OR4_110719_OB_PAR14_sSCX_fr10.raw", output_format="mzml")
Get raw file metadata:
>>> trfp.metadata("OR4_110719_OB_PAR14_sSCX_fr10.raw")
{'FileProperties': [{'accession': 'NCIT:C47922', 'cvLabel': 'NCIT' ... }]}
Query a specific spectrum:
>>> trfp.query("OR4_110719_OB_PAR14_sSCX_fr10.raw", "508,680")
[{'mzs': [204.8467254638672,
262.4529113769531,
309.53961181640625,
...
Retrieve one or more chromatograms based on a query:
>>> trfp.xic(
... "OR4_110719_OB_PAR14_sSCX_fr10.raw",
... [{"mz":488.5384, "tolerance":10, "tolerance_unit":"ppm"}],
... )
{'OutputMeta': {'base64': False, 'timeunit': 'minutes'},
'Content': [{'Meta': {'MzStart': 488.53351461600005,
'MzEnd': 488.543285384,
'RtStart': 0.007536666666666666,
'RtEnd': 179.99577166666666},
'RetentionTimes': [0.007536666666666666,
0.022771666666666666,
0.036936666666666666,
...
Contributing
Bugs, questions or suggestions? Feel free to post an issue in the issue tracker or to make a pull request! See Contributing.md for more info.
This module currently uses Python's subprocess.run() to access ThermoRawFileParser.
There are probably much better methods that would directly access the
ThermoRawFileParser library, circumventing the CLI. Suggestions and PRs are always
welcome.
Changelog
See Changelog.
Metadata
Release files for pyrawr 0.1.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 | |
|---|---|---|---|---|
| pyrawr-0.1.0.tar.gz | 8.6 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pyrawr-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 17.5 kB
Release files / pyrawr-0.1.0.tar.gz
| Download URL | pyrawr-0.1.0.tar.gz |
|---|---|
| Size | 8.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b8c3c6ca41c592d8ca42ce3bf5c540374655f413a4f539041b2fa9c700aa0bc5
|
|
BLAKE2b-256 checksum How to use checksums |
2508f097116e0c7c9f6bdcb31db4468f0938c87ae3643d84ac5d18af68b9ca7c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.1.6 CPython/3.9.4 Linux/5.4.0-1046-azure
|
Release files / pyrawr-0.1.0-py3-none-any.whl
| Download URL | pyrawr-0.1.0-py3-none-any.whl |
|---|---|
| Size | 8.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2394233f6b347d384c71a40e75a015ddadf7a44b34f59acb4a54fb5c3d3e3a01
|
|
BLAKE2b-256 checksum How to use checksums |
972226f1e3d6297a2c5a8518c0e7cb5277b7ad29050586510dd0003b3f59fe93
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.1.6 CPython/3.9.4 Linux/5.4.0-1046-azure
|
Security for pyrawr 0.1.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.