Skip to main content

Adapter for http://ndbserver.rutgers.edu/ created for biologists, bioinformatics etc.

Project description

https://img.shields.io/pypi/status/ndb_adapter.svg https://img.shields.io/pypi/v/ndb_adapter.svg https://img.shields.io/pypi/dm/ndb_adapter.svg https://img.shields.io/pypi/l/ndb_adapter.svg https://img.shields.io/pypi/pyversions/ndb_adapter.svg

Adapter for easy access to NDB resources directly from python (3.*).

Usage

To get summary of structure, type:

>>> from ndb_adapter import NDB
>>> res = NDB.summary('4Z4B')
>>> res.ndb_id
'4Z4B'
>>> res.title
'2-PYRIDYL HOECHST - A NEW GENERATION DNA-BINDING RADIOPROTECTOR'
>>> res.description
"DNA (5'-D(*CP*GP*CP*AP*AP*AP*TP*TP*TP*GP*CP*G)-3')"
>>> res.get_dict()
{'Molecular Description': "DNA (5'-D(*CP*GP*CP*AP*AP*AP*TP*TP*TP*GP*CP*G)-3')", ...}

As you see some properties are available for result. Full list of them is here. Almost on every result of search you can download related files (.pdb, .cif, .xml etc.) to buffer or save on disc.

>>> res.download() #Pdb is default
"HEADER DNA 01-APR-15 4Z4B ..."

from ndb_adapter import DownloadType
>>> res.download(download_type=DownloadType.Cif)
'data_4Z4B\n# \n_entry.id   4Z4B ...'

>>> res.download(save=True) #saves in current directory
>>> res.download(save=True, target_dir='~/Downloads/') #saves in /Downloads/

To be continued…

Requirements

Installation

To install, simply:

$ pip install ndb_adapter

Documentation

Documentation is available at https://michsior14.github.io/ndb_adapter/.

Project details


Download files

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

Source Distribution

ndb_adapter-0.1b2.zip (36.1 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page