This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

Python library for parsing data from NMR-STAR format files

Project Description

The nmrstarlib package is a Python library that facilitates reading and writing NMR-STAR formatted files used by the Biological Magnetic Resonance Data Bank (BMRB) for archival of Nuclear Magnetic Resonance (NMR) data.

The nmrstarlib package provides facilities to convert NMR-STAR 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 nmrstarlib package also provides facilities to create simulated peak lists for different types of standard solution and solid-state NMR experiments from chemical shifts and assignment information deposited in NMR-STAR files.

In addition, the nmrstarlib package provides methods to visualize chemical shift data.

The nmrstarlib package can be used in several ways:

  • As a library for accessing and manipulating data stored in NMR-STAR format files.
  • As a command-line tool to convert between NMR-STAR format and its equivalent JSONized NMR-STAR format, to create a large number of simulated peak lists, and also to visualize chemical shift data.

Citation

When using nmrstarlib in published work, please cite the following paper:

  • Smelter, Andrey, Morgan Astra, and Hunter NB Moseley. “A fast and efficient python library for interfacing with the Biological Magnetic Resonance Data Bank.” BMC Bioinformatics 18.1 (2017): 175. doi: 10.1186/s12859-017-1580-5.

Installation

The nmrstarlib package runs under Python 2.7 and Python 3.4+, use pip to install. Starting with Python 3.4, pip is included by default.

Install on Linux, Mac OS X

python3 -m pip install nmrstarlib

Install on Windows

py -3 -m pip install nmrstarlib

Quickstart

Import nmrstarlib library and create generator function that will yield nmrstarlib.nmrstarlib.StarFile instance(s):

>>> from nmrstarlib import nmrstarlib
>>>
>>> # "path": path_to_file / path_to_dir / path_to_archive / bmrb_id / file_url
>>> starfile_gen = nmrstarlib.read_files("path")
>>>
>>> for starfile in starfile_gen:
...     print(starfile.bmrbid)         # print BMRB id of StarFile
...     print(starfile.source)         # print source of StarFile
...     print(list(starfile.keys()))   # print StarFile saveframe categories
>>>
>>> # For example, let's read two files: one using BMRB id and the other one using URL:
>>> starfile_gen = nmrstarlib.read_files("15000", "http://rest.bmrb.wisc.edu/bmrb/NMR-STAR3/18569")
>>>
>>> for starfile in starfile_gen:
...     print("BMRB id:", starfile.bmrbid)
...     print("Source:", starfile.source)
...     print("List of saveframes and comments:", list(starfile.keys()))
>>>

Note

Read the User Guide and The nmrstarlib Tutorial on ReadTheDocs to learn more and to see code examples on using the nmrstarlib as a library and as a command-line tool.

License

This package is distributed under the MIT license.

Release History

Release History

This version
History Node

2.0.2

History Node

2.0.1

History Node

2.0.0

History Node

1.1.0

History Node

1.0.4

History Node

1.0.3

History Node

1.0.2

History Node

1.0.1

History Node

1.0.0

Download Files

Download Files

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

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
nmrstarlib-2.0.2.tar.gz (739.2 kB) Copy SHA256 Checksum SHA256 Source Jun 9, 2017

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting