mscheck


Namemscheck JSON
Version 0.3.1b0 PyPI version JSON
download
home_pagehttps://github.com/Waztom/mscheck
SummaryAuto MS mass checker
upload_time2023-12-15 18:48:10
maintainer
docs_urlNone
authorWarren Thompson
requires_python
licenseMIT
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # <a name="MScheck for locating target compound masses in mass spectra"></a>**MScheck for locating target compound masses in mass spectra**

[//]: # "Badges"

[![PyPI version](https://badge.fury.io/py/mscheck.svg)](https://badge.fury.io/py/mscheck)

[![build test](https://github.com/waztom/mscheck/actions/workflows/build-test.yml/badge.svg)](https://github.com/waztom/mscheck/actions/workflows/build-test.yml)

MScheck is a python package that hunts for a target compound mass + given ion mass (eg. H+, Na+).
MScheck was created to assist with the automated mass spectrum analysis of target compounds synthesised using
a high throughput approach.

MSCheck uses the excellent Python library [pyOpenMS](https://pyopenms.readthedocs.io/en/latest/index.html) for reading and handling .mzML mass spectra files. The spectra are stored and handled as a MassSpectrum class object - see [spectrum.py](https://github.com/Waztom/mscheck/blob/master/mscheck/spectrum.py).

The AnalyseSpectum class - see [analyse.py](https://github.com/Waztom/mscheck/blob/master/mscheck/analyse.py) - use Scipy's signal peak finding algorithms (find_peaks and peak_widths) to find peaks and calculate the full width at half maximum height (FWHM) of the peaks found. Mass spectrum data points are analysed in the area of the peak above the FWHM height by searching for the sum of the parent mass of the target molecule and ion. Different ions can be included in the search - see the example below.

# <a name="MScheck installation"></a>**MScheck installation**

MScheck relies on rdkit for generating molecule SVG images and for calculating molecular weights<br>
Installing rdkit using conda works best followed by a pip install of MScheck<br>

1. Create a conda environment

   > `conda create -c conda-forge -n MScheck python=3.11`

2. Activate the MScheck conda environment created

   > `conda activate MScheck`

3. Pip install pyOpenMS

   > `pip install --index-url https://pypi.cs.uni-tuebingen.de/simple/ pyopenms`

4. Pip install MScheck

   > `pip install mscheck`

# <a name="Preparing vendor files"></a>**Preparing vendor files**

MScheck has been tested on using Agilent LCMS files (.D) as the starting file format. One challenge is to convert vendor file formats into
a format with the binary decoded.

1. Convert .D Agilent folder to a .d MassHunter format using Agilent's ChemStation to MassHunter Translator (B.04.00)
2. Convert .d format into .mzML format using [ProteoWizard's](http://proteowizard.sourceforge.net/) MSConvert tool
3. Finally - we have an file format that we can use!
4. In your favourite IDE or Jupyter notebook - a basic example of using MSCheck is provided below:<br>

```
from mscheck.analyse import AnalyseSpectrum

# Create MS scptrum object and find peaks
test = AnalyseSpectrum("<path to .mzML file>", mode="Positive")

# Set SMILES of target to search for
target_SMILES = "CCOC(=O)N1CCN(C(=O)N2CCN(C(=O)c3ccco3)CC2)CC1"

# Analyse test spectrum searching for target SMILES
test.analyse(compoundsmiles=target_SMILES,
             ionstoadd=["[H]", "[Na]", "[K]", "[NH4+]"],
             tolerance=1)

# Create a .svg report - if you do not give a compound_name
# the ending leaf of the file name will be used
test.create_report(compound_name="Test")
```

 <br>

The .svg report will be in a folder called Reports

Example of report output:<br>

<p align="center">
<img src="images/report.svg" width="600px">
</p>



            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/Waztom/mscheck",
    "name": "mscheck",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "",
    "author": "Warren Thompson",
    "author_email": "waztom@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/6b/af/aefee2187cadc34d3e4e491e2f254baba48ad478036c63dd3769906e2a97/mscheck-0.3.1b0.tar.gz",
    "platform": null,
    "description": "# <a name=\"MScheck for locating target compound masses in mass spectra\"></a>**MScheck for locating target compound masses in mass spectra**\n\n[//]: # \"Badges\"\n\n[![PyPI version](https://badge.fury.io/py/mscheck.svg)](https://badge.fury.io/py/mscheck)\n\n[![build test](https://github.com/waztom/mscheck/actions/workflows/build-test.yml/badge.svg)](https://github.com/waztom/mscheck/actions/workflows/build-test.yml)\n\nMScheck is a python package that hunts for a target compound mass + given ion mass (eg. H+, Na+).\nMScheck was created to assist with the automated mass spectrum analysis of target compounds synthesised using\na high throughput approach.\n\nMSCheck uses the excellent Python library [pyOpenMS](https://pyopenms.readthedocs.io/en/latest/index.html) for reading and handling .mzML mass spectra files. The spectra are stored and handled as a MassSpectrum class object - see [spectrum.py](https://github.com/Waztom/mscheck/blob/master/mscheck/spectrum.py).\n\nThe AnalyseSpectum class - see [analyse.py](https://github.com/Waztom/mscheck/blob/master/mscheck/analyse.py) - use Scipy's signal peak finding algorithms (find_peaks and peak_widths) to find peaks and calculate the full width at half maximum height (FWHM) of the peaks found. Mass spectrum data points are analysed in the area of the peak above the FWHM height by searching for the sum of the parent mass of the target molecule and ion. Different ions can be included in the search - see the example below.\n\n# <a name=\"MScheck installation\"></a>**MScheck installation**\n\nMScheck relies on rdkit for generating molecule SVG images and for calculating molecular weights<br>\nInstalling rdkit using conda works best followed by a pip install of MScheck<br>\n\n1. Create a conda environment\n\n   > `conda create -c conda-forge -n MScheck python=3.11`\n\n2. Activate the MScheck conda environment created\n\n   > `conda activate MScheck`\n\n3. Pip install pyOpenMS\n\n   > `pip install --index-url https://pypi.cs.uni-tuebingen.de/simple/ pyopenms`\n\n4. Pip install MScheck\n\n   > `pip install mscheck`\n\n# <a name=\"Preparing vendor files\"></a>**Preparing vendor files**\n\nMScheck has been tested on using Agilent LCMS files (.D) as the starting file format. One challenge is to convert vendor file formats into\na format with the binary decoded.\n\n1. Convert .D Agilent folder to a .d MassHunter format using Agilent's ChemStation to MassHunter Translator (B.04.00)\n2. Convert .d format into .mzML format using [ProteoWizard's](http://proteowizard.sourceforge.net/) MSConvert tool\n3. Finally - we have an file format that we can use!\n4. In your favourite IDE or Jupyter notebook - a basic example of using MSCheck is provided below:<br>\n\n```\nfrom mscheck.analyse import AnalyseSpectrum\n\n# Create MS scptrum object and find peaks\ntest = AnalyseSpectrum(\"<path to .mzML file>\", mode=\"Positive\")\n\n# Set SMILES of target to search for\ntarget_SMILES = \"CCOC(=O)N1CCN(C(=O)N2CCN(C(=O)c3ccco3)CC2)CC1\"\n\n# Analyse test spectrum searching for target SMILES\ntest.analyse(compoundsmiles=target_SMILES,\n             ionstoadd=[\"[H]\", \"[Na]\", \"[K]\", \"[NH4+]\"],\n             tolerance=1)\n\n# Create a .svg report - if you do not give a compound_name\n# the ending leaf of the file name will be used\ntest.create_report(compound_name=\"Test\")\n```\n\n <br>\n\nThe .svg report will be in a folder called Reports\n\nExample of report output:<br>\n\n<p align=\"center\">\n<img src=\"images/report.svg\" width=\"600px\">\n</p>\n\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Auto MS mass checker",
    "version": "0.3.1b0",
    "project_urls": {
        "Homepage": "https://github.com/Waztom/mscheck"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "6bafaefee2187cadc34d3e4e491e2f254baba48ad478036c63dd3769906e2a97",
                "md5": "08006a9bc019cbb1c85cccb5ee9db864",
                "sha256": "c59a6b364cf26670c56c5bc4d6ef1d4a6cf4e820e2af44425f3d5e16bb2a5517"
            },
            "downloads": -1,
            "filename": "mscheck-0.3.1b0.tar.gz",
            "has_sig": false,
            "md5_digest": "08006a9bc019cbb1c85cccb5ee9db864",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 10748,
            "upload_time": "2023-12-15T18:48:10",
            "upload_time_iso_8601": "2023-12-15T18:48:10.274325Z",
            "url": "https://files.pythonhosted.org/packages/6b/af/aefee2187cadc34d3e4e491e2f254baba48ad478036c63dd3769906e2a97/mscheck-0.3.1b0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-12-15 18:48:10",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "Waztom",
    "github_project": "mscheck",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "lcname": "mscheck"
}
        
Elapsed time: 0.16364s