pyms-nist-search

PyMassSpec extension for searching mass spectra using NIST's Mass Spectrum Search Engine.


Keywords
c, chemistry, mass-spectrometry, python, python3
License
Other
Install
pip install pyms-nist-search==0.6.3.post1

Documentation

PyMassSpec NIST Search

PyMassSpec extension for searching mass spectra using NIST's Mass Spectrum Search Engine.

AppVeyor Windows Build Status
Docs Documentation Build Status Docs Check Status
Tests Linux Test Status Windows Test Status Coverage
PyPI PyPI - Package Version PyPI - Supported Python Versions PyPI - Supported Implementations PyPI - Wheel
Activity GitHub last commit GitHub commits since tagged version Maintenance PyPI - Downloads
QA CodeFactor Grade Flake8 Status mypy status
Other License GitHub top language Requirements Status

PyMassSpec extension for searching mass spectra using NIST's Spectrum Search Engine

PyMassSpec NIST Search is Free Software licensed under the GNU Lesser General Public License Version 3

A copy of the MassBank of North America database, in JSON, MSP and NIST Library formats, is included for the purposes of these tests. This library was created on 22 April 2020 using the "parse_mona_json.py" script and Lib2Nist. Licensed under the CC BY 4.0 License. For a list of contributors, see the file MoNA_GCMS_Library/AUTHORS

Installation

Usage

You will need to supply your own copy of the NIST Mass Spectral library to use this software.

The main class in this library is the Engine class. This class performs the actual searching. Start by initialising the search engine as follows:

search = pyms_nist_search.Engine(
                FULL_PATH_TO_MAIN_LIBRARY,
                pyms_nist_search.NISTMS_MAIN_LIB,
                FULL_PATH_TO_WORK_DIR,
                )

Where FULL_PATH_TO_MAIN_LIBRARY is the path to the location of your mass spectral library, and FULL_PATH_TO_WORK_DIR is the path to the working directory to be used by the search engine.

A MassSpectrum object can then be searched as follows:

search.full_search_with_ref_data(mass_spec)

This will return a list of tuples consisting of SearchResult and ReferenceData objects for the possible identities of the mass spectrum.

A list of just the SearchResult objects can be obtained with this method:

hit_list = search.full_search(mass_spec)

For each of these hits, the reference data can be obtained as follows:

for hit in hit_list:
        ref_data = search.get_reference_data(hit.spec_loc)

TODO

  1. Write comprehensive tests using pytest