Skip to main content

Python package for converting msp to database

Project description

Version Py versions Git Build Status (Travis) Build Status (AppVeyor) License RTD doc codecov

Python package to create an SQLite database from a collection of MSP mass spectromertry spectra files. Currently works with MSP files formated as MassBank records or as MoNA records.

The resulting SQLite database can be used for spectral matching with msPurity Bioconductor R package, see vigenette.

Installation

$ pip install .

Command line

$ msp2db --msp_pth [msp file or directory of msp files] --source [name of source of msp e.g. massbank] --out_pth [out dir]
$ msp2db --help

usage: PROG [-h] -m MSP_PTH -s SOURCE [-o OUT_PTH] [-t TYPE] [-d] [-l MSLEVEL]
        [-c CHUNK] [-x SCHEMA]

Convert msp to SQLite or MySQL database

optional arguments:
    -h, --help            show this help message and exit
    -m MSP_PTH, --msp_pth MSP_PTH
                            path to the MSP file (or directory of msp files)
    -s SOURCE, --source SOURCE
                            Name of data source (e.g. MassBank, LipidBlast)
    -o OUT_PTH, --out_pth OUT_PTH
                            file path for SQLite database
    -t TYPE, --db_type TYPE
                            database type [mysql, sqlite]
    -d, --delete_tables   delete tables
    -l MSLEVEL, --mslevel MSLEVEL
                            ms level of fragmentation if not detailed in msp file
    -c CHUNK, --chunk CHUNK
                            Chunks of spectra to parse data (useful to control
                            memory usage)
    -x SCHEMA, --schema SCHEMA
                            Type of schema used (by default is "mona" msp style
                            but can use "massbank" style)

--------------

API

db_pth = 'spectral_library_07112018v1.db'
create_db(file_pth=db_pth, db_type='sqlite', db_name='spectra')
libdata = LibraryData(msp_pth='MoNA-export-FAHFA.msp',
                  db_pth=db_pth,
                  db_type='sqlite',
                  d_form=None,
                  schema='mona',
                  source='fahfa',
                  mslevel=None,
                  chunk=200)

Developers & Contributors

Tom Lawson: t.n.lawson@bham.ac.uk

License

Released under the GNU General Public License v3.0 (see LICENSE file)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

msp2db-0.0.9.tar.gz (30.5 kB view details)

Uploaded Source

Built Distribution

msp2db-0.0.9-py3-none-any.whl (31.1 kB view details)

Uploaded Python 3

File details

Details for the file msp2db-0.0.9.tar.gz.

File metadata

  • Download URL: msp2db-0.0.9.tar.gz
  • Upload date:
  • Size: 30.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0.post20191101 requests-toolbelt/0.9.1 tqdm/4.37.0 CPython/3.8.0

File hashes

Hashes for msp2db-0.0.9.tar.gz
Algorithm Hash digest
SHA256 43ede3ff591cd7a16d98d0bf76cec9d064ec7ea5cd98208bbe45ca99142c1a26
MD5 d6b9d9def508963976e4b57c0d0ede33
BLAKE2b-256 af3160ebd31acfd3247a2c8525f1ddf6ed8d91632caf1a6d5cfa89f3a168a969

See more details on using hashes here.

File details

Details for the file msp2db-0.0.9-py3-none-any.whl.

File metadata

  • Download URL: msp2db-0.0.9-py3-none-any.whl
  • Upload date:
  • Size: 31.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0.post20191101 requests-toolbelt/0.9.1 tqdm/4.37.0 CPython/3.8.0

File hashes

Hashes for msp2db-0.0.9-py3-none-any.whl
Algorithm Hash digest
SHA256 e579901e4ea538a4495df1acd20d9e117e9fdd760a9a59eef9a854571efee856
MD5 a1db30f1026f330b31314015acccebce
BLAKE2b-256 e1a443f63e619f6e6ccedb1f401b1f9dbc6f7ca43e0ee35832f3aac6d3c28898

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page