User Guide¶
Description¶
The mwtab
package is a Python library that facilitates reading and writing
files in mwTab
format used by the Metabolomics Workbench for archival of
Mass Spectrometry (MS) and Nuclear Magnetic Resonance (NMR) experimental data.
The mwtab
package provides facilities to convert mwTab
formatted files into
their equivalent JSONized (JavaScript Object Notation, an open-standard format that
uses human-readable text to transmit data objects consisting of attribute-value pairs)
representation and vice versa.
The mwtab
package can be used in several ways:
- As a library for accessing and manipulating data stored in
mwTab
format files.- As a command-line tool to convert between
mwTab
format and its equivalentJSON
representation.
Installation¶
The mwtab
package runs under Python 2.7 and Python 3.4+.
Starting with Python 3.4, pip is included by default. To install
system-wide with pip run the following:
Install on Linux, Mac OS X¶
python3 -m pip install mwtab
Install on Windows¶
py -3 -m pip install mwtab
Install inside virtualenv¶
For an isolated install, you can run the same inside a virtualenv.
$ virtualenv -p /usr/bin/python3 venv # create virtual environment, use python3 interpreter
$ source venv/bin/activate # activate virtual environment
$ python3 -m pip install mwtab # install mwtab as usual
$ deactivate # if you are done working in the virtual environment
Get the source code¶
Code is available on GitHub: https://github.com/MoseleyBioinformaticsLab/mwtab
You can either clone the public repository:
$ https://github.com/MoseleyBioinformaticsLab/mwtab.git
Or, download the tarball and/or zipball:
$ curl -OL https://github.com/MoseleyBioinformaticsLab/mwtab/tarball/master
$ curl -OL https://github.com/MoseleyBioinformaticsLab/mwtab/zipball/master
Once you have a copy of the source, you can embed it in your own Python package, or install it into your system site-packages easily:
$ python3 setup.py install
Dependencies¶
The mwtab
package depends on several Python libraries. The pip
command
will install all dependencies automatically, but if you wish to install them manually,
run the following commands:
Basic usage¶
The mwtab
package can be used in several ways:
As a library for accessing and manipulating data stored in
mwTab
formatted files.As a command-line tool:
- Convert from
mwTab
file format into its equivalentJSON
file format and vice versa.- Validate data stored in
mwTab
file based on schema definition.
Note
Read The mwtab Tutorial to learn more and see code examples on using the mwtab
as a library and as a command-line tool.