openpharmacophore.Ligand
- class openpharmacophore.Ligand(mol)[source]
Bases:
object
Represents a ligand. Wrapper for rdkit Mol object
Methods
Add conformers to a ligand.
Add hydrogens to this ligand.
Draw the ligand.
Fix the bond order of a ligand.
Create a ligand from a smiles, smarts, inchi, pdb block, or mol2 block
Generate conformers for this ligand.
Find chemical features in this ligand.
Find chemical features in this ligand.
Get the coordinates of the specified conformer
get_feat_indices
Returns true if the ligand has aromatic bonds.
Returns true if the ligand has double bonds.
Returns the ligand as an rdkit molecule.
Attributes
feat_ind
has_conformers
Returns true if the ligand has any hydrogen atoms
ID of the ligand if it was extracted from a protein.
n_atoms
n_bonds
n_conformers
n_heavy_atoms
- add_conformers(coords)[source]
Add conformers to a ligand.
- Parameters:
coords (puw.Quantity) – A quantity of shape (n_conformers, n_atoms, 3)
- add_hydrogens()[source]
Add hydrogens to this ligand. Modifies the ligand in place.
Can only add hydrogens to a ligand that only has one conformer.
- fix_bond_order(smiles)[source]
Fix the bond order of a ligand. This is necessary when a ligand is extracted from a Protein object.
- Parameters:
smiles (str) – Smiles of the ligand
- classmethod from_string(string, form)[source]
Create a ligand from a smiles, smarts, inchi, pdb block, or mol2 block
- Parameters:
string (str) – The string that encodes the ligand
form (str) – Can be “smi”, “smarts”, “inchi”, “mol2”, “pdb”.
- Return type:
- generate_conformers(n_confs)[source]
Generate conformers for this ligand. Removes current conformers if any
- get_chem_feats(conf_ind, types=None, indices=False)[source]
Find chemical features in this ligand.
- Parameters:
conf_ind (int) – Index of the conformer.
types (set[str], optional) – The chemical features that will be searched for.
indices (bool, default=False) – Whether to store the indices of the atoms in the chemical features.
- Return type:
ChemFeatContainer
- get_chem_feats_with_directionality(conf_ind, types=None)[source]
Find chemical features in this ligand. Hydrogen bond donors obtained with this method will include information about hydrogen atoms, and aromatic ring will contain their normal vector.
- Parameters:
conf_ind (int) – Index of the conformer.
types (set[str], optional) – The chemical features that will be searched for.
- Return type:
ChemFeatContainer
- get_conformer(conf_ind)[source]
Get the coordinates of the specified conformer
- Parameters:
conf_ind (int) – Index of the conformer
- Returns:
A quantity of shape (n_atoms, 3)
- Return type:
puw.Quantity
- property has_hydrogens: bool
Returns true if the ligand has any hydrogen atoms
- Return type:
bool
- property lig_id: str
ID of the ligand if it was extracted from a protein.