| spartaPot |
index |
Potential term for chemical shifts.
This term restrains the chemical shifts of C, CA, CB, N, HA and HN
nuclei using chemical shift predictions from the sparta module. This term
is ensembleSimulation.EnsembleSimulation - aware.
Constructor:
It is suggested that this potential term be created using the helper
function spartaPotTools.create_SpartaPot().
PosRMSDPot(instanceName,
spartaObj,
selectionFilter) - creates a potential term with the given name.
spartaObj specifies a sparta.SPARTA
object. The selectionFilter argument is
is used to filter restraints read in.
Methods:
calcEnergy() - calcs energy
calcEnergyAndDerivs(DerivList) - calcs energy and derivative info
note that these routines also update all other potential-specific data.
addRestraints(restraints) - add restraints in the given string. The format
for reading native Xplor-NIH chemical shift
assignment statements is given below. Other
input formats are supported by
spartaPotTools.create_SpartaPot().
simulation() - return the associated simulation.Simulation
rms() - report rmsd value for this potential term.
numRestraints() - report number of restraints defined for this
term.
violations() - report number of violations for this term.
info() - return a string giving summary info for this
- term.
showRestraints(violated) - return a string listing restraints. If the
boolean violated is True, only violated
restraints are included, else all restraints are
listed.
showViolations() - return a string listing violated restraints.
restraints() - return a list of restraints.
rawRestraints() - return restraint list without updating
internal values (energy, computed
chem. shifts, etc.)
sparta() - return the associated sparta.Sparta
object.
Read-Write accessors:
scale - scale factor for potential
potType - potential type: 'harmonic' or 'square' [default: harmonic]
weightType - potential type: 'chi2' or 'one' [default: chi2]
defaultError - value to use for chemical shift error, if it is not
specified in the shift assignment table.
ambigConst - value for kAmbig - for ambiguous glycine HA assignment.
See below. [default: 0.1]
maxDiff - value at which the potential switches from quadratic to
logarithmic. See below. [default: 10 ppm]
threshold - tolerance for violation determination.
showAllRestraints - boolean which changes the behavior of showViolations. If
this parameter is set to True, the behavior of
showViolations is modified such that all restraints are
printed. Violated restraints are indicated by an
asterisk in the first column. [0]
useSimEnsWeight - whether to use the ensemble wieghts set with setEnsWeights
or to use those of the underlying EnsembleSimulation.
ensWeights - a sequence of ensemble weights to use when calculating
the ensemble- averaged value of each chemical shift. By
default, the weights of the underlying EnsembleSimulation
are used. If these are overridden by calling the
setEnsWeights method, and useSimEnsWeight is set to False.
verbose - whether or not to print informational messages. [False]
The restraint class terms have the following methods
calcd() - the most recent calculated value.
obs() - the observed value.
diff() - return calcd() - obs()
err() - input error value.
weight() - weight for this restraint.
comment() - associated comment.
name() - return a descriptive string.
calcd2() - XXX
obs2() - XXX
setObs(val) - set the obs value.
setErr(val) - set the err value.
calcd_contrib(m) - return the chemical shift contribution of the
ensemble member specified by the index m - the
current ensmble if this argument is omitted.
calcd_contrib2(m) - (for ambiguous restraints) return the chemical
shift contribution of atom2 in the ensemble
member specified by the index m - the current
ensmble if this argument is omitted.
and the members
atom - associated atom.
atom2 - XXX.
pot - the associated SpartaPot object.
The native input format for restraints is a file with entries:
assignment (selection) obs [err] ! comment
Other input is ignored. For ambiguous restraints (currently only
glycine HA ambiguous restraints are supported), there must be two
assignment statements specifying the two observed chemical shift
values.
The potential term is defined as
E = scale() * sum_i w_i * energy_i
where the sum is over all restraints, w_i is 1/err_i^2
if err_i is nonzero and weightType=='chi2'. energy_i is the
corresponding energy.
For each restraint, the energy is calculated as
(|calcd - obs| - x)^2 , for |calcd - obs| - x < maxDiff
log(A(|calcd - obs| - x) + B) , for |calcd - obs| - x > maxDiff
for non-ambiguous restraints, where x=0 for potType==harmonic and
x=err for potType==square. The constants A and B are chosen to make the
energy and its first derivative continuous. For ambiguous
restraints the energy is
( calcdSum - obsSum )^2 +
(|calcdDiff|-|obsDiff|)^2
if |calcdDiff| > |obsDiff|
kAmbig (|calcdDiff| - |obsDiff|)^2
if |calcdDiff| <= |obsDiff| and |calcdDiff| > |obsDiff|/2
kAmbig ( 1/2*obsDiff^2 - calcdDiff^2 )^2
otherwise
where calcdDiff=calcd-calcd2, obsDiff=obs-obs2. This later function is
taken from K.L. Constantine, M.S. Friedrichs, L. Mueller, and
R.E. Bruccoleri, J. Magn. Reson. B 108, 176 (1995).
# This file was automatically generated by SWIG (http://www.swig.org).
# Version 4.0.2
#
# Do not make changes to this file unless you know what you are doing--modify
# the SWIG interface file instead.
| Classes | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Functions | ||
| ||