pynmrML is a Python library for reading, writing and interfacing with nmrML documents. It includes nmrML bindings, nmrCV bindings, and readers and writers for several different NMR formats. It relies on the excellent NMRglue library for processing raw NMR data.
Add the path the the bin dir to use the var2nmrML
command
export PATH=${PATH}:/Users/mike/Projects/nmrML/nmrML/tools/Parser_and_Converters/python/pynmrml/bin
Convert a varian FID to an nmrML instance. Provide the path to the FID and the name to output the nmrML file:
var2nmrML input.fid output.nmrML
generateDS.py is required to autogenerate the bindings.
- Download generateDS and install with easy_install:
wget https://pypi.python.org/packages/2.7/g/generateDS/generateDS-2.11a-py2.7.egg#md5=bf753618fbc822bd9ed66eeb2ceae3b6
easy_install generateDS-2.11a-py2.7.egg
- nmrML.py Enhanced XML bindings that inherit from the autogenerated bindings in nmrML_lib.py. This is the class that should be used for interfacing with nmrML since this allows for enhancement while being able to easily regenerate nmrML_lib.py to keep it up to date with nmrML schema development.
- nmrML_lib.py Autogenerated XML bindings (by generateDS.py), should not be used directly
- cv Classes for parsing, and using the nmrCV
- io Factory for building readers and writers
- readers Classes for reading from different formats, a reader for a format should inherit from the AbstractReader class to ensure that they implement the correct interface.
- writers Classes for writing out to different formats (currently only nmrML)
- util Utility classes useful in different parts of the library
- util/convert unit conversion functions
The XML bindings are generated with generateDS.py, for info see http://pythonhosted.org/generateDS/
As described above nmrML_lib.py Autogenerated XML bindings (by generateDS.py), should not be used directly while nmrML.py is the enhanced XML bindings that inherit from the autogenerated bindings in nmrML_lib.py. We can autogenerate
To regenerate the bindings from an updated schema run the following command:
generateDS.py --subclass-suffix="" --root-element="nmrML" --external-encoding='utf-8' --super="nmrML_lib" -o nmrML_lib.py -s nmrML.py xml-schemata/nmrML.xsd
Then replace the current nmrML_lib.py with the generated one