Template#
- class pyjess.TemplateAtom#
A single template atom.
Added in version 0.4.0: Equality, hashing and pickle protocol support.
- __init__(*args, **kwargs)#
- 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__(*args, **kwargs)#
- __len__()#
Return len(self).
- copy()#
Create a copy of the template.
- Returns:
Template– A new template object with identical attributes and a copy of theTemplateAtomit contains.
- 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.