Using MSMBuilder OBSOLETE
Tested on piccolo, should work anywhere.
Installation
Upon first use, issue the following command: module add msmbuilder/2.0 . If you gen an error, enable the TCL version of the 'modules' system. Add the following lines to your .bashrc
PATH=$PATH:$HOME/bin:/shared/lab/software/bin export MODULEPATH=/shared/lab/software/modules/Modules/3.2.8/modulefiles/ source /shared/lab/software/bin/module.sh
Enabling the system
Before you start any session, issue the following command
module add msmbuilder/2.0
Trying the tutorial
To open the tutorial, call
evince $MSMBUILDERHOME/Docs/MSMBuilder2Documentation.pdf
We shall work in a private Tutorial directory
cd $HOME mkdir msmbuilder cp -a $MSMBUILDERHOME/Tutorial msmbuilder cd $HOME mkdir Tutorial cd Tutorial
For convenience, here is a list of the commands proposed by the tutorial (with minimal changes)
cp ~/msmbuilder/Tutorial/dipeptide.pdb ./
cp ~/msmbuilder/Tutorial/AtomIndices.dat ./
ConvertDataToHDF.py -s ./dipeptide.pdb -I ~/msmbuilder/Tutorial/XTC/ [--source gpugrid]
Cluster.py -r 0.03
Assign.py
CalculateImpliedTimescales.py -l 1,50 -X 1 -P 8
PlotImpliedTimescales.py -I ImpliedTimescales.dat -t 1
BuildMSM.py -l 3
ipython
> from numpy import *;
> Pops=loadtxt('./Data/Populations.dat');
> Ind=argsort(Pops)[-5:];
> print(Ind);
> print(Pops[Ind])
SavePDBs.py -c 3 -H 52 153 102 104 135 -a Data/Assignments.Fixed.h5
vmd PDBs/State*.pdb
BuildMSM.py -l 1 -w Model1
PCCA.py -M 4 -a Model1/Assignments.Fixed.h5 -T Model1/tProb.mtx -w Model1/
CalculateImpliedTimescales.py -l 1,50 -X 1 -a Model1/MacroAssignments.h5 \
-o MacrostateRelaxationTimescales.dat -e 3
PlotImpliedTimescales.py -I MacrostateRelaxationTimescales.dat -t 1.
cp ~/msmbuilder/Tutorial/Phi.h5 ./
cp ~/msmbuilder/Tutorial/Psi.h5 ./
cp ~/msmbuilder/Tutorial/PlotDihedrals.py ./
python PlotDihedrals.py ./Model1/MacroAssignments.h5
Enabling experimental features
Issue the command (no documentation provided)
InstallExtras.sh
Local usage
Convert directories with DCD files into nested
sdir=../filteredCA
rm -rf dcd; mkdir dcd
for i in $sdir/*.dcd; do
p=`basename $i`
mkdir dcd/$p
ln -s `readlink -f $i` dcd/$p/$p
done
Using for GPUGRID
Add the --source gpugrid to the ConvertDataToHDF.py to concatenate trajectory files.
python2.7 `which ConvertDataToHDF.py` -s ../filteredCA.pdb -I dcd -S file_dcd
Using h5 files
See also http://www.pytables.org/moin/HowToUse.
Command line tools to inspect binary data
Simple matrices: h5cat.py Data/Assignments.h5
Sparse matrices: mtxcat.py Model1/tCounts.mtx
Full inspection tools
> ipython
>>> from tables import *
>>>
>>> f=openFile('Assignments.h5')
>>> f.root # Shows that there is a 'Data' table
>>> f.root.Data # Shows details of the 'Data' table
>>> f.root.Data[:] # Summary of the table content
>>> f.root.Data[1,:] # Syntax for array access (like Matlab, but 0-based)
>>> # WARNING: colon syntax has a different meaning!
>>> # [a:b] is from a to b, b excluded (?)
>>>
>>> ## Saving as ascii files (transpose() if necessary)
>>> from numpy import *
>>> savetxt('Assignments.txt',f.root.Data)
>>>
>>> ## Working with sparse matrices
>>> from scipy import *
>>> tmp=sio.mmread('tCounts.mtx')
>>> savetxt('tCounts.txt',tmp.todense())
Transforming generators into PDB files
Makes huge files!
ipython
>>> from msmbuilder import *
>>> tj=Trajectory.Trajectory.LoadFromLHDF("Gens.lh5")
>>> tj.SaveToPDB("Gen.pdb")