IMP logo
Public Member Functions
IMP.isd.shared_functions.sfo_common Class Reference

Detailed Description

nonspecific methods used across all shared function objects.

Rules:

List of all members.

Public Member Functions

def do_md_protein_statistics
 updates statistics for md simulation: target temp, kinetic energy, kinetic temperature, writes coordinates and increments counter.
def find_atom
 scans the prot hierarchy and tries to find atom = (resno, name) assumes that resno follows the same numbering as the sequence.
def get_netcdf
def get_pdb
 returns a string corresponding to the pdb structure of hierarchy prot.
def hello
def init_model_ambiguous_NOE_restraint
 Reads an ambiguous NOE restraint.
def init_model_base
def init_model_charmm_protein_and_ff
 creates a CHARMM protein representation.
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.
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.
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.
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.
def init_model_NOE_restraint
 Sets up a lognormal distance restraint using the given sigma and gamma.
def init_model_NOEs
 read TBL file and store NOE restraints, using one sigma and one gamma for the whole dataset.
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.
def init_model_setup_scale
 sets up a Scale particle to the initial default value.
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
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.
def init_model_vonMises_restraint_full
 Sets up a vonMises torsion angle restraint using the given kappa particle as concentration parameter.
def init_model_vonMises_restraint_mean
 Sets up a vonMises torsion angle restraint using the given kappa particle as concentration parameter.
def init_simulation_setup_protein_hmc_hopper
 setup hybrid monte-carlo on protein.
def init_simulation_setup_protein_hmc_nve
 setup hybrid monte-carlo on protein.
def init_simulation_setup_scale_mc
 sets up monte carlo on scale, at a certain target temperature, optionnally using a certain set of restraints only.
def init_stats_add_hmc_category
 shortcut for a frequent series of operations on HMC simulations' statistics.
def init_stats_add_mc_category
 shortcut for a frequent series of operations on MC simulations' statistics.
def init_stats_add_md_category
 shortcut for a frequent series of operations on MD simulations' statistics.
def m
def rescale_velocities
 rescale the velocities of a bunch of particles having vx vy and vz floatkeys
def set_checklevel
def set_loglevel

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)
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.

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

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

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.

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.
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.

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
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.

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.

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.

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
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
def IMP.isd.shared_functions.sfo_common.init_model_setup_scale (   self,
  default,
  lower = -1,
  upper = -1 
)

sets up a Scale particle to the initial default value.

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

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

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
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.

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).

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)
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
def IMP.isd.shared_functions.sfo_common.init_simulation_setup_scale_mc (   self,
  scale,
  temperature = 300.0,
  mc_restraints = None,
  floatkey = IMP.FloatKey("scale"),
  nm_stepsize = 0.1 
)

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

  • scale: scale 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.
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.

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.

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.

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


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

Generated on Tue May 22 2012 23:33:36 for IMP by doxygen 1.8.1