pylgrams


Namepylgrams JSON
Version 1.0.1 PyPI version JSON
download
home_pageNone
SummaryA Python-based gloss of the RaMS package in R
upload_time2024-05-31 18:42:35
maintainerNone
docs_urlNone
authorNone
requires_python>=3.9
licenseNone
keywords gcms lcms ms r mass spectrometry metabolomics proteomics
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # pylgrams
A Python language gloss of the [RaMS package](https://github.com/wkumler/RaMS) for rapid and intuitive access to mass-spectrometry data. This package parses the open source mass-spectrometry mzML and mzXML file types in Python and returns the retention time, *m/z* ratio, and intensity values to the user as a Pandas data frame. This allows for easy chromatogram extraction and visualization.

The package currently lacks much of the expanded functionality of RaMS and is currently comparable to RaMS v1.0. I don't have plans to expand this much further - for additional functionality, consider using the [rpy2 package](https://rpy2.github.io/) to port the R code directly.

## Installation

`pip install pylgrams`

## Demo

```python
import matplotlib.pyplot as plt
import seaborn as sns
import os
import pylgrams

msdata = pylgrams.grabMSdata("src/pylgrams/example_data/S30657.mzML.gz")
bet_chrom = msdata["MS1"][(msdata["MS1"]["mz"]>118.085) & (msdata["MS1"]["mz"]<118.087)]
bet_chrom = bet_chrom[(bet_chrom["rt"]>7) & (bet_chrom["rt"]<9)]
sns.relplot(bet_chrom, kind="line", x="rt", y="int")
plt.show()

bet_frags = msdata["MS2"][(msdata["MS2"]["premz"]>118.0865) & (msdata["MS2"]["premz"]<118.0867)]
plt.stem(bet_frags["fragmz"], bet_frags["int"], linefmt='-k', markerfmt='ko', basefmt=" ")
plt.show()

dir_path = "src/pylgrams/example_data/"
only_mzML_files_os = [os.path.join(dir_path, f) for f in os.listdir(dir_path) if f.endswith('.mzML.gz')]
msdata = pylgrams.grabMSdata(only_mzML_files_os)
bet_chrom = msdata["MS1"][(msdata["MS1"]["mz"]>118.085) & (msdata["MS1"]["mz"]<118.087)]
sns.relplot(bet_chrom, kind="line", x="rt", y="int", hue="filename")
plt.show()
```

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "pylgrams",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": null,
    "keywords": "GCMS, LCMS, MS, R, mass spectrometry, metabolomics, proteomics",
    "author": null,
    "author_email": "William Kumler <wkumler@uw.edu>",
    "download_url": "https://files.pythonhosted.org/packages/62/05/d86d9089742d081a5f7a741eae9d714593f42dba7657bdc683aa3d43815d/pylgrams-1.0.1.tar.gz",
    "platform": null,
    "description": "# pylgrams\nA Python language gloss of the [RaMS package](https://github.com/wkumler/RaMS) for rapid and intuitive access to mass-spectrometry data. This package parses the open source mass-spectrometry mzML and mzXML file types in Python and returns the retention time, *m/z* ratio, and intensity values to the user as a Pandas data frame. This allows for easy chromatogram extraction and visualization.\n\nThe package currently lacks much of the expanded functionality of RaMS and is currently comparable to RaMS v1.0. I don't have plans to expand this much further - for additional functionality, consider using the [rpy2 package](https://rpy2.github.io/) to port the R code directly.\n\n## Installation\n\n`pip install pylgrams`\n\n## Demo\n\n```python\nimport matplotlib.pyplot as plt\nimport seaborn as sns\nimport os\nimport pylgrams\n\nmsdata = pylgrams.grabMSdata(\"src/pylgrams/example_data/S30657.mzML.gz\")\nbet_chrom = msdata[\"MS1\"][(msdata[\"MS1\"][\"mz\"]>118.085) & (msdata[\"MS1\"][\"mz\"]<118.087)]\nbet_chrom = bet_chrom[(bet_chrom[\"rt\"]>7) & (bet_chrom[\"rt\"]<9)]\nsns.relplot(bet_chrom, kind=\"line\", x=\"rt\", y=\"int\")\nplt.show()\n\nbet_frags = msdata[\"MS2\"][(msdata[\"MS2\"][\"premz\"]>118.0865) & (msdata[\"MS2\"][\"premz\"]<118.0867)]\nplt.stem(bet_frags[\"fragmz\"], bet_frags[\"int\"], linefmt='-k', markerfmt='ko', basefmt=\" \")\nplt.show()\n\ndir_path = \"src/pylgrams/example_data/\"\nonly_mzML_files_os = [os.path.join(dir_path, f) for f in os.listdir(dir_path) if f.endswith('.mzML.gz')]\nmsdata = pylgrams.grabMSdata(only_mzML_files_os)\nbet_chrom = msdata[\"MS1\"][(msdata[\"MS1\"][\"mz\"]>118.085) & (msdata[\"MS1\"][\"mz\"]<118.087)]\nsns.relplot(bet_chrom, kind=\"line\", x=\"rt\", y=\"int\", hue=\"filename\")\nplt.show()\n```\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "A Python-based gloss of the RaMS package in R",
    "version": "1.0.1",
    "project_urls": {
        "Documentation": "https://github.com/wkumler/pylgrams?tab=readme-ov-file#pylgrams",
        "Issues": "https://github.com/wkumler/pylgrams/issues",
        "Source": "https://github.com/wkumler/pylgrams"
    },
    "split_keywords": [
        "gcms",
        " lcms",
        " ms",
        " r",
        " mass spectrometry",
        " metabolomics",
        " proteomics"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "d2887e9fa062329ef9affa48210edcaa6b8a932a77a88b45bff0f0813a34b222",
                "md5": "9e612aa33b12d76215dfa14e5c1bef9b",
                "sha256": "a5d57324768f097bb5dc5ff823b9bdda1a160cfdaf1771edb49c2dccae31466f"
            },
            "downloads": -1,
            "filename": "pylgrams-1.0.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "9e612aa33b12d76215dfa14e5c1bef9b",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 1661579,
            "upload_time": "2024-05-31T18:42:33",
            "upload_time_iso_8601": "2024-05-31T18:42:33.070073Z",
            "url": "https://files.pythonhosted.org/packages/d2/88/7e9fa062329ef9affa48210edcaa6b8a932a77a88b45bff0f0813a34b222/pylgrams-1.0.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "6205d86d9089742d081a5f7a741eae9d714593f42dba7657bdc683aa3d43815d",
                "md5": "10a75fe07410b2bb2633a76ea338f607",
                "sha256": "cdac4e1881055a2156bbe7cdaca0b762110a4e094ec947286cb9fbc81d6190bf"
            },
            "downloads": -1,
            "filename": "pylgrams-1.0.1.tar.gz",
            "has_sig": false,
            "md5_digest": "10a75fe07410b2bb2633a76ea338f607",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 1663433,
            "upload_time": "2024-05-31T18:42:35",
            "upload_time_iso_8601": "2024-05-31T18:42:35.239915Z",
            "url": "https://files.pythonhosted.org/packages/62/05/d86d9089742d081a5f7a741eae9d714593f42dba7657bdc683aa3d43815d/pylgrams-1.0.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-05-31 18:42:35",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "wkumler",
    "github_project": "pylgrams?tab=readme-ov-file#pylgrams",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "pylgrams"
}
        
Elapsed time: 0.37422s