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 (str, os.PathLike or file-like object) – A file-like object opened in text or binary mode to read the template atom from.
- classmethod loads(text)#
Load a template atom from the given string.
- class pyjess.Template#
A template, as a sequence of
TemplateAtomobjects.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).
- classmethod load(file, id=None)#
Load a template from the given file.
- Parameters:
file (
str,os.PathLikeor file-like object) – Either the path to a file, or a file-like object opened in text mode to read the template from.id (
str, optional) – The identifier of the template. By default, the parser will take the one from thePDB_IDremark if found in the header.
- Returns:
Template– The template parsed from the given file.
- classmethod loads(text, id=None)#
Load a template from a string.
- Parameters:
file (
str,os.PathLike, or file-like object) – Either the path to a file, or a file-like object opened in text mode containing the template.id (
str, optional) – The identifier of the template. By default, the parser will take the one from thePDB_IDremark if found in the header.
- Returns:
Template– The template parsed from the given string.
See also
Template.loadto load a template from a file-like object or from a path.