Bio.Crystal package

Module contents

Represent the NDB Atlas structure (a minimal subset of PDB format) (DEPRECATED).

Hetero, Crystal and Chain exist to represent the NDB Atlas structure. Atlas is a minimal subset of the PDB format. Hetero supports a 3 alphanumeric code. The NDB web interface is located at http://ndbserver.rutgers.edu

Bio.Crystal.Hetero substitute is Bio.PDB.Atom Bio.Crystal.Chain substitute is Bio.PDB.Chain Bio.Crystal.Crystal substitute is Bio.PDB.Structure

Using Bio.PDB you can navigate the data as below:

from Bio.PDB.PDBParser import PDBParser
parser = PDBParser(PERMISSIVE=1)
# PDB NDB Only file
structure = parser.get_structure("001", "001_msd.pbd")
for model in structure:
    print('Model ',model)
    for chain in model:
        print('Chain ', chain)
        for residue in chain:
            print('Res ', residue)
            for atom in residue:
                print('Atom ', atom)

Bio.Crystal is self-contained, with the main functionality covered by Bio.PDB.

exception Bio.Crystal.CrystalError

Bases: Exception

Class to manage errors.

Bio.Crystal.wrap_line(line)

Add end of line at character eighty, to match PDB record standard.

Bio.Crystal.validate_key(key)

Check if key is a string and has at least one character.

class Bio.Crystal.Hetero(data)

Bases: object

Class to support the PDB hetero codes.

Supports only the 3 alphanumeric code. The annotation is available from http://xray.bmc.uu.se/hicup/xname.html

__init__(self, data)

Initialize the class.

__eq__(self, other)

Return self==value.

__ne__(self, other)

Return true iff self is not equal to other.

__repr__(self)

Return repr(self).

__str__(self)

Return str(self).

__len__(self)
__hash__ = None
class Bio.Crystal.Chain(residues='')

Bases: object

Class representing a sequence of Hetero elements.

__init__(self, residues='')

Initialize the class.

validate(self)

Check all data elements are of type Hetero.

validate_element(self, element)

Check the element is of type Hetero.

__str__(self)

Return str(self).

__eq__(self, other)

Return self==value.

__ne__(self, other)

Return true iff self is not equal to other.

__len__(self)
__getitem__(self, index)
__setitem__(self, index, value)
__delitem__(self, index)
__contains__(self, item)
append(self, item)

Add Hetero element.

insert(self, i, item)

Insert Hetero element in position i of the Chain.

remove(self, item)

Delete Hetero element.

count(self, item)

Return number of elements in the Chain.

index(self, item)

Find the index of the item.

__add__(self, other)
__radd__(self, other)
__iadd__(self, other)
__hash__ = None
class Bio.Crystal.Crystal(data=None)

Bases: object

Represents a dictionary of labeled chains from the same structure.

__init__(self, data=None)

Initialize the class.

fix(self)

Change element of type string to type Chain.

All elements of Crystal shall be Chain.

__repr__(self)

Return repr(self).

__str__(self)

Return str(self).

tostring(self)

Return Chains and correspondent Heteros.

__len__(self)
__getitem__(self, key)
__setitem__(self, key, item)
__delitem__(self, key)
clear(self)

Empty the data.

copy(self)

Copy the Crystal object.

keys(self)

Return all Chain labels.

items(self)

Return all tuples (Chain label, Hetero).

values(self)

Return all Hetero in the Chains.

__contains__(self, value)
has_key(self, key)

Return true if the Chain Label is in the dictionary.

get(self, key, failobj=None)

Return Hetero for the given Chain Label.

setdefault(self, key, failobj=None)

Return Hetero for the given Chain Label, if Chain Label is not there add it.

popitem(self)

Return and delete a Chain.