fragmenstein.igor package
The class Igor is split into multiple files.
Additionally, the submodule fragmenstein.igor.pyrosetta_import implements a hack to allow Pyrosetta to be mocked
for import —for typehinting and Sphinx (RTD) purposes only.
- class fragmenstein.igor.Igor[source]
Bases:
_IgorInit,_IgorMin,_IgorUtilsRegular Igor(..) accepts pyrosetta pose.
Igor.from_pdbblock(..)accepts pdb block as str, whileIgor.from_pdbfile(..)accepts filename as str.ligandcan be one of many things. default is ‘LIG’. But it can bepose index (123)
PDB index ‘123A’
a tuple of (PDB resi, PDB chain)
a residue name in uppercase “LIG”
a pyrosetta.Vector1 where 1 == the ligand.
If key_residues is None, only the connecting residue is added (if present in the LINK record). This is overridden if one of many options are given. If it is a pyrosetta.Vector1 it is assumed that 1 mean select this residue (as a result of a
selector.apply(pose)operation) If it is a list or tuple, the elements are interpreted similarly to ligand.This class inherits the base classes
_IgorInit,_IgorMin,_IgorUtils, which contain the initialisation methods, minimisation methods and extra methods respectively.- MMFF_score(mol: Mol | None = None, delta: bool = False) float
- Warning:
This was moved out of Igor, which still has a method, albeit for calling this. But on the minimised.
mol = victor.igor.mol_from_pose()
- Xrepack_neighbors() None
- __init__()
Given a pose with a blended ligand at ligand residue. Load it (ready for minimisation).
- Parameters:
pose – pose.
constraint_file – filename
ligand_residue – ligands -see class docstring
key_residues – multiple entries -see class docstring
- classmethod add_constraint_file()
Add a constraint file to the pose.
- Parameters:
pose
constraint_file
- Returns:
- angle_constraint = 10
- atom_pair_constraint = 10
- constraint_file
str
- coordinate_constraint = 1
- classmethod detailed_scores()
Gets called by Victor too, hence the classmethod :param pose: :return:
- display_energy()
Given the
minimized_moldisplay the energy contributions. As Victor has this while Igor is naive of bond orders, if None is passed it will made due with no bond order.termis the term to use:allwill be['lj_atr', 'lj_rep', 'fa_solv', 'fa_elec']lenard-joneswill['lj_atr', 'lj_rep']while
['lj_atr', 'lj_rep', 'fa_solv', 'fa_elec']will be the individual ones.
As this is rather obscure, there is an enum as an attribute of
display_energymethod calledTerm, with the values.display.Term.ALL,.display.Term.ATTRACTION,.display.Term.REPULSION,.display.Term.LENARDJONES,.display.Term.SOLVATATION,.display.Term.ELECTROSTATICwhich is possibly more sane (e.g.igor.display_energy(minimized_mol, term=igor.display.Term.ELECTROSTATIC)).
- dock()
Docks the pose the normal way and without constraints.
- Returns:
- classmethod download_map(pdbcode: str, filename: str)
Download to disk a CCP4 map of a given PDB code :param pdbcode: :param filename: :return:
- fa_intra_rep = 0.005
- classmethod fix_scorefxn_weights(scorefxn, **constraint_weights)
- classmethod from_pdbblock()
- classmethod from_pdbfile()
Given a PDB with the ligand load it.
- Parameters:
pdbfile – pdb file
params_file – params file
constraint_file – filename
ligand_residue – ligand -see class docstring
key_residues – multiple entries -see class docstring
- Returns:
- get_MinMover()
This gets stuck.
- Returns:
Move
- get_PertMinMover()
This makes a mess of the structure.
- Returns:
Move
- get_mod_FastRelax()
This is not the usual fastRelax. It uses a modded minimiser protocol!
default_coord_constraint turns on the restrict to starting position, which is mostly redundant/ineffectual with fragmenstein constraint set. Actually, epirically I cannot see a difference. No repacking.
- Parameters:
cycles – number of cycles
weight – 10 is strict. 5 is decent. 1 is traditional.
default_coord_constraint – whether to constrain to the start position
- Returns:
- get_old_FastRelax()
- Parameters:
cycles
- Returns:
- static init_pyrosetta()
Common options for pyrosetta. Does not use pyrosetta_help atm
- ligand_score()
- make_ligand_only_pose()
- Returns:
- minimize(cycles: int = 15, default_coord_constraint=True, weight: float = 1.0)
- mol_from_pose()
Returns the ligand without the dummy atom!
- Returns:
ligand
- Return type:
Chem.Mol
- per_atom_scores()
Per atom scores are generally a bad idea as a score relative to something else is better. So do treat with the appropriate caution. NB. these scores will not sum to the that of the residue.
Given a pose, a target_res and a scorefxn return a dict of per atom scores:
Lenard-Jones attraction 6-term
Lenard-Jones repulsion 12-term
Solvatation (zero)
Electrostatic interactions
- Parameters:
pose
target_res
scorefxn
- Returns:
a dict of atom names to dict of ‘lj_atr’, ‘lj_rep’, ‘fa_solv’, ‘fa_elec’ to value
- pose
pyrosetta.Pose
- pose2str()
Convert a pose to a string. Why isn’t this standard?
- Parameters:
pose – if no pose is provided self.pose is used.
- Returns:
pdb block
- Return type:
str
- classmethod relax_with_ED()
Relaxes
posebased on the ccp4 electron density map provided. Seedownload_mapto download one.- Parameters:
pose
ccp4_file – download map from ePDB
constraint_weights – weights for the constraints First run with high weights, then lower.
cycles – number of cycles
- Returns:
Relaxes pose in place
- repack_neighbors() None
Repacking is done by relax… :return:
- score_split()
- classmethod tethered_relax()
Relax by constraining the original pose.
- Parameters:
original – the pose to relax, but makes a copy
constraint_weight – the weight of the constraints (coordinate_constraint, angle_constraint, atom_pair_constraint)
cycles – number of cycles
relax_to_start_coords – relax to the start coords or not
- Returns:
the relaxed pose
relax_to_start_coordsis the same asconstraint_weight=0if the original pose has no custom constraints