Code Monkey home page Code Monkey logo

msp2db's Introduction

msp2db

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: [email protected]

License

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

msp2db's People

Contributors

tomnl avatar rjmw avatar

Stargazers

Johon Li Tuobang 李拓邦 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.