IMP logo
IMP Reference Guide  2.20.0
The Integrative Modeling Platform
IMP.isd.shared_functions.sfo_common Class Reference

nonspecific methods used across all shared function objects. More...

Detailed Description

nonspecific methods used across all shared function objects.

Rules:

  • Their name starts with the name of the parent function (e.g. init_model_* )
  • they don't store anything in the class, but instead return all created objects. Exceptions: the model, which is self._m the statistics class, which is self.stat
  • they store what they have to store in the model (e.g. restraints)
  • they don't print out anything except for long routines (e.g. NOE parsing)
  • the prior RestraintSet is added to the model when it is created, so that when it is passed to another function, it is not added twice.
Note
This class is only available in Python.

Definition at line 125 of file shared_functions.py.

Public Member Functions

def do_md_protein_statistics
 updates statistics for md simulation: target temp, kinetic energy, kinetic temperature, writes coordinates and increments counter. More...
 
def find_atom
 scans the prot hierarchy and tries to find atom = (resno, name) assumes that resno follows the same numbering as the sequence. More...
 
def get_pdb
 returns a string corresponding to the pdb structure of hierarchy prot. More...
 
def init_model_ambiguous_NOE_restraint
 Reads an ambiguous NOE restraint. More...
 
def init_model_base
 moves to wd and creates model More...
 
def init_model_charmm_protein_and_ff
 creates a CHARMM protein representation. More...
 
def init_model_conjugate_kappa
 given a list of scales, returns a RestraintSet('prior') with weight 1.0 that contains a list of vonMisesKappaConjugateRestraint on each scale. More...
 
def init_model_HBonds_marginal
 read TBL file and store lognormal restraints, using the marginal of the lognormal with one sigma and gamma=1, for the whole dataset. More...
 
def init_model_jeffreys
 given a list of scales, returns a RestraintSet('prior') with weight 1.0 that contains a list of JeffreysRestraint on each scale. More...
 
def init_model_jeffreys_kappa
 given a list of scales, returns a RestraintSet('prior') with weight 1.0 that contains a list of vonMisesKappaJeffreysRestraint on each scale. More...
 
def init_model_NOE_restraint
 Sets up a lognormal distance restraint using the given sigma and gamma. More...
 
def init_model_NOEs
 read TBL file and store NOE restraints, using one sigma and one gamma for the whole dataset. More...
 
def init_model_NOEs_marginal
 read TBL file and store NOE restraints, using the marginal of the lognormal with one sigma and one gamma, for the whole dataset. More...
 
def init_model_setup_scale
 sets up a Scale particle to the initial default value. More...
 
def init_model_standard_SAXS_restraint
 read experimental SAXS profile and apply restraint the standard way (like foxs) Returns: a restraintset and the experimental profile More...
 
def init_model_TALOS
 read TALOS dihedral angle data, and create restraints for phi/psi torsion angles, along with the prior for kappa, which is a scale for the whole dataset, compare to 1/sigma**2 in the NOE case. More...
 
def init_model_vonMises_restraint_full
 Sets up a vonMises torsion angle restraint using the given kappa particle as concentration parameter. More...
 
def init_model_vonMises_restraint_mean
 Sets up a vonMises torsion angle restraint using the given kappa particle as concentration parameter. More...
 
def init_simulation_setup_nuisance_mc
 sets up monte carlo on nuisance, at a certain target temperature, optionally using a certain set of restraints only. More...
 
def init_simulation_setup_protein_hmc_hopper
 setup hybrid monte-carlo on protein. More...
 
def init_simulation_setup_protein_hmc_nve
 setup hybrid monte-carlo on protein. More...
 
def init_stats_add_hmc_category
 shortcut for a frequent series of operations on HMC simulations' statistics. More...
 
def init_stats_add_mc_category
 shortcut for a frequent series of operations on MC simulations' statistics. More...
 
def init_stats_add_md_category
 shortcut for a frequent series of operations on MD simulations' statistics. More...
 
def m
 wrapper to call methods of m More...
 
def rescale_velocities
 rescale the velocities of a bunch of particles having vx vy and vz floatkeys More...
 

Member Function Documentation

def IMP.isd.shared_functions.sfo_common.do_md_protein_statistics (   self,
  md_key,
  nsteps,
  md_instance,
  temperature = 300.0,
  prot_coordinates = None 
)

updates statistics for md simulation: target temp, kinetic energy, kinetic temperature, writes coordinates and increments counter.

  • md_key: stats md key
  • nsteps: number of steps performed.
  • md_instance: instance of the MolecularDynamics class.
  • temperature: target temperature
  • prot_coordinates: protein coordinates to be passed to the stats class, (should be a string)

Definition at line 942 of file shared_functions.py.

def IMP.isd.shared_functions.sfo_common.find_atom (   self,
  atom,
  prot 
)

scans the prot hierarchy and tries to find atom = (resno, name) assumes that resno follows the same numbering as the sequence.

Stores already found atoms for increased speed.

Definition at line 371 of file shared_functions.py.

def IMP.isd.shared_functions.sfo_common.get_pdb (   self,
  prot 
)

returns a string corresponding to the pdb structure of hierarchy prot.

Definition at line 931 of file shared_functions.py.

def IMP.isd.shared_functions.sfo_common.init_model_ambiguous_NOE_restraint (   self,
  prot,
  contributions,
  distance,
  sigma,
  gamma 
)

Reads an ambiguous NOE restraint.

contributions is a list of (atom1, atom2) pairs, where atom1 is (resno, atomname). Sets up a lognormal distance restraint using the given sigma and gamma. Returns the restraint.

Definition at line 434 of file shared_functions.py.

def IMP.isd.shared_functions.sfo_common.init_model_base (   self,
  wd 
)

moves to wd and creates model

Definition at line 156 of file shared_functions.py.

def IMP.isd.shared_functions.sfo_common.init_model_charmm_protein_and_ff (   self,
  initpdb,
  top,
  par,
  selector,
  pairscore,
  ff_temp = 300.0,
  disulfides = None,
  representation = 'custom' 
)

creates a CHARMM protein representation.

creates the charmm force field, bonded and nonbonded.

  • initpdb: initial structure in pdb format
  • top is a CHARMM top.lib, read if representation=='custom' (default)
  • par is a CHARMM par.lib
  • selector is an instance of one of the selectors of IMP.atom, for example IMP.atom.NonWaterNonHydrogenPDBSelector().
  • pairscore is an instance of a Pair Score to score the interaction between two atoms. usually, it's either LennardJonesDistancePairScore(0,1) or RepulsiveDistancePairScore(0,1)
  • ff_temp is the temperature at which the force field should be simulated.
  • disulfides: if not None, a list of tuples corresponding to residue numbers that should be cross-linked. Residues should be cysteines, and residue numbering should start at 0.
  • representation: 'full' : all-atom CHARMM force field 'heavy': heavy atom CHARMM forcefield with polar H 'calpha': only C alphas, ball and stick model with bondlength 3.78 angstrom, beads at VdW contact, and harmonic restraint between them. 'custom' (default) : read given CHARMM top and par files. Returns: prot, ff, rsb, rs
    • prot: the protein
    • ff: the force field
    • rsb: the RestraintSet on bonded interactions
    • rs: the RestraintSet on nonbonded interactions. Both are weighted using ff_temp.

Definition at line 189 of file shared_functions.py.

def IMP.isd.shared_functions.sfo_common.init_model_conjugate_kappa (   self,
  scales,
  c,
  R,
  prior_rs = None 
)

given a list of scales, returns a RestraintSet('prior') with weight 1.0 that contains a list of vonMisesKappaConjugateRestraint on each scale.

If argument prior_rs is used, add them to that RestraintSet instead.

Definition at line 356 of file shared_functions.py.

def IMP.isd.shared_functions.sfo_common.init_model_HBonds_marginal (   self,
  prot,
  seqfile,
  tblfile,
  name = 'NOE',
  verbose = True 
)

read TBL file and store lognormal restraints, using the marginal of the lognormal with one sigma and gamma=1, for the whole dataset.

  • prot: protein hierarchy
  • seqfile: a file with 3-letter sequence
  • tblfile: a TBL file with the restraints
  • name: an optional name for the restraintset
  • verbose: be verbose (default True) Returns: data_rs

Definition at line 544 of file shared_functions.py.

def IMP.isd.shared_functions.sfo_common.init_model_jeffreys (   self,
  scales,
  prior_rs = None 
)

given a list of scales, returns a RestraintSet('prior') with weight 1.0 that contains a list of JeffreysRestraint on each scale.

If argument prior_rs is used, add them to that RestraintSet instead.

Definition at line 344 of file shared_functions.py.

def IMP.isd.shared_functions.sfo_common.init_model_jeffreys_kappa (   self,
  scales,
  prior_rs = None 
)

given a list of scales, returns a RestraintSet('prior') with weight 1.0 that contains a list of vonMisesKappaJeffreysRestraint on each scale.

If argument prior_rs is used, add them to that RestraintSet instead.

Definition at line 331 of file shared_functions.py.

def IMP.isd.shared_functions.sfo_common.init_model_NOE_restraint (   self,
  prot,
  atoms,
  distance,
  sigma,
  gamma 
)

Sets up a lognormal distance restraint using the given sigma and gamma.

Returns the restraint. assumes atoms = (atom1, atom2) where atom1 is (resno, atomname) and resno is the residue sequence number.

Definition at line 413 of file shared_functions.py.

def IMP.isd.shared_functions.sfo_common.init_model_NOEs (   self,
  prot,
  seqfile,
  tblfile,
  name = 'NOE',
  prior_rs = None,
  bounds_sigma = (1.0, 0.1,
  bounds_gamma = (1.0, 0.1,
  verbose = True,
  sequence_match = (1, 1 
)

read TBL file and store NOE restraints, using one sigma and one gamma for the whole dataset.

Creates the necessary uninformative priors.

  • prot: protein hierarchy
  • seqfile: a file with 3-letter sequence
  • tblfile: a TBL file with the restraints
  • name: an optional name for the restraintset
  • prior_rs: when not None, add new sigma and gamma to this RestraintSet instance.
  • bounds_sigma or gamma: tuple of (initial value, lower, upper bound) bounds can be -1 to set to default range [0,+inf]
  • verbose: be verbose (default True)
  • sequence_match : (noe_start, sequence_start) Returns: data_rs, prior_rs, sigma, gamma

Definition at line 451 of file shared_functions.py.

def IMP.isd.shared_functions.sfo_common.init_model_NOEs_marginal (   self,
  prot,
  seqfile,
  tblfile,
  name = 'NOE',
  verbose = True,
  sequence_match = (1, 1 
)

read TBL file and store NOE restraints, using the marginal of the lognormal with one sigma and one gamma, for the whole dataset.

  • prot: protein hierarchy
  • seqfile: a file with 3-letter sequence
  • tblfile: a TBL file with the restraints
  • name: an optional name for the restraintset
  • verbose: be verbose (default True)
  • sequence_match : (noe_start, sequence_start) Returns: data_rs

Definition at line 505 of file shared_functions.py.

def IMP.isd.shared_functions.sfo_common.init_model_setup_scale (   self,
  default,
  lower = None,
  upper = None 
)

sets up a Scale particle to the initial default value.

It can optionally be constrained between two positive bounds, or else its range is 0 to infinity.

Definition at line 318 of file shared_functions.py.

def IMP.isd.shared_functions.sfo_common.init_model_standard_SAXS_restraint (   self,
  prot,
  profilefile,
  name = 'SAXS',
  ff_type = IMP.saxs.HEAVY_ATOMS 
)

read experimental SAXS profile and apply restraint the standard way (like foxs) Returns: a restraintset and the experimental profile

Definition at line 683 of file shared_functions.py.

def IMP.isd.shared_functions.sfo_common.init_model_TALOS (   self,
  prot,
  seqfile,
  talos_data,
  fulldata = True,
  sequence_match = (1, 1,
  name = 'TALOS',
  prior_rs = None,
  bounds_kappa = (1.0, 0.1,
  verbose = True,
  prior = 'jeffreys',
  keep_all = False 
)

read TALOS dihedral angle data, and create restraints for phi/psi torsion angles, along with the prior for kappa, which is a scale for the whole dataset, compare to 1/sigma**2 in the NOE case.

  • prot: protein hierarchy
  • seqfile: a file with 3-letter sequence
  • talos_data: either a file (pred.tab), or a folder (pred/) in which all files in the form res???.tab can be found. If possible, try to provide the folder, as statistics are more accurate in that case.
  • fulldata : either True or False, whether the data is the full TALOS output (predAll.tab or pred/ folder), or just the averages (pred.tab)
  • sequence_match : (talos_no, sequence_no) to adjust for different residue numberings
  • name: an optional name for the restraintset
  • prior_rs: when not None, add new kappa(s) to this RestraintSet instance.
  • bounds_kappa: tuple of (initial value, lower, upper bound) bounds can be -1 to set to default range [0,+inf]
  • verbose: be verbose (default True)
  • prior: either 'jeffreys' or a tuple (R,c), which signifies to use the conjugate prior of the von Mises restraint, with parameters R and c. Good values are R=0 and c=10. Default: jeffreys prior.
  • keep_all: in case of a folder for 'talos_data', whether to keep candidates marked as 'outliers' by TALOS, or to include them. Returns: data_rs, prior_rs, kappa

Definition at line 580 of file shared_functions.py.

def IMP.isd.shared_functions.sfo_common.init_model_vonMises_restraint_full (   self,
  atoms,
  data,
  kappa 
)

Sets up a vonMises torsion angle restraint using the given kappa particle as concentration parameter.

Returns the restraint. data is a list of observations.

Definition at line 397 of file shared_functions.py.

def IMP.isd.shared_functions.sfo_common.init_model_vonMises_restraint_mean (   self,
  prot,
  atoms,
  data,
  kappa 
)

Sets up a vonMises torsion angle restraint using the given kappa particle as concentration parameter.

Returns the restraint. data is (mean, standard deviation).

Definition at line 405 of file shared_functions.py.

def IMP.isd.shared_functions.sfo_common.init_simulation_setup_nuisance_mc (   self,
  nuis,
  temperature = 300.0,
  mc_restraints = None,
  nm_stepsize = 0.1 
)

sets up monte carlo on nuisance, at a certain target temperature, optionally using a certain set of restraints only.

  • nuis: nuisance particle
  • temperature: target temperature
  • mc_restraints: optional set of restraints from which the energy should be drawn instead of the energy of the complete system.
  • floatkey: the floatkey to move.
  • nm_stepsize: the stepsize of the normal mover Returns: mc instance, nm instance.

Definition at line 864 of file shared_functions.py.

def IMP.isd.shared_functions.sfo_common.init_simulation_setup_protein_hmc_hopper (   self,
  prot,
  temperature = 300.0,
  gamma = 0.01,
  n_md_steps = 10,
  md_restraints = None,
  mc_restraints = None,
  timestep = 1.0,
  sd_threshold = 0.0,
  sd_stepsize = 0.01,
  sd_maxsteps = 100 
)

setup hybrid monte-carlo on protein.

Uses basin hopping with steepest descent minimization.

  • prot: protein hierarchy.
  • temperature: target temperature.
  • gamma: coupling constant for langevin (/fs)
  • n_md_steps: number of md steps per mc step
  • md_restraints: if not None, specify the terms of the energy to be used during the md steps.
  • mc_restraints: if not None, use these energy terms for the metropolis criterion.
  • timestep: time step for md, in femtoseconds.
  • sd_threshold: stop steepest descent after energy difference drops below that threshold
  • sd_stepsize: stepsize to use for the steepest descent, in angstrom.
  • sd_maxsteps: maximum number of steps for steepest descent Returns: hmc, mdmover, md and OptimizerState (thermostat)

Definition at line 788 of file shared_functions.py.

def IMP.isd.shared_functions.sfo_common.init_simulation_setup_protein_hmc_nve (   self,
  prot,
  temperature = 300.0,
  n_md_steps = 100,
  md_restraints = None,
  mc_restraints = None,
  timestep = 1.0 
)

setup hybrid monte-carlo on protein.

Uses NVE MD and tries the full

  • prot: protein hierarchy.
  • temperature: target temperature.
  • coupling: coupling constant (tau (fs) for berendsen, gamma (/fs) for langevin)
  • n_md_steps: number of md steps per mc step
  • md_restraints: if not None, specify the terms of the energy to be used during the md steps.
  • mc_restraints: if not None, use these energy terms for the metropolis criterion.
  • timestep: time step for md, in femtoseconds.
  • sd_threshold: stop steepest descent after energy difference drops below that threshold
  • sd_stepsize: stepsize to use for the steepest descent, in angstrom.
  • sd_maxsteps: maximum number of steps for steepest descent Returns: hmc, mdmover and md

Definition at line 824 of file shared_functions.py.

def IMP.isd.shared_functions.sfo_common.init_stats_add_hmc_category (   self,
  stat,
  name = 'hmc',
  coord = 'protein' 
)

shortcut for a frequent series of operations on HMC simulations' statistics.

Adds acceptance, number of MD steps and a trajectory for a protein.

Definition at line 996 of file shared_functions.py.

def IMP.isd.shared_functions.sfo_common.init_stats_add_mc_category (   self,
  stat,
  name = 'mc',
  coord = 'particle' 
)

shortcut for a frequent series of operations on MC simulations' statistics.

Creates an entry for acceptance, stepsize and one coordinate set printed in the statistics file.

Definition at line 961 of file shared_functions.py.

def IMP.isd.shared_functions.sfo_common.init_stats_add_md_category (   self,
  stat,
  name = 'md',
  coord = 'protein' 
)

shortcut for a frequent series of operations on MD simulations' statistics.

Creates an entry for target temp, instantaneous temp, kinetic energy, and one set of coordinates called 'protein' by default.

Definition at line 978 of file shared_functions.py.

def IMP.isd.shared_functions.sfo_common.m (   self,
  name,
  args,
  kw 
)

wrapper to call methods of m

Definition at line 151 of file shared_functions.py.

def IMP.isd.shared_functions.sfo_common.rescale_velocities (   self,
  particles,
  factor 
)

rescale the velocities of a bunch of particles having vx vy and vz floatkeys

Definition at line 1014 of file shared_functions.py.


The documentation for this class was generated from the following file: