Welcome to mwtab’s documentation!#
mwtab#
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 JSON ized representation and vice versa. JSON stands for JavaScript
Object Notation, an open-standard format that uses human-readable text to transmit
data objects consisting of attribute-value pairs.
The mwtab package can be used in several ways:
As a library for accessing and manipulating data stored in
mwTabformat files.As a command-line tool to convert between
mwTabformat and its equivalentJSONrepresentation.
Citation#
When using mwtab package in published work, please cite the following papers:
Powell, Christian D., and Hunter NB Moseley. “The mwtab Python Library for RESTful Access and Enhanced Quality Control, Deposition, and Curation of the Metabolomics Workbench Data Repository.” Metabolites 11.3 (2021): 163. doi: 10.3390/metabo11030163.
Smelter, Andrey and Hunter NB Moseley. “A Python library for FAIRer access and deposition to the Metabolomics Workbench Data Repository.” Metabolomics 2018, 14(5): 64. doi: 10.1007/s11306-018-1356-6.
Links#
Installation#
Install on Linux, Mac OS X#
python3 -m pip install mwtab
Install on Windows#
py -3 -m pip install mwtab
Upgrade on Linux, Mac OS X#
python3 -m pip install mwtab --upgrade
Upgrade on Windows#
py -3 -m pip install mwtab --upgrade
Quickstart#
>>> import mwtab
>>>
>>> # Here we use ANALYSIS_ID of file to fetch data from URL
>>> for mwfile in mwtab.read_files("1", "2"):
... print("STUDY_ID:", mwfile.study_id)
... print("ANALYSIS_ID:", mwfile.analysis_id)
... print("SOURCE:", mwfile.source)
... print("Blocks:", list(mwfile.keys()))
>>>
Note
Read the User Guide and the mwtab Tutorial on Pages
to learn more and to see code examples on using the mwtab as a
library and as a command-line tool.
License#
This package is distributed under the BSD license.
Documentation index:#
Contents:
- User Guide
- The mwtab Tutorial
- Metadata Column Matching
- The mwtab API Reference
- mwtab.mwtab
MWTabFile- The mwtab Command Line Interface
cli()- mwtab.tokenizer
tokenizer()- mwtab.fileio
read_files()- mwtab.converter
TranslatorMWTabFileToMWTabFileConverter- mwtab.validator
validate_file()- mwtab.mwrest
analysis_ids()study_ids()generate_mwtab_urls()GenericMWURLMWRESTFile- mwtab.mwextract
ItemMatcherReGeXMatchergenerate_matchers()extract_metabolites()extract_metadata()write_metadata_csv()write_metabolites_csv()SetEncoderwrite_json()- Metadata Column Matching
WRAP_STRINGNameMatcherValueMatcherColumnFindermake_list_regex()
- License
- TODO