Skip to content
Charles Greenberg edited this page Feb 28, 2016 · 1 revision

Tutorials

Representation, scoring, analysis tutorial (still in construction)

Analyse replica exchange results [tutorial] (http://nbviewer.ipython.org/github/salilab/pmi/blob/master/examples/analysis/replica_exchange_analysis.ipynb?create=1) (still in construction)

Clustering analysis [tutorial] (http://nbviewer.ipython.org/github/salilab/pmi/blob/master/examples/analysis/clustering_analysis.ipynb?create=1)

Sampling exhaustiveness analysis [example] (http://nbviewer.ipython.org/github/salilab/pmi/blob/master/examples/analysis/sampling%20exhaustiveness%20analysis.ipynb?create=1)

Analyse crosslinks [example] (http://nbviewer.ipython.org/github/salilab/pmi/blob/master/examples/analysis/analyse_crosslink_from_a_cluster.ipynb?create=1)

Script Snippets

Examples on using representation.py

    examples:

    1) Create a chain of helices and flexible parts

    c_1_119   =self.add_component_necklace("prot1",1,119,20)
    c_120_131 =self.add_component_ideal_helix("prot1",resolutions=[1,10],resrange=(120,131))
    c_132_138 =self.add_component_beads("prot1",[(132,138)])
    c_139_156 =self.add_component_ideal_helix("prot1",resolutions=[1,10],resrange=(139,156))
    c_157_174 =self.add_component_beads("prot1",[(157,174)])
    c_175_182 =self.add_component_ideal_helix("prot1",resolutions=[1,10],resrange=(175,182))
    c_183_194 =self.add_component_beads("prot1",[(183,194)])
    c_195_216 =self.add_component_ideal_helix("prot1",resolutions=[1,10],resrange=(195,216))
    c_217_250 =self.add_component_beads("prot1",[(217,250)])


    self.set_rigid_body_from_hierarchies(c_120_131)
    self.set_rigid_body_from_hierarchies(c_139_156)
    self.set_rigid_body_from_hierarchies(c_175_182)
    self.set_rigid_body_from_hierarchies(c_195_216)

    clist=[c_1_119,c_120_131,c_132_138,c_139_156,c_157_174,c_175_182,c_183_194,c_195_216,
      c_217_250]

    self.set_chain_of_super_rigid_bodies(clist,2,3)

    self.set_super_rigid_bodies(["prot1"])

Frequently Asked Questions

how to revert to a IMP version that works and compiles?

get into the imp source directory type

git reset hashcode --hard
.git/hooks/post-checkout 

how can I print the radii of selected residues at a given resolution?

After you've generated the topology/representation Define your list of residues that you want to get the radius from:

list_of_residues=[(residue_index_1,component_name),(residue_index_2,component_name), .... ]

example: list_of_residues=[(1,"Rpb1"),(2,"Rpb2")]

Then loop over the residues and get the information

for res in list_of_residues:
    particles=IMP.pmi.tools.select(r,resolution=your_queried_resolution,name=res[1],residue=res[0])
    if len(particles)>1 : print res[0],res[1],"more that one particle selected"; continue
    if len(particles)==0 : print res[0],res[1],"no particle was selected"; continue
    print res[0],res[1],IMP.core.XYZR(particles[0]).get_radius()

exit()

what is get_particles_to_sample() ?

it is a dictionary, containing as a key the type of particle ("Nuisance","Floppy",RigidBody", etc.) and as value a tuple that has the list of particles and the displacements values (gammaxtrans) used to construct a MonteCarloMover. This method is called by IMP.pmi.MonteCarlo to construct the serial mover, which is a list of moves that must be perfomed at each Monte Carlo step. When Monte Carlo is constructed, it queries to the passed sampled_objects whether they have any particle to sample. The key is used to understand what mover MonteCarlo must construct (RigidBodyMover, BallMover, XYMover, NormalMover, etc.).

hon can I calculate the rmsd with respect to an initial structure, before it is randomized?

Before you "shuffle" the coordinates, type:

simo.set_current_coordinates_as_reference_for_rmsd()

That will store the current coordinates, and will use it to calculate the rmsd. The rmsd calculation will be performed automatically, everytime the stat file is written.

how can I implement a new mover?

YourClass.get_particles_to_sample():
        ps["YourMover_YourClass"]=(self.your_particles,self.your_mover_parameter_1,self.your_mover_parameter_2)
        .....
        return ps

MonteCarlo.__init__():
        .....
                if "YourMover" in k:
                    mvs=self.get_your_movers(pts[k][0],pts[k][1],pts[k][2])
                    for mv in mvs: mv.set_name(k)
                    self.mvs+=mvs

.....

MonteCarlo.get_your_movers(self,particles,parameter1,parameter2):
        mvs=[]
        for particle in particles:
            mvs.append(YourMover(particle,parameter1,parameter2))
        return mvs

If I want to add some output, is it enough to just add a line in get_output() ?

Yes, output is a simply a dictionary. Create your personalized keys:

output["MyKey"]=str(myvalue)

the ReplicaExchange swap ratios are looking too high

pmi/pyext/src/process-output -f stat.0.out -s ReplicaExchange_SwapSuccessRatio
# ReplicaExchange_SwapSuccessRatio
>        0.85393258427
>       0.844444444444
>       0.838095238095
>       0.830188679245
>       0.820143884892
>       0.814285714286
>       0.811188811189
>       0.805555555556
>        0.78527607362
>       0.780487804878

It looks like the highest temperature wants to be higher. Trial and error until you get something between 0.40 and 0.60. Look at every replica also (not only one). Another important thing is whether all replicas sample both the lowest temperature and the highest one. Cehck for these keywords using pmi/pyext/src/process_output.py:

ReplicaExchange_MinTempFrequency
ReplicaExchange_MaxTempFrequency

Compile and run IMP using MPI on the ucsf qb3 cluster

This is what I do. On int64a:

module load openmpi-1.6-nodlopen

then compile using

cmake28 ../imp -DCMAKE_CXX_COMPILER=mpicxx -DCMAKE_BUILD_TYPE=Release -DIMP_MAX_CHECKS=NONE -DIMP_MAX_LOG=SILENT -G Ninja
ninja -j 8 -k 1000

to submit the job I use the following. (NOTE: if you have problems, e.g. with the job not being able to find local files, try using #$ -pe ompi_onehost #NUM_PROCS instead of ompi. This will run entirely on one machine.)

#!/bin/sh
#$ -S /bin/sh
#$ -N ##JOB_NAME##
#$ -o ##OUTPUT_FILE_PATH##
#$ -e ##ERROR_FILE_PATH##
#$ -r n
#$ -j n
#$ -l netapp=1G
#$ -l h_rt=168:00:00
#$ -l mem_free=2G
#$ -q lab.q
#$ -pe ompi ##NUMBER_OF_PARALLEL_PROCESS##
#$ -l arch=linux-x64
#$ -l xx5650=true
#$ -R yes
#$ -V
#$ -cwd

# load MPI modules
module load openmpi-1.6-nodlopen
module load sali-libraries

export IMP=##IMP_SETUP_ENVIRONMENT##

# run the job
mpirun -np $NSLOTS $IMP python ##IMP_SCRIPT##