ensembleSimulation
index
ensembleSimulation.py

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. 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,simulation) -
     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.
 
Methods:
 
  This objects contains all of the methods of the simulation.Simulation 
class. In addition, it contains the following:
 
 
  meanAtomPosArr() - return array of ensemble-averaged atom positions.
 
  members(memberIndex) - return Simulation corresponding to ensemble member.
 
  member()             - member associated with the current process
 
  multiThread() - call to terminate a single threaded region.
 
  numThreads() - the number of threads which execute simulataneously.
 
  singleThread() - used to enter a single threaded region in which only 
                   the master thread 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.
 
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 a SharedObj object from
                   the ensembleSharedObj module.
 
  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
 
  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 three 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
 

 
Classes
       
__builtin__.object
EnsembleRMSD
EnsembleRMSDPtr
EnsembleSimulation_SharedString
EnsembleSimulation_SharedStringPtr
Simulation
EnsembleMemberSimulation
EnsembleMemberSimulationPtr
EnsembleSimulation
EnsembleSimulationPtr
SimulationPtr

 
class EnsembleMemberSimulation(Simulation)
    
Method resolution order:
EnsembleMemberSimulation
Simulation
__builtin__.object

Methods defined here:
__del__(self, destroy=<built-in function delete_EnsembleMemberSimulation>)
__getattr__ lambda self, name
__init__(self)
__repr__(self)
__setattr__ lambda self, name, value
addDependent(*args)
atomCharge(*args)
atomFric(*args)
atomMass(*args)
atomMassArr(*args)
atomName(*args)
atomPos(*args)
atomPosArr(*args)
atomString(*args)
atomVel(*args)
atomVelArr(*args)
barrierCnt(*args)
barrierID(*args)
barrierIncr(*args)
bondPairByID(*args)
calcKE(*args)
chemType(*args)
deleteAtoms_byIndex(*args)
ensembleSim(*args)
getKE(*args)
markAsModified(*args)
memberIndex(*args)
modifiedID(*args)
pid(*args)
removeDependent(*args)
residueName(*args)
residueNum(*args)
resize(*args)
segmentName(*args)
select(*args)
setAtomCharge(*args)
setAtomFric(*args)
setAtomMass(*args)
setAtomMassArr(*args)
setAtomName(*args)
setAtomPos(*args)
setAtomPosArr(*args)
setAtomVel(*args)
setAtomVelArr(*args)
setChemType(*args)
setResidueName(*args)
setResidueNum(*args)
setSegmentName(*args)
sleep(*args)
subSim(*args)
wake(*args)
weight(*args)

Data and other attributes defined here:
__swig_getmethods__ = {'currentSimulation': <function <lambda> at 0xd895f0>, 'deleteSimulation': <function <lambda> at 0xd89848>, 'getReference': <function <lambda> at 0xd897d0>, 'makeCurrent': <function <lambda> at 0xd89668>, 'numSimulations': <function <lambda> at 0xd896e0>, 'simulationByID': <function <lambda> at 0xd89758>}
__swig_setmethods__ = {}

Methods inherited from Simulation:
atomByID(*args)
id(*args)
kineticEnergy(*args)
name(*args)
numAtoms(*args)
numBonds(*args)
registerCallbacks(*args)
sync(*args)
type(*args)

Static methods inherited from Simulation:
currentSimulation = Simulation_currentSimulation(...)
deleteSimulation = Simulation_deleteSimulation(...)
getReference = Simulation_getReference(...)
makeCurrent = Simulation_makeCurrent(...)
numSimulations = Simulation_numSimulations(...)
simulationByID = Simulation_simulationByID(...)

Data and other attributes inherited from Simulation:
__dict__ = <dictproxy object at 0xee9fa0>
dictionary for instance variables (if defined)
__weakref__ = <attribute '__weakref__' of 'Simulation' objects>
list of weak references to the object (if defined)

 
class EnsembleMemberSimulationPtr(EnsembleMemberSimulation)
    
Method resolution order:
EnsembleMemberSimulationPtr
EnsembleMemberSimulation
Simulation
__builtin__.object

Methods defined here:
__init__(self, this)

Methods inherited from EnsembleMemberSimulation:
__del__(self, destroy=<built-in function delete_EnsembleMemberSimulation>)
__getattr__ lambda self, name
__repr__(self)
__setattr__ lambda self, name, value
addDependent(*args)
atomCharge(*args)
atomFric(*args)
atomMass(*args)
atomMassArr(*args)
atomName(*args)
atomPos(*args)
atomPosArr(*args)
atomString(*args)
atomVel(*args)
atomVelArr(*args)
barrierCnt(*args)
barrierID(*args)
barrierIncr(*args)
bondPairByID(*args)
calcKE(*args)
chemType(*args)
deleteAtoms_byIndex(*args)
ensembleSim(*args)
getKE(*args)
markAsModified(*args)
memberIndex(*args)
modifiedID(*args)
pid(*args)
removeDependent(*args)
residueName(*args)
residueNum(*args)
resize(*args)
segmentName(*args)
select(*args)
setAtomCharge(*args)
setAtomFric(*args)
setAtomMass(*args)
setAtomMassArr(*args)
setAtomName(*args)
setAtomPos(*args)
setAtomPosArr(*args)
setAtomVel(*args)
setAtomVelArr(*args)
setChemType(*args)
setResidueName(*args)
setResidueNum(*args)
setSegmentName(*args)
sleep(*args)
subSim(*args)
wake(*args)
weight(*args)

Data and other attributes inherited from EnsembleMemberSimulation:
__swig_getmethods__ = {'currentSimulation': <function <lambda> at 0xd895f0>, 'deleteSimulation': <function <lambda> at 0xd89848>, 'getReference': <function <lambda> at 0xd897d0>, 'makeCurrent': <function <lambda> at 0xd89668>, 'numSimulations': <function <lambda> at 0xd896e0>, 'simulationByID': <function <lambda> at 0xd89758>}
__swig_setmethods__ = {}

Methods inherited from Simulation:
atomByID(*args)
id(*args)
kineticEnergy(*args)
name(*args)
numAtoms(*args)
numBonds(*args)
registerCallbacks(*args)
sync(*args)
type(*args)

Static methods inherited from Simulation:
currentSimulation = Simulation_currentSimulation(...)
deleteSimulation = Simulation_deleteSimulation(...)
getReference = Simulation_getReference(...)
makeCurrent = Simulation_makeCurrent(...)
numSimulations = Simulation_numSimulations(...)
simulationByID = Simulation_simulationByID(...)

Data and other attributes inherited from Simulation:
__dict__ = <dictproxy object at 0xee9f30>
dictionary for instance variables (if defined)
__weakref__ = <attribute '__weakref__' of 'Simulation' objects>
list of weak references to the object (if defined)

 
class EnsembleRMSD(__builtin__.object)
     Methods defined here:
__del__(self, destroy=<built-in function delete_EnsembleRMSD>)
__getattr__ lambda self, name
__init__(self, *args)
__repr__(self)
__setattr__ lambda self, name, value
byResidue(*args)
rmsd(*args)
run(*args)

Data and other attributes defined here:
__dict__ = <dictproxy object at 0xee9fa0>
dictionary for instance variables (if defined)
__swig_getmethods__ = {}
__swig_setmethods__ = {}
__weakref__ = <attribute '__weakref__' of 'EnsembleRMSD' objects>
list of weak references to the object (if defined)

 
class EnsembleRMSDPtr(EnsembleRMSD)
    
Method resolution order:
EnsembleRMSDPtr
EnsembleRMSD
__builtin__.object

Methods defined here:
__init__(self, this)

Methods inherited from EnsembleRMSD:
__del__(self, destroy=<built-in function delete_EnsembleRMSD>)
__getattr__ lambda self, name
__repr__(self)
__setattr__ lambda self, name, value
byResidue(*args)
rmsd(*args)
run(*args)

Data and other attributes inherited from EnsembleRMSD:
__dict__ = <dictproxy object at 0xee9d70>
dictionary for instance variables (if defined)
__swig_getmethods__ = {}
__swig_setmethods__ = {}
__weakref__ = <attribute '__weakref__' of 'EnsembleRMSD' objects>
list of weak references to the object (if defined)

 
class EnsembleSimulation(Simulation)
    
Method resolution order:
EnsembleSimulation
Simulation
__builtin__.object

Methods defined here:
__del__(self)
__getattr__ lambda self, name
__init__ = construct(self, *args)
__repr__(self)
__setattr__ lambda self, name, value
abort(*args)
addDependent(*args)
atomCharge(*args)
atomFric(*args)
atomMass(*args)
atomMassArr(*args)
atomName(*args)
atomPos(*args)
atomPosArr(*args)
atomString(*args)
atomVel(*args)
atomVelArr(*args)
barrier(*args)
bondPairByID(*args)
chemType(*args)
deleteAtoms(self, arg)
deleteAtoms_byIndex(*args)
help(*args)
kineticEnergy(*args)
markAsModified(*args)
meanAtomPosArr(*args)
member(*args)
members(*args)
modifiedID(*args)
multiThread(*args)
numThreads(*args)
registerCallbacks(*args)
removeDependent(*args)
residueName(*args)
residueNum(*args)
resize(*args)
segmentName(*args)
select(*args)
setAtomCharge(*args)
setAtomFric(*args)
setAtomMass(*args)
setAtomMassArr(*args)
setAtomName(*args)
setAtomPos(*args)
setAtomPosArr(*args)
setAtomVel(*args)
setAtomVelArr(*args)
setChemType(*args)
setResidueName(*args)
setResidueNum(*args)
setSegmentName(*args)
setWeights(*args)
sharedObj(self, obj=0)
sharedString(*args)
shutdown(*args)
singleThread(*args)
singleThreaded(*args)
size(*args)
subSim(*args)
sync(*args)
type(*args)
weight(*args)

Static methods defined here:
currentSimulation = EnsembleSimulation_currentSimulation(...)
sizeOneSimulation = EnsembleSimulation_sizeOneSimulation(...)

Data and other attributes defined here:
__swig_getmethods__ = {'currentSimulation': <function <lambda> at 0xd8c5f0>, 'deleteSimulation': <function <lambda> at 0xd89848>, 'getReference': <function <lambda> at 0xd897d0>, 'makeCurrent': <function <lambda> at 0xd89668>, 'numSimulations': <function <lambda> at 0xd896e0>, 'simulationByID': <function <lambda> at 0xd89758>, 'sizeOneSimulation': <function <lambda> at 0xd8c668>}
__swig_setmethods__ = {}

Methods inherited from Simulation:
atomByID(*args)
id(*args)
name(*args)
numAtoms(*args)
numBonds(*args)

Static methods inherited from Simulation:
deleteSimulation = Simulation_deleteSimulation(...)
getReference = Simulation_getReference(...)
makeCurrent = Simulation_makeCurrent(...)
numSimulations = Simulation_numSimulations(...)
simulationByID = Simulation_simulationByID(...)

Data and other attributes inherited from Simulation:
__dict__ = <dictproxy object at 0xee9f30>
dictionary for instance variables (if defined)
__weakref__ = <attribute '__weakref__' of 'Simulation' objects>
list of weak references to the object (if defined)

 
class EnsembleSimulationPtr(EnsembleSimulation)
    
Method resolution order:
EnsembleSimulationPtr
EnsembleSimulation
Simulation
__builtin__.object

Methods defined here:
__init__(self, this)

Methods inherited from EnsembleSimulation:
__del__(self)
__getattr__ lambda self, name
__repr__(self)
__setattr__ lambda self, name, value
abort(*args)
addDependent(*args)
atomCharge(*args)
atomFric(*args)
atomMass(*args)
atomMassArr(*args)
atomName(*args)
atomPos(*args)
atomPosArr(*args)
atomString(*args)
atomVel(*args)
atomVelArr(*args)
barrier(*args)
bondPairByID(*args)
chemType(*args)
deleteAtoms(self, arg)
deleteAtoms_byIndex(*args)
help(*args)
kineticEnergy(*args)
markAsModified(*args)
meanAtomPosArr(*args)
member(*args)
members(*args)
modifiedID(*args)
multiThread(*args)
numThreads(*args)
registerCallbacks(*args)
removeDependent(*args)
residueName(*args)
residueNum(*args)
resize(*args)
segmentName(*args)
select(*args)
setAtomCharge(*args)
setAtomFric(*args)
setAtomMass(*args)
setAtomMassArr(*args)
setAtomName(*args)
setAtomPos(*args)
setAtomPosArr(*args)
setAtomVel(*args)
setAtomVelArr(*args)
setChemType(*args)
setResidueName(*args)
setResidueNum(*args)
setSegmentName(*args)
setWeights(*args)
sharedObj(self, obj=0)
sharedString(*args)
shutdown(*args)
singleThread(*args)
singleThreaded(*args)
size(*args)
subSim(*args)
sync(*args)
type(*args)
weight(*args)

Static methods inherited from EnsembleSimulation:
currentSimulation = EnsembleSimulation_currentSimulation(...)
sizeOneSimulation = EnsembleSimulation_sizeOneSimulation(...)

Data and other attributes inherited from EnsembleSimulation:
__swig_getmethods__ = {'currentSimulation': <function <lambda> at 0xd8c5f0>, 'deleteSimulation': <function <lambda> at 0xd89848>, 'getReference': <function <lambda> at 0xd897d0>, 'makeCurrent': <function <lambda> at 0xd89668>, 'numSimulations': <function <lambda> at 0xd896e0>, 'simulationByID': <function <lambda> at 0xd89758>, 'sizeOneSimulation': <function <lambda> at 0xd8c668>}
__swig_setmethods__ = {}

Methods inherited from Simulation:
atomByID(*args)
id(*args)
name(*args)
numAtoms(*args)
numBonds(*args)

Static methods inherited from Simulation:
deleteSimulation = Simulation_deleteSimulation(...)
getReference = Simulation_getReference(...)
makeCurrent = Simulation_makeCurrent(...)
numSimulations = Simulation_numSimulations(...)
simulationByID = Simulation_simulationByID(...)

Data and other attributes inherited from Simulation:
__dict__ = <dictproxy object at 0xee9fa0>
dictionary for instance variables (if defined)
__weakref__ = <attribute '__weakref__' of 'Simulation' objects>
list of weak references to the object (if defined)

 
class EnsembleSimulation_SharedString(__builtin__.object)
     Methods defined here:
__del__(self, destroy=<built-in function delete_EnsembleSimulation_SharedString>)
__getattr__ lambda self, name
__init__(self, *args)
__repr__(self)
__setattr__ lambda self, name, value
get(*args)
set(*args)

Data and other attributes defined here:
__dict__ = <dictproxy object at 0xee9f30>
dictionary for instance variables (if defined)
__swig_getmethods__ = {}
__swig_setmethods__ = {}
__weakref__ = <attribute '__weakref__' of 'EnsembleSimulation_SharedString' objects>
list of weak references to the object (if defined)

 
class EnsembleSimulation_SharedStringPtr(EnsembleSimulation_SharedString)
    
Method resolution order:
EnsembleSimulation_SharedStringPtr
EnsembleSimulation_SharedString
__builtin__.object

Methods defined here:
__init__(self, this)

Methods inherited from EnsembleSimulation_SharedString:
__del__(self, destroy=<built-in function delete_EnsembleSimulation_SharedString>)
__getattr__ lambda self, name
__repr__(self)
__setattr__ lambda self, name, value
get(*args)
set(*args)

Data and other attributes inherited from EnsembleSimulation_SharedString:
__dict__ = <dictproxy object at 0xee99b8>
dictionary for instance variables (if defined)
__swig_getmethods__ = {}
__swig_setmethods__ = {}
__weakref__ = <attribute '__weakref__' of 'EnsembleSimulation_SharedString' objects>
list of weak references to the object (if defined)

 
class Simulation(__builtin__.object)
     Methods defined here:
__del__(self, destroy=<built-in function delete_Simulation>)
__getattr__ lambda self, name
__init__(self)
__repr__(self)
__setattr__ lambda self, name, value
addDependent(*args)
atomByID(*args)
atomCharge(*args)
atomFric(*args)
atomMass(*args)
atomMassArr(*args)
atomName(*args)
atomPos(*args)
atomPosArr(*args)
atomString(*args)
atomVel(*args)
atomVelArr(*args)
bondPairByID(*args)
chemType(*args)
deleteAtoms_byIndex(*args)
id(*args)
kineticEnergy(*args)
markAsModified(*args)
modifiedID(*args)
name(*args)
numAtoms(*args)
numBonds(*args)
registerCallbacks(*args)
removeDependent(*args)
residueName(*args)
residueNum(*args)
segmentName(*args)
select(*args)
setAtomCharge(*args)
setAtomFric(*args)
setAtomMass(*args)
setAtomMassArr(*args)
setAtomName(*args)
setAtomPos(*args)
setAtomPosArr(*args)
setAtomVel(*args)
setAtomVelArr(*args)
setChemType(*args)
setResidueName(*args)
setResidueNum(*args)
setSegmentName(*args)
sync(*args)
type(*args)

Static methods defined here:
currentSimulation = Simulation_currentSimulation(...)
deleteSimulation = Simulation_deleteSimulation(...)
getReference = Simulation_getReference(...)
makeCurrent = Simulation_makeCurrent(...)
numSimulations = Simulation_numSimulations(...)
simulationByID = Simulation_simulationByID(...)

Data and other attributes defined here:
__dict__ = <dictproxy object at 0xee9a60>
dictionary for instance variables (if defined)
__swig_getmethods__ = {'currentSimulation': <function <lambda> at 0xd895f0>, 'deleteSimulation': <function <lambda> at 0xd89848>, 'getReference': <function <lambda> at 0xd897d0>, 'makeCurrent': <function <lambda> at 0xd89668>, 'numSimulations': <function <lambda> at 0xd896e0>, 'simulationByID': <function <lambda> at 0xd89758>}
__swig_setmethods__ = {}
__weakref__ = <attribute '__weakref__' of 'Simulation' objects>
list of weak references to the object (if defined)

 
class SimulationPtr(Simulation)
    
Method resolution order:
SimulationPtr
Simulation
__builtin__.object

Methods defined here:
__init__(self, this)

Methods inherited from Simulation:
__del__(self, destroy=<built-in function delete_Simulation>)
__getattr__ lambda self, name
__repr__(self)
__setattr__ lambda self, name, value
addDependent(*args)
atomByID(*args)
atomCharge(*args)
atomFric(*args)
atomMass(*args)
atomMassArr(*args)
atomName(*args)
atomPos(*args)
atomPosArr(*args)
atomString(*args)
atomVel(*args)
atomVelArr(*args)
bondPairByID(*args)
chemType(*args)
deleteAtoms_byIndex(*args)
id(*args)
kineticEnergy(*args)
markAsModified(*args)
modifiedID(*args)
name(*args)
numAtoms(*args)
numBonds(*args)
registerCallbacks(*args)
removeDependent(*args)
residueName(*args)
residueNum(*args)
segmentName(*args)
select(*args)
setAtomCharge(*args)
setAtomFric(*args)
setAtomMass(*args)
setAtomMassArr(*args)
setAtomName(*args)
setAtomPos(*args)
setAtomPosArr(*args)
setAtomVel(*args)
setAtomVelArr(*args)
setChemType(*args)
setResidueName(*args)
setResidueNum(*args)
setSegmentName(*args)
sync(*args)
type(*args)

Static methods inherited from Simulation:
currentSimulation = Simulation_currentSimulation(...)
deleteSimulation = Simulation_deleteSimulation(...)
getReference = Simulation_getReference(...)
makeCurrent = Simulation_makeCurrent(...)
numSimulations = Simulation_numSimulations(...)
simulationByID = Simulation_simulationByID(...)

Data and other attributes inherited from Simulation:
__dict__ = <dictproxy object at 0xee9750>
dictionary for instance variables (if defined)
__swig_getmethods__ = {'currentSimulation': <function <lambda> at 0xd895f0>, 'deleteSimulation': <function <lambda> at 0xd89848>, 'getReference': <function <lambda> at 0xd897d0>, 'makeCurrent': <function <lambda> at 0xd89668>, 'numSimulations': <function <lambda> at 0xd896e0>, 'simulationByID': <function <lambda> at 0xd89758>}
__swig_setmethods__ = {}
__weakref__ = <attribute '__weakref__' of 'Simulation' objects>
list of weak references to the object (if defined)

 
Functions
       
EnsembleSimulation_currentSimulation(...)
EnsembleSimulation_sizeOneSimulation(...)
Simulation_currentSimulation(...)
Simulation_deleteSimulation(...)
Simulation_getReference(...)
Simulation_makeCurrent(...)
Simulation_numSimulations(...)
Simulation_simulationByID(...)
commBarrier(comm)
 perform EnsembleSimulation-safe socketComm.SocketComm barrier
    
construct(self, *args)
fromSimulation(...)
help(...)
multiThread()

    Wrap around ensembleSimulation.EnsembleSimulation.multiThread
    which also works if no EnsembleSimulation is used.
    
oldConstructor = __init__(self, *args) unbound EnsembleSimulation method
singleThread()

    Wrap around ensembleSimulation.EnsembleSimulation.singleThread
    This returns true for member 0 of an EmsembleSimulation or if no
    EnsembleSimulation is used.
    

 
Data
        threadSuffix = ''