openpharmacophore.Protein
- class openpharmacophore.Protein(topology, coords)[source]
Bases:
object
Represents a protein and optionally its different structures if it comes from a MD trajectory. The protein may contain ligands but is not necessary.
- Parameters:
topology (Topology) – The topology.
coords (Quantity) – A quantity of shape (n_structures, n_atoms, 3)
Methods
Add hydrogens to the protein.
Get the indices of the atoms that are at min_dist <= centroid <= max_dist.
Concatenate new residues to this protein.
Extract the chain with given id from the topology.
Extract a ligand assuming there is one.
has_hydrogens
has_ligands
has_solvent_or_ions
ligand_ids
Remove all ligands from this protein.
Remove a ligand from this protein.
Remove the solvent and ions from this protein.
Obtain a subset of the protein with the specified atoms.
Attributes
coords
n_atoms
n_chains
n_residues
topology
- atoms_at_distance(frame, centroid, max_dist, min_dist=0)[source]
Get the indices of the atoms that are at min_dist <= centroid <= max_dist.
- Parameters:
frame (int) – Frame of the trajectory
centroid (puw.Quantity) – Shape (1,3)
max_dist (puw.Quantity) – Scalar
min_dist (puw.Quantity) – Scalar
- Returns:
Array if integers with the indices.
- Return type:
np.ndarray
- concatenate(topology, coords)[source]
Concatenate new residues to this protein.
- Parameters:
topology (Topology)
coords (QuantityLike)
- extract_chain(chain_id)[source]
Extract the chain with given id from the topology.
- Parameters:
chain_id (str or int) – Id of the chain
- get_ligand(ligand_id, remove_hyd=False)[source]
Extract a ligand assuming there is one.
- Parameters:
ligand_id (str) – ID of the ligand. ID is composed by pdb id followed by chain name, i.e. “EST:B”.
remove_hyd (bool) – Whether to remove hydrogens from the ligand.
- Returns:
A ligand. Its bond orders may be incorrect.
- Return type:
- remove_ligand(ligand_id)[source]
Remove a ligand from this protein.
- Parameters:
ligand_id (str) – ID of the ligand
- slice(atoms, frame=None)[source]
Obtain a subset of the protein with the specified atoms.
- Parameters:
atoms (list[int])
atoms (list[int]) – Indices of the atoms in the sliced protein.
frame (int, optional) – Frame to extract. If None all frames are extracted.
- Returns:
The sliced protein.
- Return type: