ProteinComponent
#
- class gufe.components.proteincomponent.ProteinComponent(rdkit: rdkit.Chem.rdchem.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.
Methods
Create
ProteinComponent
from PDB-formatted file.Create
ProteinComponent
from PDBX-formatted file.serialize the positions to openmm.unit.Quantity
Convert to an openmm Topology object
serialize protein to pdb file.
serialize protein to pdbx file.
- classmethod from_json(json_str)#
- classmethod from_pdb_file(pdb_file: str, name: str = '')#
Create
ProteinComponent
from PDB-formatted file.- Parameters:
pdb_file (str) – path to the pdb file.
name (str, optional) – name of the input protein, by default “”
- Returns:
the deserialized molecule
- Return type:
- classmethod from_pdbx_file(pdbx_file: str, name='')#
Create
ProteinComponent
from PDBX-formatted file.- Parameters:
pdbxfile (str) – path to the pdb file.
name (str, optional) – name of the input protein, by default “”
- Returns:
the deserialized molecule
- Return type:
- classmethod from_rdkit(rdkit: rdkit.Chem.rdchem.Mol, name: str = '')#
Create a Component, copying from an RDKit Mol
- property name: str#
- property smiles: str#
- to_json()#
- 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_openmm_topology() Topology #
Convert to an openmm Topology object
- Returns:
resulting topology obj.
- Return type:
openmm.app.Topology
- to_pdb_file(out_path: str | bytes | PathLike[str] | PathLike[bytes] | TextIOBase) str #
serialize protein to pdb file.
- Parameters:
out_path (Union[str, bytes, PathLike[str], PathLike[bytes], io.TextIOBase]) – provide path or any string based stream (e.g. FileIO ) to the resulting file
- Returns:
string path to the resulting pdb.
- Return type:
str
- to_pdbx_file(out_path: str | bytes | PathLike[str] | PathLike[bytes] | TextIOBase) str #
serialize protein to pdbx file.
- Parameters:
out_path (Union[str, bytes, PathLike[str], PathLike[bytes], io.TextIOBase]) – provide path or FileIO to the resulting file
- Returns:
string path to the resulting pdbx.
- Return type:
str
- to_rdkit() rdkit.Chem.rdchem.Mol #
Return an RDKit copied representation of this molecule
- property total_charge#
Net formal charge for the
Component
, if defined.