IMP logo
IMP Manual  for IMP version 2.10.1
rnapolii_3.md
1 Stage 3 - Sampling {#rnapolii_3}
2 ==================
3 
4 With the system representation built and data restraints entered, the system is now ready to sample configurations. First, sampling parameters are set:
5 
6 \code{.py}
7 #--------------------------
8 # Set MC Sampling Parameters
9 #--------------------------
10 num_frames = 20000
11 num_mc_steps = 10
12 \endcode
13 
14 MC sampling parameters define the number of frames (model structures) which will be output during sampling. `num_mc_steps` defines the number of Monte Carlo steps between output frames. This setup would therefore encompass 200000 MC steps in total.
15 
16 Next, a replica exchange run can be set up using the [ReplicaExchange0](@ref IMP::pmi::macros::ReplicaExchange0) macro:
17 
18 \code{.py}
19 mc1=IMP.pmi.macros.ReplicaExchange0(m,
20  root_hier=root_hier,
21  monte_carlo_sample_objects=dof.get_movers(),
22  output_objects=outputobjects,
23  crosslink_restraints=[xl1,xl2],
24  monte_carlo_temperature=1.0,
25  simulated_annealing=True,
26  simulated_annealing_minimum_temperature=1.0,
27  simulated_annealing_maximum_temperature=2.5,
28  simulated_annealing_minimum_temperature_nframes=200,
29  simulated_annealing_maximum_temperature_nframes=20,
30  replica_exchange_minimum_temperature=1.0,
31  replica_exchange_maximum_temperature=2.5,
32  number_of_best_scoring_models=100,
33  monte_carlo_steps=num_mc_steps,
34  number_of_frames=num_frames,
35  global_output_directory="output")
36 \endcode
37 
38 See the [ReplicaExchange0 documentation](@ref IMP::pmi::macros::ReplicaExchange0.__init__)
39 for a full description of all of the input parameters.
40 
41 The sampling is performed by executing the macro built above:
42 
43 \code{.py}
44 mc1.execute_macro()
45 \endcode
46 
47 ### Sampling Output
48 
49 The script generates an `output` directory containing the following:
50 * `pdbs`: a directory containing the 100 best-scoring models (see the `number_of_best_scoring_models` variable above) from the run, in PDB format.
51 * `rmfs`: a single [RMF file](https://integrativemodeling.org/rmf/) containing all the frames. RMF is a file format specially designed to store coarse-grained, multi-resolution and multi-state models such as those generated by %IMP. It is a compact binary format and (as in this case) can also be used to store multiple models or trajectories.
52 * Statistics from the sampling, contained in a "statfile", `stat.*.out`. This file contains information on each restraint, MC acceptance criteria and other things at each step.
53 
54 **Gathering Data from statfile**
55 Data from the stat file can be parsed and analyzed using two utilities:
56 * `process_output.py` - parses the statfile and returns columns of interest
57 * `plot_stat.sh` - plots one or two columns of data (requires [gnuplot](http://www.gnuplot.info/download.html))
58 
59 `process_output.py` usage:
60 
61 \code{.sh}
62 IMP_HOME/modules/pmi/pyext/process_output.py [-h] [-f FILENAME] [-s FIELDS [FIELDS ...]]
63  [-t SINGLE_COLUMN_FIELD] [-p] [--head]
64  [-n PRINT_RAW_NUMBER] [--soft]
65  [--search_field SEARCH_FIELD]
66  [--search_value SEARCH_VALUE] [--nframe]
67 \endcode
68 
69 `plot_stat.sh` usage:
70 \code{.sh}
71 IMP_HOME/modules/pmi/pyext/plot_stat.sh -i STATFILE -y YCOLUMN [-x XCOLUMN] [-m POINTS] [-plot] [-o OUTPUTFILE] [-b BEGIN]
72 #
73 # -i | input stat file name
74 # -y | column number with Y data values OR column header string
75 # -x | column number with X data values OR column header string
76 # -m | method of plotting. POINTS, LINES or LINESPOINTS
77 # -s | suppress showing plot
78 # -o | saves plot to png file with column header names
79 # -b | begin at this frame number
80 # -g | saves gnuplot file
81 # -h | prints this help text to screen
82 \endcode
83 
84 ---
85 
86 Analysis of the sampled models is described in \ref rnapolii_4.