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

Adapter offers 4 types of search: summary, advanced, dna and rna.

Summary

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 summary result. Full list of them is here.

Structure Download

Almost on every result of search you can download related files (.pdb, .cif, .xml etc.) to buffer or save.

>>> from ndb_adapter import NDB
>>> res = NDB.summary('4Z4B')
>>> 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 = NDB.advanced_search()
>>> res.download(save=True) # saves n files in current directory
>>> res.download(save=True, target_dir='/home/user/Downloads/')  # saves n files in ~/Downloads/

>>> res.report[0].download(save=True) # saves first structure file in current directory

You can also search and download in one line:

>>> from ndb_adapter import NDB
>>> res = NDB.download('4Z4B')   # like above .pdb is default
"HEADER DNA 01-APR-15 4Z4B ..."
# save and target dir is also available

Requirements

Installation

To install, simply:

$ pip install ndb_adapter

Documentation

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

Licence

Software is distributed under the MIT Licence.

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-1.2.zip (60.8 kB view details)

Uploaded Source

File details

Details for the file ndb_adapter-1.2.zip.

File metadata

  • Download URL: ndb_adapter-1.2.zip
  • Upload date:
  • Size: 60.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for ndb_adapter-1.2.zip
Algorithm Hash digest
SHA256 5ea09a687f1b20afdea6faaa68bc7916acc1511b39595c0aed213c1031ce0d12
MD5 6b792263860ec4fbd39b938de2178519
BLAKE2b-256 e0fb43058d443cc6ee51937e5388d5ba5de5c116ea6d7f73ecb25858e86e0a81

See more details on using hashes here.

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