Package Biskit :: Module AmberEntropist :: Class AmberEntropist
[hide private]
[frames] | no frames]

Class AmberEntropist

source code


Run ptraj entropy analysis on Trajectory instance.

Instance Methods [hide private]
  __init__(self, traj=None, parm=None, crd=None, ref=None, cast=0, chains=None, border=None, split=0, shift=0, shuffle=0, thin=None, s=0, e=None, ss=0, se=None, step=1, atoms=None, heavy=0, ex=[], ex_n=0, ex3=None, ex1=None, fit_s=None, fit_e=None, memsave=1, **kw)
Create Executor.
  prepare(self)
Overrides Executor method.
  buildParm(self)
Build amber topology.
  fit(self, traj, refModel=None, mask=None, conv=1e-6)
Fit trajectory until convergence onto it's own average and then transform the average of all frames onto the reference.
str, str __splitFilenames(self, f)
Split file name:
PDBModel __cleanAtoms(self, m)
Remove non protein atoms and H if needed.
PDBModel __getModel(self, f)
Load PDBModel directly or extract it from Trajectory.
PDBModel|Complex prepareRef(self, fname)
Prepare reference model.
[ int ] __add3(self, n_members, excluded, trippleIndex)
Add a tripple of numbers from range( n_members ) to be excluded for error estimation.
[ int ] __add1(self, n_members, excluded, index)
Add one number from range( n_members ) to list of excluded indices
EnsembleTraj __exclude(self, traj, exclude)
Exclude members from a (set of) Trajectory.
EnsembleTraj OR (EnsembleTraj, EnsembleTraj ) __removeMembers(self, t)
Some individual trajectories may have to be excluded as outliers or for error estimation (depending on the parameters passed to AmberEntropist).
EnsembleTraj OR (EnsembleTraj, EnsembleTraj ) prepareTraj(self, fname, ref=None, cast=1)
Prepare trajectory for Amber.
Trajectroy load_locked(self, fname)
wait with unpickling until another Entropist has finished.
  loadTraj(self, fname, shift=0)
Load single trajectory.
  shiftTraj(self, traj, shift=0)
reorder member trajectories
  shuffleTraj(self, traj)
reorder all frames at random
  castTraj(self, traj, refModel)
Equalize atom content of traj to refModel.
  tripples(self, lst, n)
Group items of lst into n tripples with minimal overlap.
  cleanup(self)
Remove temporary files.
  finish(self)
Called when done.

Inherited from AmberCrdEntropist.AmberCrdEntropist: command, isFailed, parsePtrajResult, version

Inherited from Executor.Executor: communicate, convertInput, environment, execute, fail, fillTemplate, generateInp, postProcess, run


Class Variables [hide private]

Inherited from AmberCrdEntropist.AmberCrdEntropist: ptraj_script


Instance Variables [hide private]

Inherited from Executor.Executor: error, f_in, log, output, pid, result, returncode, runTime


Method Details [hide private]

__init__(self, traj=None, parm=None, crd=None, ref=None, cast=0, chains=None, border=None, split=0, shift=0, shuffle=0, thin=None, s=0, e=None, ss=0, se=None, step=1, atoms=None, heavy=0, ex=[], ex_n=0, ex3=None, ex1=None, fit_s=None, fit_e=None, memsave=1, **kw)
(Constructor)

source code 

Create Executor. *name* must point to an existing program configuration unless *strict*=0. Executor will create a program input from the template and its own fields and put it into f_in. If f_in but no template is given, the unchanged f_in is used as input. If neither is given, the program is called without input. If a node is given, the process is wrapped in a ssh call. If *nice* != 0, the process is preceeded by nice. *cwd* specifies the working directory. By default, this setting is taken from the configuration file which defaults to the current working directory.
Parameters:
  • traj (str) - path to 1 or 2 pickled Trajectory instances (2 separated by '+', e.g. 'rec.traj+lig.traj')
  • parm (str) - try using existing parm file & keep it [create+discard]
  • crd (str) - target file for amber crd & keep it (default: discard)
  • ref (str|PDBModel|Complex) - superimpose onto this structure
  • cast (0|1) - equalize atom content against ref (if given) (default: 1)
  • chains ([int]) - extract chains from traj (default: None, all chains)
  • border (int) - 1st chain of 2nd molecule; required for split, shift, shuffle if traj is not already a tuple of trajectories
  • split (1|0) - split trajectory after *border* and fit the two halfs separately (default: 0)
  • shift (int) - recombine rec and lig member trajectories, should disrupt correlations between rec and lig, requires *chains* or 2 traj files to identify rec (default: 0)
  • shuffle (0|1) - shuffle the order of frames for one trajectory half, requires *border* or 2 traj files to identify rec
  • s (int) - start frame of complete traj (default: 0)
  • e (int) - stop frame of complete traj (default: None)
  • ss (int) - start frame of single member trajectories (only works with EnsembleTraj; overrides s,e) (default: 0)
  • se (int) - stop frame of single member trajectories (only works with EnsembleTraj; overrides s,e) (default: None)
  • step (int) - frame offset (default: 1, no offset)
  • thin (float) - use only randomly distributed fraction of frames (default: all)
  • atoms ([str]) - atom names to consider (default: all)
  • heavy (1|0) - remove hydrogens (default: 0)
  • ex ([int] OR ([int],[int])) - exclude member trajectories
  • ex_n (int) - exclude last n members OR...
  • ex3 (int) - exclude *ex3*rd tripple of trajectories (default: 0) (index starts with 1! 0 to exclude nothing) OR....
  • ex1 (int) - exclude *ex1*-th member remaining after applying *ex* (default: None)(index starts with 1! 0 to exclude nothing)
  • fit_s (int|None) - fit to average of different frame slice
  • fit_e (int|None) - fit to average of different frame slice
  • memsave (1|0) - delete internal trajectory after writing crd (default: 1)
  • kw (key=value pairs :
     ... parameters for AmberCrdEntropist
     f_template - str, alternative ptraj input template
    
     ... and key=value parameters for Executor:
     f_out    - str, target name for ptraj output file (default: discard)
     debug    - 0|1, keep all temporary files (default: 0)
     verbose  - 0|1, print progress messages to log (log != STDOUT)
     node     - str, host for calculation (None->local) NOT TESTED
                     (default: None)
     nice     - int, nice level (default: 0)
     log      - Biskit.LogFile, program log (None->STOUT) (default: None)
    
    ) - additional key=value parameters for AmberCrdEntropist and Executor:
Overrides: AmberCrdEntropist.AmberCrdEntropist.__init__

prepare(self)

source code 

Overrides Executor method.
Overrides: Executor.Executor.prepare

buildParm(self)

source code 

Build amber topology.

fit(self, traj, refModel=None, mask=None, conv=1e-6)

source code 

Fit trajectory until convergence onto it's own average and then transform the average of all frames onto the reference.
Parameters:
  • traj (Trajectory) - trajectory in which to fit frames
  • refModel (PDBModel) - reference PDBModel
  • mask ([1|0]) - atom mask for superposition (default: all)
  • conv (float) - convergence criteria (default: 1e-6)

__splitFilenames(self, f)

source code 

Split file name:
 split(traj1.dat+traj2.dat) -> (traj1.dat, traj2.dat)
Parameters:
  • f (str) - file name
Returns: str, str
split filename

__cleanAtoms(self, m)

source code 

Remove non protein atoms and H if needed.
Parameters:
  • m (PDBModel) - model to clean
Returns: PDBModel
cleaned model

__getModel(self, f)

source code 

Load PDBModel directly or extract it from Trajectory.
Parameters:
  • f (str) - file name of PDB file, pickled PDBModel, or Trajectory
Returns: PDBModel
model
Raises:
  • IOError - if file does not exist

prepareRef(self, fname)

source code 

Prepare reference model.
Parameters:
  • fname (str) - file name
Returns: PDBModel|Complex
reference structure
Raises:

__add3(self, n_members, excluded, trippleIndex)

source code 

Add a tripple of numbers from range( n_members ) to be excluded for error estimation. Tripples are chosen to have minimal overlap. For 10 trajectories (*n_members*=10), the first 3 tripples will be (1,2,3), (4,5,6), (7,8,9).
Parameters:
  • n_members (int) - number of member trajectories
  • excluded ([ int ]) - excluded member trajectories
  • trippleIndex (int) -
Returns: [ int ]
the indices of all excluded member trajectories

__add1(self, n_members, excluded, index)

source code 

Add one number from range( n_members ) to list of excluded indices
Parameters:
  • n_members (int) - number of member trajectories
  • excluded ([ int ]) - excluded member trajectories
  • index (int) -
Returns: [ int ]
the indices of all excluded member trajectories

__exclude(self, traj, exclude)

source code 

Exclude members from a (set of) Trajectory.
Parameters:
  • traj (EnsembleTraj) - input trajectory
  • exclude ([ int ]) - set of indices to be excluded
Returns: EnsembleTraj

__removeMembers(self, t)

source code 

Some individual trajectories may have to be excluded as outliers or for error estimation (depending on the parameters passed to AmberEntropist).
Parameters:
  • t (EnsembleTraj OR (EnsembleTraj, EnsembleTraj )) - one or two ensembles of trajectories
Returns: EnsembleTraj OR (EnsembleTraj, EnsembleTraj )
t with some member trajectories excluded, if needed

prepareTraj(self, fname, ref=None, cast=1)

source code 

Prepare trajectory for Amber.
Parameters:
  • fname (str OR (str,str)) - path to EnsembleTraj OR ( EnsembleTraj, EnsembleTraj )
  • ref (EnsembleTraj) - reference structure
  • cast (1|0) - cast to reference (same atom content) (default: 1)
Returns: EnsembleTraj OR (EnsembleTraj, EnsembleTraj )
split, fitted or shuffled, etc. trajectory instance

load_locked(self, fname)

source code 

wait with unpickling until another Entropist has finished.
Parameters:
  • fname (str) - file name
Returns: Trajectroy
trajectroy

loadTraj(self, fname, shift=0)

source code 

Load single trajectory.

shiftTraj(self, traj, shift=0)

source code 

reorder member trajectories

shuffleTraj(self, traj)

source code 

reorder all frames at random

castTraj(self, traj, refModel)

source code 

Equalize atom content of traj to refModel.

tripples(self, lst, n)

source code 

Group items of lst into n tripples with minimal overlap.

cleanup(self)

source code 

Remove temporary files.
Overrides: Executor.Executor.cleanup

finish(self)

source code 

Called when done.
Overrides: AmberCrdEntropist.AmberCrdEntropist.finish