ensembleSimulation |
index |
an ensemble of structures
A simulation which replicates the molecular structure in a given
simulation.Simulation, and allows structure calculations to be
performed on the simulation, optionally executing in parallel. All
members of the simulation are exact replicas of each other, with
identical atoms. This module is described in
G.M. Clore and C.D. Schwieters, ``How much backbone motion in
ubiquitin is required to be consistent with dipolar coupling data
measured in multiple alignment media as assessed by independent
cross-validation,'' J. Am. Chem. Soc. 126, 2923-2938 (2004).
Constructor:
EnsembleSimulation(name,
size,
numThreads=1,
simulation=simulation.currentSimulation(),
barrierDebug=False)
required parameters are the name of the new simulation, and the
ensemble size. numThreads defaults to 1. On multiprocessor machines
this may be increased for approximate linear speedup. The
ensemble is based on the simulation argument, which defaults to
the current simulation. This ensemble should normally be constructed
before defining any potential terms, or ivm.IVM objects. Any
EnsemblePot (including PotList) will try to detect whether it was
created before EnsembleSimulation(), and explicitly crash in the
next call to its calcEnergy method. If the barrierDebug argument is
set to True, problems with synchronization of EnsembleSimulation threads
are detected as early as possible, without incurring a large run-time
penalty.
For EnsembleSimulations, the value of Simulation.noFit is set to
True, as the relative orientation of ensemble members is usually
significant for some energy terms.
Methods:
This objects contains all of the methods of the simulation.Simulation
class. In addition, it contains the following:
type() - returns the string "EnsembleSimulation"
meanAtomPosArr() - return array of ensemble-averaged atom positions.
members(memberIndex) - return Simulation corresponding to ensemble member.
member() - member associated with the current process
numThreads() - the number of threads which execute simulataneously.
multiThread() - call to terminate a single threaded region.
singleThread(index=0) - used to enter a single threaded region in which
only the thread with memberIndex index executes. Returns 1
for the master process and 0 otherwise. Example use:
if singleThread():
#perform action in only one thread
multiThread() #after this statement all threads run
singleThreaded() - returns 1 if in a singleThreaded region.
size() - size of ensemble.
subSim() - simulation upon which the ensemble is based.
weight(memberIndex) - return the weight of the given member.
setWeights(list) - given a sequence of positive numeric vals of length
size(), set the ensemble weights to the
corresponding normalized values.
aveType()/setAveType(aveType) - accessors for aveType- how energy is
averaged over the ensemble. Valid values
for aveType are 'sum' and 'ave'. The default
value is 'ave'.
less used methods:
barrier() - used to synchronize threads of execution. All threads will
reach this point before one continues on.
sharedString() - return a SharedString object shared across the ensemble.
It's usually preferable to use sharedObj(), as it's more
flexible and doesn't require explicit thread
synchronization.
sharedObj() - return an ensembleSharedObj.EnsembleSharedObj associated
with this EnsembleSimulation.
shutdown() - explicitly shutdown threads.
class EnsembleMemberSimulation
this class is returned by the member() and members() methods of
EnsembleSimulation. It contains all the methods of the Simulation
class. In addition, there are
type() - returns the string "EnsembleMemberSimulation"
pid() - return the id of the process which performs calculations on
this member.
memberIndex() - the index corresponding to this member.
weight() - weight for this member
ensembleSim() - the ensembleSimulation for this member.
subSim() - the Simulation on which this member is based.
The following atomSelAction.AtomSelAction helper function
calculates RMSD between the ensemble members.
class EnsembleRMSD
methods:
rmsd() : return overall RMSD between ensemble members
byResidue(): return a dictionary with keys being residue ids, and
values being per-residue RMSDs.
the RMSD is defined as
sqrt( 1/N sum_ijk w_i * w_j * |q_ik - q_jk|^2 )
where q_ik is the position of atom k in ensemble i, N is the number of
atoms and w_i is the weight on ensemble member i.
Helper Functions
There are module-level helper functions which can be used
whether or not an EnsembleSimulation is defined:
singleThread - general version of EnsembleSimulation.singleThread
multiThread - general version of EnsembleSimulation.multiThread
commBarrier - EnsembleSimulation-safe socketComm.SocketComm barrier
sizeOneSimulation(sim) - return a size-one EnsembleSimulation based on sim. If
sim is omitted, use the
simulation.currentSimulation.
getEnsembleSimulation(sim) - determine if the Simulation is an
EnsembleSimulation. If so, return that else,
return a sizeOneSimulation based on sim.
fromSimulation(sim) - given a Simulation argument, cast this to an
EnsembleSimualtion, if it is indeed an EnsembleSimulation,
else raise an exception.
memberFromSimulation(sim) - given a Simulation argument, cast this to an
EnsembleMemberSimualtion, if it is indeed an
EnsembleSimulation, else raise an exception.
currentSimulation() - return the current EnsembleSimulation, if there is
one, else None.
# 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 | ||
|
Data | ||
cvar = <Swig global variables> maxMessageSize = 200 threadSuffix = '' |