Package csb :: Package bio :: Package io :: Module wwpdb :: Class CustomStructureProvider

[frames] | no frames]

# Class CustomStructureProvider

source code

           object --+
                    |
    StructureProvider --+
                        |
                       CustomStructureProvider

A custom PDB data source. Functions as a user-defined map of structure identifiers and their corresponding local file names.

Nested Classes
Inherited from `StructureProvider`: `__metaclass__`

Instance Methods

__init__(self, files=`{``}`) x.__init__(...) initializes x; see help(type(x)) for signature | source code

add(self, id, path) Register a new local `id`:`path` pair. | source code

str or None

find(self, id) Attempt to discover a PDB file, given a specific PDB `id`. | source code

remove(self, id) Unregister an existing structure `id`. | source code

Inherited from `StructureProvider`: `__getitem__`, `get` Inherited from `object`: `__delattr__`, `__format__`, `__getattribute__`, `__hash__`, `__new__`, `__reduce__`, `__reduce_ex__`, `__repr__`, `__setattr__`, `__sizeof__`, `__str__`, `__subclasshook__`

Class Variables
| __abstractmethods__ = ``frozenset([``])``

Properties
tuple | identifiers List of currently registered structure identifiers
tuple | paths List of currently registered file names
Inherited from `object`: `__class__`

Method Details

### __init__(self, files=`{``}`)
(Constructor)

source code

x.__init__(...) initializes x; see help(type(x)) for signature

Parameters:
  - `files` (dict-like) - initialization dictionary of id:file pairs
Overrides: object.__init__
  (inherited documentation)

### add(self, id, path)

source code

Register a new local `id`:`path` pair.

Parameters:
  - `id` (str) - structure identifier
  - `path` (str) - path and file name
Raises:
  - `IOError` - if `path` is not a valid file name

### find(self, id)

source code

Attempt to discover a PDB file, given a specific PDB `id`.

Parameters:
  - `id` - structure identifier (e.g. 1x80)
Returns: str or None
  path and file name on success, None otherwise
Overrides: StructureProvider.find
  (inherited documentation)

### remove(self, id)

source code

Unregister an existing structure `id`.

Parameters:
  - `id` (str) - structure identifier
Raises:
  - `ValueError` - if `id` had not been registered

Property Details

### identifiers

List of currently registered structure identifiers

Get Method:
  unreachable.identifiers(self) - List of currently registered structure identifiers
Type:
  tuple

### paths

List of currently registered file names

Get Method:
  unreachable.paths(self) - List of currently registered file names
Type:
  tuple