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.

Parameters:

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

altloc

The alternate location indicator for the atom.

Type:

str

chain_id

The identifier of the chain the atom belongs to.

Type:

str

charge

The atom charge.

Type:

int

element

The element symbol.

Type:

str

insertion_code

The code for insertion of residues.

Type:

str

name

The atom name.

Type:

str

occupancy

The atom occupancy.

Type:

float

residue_name

The residue name.

Type:

str

residue_number

The residue sequence number.

Type:

int

segment

The segment identifier.

Type:

str

serial

The atom serial number.

Type:

int

temperature_factor

The atom temperature factor.

Type:

float

class pyjess.Molecule

A molecule structure, as a sequence of Atom objects.

__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. If None given, the parser will attempt to extract it from the HEADER line.

  • ignore_endmdl (bool) – Pass True to 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 first ENDMDL line.

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. If None given, the parser will attempt to extract it from the HEADER line.

  • ignore_endmdl (bool) – Pass True to 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 first ENDMDL line.

Returns:

Molecule – The molecule parsed from the PDB file.

See also

Molecule.load to load a PDB molecule from a file-like object or from a path.