Template#

class pyjess.TemplateAtom#

A single template atom.

Added in version 0.4.0: Equality, hashing and pickle protocol support.

__init__(*, chain_id, residue_number, x, y, z, residue_names, atom_names, distance_weight=0.0, match_mode=0)#

Create a new template atom.

Raises:

MemoryError – When the system allocator fails to allocate enough memory for the template atom storage.

copy()#

Create a copy of this template atom.

Returns:

TemplateAtom – A new template atom object with identical attributes.

Added in version 0.4.0.

classmethod load(file)#

Load a template atom from the given file.

Parameters:

file (file-like object) – A file-like object opened in text mode to read the template atom from.

classmethod loads(text)#

Load a template atom from the given string.

Parameters:

text (str, bytes or bytearray) – The atom line to read the atom metadata from.

atom_names#

The different atom names for this atom.

Changed in version 0.4.1: Property now returns a tuple rather than a list.

Type:

tuple of str

chain_id#

The identifier of the chain the atom belongs to.

Type:

str

distance_weight#

The distance weight for this atom.

Type:

float

match_mode#

The match mode for this particular atom.

Type:

int

residue_names#

The different residue names for this atom.

Changed in version 0.4.1: Property now returns a tuple rather than a list.

Type:

tuple of str

residue_number#

The residue sequence number.

Type:

int

x#

The x coordinate of the atom.

Type:

float

y#

The y coordinate of the atom.

Type:

float

z#

The z coordinate of the atom.

Type:

float

class pyjess.Template#

A template, as a sequence of TemplateAtom objects.

Added in version 0.4.0: Equality, hashing and pickle protocol support.

__getitem__(key, /)#

Return self[key].

__init__(atoms=(), id=None)#

Create a new template.

Parameters:
  • atoms (sequence of TemplateAtom) – The atoms of the templates.

  • id (str, optional) – The identifier of the template.

Raises:

MemoryError – When the system allocator fails to allocate enough memory for the template storage.

__len__()#

Return len(self).

dimension#

The dimension of the template (i.e. number of residues).

Type:

int