- class openfe.ProteinComponent(rdkit: Mol, name='')#
Component
representing the contents of a PDB file, such as a protein.In comparison to a SmallMoleculeComponent, this representation additionally contains information relating to the residue and chain information. Technically, this is done by having the
MonomerInfo
attributes present on each atom of the input RDKit molecule, which is done when reading from either PDB or.mae
file inputs.- Parameters:
rdkit (rdkit.Mol) – rdkit representation of the protein
name (str, optional) – of the protein, by default “”
Note
This class is a read-only representation of a protein, if you want to edit the molecule do this in an appropriate toolkit before creating an instance from this class.
- classmethod from_pdb_file(pdb_file: str, name: str = '')#
Create
ProteinComponent
from PDB-formatted file.- Parameters:
- Returns:
the deserialized molecule
- Return type:
- classmethod from_pdbx_file(pdbx_file: str, name='')#
Create
ProteinComponent
from PDBX-formatted file.- Parameters:
- Returns:
the deserialized molecule
- Return type:
- to_openmm_topology() Topology #
Convert to an openmm Topology object
- Returns:
resulting topology obj.
- Return type:
openmm.app.Topology
- to_openmm_positions() Quantity #
serialize the positions to openmm.unit.Quantity
Note
Currently only one frame/model is given
- Returns:
Quantity containing protein atom positions
- Return type:
omm_unit.Quantity
- to_pdb_file(out_path: str | bytes | PathLike[str] | PathLike[bytes] | TextIOBase) str #
serialize protein to pdb file.
- to_pdbx_file(out_path: str | bytes | PathLike[str] | PathLike[bytes] | TextIOBase) str #
serialize protein to pdbx file.
- classmethod from_json(json_str)#
Generate an instance from JSON keyed chain representation.
Can provide either a filepath/filelike as file, or JSON content via content.
- Parameters:
file – A filepath or filelike object to read JSON data from.
content – A string to read JSON data from.
See also
- to_json()#
Generate a JSON keyed chain representation.
This will be writen to the filepath or filelike object if passed.
- Parameters:
file – A filepath or filelike object to write the JSON to.
- Returns:
A minimal JSON representation of the object if file is None; else None.
- Return type:
See also
- property total_charge#
Net formal charge for the
Component
, if defined.