Biskit :: TrajFlexMaster :: TrajFlexMaster :: Class TrajFlexMaster
[hide private]
[frames] | no frames]

Class TrajFlexMaster

source code


Parallize calculation of pairwise rmsd between the frames of one or two trajectories.

Instance Methods [hide private]
  __init__(self, traj1, traj2=None, aMask=None, hosts=hosts.cpus_all, niceness=hosts.nice_dic, show_output=0, add_hosts=0, log=None, slaveLog=None, verbose=1, only_off_diagonal=1, only_cross_member=0)
{param:value} getInitParameters(self, slave_tid)
Returns dictionary with init parameters
int __windowSize(self, n_per_node, n_nodes, n_frames)
Returns calculate number of frames per chunk
  cleanup(self)
Tidy up.
[(int, int)] __getFrameWindows(self, traj, n_frames)
Divide frame indices into chunks.
{((int, int),(int, int)) : (str, str)} __taskDict(self, f_frames_1, f_frames_2)
Returns { ((int, int),(int, int)) : (str, str) }
{(int,int) : str} __dumpFrames(self, traj, outFolder, prefix)
Returns { (int,int) : str } OR None, if traj is None
[ int ] OR None memberMap(self, traj)
Tell which traj frame belongs to which member trajectory.
array getResult(self, mirror=0)
Get result matrix ordered such as input trajectory.
  rmsMatrixByMember(self, mirror=0, step=1)
Get result matrix ordered first by member then by time.
[float] rmsList(self)
Returns list of all calculated pairwise rms values
(float, float) averageRms(self)
Returns average pairwise rmsd and it's standard deviation

Class Variables [hide private]
  slave_script = T.projectRoot()+ '/Biskit/TrajFlexSlave.py'

Method Details [hide private]

__init__(self, traj1, traj2=None, aMask=None, hosts=hosts.cpus_all, niceness=hosts.nice_dic, show_output=0, add_hosts=0, log=None, slaveLog=None, verbose=1, only_off_diagonal=1, only_cross_member=0)
(Constructor)

source code 
Parameters:
  • traj1 (Trajectory OR EnsembleTraj) - Trajectory or EnsembleTraj, traj1 and 2 must have the same atom content. If only traj1 is given, the pairwise rms is calculated between its frames.
  • traj2 (Trajectory OR EnsembleTraj) - see traj1
  • aMask ([0|1]) - atom mask, consider only subset of atoms (default: all)
  • hosts ([str]) - slave hosts to be used (default: Biskit.hosts.cpus_all)
  • niceness (dict) - { str:int, 'default':int }, nice value for each host
  • show_output (0|1) - open xterm window for each slave (default: 0)
  • add_hosts (1|0) - add hosts to PVM before starting (default: 0)
  • log (LogFile) - log file for master (default: None-> StdErr )
  • slaveLog (LogFile) - slave log (default: None->'TrajFlexSlave_errors.log')
  • verbose (0|1) - print progress infos (default: 1)
  • only_off_diagonal (0|1) - Don't calculate self-rms of frames. Only considered for a single trajectory (default: 1)
  • only_cross_member (0|1) - Don't calculate rms between frames from same member trajectory only considered for a single trajectory(requires EnsembleTraj) (default: 0)

getInitParameters(self, slave_tid)

source code 
Parameters:
  • slave_tid (int) - slave task id
Returns: {param:value}
dictionary with init parameters

__windowSize(self, n_per_node, n_nodes, n_frames)

source code 
Parameters:
  • n_per_node (int) - how many chunks should be generated per node
  • n_nodes (int) - number of slave nodes
  • n_frames (int) - length of trajectory
Returns: int
calculate number of frames per chunk

cleanup(self)

source code 

Tidy up.

__getFrameWindows(self, traj, n_frames)

source code 

Divide frame indices into chunks.
Parameters:
  • n_frames (int) - number of frames per chunk
Returns: [(int, int)]
list with start and stop frame index of each chunk

__taskDict(self, f_frames_1, f_frames_2)

source code 
Parameters:
  • f_frames_1 ({(int, int) : str}) - file name of chunk 1 of frames
  • f_frames_2 ({(int, int) : str}) - file name of chunk 2 of frames
Returns: {((int, int),(int, int)) : (str, str)}
{ ((int, int),(int, int)) : (str, str) }

__dumpFrames(self, traj, outFolder, prefix)

source code 
Parameters:
  • traj (Trajectory) - Trajectory
  • outFolder (str) - folder for pickled arrays
  • prefix (str) - file name prefix
Returns: {(int,int) : str}
{ (int,int) : str } OR None, if traj is None

memberMap(self, traj)

source code 

Tell which traj frame belongs to which member trajectory.
Parameters:
  • traj (Trajectory) - Trajectory
Returns: [ int ] OR None
member index of each frame OR None if traj is not a EnsembleTraj

getResult(self, mirror=0)

source code 

Get result matrix ordered such as input trajectory.
Parameters:
  • mirror (1|0) - mirror the matrix at diagonal (default: 1) (only for intra-traj)
Returns: array
array( (n_frames, n_frames), 'f'), matrix of pairwise rms

rmsMatrixByMember(self, mirror=0, step=1)

source code 

Get result matrix ordered first by member then by time. (requires EnsembleTraj)
Parameters:
  • mirror (0|1) - mirror matrix at diagonal (only for intra-traj. rms) (default: 0)
  • step (int) - take only every step frame [1]

rmsList(self)

source code 
Returns: [float]
list of all calculated pairwise rms values
Raises:

averageRms(self)

source code 
Returns: (float, float)
average pairwise rmsd and it's standard deviation
Raises:

Class Variable Details [hide private]

slave_script

Value:
T.projectRoot()+ '/Biskit/TrajFlexSlave.py'