Molecule¶
- class pyjess.Atom¶
A single atom in a molecule.
- __init__(*args, **kwargs)¶
- classmethod load(file)¶
Load an atom from the given file.
- Parameters:
file (file-like object) – A file-like object opened in text mode to read the atom from.
- classmethod loads(text)¶
Load an atom from the given string.
- class pyjess.Molecule¶
A molecule structure, as a sequence of
Atomobjects.- __getitem__(key, /)¶
Return self[key].
- __init__(*args, **kwargs)¶
- __len__()¶
Return len(self).
- classmethod load(file, id=None, ignore_endmdl=False)¶
Load a molecule from a PDB file.
- 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 a PDB molecule.id (
str, optional) – The identifier of the molecule. IfNonegiven, the parser will attempt to extract it from theHEADERline.ignore_endmdl (
bool) – PassTrueto make the parser read all the atoms from the PDB file. By default, the parser only reads the atoms of the first model, and stops at the firstENDMDLline.
- Returns:
Molecule– The molecule parsed from the PDB file.
- classmethod loads(text, id=None, ignore_endmdl=False)¶
Load a molecule from a PDB 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 a PDB molecule.id (
str, optional) – The identifier of the molecule. IfNonegiven, the parser will attempt to extract it from theHEADERline.ignore_endmdl (
bool) – PassTrueto make the parser read all the atoms from the PDB file. By default, the parser only reads the atoms of the first model, and stops at the firstENDMDLline.
- Returns:
Molecule– The molecule parsed from the PDB file.
See also
Molecule.loadto load a PDB molecule from a file-like object or from a path.