<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://viper.lbl.gov:8080/cctbx.xfel/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Mona</id>
	<title>cctbx_xfel - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="http://viper.lbl.gov:8080/cctbx.xfel/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Mona"/>
	<link rel="alternate" type="text/html" href="http://viper.lbl.gov:8080/cctbx.xfel/index.php/Special:Contributions/Mona"/>
	<updated>2026-05-31T20:35:16Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.15</generator>
	<entry>
		<id>http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=2017_prime_tutorial&amp;diff=1402</id>
		<title>2017 prime tutorial</title>
		<link rel="alternate" type="text/html" href="http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=2017_prime_tutorial&amp;diff=1402"/>
		<updated>2017-02-14T20:38:21Z</updated>

		<summary type="html">&lt;p&gt;Mona: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Post-refine and Merge Sample Data Set with PRIME (2017 Tutorial)&lt;br /&gt;
&lt;br /&gt;
In this tutorial, we will work on the integration results from the first part of Tutorial 2 (Myoglobin Data). Before proceeding to running the program, we&#039;ll consider making the input file for PRIME based on the situation of this data set.&lt;br /&gt;
&lt;br /&gt;
== Generating Input File ==&lt;br /&gt;
&lt;br /&gt;
PRIME input files contain information necessary for successful post-refinement and merging steps. You can access and review the list of input parameters by running prime.run or prime.run -h to view the description of these parameters. For this tutorial we&#039;ll start building it from scratch.&lt;br /&gt;
&lt;br /&gt;
* Location of integration results&lt;br /&gt;
In this case, we know the location where the integration results (pickle files) are. We can then set,&lt;br /&gt;
&lt;br /&gt;
 data = /net/viper/raid1/mu238/XfelProject/dials17/extracted&lt;br /&gt;
&lt;br /&gt;
Note that you can supply data parameter as multiple arguments. The value of the parameter can be a file containing list of integration results or a folder.&lt;br /&gt;
&lt;br /&gt;
* Unit cell information &lt;br /&gt;
You can obtain the mean (or median) unit-cell dimensions from either IOTA or DIALS. In case of IOTA, prime .phil file is auto generated and this information is readily available in there. For n_residues, enter number of residues in asymmetric unit of your molecule.&lt;br /&gt;
&lt;br /&gt;
 target_unit_cell = 91.7 91.7 46 90 90 120&lt;br /&gt;
 target_space_group = P6&lt;br /&gt;
 n_residues = 128&lt;br /&gt;
&lt;br /&gt;
* Detector information&lt;br /&gt;
 pixel_size_mm = 0.172&lt;br /&gt;
&lt;br /&gt;
* Post-refinement and Scaling information&lt;br /&gt;
This is where you specify the optimal resolution cutoffs for post-refinement and merging. Note that when running for the first time on you newly collected data, you can choose the &amp;quot;expected&amp;quot; values (resolution which you see the spots at the corner or on the edge). You can then adjust these parameters when analyzing merging statistics based on the I/sigI values in the high resolution shells and rerun the program again. Note that sigma cutoffs are set to 1.5 in scaling and post-refinement steps while it&#039;s set to -3.0 so we can include negative values in the merged reflection set.  &lt;br /&gt;
 &lt;br /&gt;
 scale {&lt;br /&gt;
   d_min = 2.5&lt;br /&gt;
   d_max = 20&lt;br /&gt;
   sigma_min = 1.5&lt;br /&gt;
 }&lt;br /&gt;
 postref {&lt;br /&gt;
   scale {&lt;br /&gt;
     d_min = 2.5&lt;br /&gt;
     d_max = 20&lt;br /&gt;
     sigma_min = 1.5&lt;br /&gt;
     partiality_min = 0.1&lt;br /&gt;
   allparams {&lt;br /&gt;
     flag_on = True&lt;br /&gt;
     d_min = 2.5&lt;br /&gt;
     d_max = 20&lt;br /&gt;
     sigma_min = 1.5&lt;br /&gt;
     partiality_min = 0.1&lt;br /&gt;
     uc_tolerance = 5&lt;br /&gt;
   }&lt;br /&gt;
 }&lt;br /&gt;
 merge {&lt;br /&gt;
   d_min = 2.5&lt;br /&gt;
   d_max = 20&lt;br /&gt;
   sigma_min = -3.0&lt;br /&gt;
   partiality_min = 0.1&lt;br /&gt;
   uc_tolerance = 5&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
* Indexing ambiguity&lt;br /&gt;
For other sets that are not in polar space or have indexing ambiguity (when one or more of the unit-cell dimensions are very similar but not the same!), you can very well use the .phil file parameters thus far to proceed and run post-refinement. However, this data set is in P6 (polar space group) and therefore, the indexing ambiguity needs to be resolved prior to other refinement and merging steps.&lt;br /&gt;
&lt;br /&gt;
Other point worth noting is for any polar space groups, PRIME will automatically solve the ambiguity based on the default parameters. However, this data set has about 5,000 integration results so we want to make sure that we modify the number of images used for random and best selections.&lt;br /&gt;
&lt;br /&gt;
 indexing_ambiguity {&lt;br /&gt;
  mode = Auto&lt;br /&gt;
  index_basis_in = None&lt;br /&gt;
  assigned_basis = None&lt;br /&gt;
  d_min = 3.0&lt;br /&gt;
  d_max = 10.0&lt;br /&gt;
  sigma_min = 1.5&lt;br /&gt;
  n_sample_frames = 1000&lt;br /&gt;
  n_selected_frames = 100&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
We left other parameters to their default value and modified n_sample_frames to 1000 and n_selected_frames to 100.&lt;br /&gt;
&lt;br /&gt;
* No. of Bin&lt;br /&gt;
 n_bins = 10&lt;br /&gt;
&lt;br /&gt;
Now we have a complete .phil file ready to run.&lt;br /&gt;
&lt;br /&gt;
 data = /net/viper/raid1/mu238/XfelProject/dials17/extracted&lt;br /&gt;
 target_unit_cell = 91.7 91.7 46 90 90 120&lt;br /&gt;
 target_space_group = P6&lt;br /&gt;
 n_residues = 128&lt;br /&gt;
 pixel_size_mm = 0.172&lt;br /&gt;
 scale {&lt;br /&gt;
  d_min = 2.5&lt;br /&gt;
  d_max = 20&lt;br /&gt;
  sigma_min = 1.5&lt;br /&gt;
 }&lt;br /&gt;
 postref {&lt;br /&gt;
  scale {&lt;br /&gt;
    d_min = 2.5&lt;br /&gt;
    d_max = 20&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
  }&lt;br /&gt;
  allparams {&lt;br /&gt;
    flag_on = True&lt;br /&gt;
    d_min = 2.5&lt;br /&gt;
    d_max = 20&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
    uc_tolerance = 5&lt;br /&gt;
  }&lt;br /&gt;
 }&lt;br /&gt;
 merge {&lt;br /&gt;
  d_min = 2.5&lt;br /&gt;
  d_max = 20&lt;br /&gt;
  sigma_min = -3.0&lt;br /&gt;
  partiality_min = 0.1&lt;br /&gt;
  uc_tolerance = 5&lt;br /&gt;
 }&lt;br /&gt;
 indexing_ambiguity {&lt;br /&gt;
  mode = Auto&lt;br /&gt;
  index_basis_in = None&lt;br /&gt;
  assigned_basis = None&lt;br /&gt;
  d_min = 3.0&lt;br /&gt;
  d_max = 10.0&lt;br /&gt;
  sigma_min = 1.5&lt;br /&gt;
  n_sample_frames = 1000&lt;br /&gt;
  n_selected_frames = 100&lt;br /&gt;
 }&lt;br /&gt;
 n_bins = 10&lt;br /&gt;
&lt;br /&gt;
Copy and paste this set of parameter in an editor then save the file as &amp;quot;prime.phil&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
== Running the Program ==&lt;br /&gt;
You can run the program by giving it an input file:&lt;br /&gt;
&lt;br /&gt;
 prime.run prime.phil&lt;br /&gt;
&lt;br /&gt;
For this tutorial, PRIME will score the randomly selected 1,000 images then select the best 100 for running Brehm &amp;amp; Diederichs algorithm in Bootstrap mode. If you run the program with flag_plot=True, you&#039;ll see a plot showing two separated clusters, each representing images with matching assigned basis. &lt;br /&gt;
&lt;br /&gt;
[https://commons.wikimedia.org/wiki/File:Dials17_myo_indexing_ambiguity.png Results of Running Indexing Ambiguity with Boostrap]&lt;br /&gt;
&lt;br /&gt;
[https://commons.wikimedia.org/wiki/File:Dials17_indexing_ambiguity_clustering.gif Results of Image Clustering]&lt;br /&gt;
&lt;br /&gt;
PRIME will select on of these two clusters and merge it to get a reference set for the Bootstrap step. Here, the remaining images will get assigned with a basis that makes it correlate best with the reference set.&lt;br /&gt;
&lt;br /&gt;
Once all images are assigned with appropriate basis, PRIME will proceed to scaling and post-refinement steps. After three post-refinement cycles (default value), the process is done and here is the output of the program.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 Isotropic B-factor:     5.30&lt;br /&gt;
 No. of reflections&lt;br /&gt;
  all:                   7786&lt;br /&gt;
  outside resolution:      51&lt;br /&gt;
  outliers:                 0&lt;br /&gt;
  total left:            7735&lt;br /&gt;
 Summary for Prime_Run_1/postref_cycle_3_merge.mtz&lt;br /&gt;
 Bin Resolution Range     Completeness       N_obs  |Rmerge  Rsplit   CC1/2   N_ind |CCiso   N_ind|CCanoma  N_ind|  I/sigI     I      sigI      I**2 &lt;br /&gt;
 --------------------------------------------------------------------------------------------------------------------------------------------------&lt;br /&gt;
 01   19.88 -    5.35 100.0    807 /    807  189.78   85.75    8.87   98.43    807    0.00      0    0.00      0     4.46      684.2    136.2   3.57&lt;br /&gt;
 02    5.35 -    4.26 100.0    782 /    782  140.90   73.61    8.89   97.67    782    0.00      0    0.00      0     5.23      794.3    140.3   2.05&lt;br /&gt;
 03    4.26 -    3.73 100.0    788 /    788  129.32   69.32    8.70   98.11    788    0.00      0    0.00      0     5.41      878.5    150.3   1.95&lt;br /&gt;
 04    3.73 -    3.39 100.0    765 /    765  117.75   70.72    9.67   97.55    765    0.00      0    0.00      0     4.12      712.3    162.4   1.88&lt;br /&gt;
 05    3.39 -    3.15 100.0    770 /    770  113.22   71.61   11.22   88.54    770    0.00      0    0.00      0     2.73      500.1    173.7   2.19&lt;br /&gt;
 06    3.15 -    2.96 100.0    767 /    767  106.12   73.19   11.07   97.21    767    0.00      0    0.00      0     2.09      404.6    183.8   2.02&lt;br /&gt;
 07    2.96 -    2.81 100.0    766 /    766  103.73   75.79   12.53   96.62    766    0.00      0    0.00      0     1.72      345.3    193.9   1.89&lt;br /&gt;
 08    2.81 -    2.69 100.0    745 /    745  101.51   76.11   12.84   96.21    745    0.00      0    0.00      0     1.49      317.3    204.1   1.98&lt;br /&gt;
 09    2.69 -    2.59 100.0    786 /    786   97.88   77.59   14.19   95.40    786    0.00      0    0.00      0     1.38      299.0    209.3   1.86&lt;br /&gt;
 10    2.59 -    2.50 100.0    759 /    759   92.53   78.61   14.72   96.51    759    0.00      0    0.00      0     1.36      312.4    218.8   2.07&lt;br /&gt;
 --------------------------------------------------------------------------------------------------------------------------------------------------&lt;br /&gt;
         TOTAL        100.0   7735 /   7735  119.73   75.51   10.45   97.21   7735    0.00      0    0.00      0     3.02      527.3    176.9   2.56&lt;br /&gt;
 --------------------------------------------------------------------------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
 Summary of CC1/2 on three crystal axes&lt;br /&gt;
 Bin Resolution Range           CC1/2                       I                           N_refl           &lt;br /&gt;
                        a*      b*      c*  |      a*        b*       c*    |    a*      b*     c*      &lt;br /&gt;
 ---------------------------------------------------------------------------------------------------------&lt;br /&gt;
 01   19.88 -    5.35   97.01   98.64   98.23      528.6      559.6     1216.7     42     51     47&lt;br /&gt;
 02    5.35 -    4.26   97.64   98.43   99.08      817.6      527.5      964.9     43     44     40&lt;br /&gt;
 03    4.26 -    3.73   96.31   98.02   97.68      605.7      682.9      856.0     39     39     41&lt;br /&gt;
 04    3.73 -    3.39   98.49   98.55   97.73      961.9      532.6      729.1     42     37     45&lt;br /&gt;
 05    3.39 -    3.15   96.88   98.38   92.69      449.5      492.1      721.6     39     39     40&lt;br /&gt;
 06    3.15 -    2.96   98.48   93.58   98.61      389.9      303.4      391.7     39     37     39&lt;br /&gt;
 07    2.96 -    2.81   96.98   98.02   95.35      361.3      331.7      383.2     42     37     43&lt;br /&gt;
 08    2.81 -    2.69   95.29   94.02   94.69      290.8      194.7      292.7     41     35     36&lt;br /&gt;
 09    2.69 -    2.59   96.55   91.88   98.57      265.7      341.4      290.2     41     35     44&lt;br /&gt;
 10    2.59 -    2.50   94.44   97.81   96.67      249.0      400.1      236.2     42     36     40&lt;br /&gt;
 ----------------------------------------------------------------------------------------------------------&lt;br /&gt;
        total           97.57   97.74   94.58      494.1      446.0      619.4    410    390    415&lt;br /&gt;
 ----------------------------------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
 Summary of refinement and merging&lt;br /&gt;
 No. good frames:                  4733&lt;br /&gt;
 No. bad cc frames:                 113&lt;br /&gt;
 No. bad G frames) :                109&lt;br /&gt;
 No. bad unit cell frames:           20&lt;br /&gt;
 No. bad gamma_e frames:             22&lt;br /&gt;
 No. bad SE:                          2&lt;br /&gt;
 No. observations:               935265&lt;br /&gt;
 Mean target value (BEFORE: Mean Median (Std.))&lt;br /&gt;
 post-refinement:                301.22       259.10 (   171.56)&lt;br /&gt;
 (x,y) restraints:              1679.63      1573.15 (   657.49)&lt;br /&gt;
 Mean target value (AFTER: Mean Median (Std.))&lt;br /&gt;
 post-refinement:                300.02       257.53 (   170.98)&lt;br /&gt;
 (x,y) restraints:              1679.90      1572.77 (   660.19)&lt;br /&gt;
 SE:                            1915.60       776.84 ( 33765.97)&lt;br /&gt;
 G:                           1.000e+00    8.971e-01 ( 8.15e-01)&lt;br /&gt;
 B:                               11.83        14.45 (    11.95)&lt;br /&gt;
 Rot.x:                           -0.08         0.00 (    12.10)&lt;br /&gt;
 Rot.y:                            0.14         0.00 (     9.62)&lt;br /&gt;
 gamma_y:                       0.00000      0.00000 (  0.00000)&lt;br /&gt;
 gamma_z:                       0.00000      0.00000 (  0.00000)&lt;br /&gt;
 gamma_0:                       0.03793      0.00019 (  0.60820)&lt;br /&gt;
 gamma_e:                      -0.12824      0.00145 (  0.60227)&lt;br /&gt;
 voigt_nu:                      0.50000      0.50000 (  0.00000)&lt;br /&gt;
 unit cell&lt;br /&gt;
   a:                             91.45        91.45 (     0.11)&lt;br /&gt;
   b:                             91.45        91.45 (     0.11)&lt;br /&gt;
   c:                             45.96        45.96 (     0.12)&lt;br /&gt;
   alpha:                         90.00        90.00 (     0.00)&lt;br /&gt;
   beta:                          90.00        90.00 (     0.00)&lt;br /&gt;
   gamma:                        120.00       120.00 (     0.00)&lt;br /&gt;
 Parmeters from integration (not-refined)&lt;br /&gt;
  Wavelength:                   0.96861      0.96861 (  0.00000)&lt;br /&gt;
  Detector distance:          303.81868    303.81868 (  0.00000)&lt;br /&gt;
 * (standard deviation)&lt;br /&gt;
&lt;br /&gt;
 Total calculation time: 542.00 seconds&lt;br /&gt;
 Finished: Tuesday 14. February 2017 10:53:18&lt;br /&gt;
&lt;br /&gt;
== Obtaining the Output ==&lt;br /&gt;
&lt;br /&gt;
Your output will be in Prime_Run_n (where n is the number of run). &lt;br /&gt;
&lt;br /&gt;
 -bash-4.1$ ls Prime_Run_1/ -l&lt;br /&gt;
 total 9076&lt;br /&gt;
 -rw-r--r-- 1 mu238 camb  879638 Feb 14 10:53 crystal.o&lt;br /&gt;
 drwxr-xr-x 2 mu238 camb     104 Feb 14 10:46 index_ambiguity&lt;br /&gt;
 drwxr-xr-x 2 mu238 camb       6 Feb 14 10:44 isoform_cluster&lt;br /&gt;
 -rw-r--r-- 1 mu238 camb   32704 Feb 14 10:53 log.txt&lt;br /&gt;
 -rw-r--r-- 1 mu238 camb  324556 Feb 14 10:47 mean_scaled_merge.hkl&lt;br /&gt;
 -rw-r--r-- 1 mu238 camb  157260 Feb 14 10:47 mean_scaled_merge.mtz&lt;br /&gt;
 -rw-r--r-- 1 mu238 camb   15753 Feb 14 10:53 pickle.stat&lt;br /&gt;
 -rw-r--r-- 1 mu238 camb  324381 Feb 14 10:49 postref_cycle_1_merge.hkl&lt;br /&gt;
 -rw-r--r-- 1 mu238 camb  157260 Feb 14 10:49 postref_cycle_1_merge.mtz&lt;br /&gt;
 -rw-r--r-- 1 mu238 camb  324515 Feb 14 10:51 postref_cycle_2_merge.hkl&lt;br /&gt;
 -rw-r--r-- 1 mu238 camb  157260 Feb 14 10:51 postref_cycle_2_merge.mtz&lt;br /&gt;
 -rw-r--r-- 1 mu238 camb  324716 Feb 14 10:53 postref_cycle_3_merge.hkl&lt;br /&gt;
 -rw-r--r-- 1 mu238 camb  157340 Feb 14 10:53 postref_cycle_3_merge.mtz&lt;br /&gt;
 -rw-r--r-- 1 mu238 camb 6412200 Feb 14 10:53 rejections.txt&lt;br /&gt;
&lt;br /&gt;
File log.txt contains all the merging stats. The final merged reflection set is postref_cycle_3_merge.mtz (or .hkl).&lt;/div&gt;</summary>
		<author><name>Mona</name></author>
	</entry>
	<entry>
		<id>http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=2017_prime_tutorial&amp;diff=1401</id>
		<title>2017 prime tutorial</title>
		<link rel="alternate" type="text/html" href="http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=2017_prime_tutorial&amp;diff=1401"/>
		<updated>2017-02-14T20:37:23Z</updated>

		<summary type="html">&lt;p&gt;Mona: /* Generating Input File */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Post-refine and Merge Sample Data Set with PRIME (2017 Tutorial)&lt;br /&gt;
&lt;br /&gt;
In this tutorial, we will work on the integration results from the first of Tutorial 2 (Myoglobin Data). Before proceeding to running the program, we&#039;ll consider making the input file for PRIME based on the situation of this data set.&lt;br /&gt;
&lt;br /&gt;
== Generating Input File ==&lt;br /&gt;
&lt;br /&gt;
PRIME input files contain information necessary for successful post-refinement and merging steps. You can access and review the list of input parameters by running prime.run or prime.run -h to view the description of these parameters. For this tutorial we&#039;ll start building it from scratch.&lt;br /&gt;
&lt;br /&gt;
* Location of integration results&lt;br /&gt;
In this case, we know the location where the integration results (pickle files) are. We can then set,&lt;br /&gt;
&lt;br /&gt;
 data = /net/viper/raid1/mu238/XfelProject/dials17/extracted&lt;br /&gt;
&lt;br /&gt;
Note that you can supply data parameter as multiple arguments. The value of the parameter can be a file containing list of integration results or a folder.&lt;br /&gt;
&lt;br /&gt;
* Unit cell information &lt;br /&gt;
You can obtain the mean (or median) unit-cell dimensions from either IOTA or DIALS. In case of IOTA, prime .phil file is auto generated and this information is readily available in there. For n_residues, enter number of residues in asymmetric unit of your molecule.&lt;br /&gt;
&lt;br /&gt;
 target_unit_cell = 91.7 91.7 46 90 90 120&lt;br /&gt;
 target_space_group = P6&lt;br /&gt;
 n_residues = 128&lt;br /&gt;
&lt;br /&gt;
* Detector information&lt;br /&gt;
 pixel_size_mm = 0.172&lt;br /&gt;
&lt;br /&gt;
* Post-refinement and Scaling information&lt;br /&gt;
This is where you specify the optimal resolution cutoffs for post-refinement and merging. Note that when running for the first time on you newly collected data, you can choose the &amp;quot;expected&amp;quot; values (resolution which you see the spots at the corner or on the edge). You can then adjust these parameters when analyzing merging statistics based on the I/sigI values in the high resolution shells and rerun the program again. Note that sigma cutoffs are set to 1.5 in scaling and post-refinement steps while it&#039;s set to -3.0 so we can include negative values in the merged reflection set.  &lt;br /&gt;
 &lt;br /&gt;
 scale {&lt;br /&gt;
   d_min = 2.5&lt;br /&gt;
   d_max = 20&lt;br /&gt;
   sigma_min = 1.5&lt;br /&gt;
 }&lt;br /&gt;
 postref {&lt;br /&gt;
   scale {&lt;br /&gt;
     d_min = 2.5&lt;br /&gt;
     d_max = 20&lt;br /&gt;
     sigma_min = 1.5&lt;br /&gt;
     partiality_min = 0.1&lt;br /&gt;
   allparams {&lt;br /&gt;
     flag_on = True&lt;br /&gt;
     d_min = 2.5&lt;br /&gt;
     d_max = 20&lt;br /&gt;
     sigma_min = 1.5&lt;br /&gt;
     partiality_min = 0.1&lt;br /&gt;
     uc_tolerance = 5&lt;br /&gt;
   }&lt;br /&gt;
 }&lt;br /&gt;
 merge {&lt;br /&gt;
   d_min = 2.5&lt;br /&gt;
   d_max = 20&lt;br /&gt;
   sigma_min = -3.0&lt;br /&gt;
   partiality_min = 0.1&lt;br /&gt;
   uc_tolerance = 5&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
* Indexing ambiguity&lt;br /&gt;
For other sets that are not in polar space or have indexing ambiguity (when one or more of the unit-cell dimensions are very similar but not the same!), you can very well use the .phil file parameters thus far to proceed and run post-refinement. However, this data set is in P6 (polar space group) and therefore, the indexing ambiguity needs to be resolved prior to other refinement and merging steps.&lt;br /&gt;
&lt;br /&gt;
Other point worth noting is for any polar space groups, PRIME will automatically solve the ambiguity based on the default parameters. However, this data set has about 5,000 integration results so we want to make sure that we modify the number of images used for random and best selections.&lt;br /&gt;
&lt;br /&gt;
 indexing_ambiguity {&lt;br /&gt;
  mode = Auto&lt;br /&gt;
  index_basis_in = None&lt;br /&gt;
  assigned_basis = None&lt;br /&gt;
  d_min = 3.0&lt;br /&gt;
  d_max = 10.0&lt;br /&gt;
  sigma_min = 1.5&lt;br /&gt;
  n_sample_frames = 1000&lt;br /&gt;
  n_selected_frames = 100&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
We left other parameters to their default value and modified n_sample_frames to 1000 and n_selected_frames to 100.&lt;br /&gt;
&lt;br /&gt;
* No. of Bin&lt;br /&gt;
 n_bins = 10&lt;br /&gt;
&lt;br /&gt;
Now we have a complete .phil file ready to run.&lt;br /&gt;
&lt;br /&gt;
 data = /net/viper/raid1/mu238/XfelProject/dials17/extracted&lt;br /&gt;
 target_unit_cell = 91.7 91.7 46 90 90 120&lt;br /&gt;
 target_space_group = P6&lt;br /&gt;
 n_residues = 128&lt;br /&gt;
 pixel_size_mm = 0.172&lt;br /&gt;
 scale {&lt;br /&gt;
  d_min = 2.5&lt;br /&gt;
  d_max = 20&lt;br /&gt;
  sigma_min = 1.5&lt;br /&gt;
 }&lt;br /&gt;
 postref {&lt;br /&gt;
  scale {&lt;br /&gt;
    d_min = 2.5&lt;br /&gt;
    d_max = 20&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
  }&lt;br /&gt;
  allparams {&lt;br /&gt;
    flag_on = True&lt;br /&gt;
    d_min = 2.5&lt;br /&gt;
    d_max = 20&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
    uc_tolerance = 5&lt;br /&gt;
  }&lt;br /&gt;
 }&lt;br /&gt;
 merge {&lt;br /&gt;
  d_min = 2.5&lt;br /&gt;
  d_max = 20&lt;br /&gt;
  sigma_min = -3.0&lt;br /&gt;
  partiality_min = 0.1&lt;br /&gt;
  uc_tolerance = 5&lt;br /&gt;
 }&lt;br /&gt;
 indexing_ambiguity {&lt;br /&gt;
  mode = Auto&lt;br /&gt;
  index_basis_in = None&lt;br /&gt;
  assigned_basis = None&lt;br /&gt;
  d_min = 3.0&lt;br /&gt;
  d_max = 10.0&lt;br /&gt;
  sigma_min = 1.5&lt;br /&gt;
  n_sample_frames = 1000&lt;br /&gt;
  n_selected_frames = 100&lt;br /&gt;
 }&lt;br /&gt;
 n_bins = 10&lt;br /&gt;
&lt;br /&gt;
Copy and paste this set of parameter in an editor then save the file as &amp;quot;prime.phil&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
== Running the Program ==&lt;br /&gt;
You can run the program by giving it an input file:&lt;br /&gt;
&lt;br /&gt;
 prime.run prime.phil&lt;br /&gt;
&lt;br /&gt;
For this tutorial, PRIME will score the randomly selected 1,000 images then select the best 100 for running Brehm &amp;amp; Diederichs algorithm in Bootstrap mode. If you run the program with flag_plot=True, you&#039;ll see a plot showing two separated clusters, each representing images with matching assigned basis. &lt;br /&gt;
&lt;br /&gt;
[https://commons.wikimedia.org/wiki/File:Dials17_myo_indexing_ambiguity.png Results of Running Indexing Ambiguity with Boostrap]&lt;br /&gt;
&lt;br /&gt;
[https://commons.wikimedia.org/wiki/File:Dials17_indexing_ambiguity_clustering.gif Results of Image Clustering]&lt;br /&gt;
&lt;br /&gt;
PRIME will select on of these two clusters and merge it to get a reference set for the Bootstrap step. Here, the remaining images will get assigned with a basis that makes it correlate best with the reference set.&lt;br /&gt;
&lt;br /&gt;
Once all images are assigned with appropriate basis, PRIME will proceed to scaling and post-refinement steps. After three post-refinement cycles (default value), the process is done and here is the output of the program.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 Isotropic B-factor:     5.30&lt;br /&gt;
 No. of reflections&lt;br /&gt;
  all:                   7786&lt;br /&gt;
  outside resolution:      51&lt;br /&gt;
  outliers:                 0&lt;br /&gt;
  total left:            7735&lt;br /&gt;
 Summary for Prime_Run_1/postref_cycle_3_merge.mtz&lt;br /&gt;
 Bin Resolution Range     Completeness       N_obs  |Rmerge  Rsplit   CC1/2   N_ind |CCiso   N_ind|CCanoma  N_ind|  I/sigI     I      sigI      I**2 &lt;br /&gt;
 --------------------------------------------------------------------------------------------------------------------------------------------------&lt;br /&gt;
 01   19.88 -    5.35 100.0    807 /    807  189.78   85.75    8.87   98.43    807    0.00      0    0.00      0     4.46      684.2    136.2   3.57&lt;br /&gt;
 02    5.35 -    4.26 100.0    782 /    782  140.90   73.61    8.89   97.67    782    0.00      0    0.00      0     5.23      794.3    140.3   2.05&lt;br /&gt;
 03    4.26 -    3.73 100.0    788 /    788  129.32   69.32    8.70   98.11    788    0.00      0    0.00      0     5.41      878.5    150.3   1.95&lt;br /&gt;
 04    3.73 -    3.39 100.0    765 /    765  117.75   70.72    9.67   97.55    765    0.00      0    0.00      0     4.12      712.3    162.4   1.88&lt;br /&gt;
 05    3.39 -    3.15 100.0    770 /    770  113.22   71.61   11.22   88.54    770    0.00      0    0.00      0     2.73      500.1    173.7   2.19&lt;br /&gt;
 06    3.15 -    2.96 100.0    767 /    767  106.12   73.19   11.07   97.21    767    0.00      0    0.00      0     2.09      404.6    183.8   2.02&lt;br /&gt;
 07    2.96 -    2.81 100.0    766 /    766  103.73   75.79   12.53   96.62    766    0.00      0    0.00      0     1.72      345.3    193.9   1.89&lt;br /&gt;
 08    2.81 -    2.69 100.0    745 /    745  101.51   76.11   12.84   96.21    745    0.00      0    0.00      0     1.49      317.3    204.1   1.98&lt;br /&gt;
 09    2.69 -    2.59 100.0    786 /    786   97.88   77.59   14.19   95.40    786    0.00      0    0.00      0     1.38      299.0    209.3   1.86&lt;br /&gt;
 10    2.59 -    2.50 100.0    759 /    759   92.53   78.61   14.72   96.51    759    0.00      0    0.00      0     1.36      312.4    218.8   2.07&lt;br /&gt;
 --------------------------------------------------------------------------------------------------------------------------------------------------&lt;br /&gt;
         TOTAL        100.0   7735 /   7735  119.73   75.51   10.45   97.21   7735    0.00      0    0.00      0     3.02      527.3    176.9   2.56&lt;br /&gt;
 --------------------------------------------------------------------------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
 Summary of CC1/2 on three crystal axes&lt;br /&gt;
 Bin Resolution Range           CC1/2                       I                           N_refl           &lt;br /&gt;
                        a*      b*      c*  |      a*        b*       c*    |    a*      b*     c*      &lt;br /&gt;
 ---------------------------------------------------------------------------------------------------------&lt;br /&gt;
 01   19.88 -    5.35   97.01   98.64   98.23      528.6      559.6     1216.7     42     51     47&lt;br /&gt;
 02    5.35 -    4.26   97.64   98.43   99.08      817.6      527.5      964.9     43     44     40&lt;br /&gt;
 03    4.26 -    3.73   96.31   98.02   97.68      605.7      682.9      856.0     39     39     41&lt;br /&gt;
 04    3.73 -    3.39   98.49   98.55   97.73      961.9      532.6      729.1     42     37     45&lt;br /&gt;
 05    3.39 -    3.15   96.88   98.38   92.69      449.5      492.1      721.6     39     39     40&lt;br /&gt;
 06    3.15 -    2.96   98.48   93.58   98.61      389.9      303.4      391.7     39     37     39&lt;br /&gt;
 07    2.96 -    2.81   96.98   98.02   95.35      361.3      331.7      383.2     42     37     43&lt;br /&gt;
 08    2.81 -    2.69   95.29   94.02   94.69      290.8      194.7      292.7     41     35     36&lt;br /&gt;
 09    2.69 -    2.59   96.55   91.88   98.57      265.7      341.4      290.2     41     35     44&lt;br /&gt;
 10    2.59 -    2.50   94.44   97.81   96.67      249.0      400.1      236.2     42     36     40&lt;br /&gt;
 ----------------------------------------------------------------------------------------------------------&lt;br /&gt;
        total           97.57   97.74   94.58      494.1      446.0      619.4    410    390    415&lt;br /&gt;
 ----------------------------------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
 Summary of refinement and merging&lt;br /&gt;
 No. good frames:                  4733&lt;br /&gt;
 No. bad cc frames:                 113&lt;br /&gt;
 No. bad G frames) :                109&lt;br /&gt;
 No. bad unit cell frames:           20&lt;br /&gt;
 No. bad gamma_e frames:             22&lt;br /&gt;
 No. bad SE:                          2&lt;br /&gt;
 No. observations:               935265&lt;br /&gt;
 Mean target value (BEFORE: Mean Median (Std.))&lt;br /&gt;
 post-refinement:                301.22       259.10 (   171.56)&lt;br /&gt;
 (x,y) restraints:              1679.63      1573.15 (   657.49)&lt;br /&gt;
 Mean target value (AFTER: Mean Median (Std.))&lt;br /&gt;
 post-refinement:                300.02       257.53 (   170.98)&lt;br /&gt;
 (x,y) restraints:              1679.90      1572.77 (   660.19)&lt;br /&gt;
 SE:                            1915.60       776.84 ( 33765.97)&lt;br /&gt;
 G:                           1.000e+00    8.971e-01 ( 8.15e-01)&lt;br /&gt;
 B:                               11.83        14.45 (    11.95)&lt;br /&gt;
 Rot.x:                           -0.08         0.00 (    12.10)&lt;br /&gt;
 Rot.y:                            0.14         0.00 (     9.62)&lt;br /&gt;
 gamma_y:                       0.00000      0.00000 (  0.00000)&lt;br /&gt;
 gamma_z:                       0.00000      0.00000 (  0.00000)&lt;br /&gt;
 gamma_0:                       0.03793      0.00019 (  0.60820)&lt;br /&gt;
 gamma_e:                      -0.12824      0.00145 (  0.60227)&lt;br /&gt;
 voigt_nu:                      0.50000      0.50000 (  0.00000)&lt;br /&gt;
 unit cell&lt;br /&gt;
   a:                             91.45        91.45 (     0.11)&lt;br /&gt;
   b:                             91.45        91.45 (     0.11)&lt;br /&gt;
   c:                             45.96        45.96 (     0.12)&lt;br /&gt;
   alpha:                         90.00        90.00 (     0.00)&lt;br /&gt;
   beta:                          90.00        90.00 (     0.00)&lt;br /&gt;
   gamma:                        120.00       120.00 (     0.00)&lt;br /&gt;
 Parmeters from integration (not-refined)&lt;br /&gt;
  Wavelength:                   0.96861      0.96861 (  0.00000)&lt;br /&gt;
  Detector distance:          303.81868    303.81868 (  0.00000)&lt;br /&gt;
 * (standard deviation)&lt;br /&gt;
&lt;br /&gt;
 Total calculation time: 542.00 seconds&lt;br /&gt;
 Finished: Tuesday 14. February 2017 10:53:18&lt;br /&gt;
&lt;br /&gt;
== Obtaining the Output ==&lt;br /&gt;
&lt;br /&gt;
Your output will be in Prime_Run_n (where n is the number of run). &lt;br /&gt;
&lt;br /&gt;
 -bash-4.1$ ls Prime_Run_1/ -l&lt;br /&gt;
 total 9076&lt;br /&gt;
 -rw-r--r-- 1 mu238 camb  879638 Feb 14 10:53 crystal.o&lt;br /&gt;
 drwxr-xr-x 2 mu238 camb     104 Feb 14 10:46 index_ambiguity&lt;br /&gt;
 drwxr-xr-x 2 mu238 camb       6 Feb 14 10:44 isoform_cluster&lt;br /&gt;
 -rw-r--r-- 1 mu238 camb   32704 Feb 14 10:53 log.txt&lt;br /&gt;
 -rw-r--r-- 1 mu238 camb  324556 Feb 14 10:47 mean_scaled_merge.hkl&lt;br /&gt;
 -rw-r--r-- 1 mu238 camb  157260 Feb 14 10:47 mean_scaled_merge.mtz&lt;br /&gt;
 -rw-r--r-- 1 mu238 camb   15753 Feb 14 10:53 pickle.stat&lt;br /&gt;
 -rw-r--r-- 1 mu238 camb  324381 Feb 14 10:49 postref_cycle_1_merge.hkl&lt;br /&gt;
 -rw-r--r-- 1 mu238 camb  157260 Feb 14 10:49 postref_cycle_1_merge.mtz&lt;br /&gt;
 -rw-r--r-- 1 mu238 camb  324515 Feb 14 10:51 postref_cycle_2_merge.hkl&lt;br /&gt;
 -rw-r--r-- 1 mu238 camb  157260 Feb 14 10:51 postref_cycle_2_merge.mtz&lt;br /&gt;
 -rw-r--r-- 1 mu238 camb  324716 Feb 14 10:53 postref_cycle_3_merge.hkl&lt;br /&gt;
 -rw-r--r-- 1 mu238 camb  157340 Feb 14 10:53 postref_cycle_3_merge.mtz&lt;br /&gt;
 -rw-r--r-- 1 mu238 camb 6412200 Feb 14 10:53 rejections.txt&lt;br /&gt;
&lt;br /&gt;
File log.txt contains all the merging stats. The final merged reflection set is postref_cycle_3_merge.mtz (or .hkl).&lt;/div&gt;</summary>
		<author><name>Mona</name></author>
	</entry>
	<entry>
		<id>http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=2017_prime_tutorial&amp;diff=1400</id>
		<title>2017 prime tutorial</title>
		<link rel="alternate" type="text/html" href="http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=2017_prime_tutorial&amp;diff=1400"/>
		<updated>2017-02-14T20:02:38Z</updated>

		<summary type="html">&lt;p&gt;Mona: /* Running the Program */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Post-refine and Merge Sample Data Set with PRIME (2017 Tutorial)&lt;br /&gt;
&lt;br /&gt;
In this tutorial, we will work on the integration results from the first of Tutorial 2 (Myoglobin Data). Before proceeding to running the program, we&#039;ll consider making the input file for PRIME based on the situation of this data set.&lt;br /&gt;
&lt;br /&gt;
== Generating Input File ==&lt;br /&gt;
&lt;br /&gt;
PRIME input files contain information necessary for successful post-refinement and merging steps. You can access and review the list of input parameters by running prime.run or prime.run -h to view the description of these parameters. For this tutorial we&#039;ll start building it from scratch.&lt;br /&gt;
&lt;br /&gt;
* Location of integration results&lt;br /&gt;
In this case, we know the location where the integration results (pickle files) are. We can then set,&lt;br /&gt;
&lt;br /&gt;
 data = /net/viper/raid1/mu238/XfelProject/dials17/extracted&lt;br /&gt;
&lt;br /&gt;
Note that you supply data as a multiple arguments. The value of the parameter can be a file containing list of integration results, a folder, or a wildcard argument.&lt;br /&gt;
&lt;br /&gt;
* Unit cell information &lt;br /&gt;
You can obtain the mean (or median) unit-cell dimensions from either IOTA or DIALS. In case of IOTA, prime .phil file is auto generated and this information is readily available in there. For n_residues, enter number of residues in asymmetric unit of your molecule.&lt;br /&gt;
&lt;br /&gt;
 target_unit_cell = 91.7 91.7 46 90 90 120&lt;br /&gt;
 target_space_group = P6&lt;br /&gt;
 n_residues = 128&lt;br /&gt;
&lt;br /&gt;
* Detector information&lt;br /&gt;
 pixel_size_mm = 0.172&lt;br /&gt;
&lt;br /&gt;
* Post-refinement and Scaling information&lt;br /&gt;
This is where you specify the optimal resolution cutoffs for post-refinement and merging. Note that when running for the first time on you newly collected data, you can choose the &amp;quot;expected&amp;quot; values (resolution which you see the spots at the corner or on the edge). You can then adjust these parameters when analyzing merging statistics based on the I/sigI values in the high resolution shells and rerun the program again. Note that sigma cutoffs are set to 1.5 in scaling and post-refinement steps while it&#039;s set to -3.0 so we can include negative values in the merged reflection set.  &lt;br /&gt;
 &lt;br /&gt;
 scale {&lt;br /&gt;
   d_min = 2.5&lt;br /&gt;
   d_max = 20&lt;br /&gt;
   sigma_min = 1.5&lt;br /&gt;
 }&lt;br /&gt;
 postref {&lt;br /&gt;
   scale {&lt;br /&gt;
     d_min = 2.5&lt;br /&gt;
     d_max = 20&lt;br /&gt;
     sigma_min = 1.5&lt;br /&gt;
     partiality_min = 0.1&lt;br /&gt;
   allparams {&lt;br /&gt;
     flag_on = True&lt;br /&gt;
     d_min = 2.5&lt;br /&gt;
     d_max = 20&lt;br /&gt;
     sigma_min = 1.5&lt;br /&gt;
     partiality_min = 0.1&lt;br /&gt;
     uc_tolerance = 5&lt;br /&gt;
   }&lt;br /&gt;
 }&lt;br /&gt;
 merge {&lt;br /&gt;
   d_min = 2.5&lt;br /&gt;
   d_max = 20&lt;br /&gt;
   sigma_min = -3.0&lt;br /&gt;
   partiality_min = 0.1&lt;br /&gt;
   uc_tolerance = 5&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
* Indexing ambiguity&lt;br /&gt;
For other sets that are not in polar space or have indexing ambiguity (when one or more of the unit-cell dimensions are very similar but not the same!), you can very well use the .phil file parameters thus far to proceed and run post-refinement. However, this data set is in P6 (polar space group) and therefore, the indexing ambiguity needs to be resolved prior to other refinement and merging steps.&lt;br /&gt;
&lt;br /&gt;
Other point worth noting is for any polar space groups, PRIME will automatically solve the ambiguity based on the default parameters. However, this data set has about 5,000 integration results so we want to make sure that we modify the number of images used for random and best selections.&lt;br /&gt;
&lt;br /&gt;
 indexing_ambiguity {&lt;br /&gt;
  mode = Auto&lt;br /&gt;
  index_basis_in = None&lt;br /&gt;
  assigned_basis = None&lt;br /&gt;
  d_min = 3.0&lt;br /&gt;
  d_max = 10.0&lt;br /&gt;
  sigma_min = 1.5&lt;br /&gt;
  n_sample_frames = 1000&lt;br /&gt;
  n_selected_frames = 100&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
We left other parameters to their default value and modified n_sample_frames to 1000 and n_selected_frames to 100.&lt;br /&gt;
&lt;br /&gt;
* No. of Bin&lt;br /&gt;
 n_bins = 10&lt;br /&gt;
&lt;br /&gt;
Now we have a complete .phil file ready to run.&lt;br /&gt;
&lt;br /&gt;
 data = /net/viper/raid1/mu238/XfelProject/dials17/extracted&lt;br /&gt;
 target_unit_cell = 91.7 91.7 46 90 90 120&lt;br /&gt;
 target_space_group = P6&lt;br /&gt;
 n_residues = 128&lt;br /&gt;
 pixel_size_mm = 0.172&lt;br /&gt;
 scale {&lt;br /&gt;
  d_min = 2.5&lt;br /&gt;
  d_max = 20&lt;br /&gt;
  sigma_min = 1.5&lt;br /&gt;
 }&lt;br /&gt;
 postref {&lt;br /&gt;
  scale {&lt;br /&gt;
    d_min = 2.5&lt;br /&gt;
    d_max = 20&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
  }&lt;br /&gt;
  allparams {&lt;br /&gt;
    flag_on = True&lt;br /&gt;
    d_min = 2.5&lt;br /&gt;
    d_max = 20&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
    uc_tolerance = 5&lt;br /&gt;
  }&lt;br /&gt;
 }&lt;br /&gt;
 merge {&lt;br /&gt;
  d_min = 2.5&lt;br /&gt;
  d_max = 20&lt;br /&gt;
  sigma_min = -3.0&lt;br /&gt;
  partiality_min = 0.1&lt;br /&gt;
  uc_tolerance = 5&lt;br /&gt;
 }&lt;br /&gt;
 indexing_ambiguity {&lt;br /&gt;
  mode = Auto&lt;br /&gt;
  index_basis_in = None&lt;br /&gt;
  assigned_basis = None&lt;br /&gt;
  d_min = 3.0&lt;br /&gt;
  d_max = 10.0&lt;br /&gt;
  sigma_min = 1.5&lt;br /&gt;
  n_sample_frames = 1000&lt;br /&gt;
  n_selected_frames = 100&lt;br /&gt;
 }&lt;br /&gt;
 n_bins = 10&lt;br /&gt;
&lt;br /&gt;
Copy and paste this set of parameter in an editor then save the file as &amp;quot;prime.phil&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
== Running the Program ==&lt;br /&gt;
You can run the program by giving it an input file:&lt;br /&gt;
&lt;br /&gt;
 prime.run prime.phil&lt;br /&gt;
&lt;br /&gt;
For this tutorial, PRIME will score the randomly selected 1,000 images then select the best 100 for running Brehm &amp;amp; Diederichs algorithm in Bootstrap mode. If you run the program with flag_plot=True, you&#039;ll see a plot showing two separated clusters, each representing images with matching assigned basis. &lt;br /&gt;
&lt;br /&gt;
[https://commons.wikimedia.org/wiki/File:Dials17_myo_indexing_ambiguity.png Results of Running Indexing Ambiguity with Boostrap]&lt;br /&gt;
&lt;br /&gt;
[https://commons.wikimedia.org/wiki/File:Dials17_indexing_ambiguity_clustering.gif Results of Image Clustering]&lt;br /&gt;
&lt;br /&gt;
PRIME will select on of these two clusters and merge it to get a reference set for the Bootstrap step. Here, the remaining images will get assigned with a basis that makes it correlate best with the reference set.&lt;br /&gt;
&lt;br /&gt;
Once all images are assigned with appropriate basis, PRIME will proceed to scaling and post-refinement steps. After three post-refinement cycles (default value), the process is done and here is the output of the program.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 Isotropic B-factor:     5.30&lt;br /&gt;
 No. of reflections&lt;br /&gt;
  all:                   7786&lt;br /&gt;
  outside resolution:      51&lt;br /&gt;
  outliers:                 0&lt;br /&gt;
  total left:            7735&lt;br /&gt;
 Summary for Prime_Run_1/postref_cycle_3_merge.mtz&lt;br /&gt;
 Bin Resolution Range     Completeness       N_obs  |Rmerge  Rsplit   CC1/2   N_ind |CCiso   N_ind|CCanoma  N_ind|  I/sigI     I      sigI      I**2 &lt;br /&gt;
 --------------------------------------------------------------------------------------------------------------------------------------------------&lt;br /&gt;
 01   19.88 -    5.35 100.0    807 /    807  189.78   85.75    8.87   98.43    807    0.00      0    0.00      0     4.46      684.2    136.2   3.57&lt;br /&gt;
 02    5.35 -    4.26 100.0    782 /    782  140.90   73.61    8.89   97.67    782    0.00      0    0.00      0     5.23      794.3    140.3   2.05&lt;br /&gt;
 03    4.26 -    3.73 100.0    788 /    788  129.32   69.32    8.70   98.11    788    0.00      0    0.00      0     5.41      878.5    150.3   1.95&lt;br /&gt;
 04    3.73 -    3.39 100.0    765 /    765  117.75   70.72    9.67   97.55    765    0.00      0    0.00      0     4.12      712.3    162.4   1.88&lt;br /&gt;
 05    3.39 -    3.15 100.0    770 /    770  113.22   71.61   11.22   88.54    770    0.00      0    0.00      0     2.73      500.1    173.7   2.19&lt;br /&gt;
 06    3.15 -    2.96 100.0    767 /    767  106.12   73.19   11.07   97.21    767    0.00      0    0.00      0     2.09      404.6    183.8   2.02&lt;br /&gt;
 07    2.96 -    2.81 100.0    766 /    766  103.73   75.79   12.53   96.62    766    0.00      0    0.00      0     1.72      345.3    193.9   1.89&lt;br /&gt;
 08    2.81 -    2.69 100.0    745 /    745  101.51   76.11   12.84   96.21    745    0.00      0    0.00      0     1.49      317.3    204.1   1.98&lt;br /&gt;
 09    2.69 -    2.59 100.0    786 /    786   97.88   77.59   14.19   95.40    786    0.00      0    0.00      0     1.38      299.0    209.3   1.86&lt;br /&gt;
 10    2.59 -    2.50 100.0    759 /    759   92.53   78.61   14.72   96.51    759    0.00      0    0.00      0     1.36      312.4    218.8   2.07&lt;br /&gt;
 --------------------------------------------------------------------------------------------------------------------------------------------------&lt;br /&gt;
         TOTAL        100.0   7735 /   7735  119.73   75.51   10.45   97.21   7735    0.00      0    0.00      0     3.02      527.3    176.9   2.56&lt;br /&gt;
 --------------------------------------------------------------------------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
 Summary of CC1/2 on three crystal axes&lt;br /&gt;
 Bin Resolution Range           CC1/2                       I                           N_refl           &lt;br /&gt;
                        a*      b*      c*  |      a*        b*       c*    |    a*      b*     c*      &lt;br /&gt;
 ---------------------------------------------------------------------------------------------------------&lt;br /&gt;
 01   19.88 -    5.35   97.01   98.64   98.23      528.6      559.6     1216.7     42     51     47&lt;br /&gt;
 02    5.35 -    4.26   97.64   98.43   99.08      817.6      527.5      964.9     43     44     40&lt;br /&gt;
 03    4.26 -    3.73   96.31   98.02   97.68      605.7      682.9      856.0     39     39     41&lt;br /&gt;
 04    3.73 -    3.39   98.49   98.55   97.73      961.9      532.6      729.1     42     37     45&lt;br /&gt;
 05    3.39 -    3.15   96.88   98.38   92.69      449.5      492.1      721.6     39     39     40&lt;br /&gt;
 06    3.15 -    2.96   98.48   93.58   98.61      389.9      303.4      391.7     39     37     39&lt;br /&gt;
 07    2.96 -    2.81   96.98   98.02   95.35      361.3      331.7      383.2     42     37     43&lt;br /&gt;
 08    2.81 -    2.69   95.29   94.02   94.69      290.8      194.7      292.7     41     35     36&lt;br /&gt;
 09    2.69 -    2.59   96.55   91.88   98.57      265.7      341.4      290.2     41     35     44&lt;br /&gt;
 10    2.59 -    2.50   94.44   97.81   96.67      249.0      400.1      236.2     42     36     40&lt;br /&gt;
 ----------------------------------------------------------------------------------------------------------&lt;br /&gt;
        total           97.57   97.74   94.58      494.1      446.0      619.4    410    390    415&lt;br /&gt;
 ----------------------------------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
 Summary of refinement and merging&lt;br /&gt;
 No. good frames:                  4733&lt;br /&gt;
 No. bad cc frames:                 113&lt;br /&gt;
 No. bad G frames) :                109&lt;br /&gt;
 No. bad unit cell frames:           20&lt;br /&gt;
 No. bad gamma_e frames:             22&lt;br /&gt;
 No. bad SE:                          2&lt;br /&gt;
 No. observations:               935265&lt;br /&gt;
 Mean target value (BEFORE: Mean Median (Std.))&lt;br /&gt;
 post-refinement:                301.22       259.10 (   171.56)&lt;br /&gt;
 (x,y) restraints:              1679.63      1573.15 (   657.49)&lt;br /&gt;
 Mean target value (AFTER: Mean Median (Std.))&lt;br /&gt;
 post-refinement:                300.02       257.53 (   170.98)&lt;br /&gt;
 (x,y) restraints:              1679.90      1572.77 (   660.19)&lt;br /&gt;
 SE:                            1915.60       776.84 ( 33765.97)&lt;br /&gt;
 G:                           1.000e+00    8.971e-01 ( 8.15e-01)&lt;br /&gt;
 B:                               11.83        14.45 (    11.95)&lt;br /&gt;
 Rot.x:                           -0.08         0.00 (    12.10)&lt;br /&gt;
 Rot.y:                            0.14         0.00 (     9.62)&lt;br /&gt;
 gamma_y:                       0.00000      0.00000 (  0.00000)&lt;br /&gt;
 gamma_z:                       0.00000      0.00000 (  0.00000)&lt;br /&gt;
 gamma_0:                       0.03793      0.00019 (  0.60820)&lt;br /&gt;
 gamma_e:                      -0.12824      0.00145 (  0.60227)&lt;br /&gt;
 voigt_nu:                      0.50000      0.50000 (  0.00000)&lt;br /&gt;
 unit cell&lt;br /&gt;
   a:                             91.45        91.45 (     0.11)&lt;br /&gt;
   b:                             91.45        91.45 (     0.11)&lt;br /&gt;
   c:                             45.96        45.96 (     0.12)&lt;br /&gt;
   alpha:                         90.00        90.00 (     0.00)&lt;br /&gt;
   beta:                          90.00        90.00 (     0.00)&lt;br /&gt;
   gamma:                        120.00       120.00 (     0.00)&lt;br /&gt;
 Parmeters from integration (not-refined)&lt;br /&gt;
  Wavelength:                   0.96861      0.96861 (  0.00000)&lt;br /&gt;
  Detector distance:          303.81868    303.81868 (  0.00000)&lt;br /&gt;
 * (standard deviation)&lt;br /&gt;
&lt;br /&gt;
 Total calculation time: 542.00 seconds&lt;br /&gt;
 Finished: Tuesday 14. February 2017 10:53:18&lt;br /&gt;
&lt;br /&gt;
== Obtaining the Output ==&lt;br /&gt;
&lt;br /&gt;
Your output will be in Prime_Run_n (where n is the number of run). &lt;br /&gt;
&lt;br /&gt;
 -bash-4.1$ ls Prime_Run_1/ -l&lt;br /&gt;
 total 9076&lt;br /&gt;
 -rw-r--r-- 1 mu238 camb  879638 Feb 14 10:53 crystal.o&lt;br /&gt;
 drwxr-xr-x 2 mu238 camb     104 Feb 14 10:46 index_ambiguity&lt;br /&gt;
 drwxr-xr-x 2 mu238 camb       6 Feb 14 10:44 isoform_cluster&lt;br /&gt;
 -rw-r--r-- 1 mu238 camb   32704 Feb 14 10:53 log.txt&lt;br /&gt;
 -rw-r--r-- 1 mu238 camb  324556 Feb 14 10:47 mean_scaled_merge.hkl&lt;br /&gt;
 -rw-r--r-- 1 mu238 camb  157260 Feb 14 10:47 mean_scaled_merge.mtz&lt;br /&gt;
 -rw-r--r-- 1 mu238 camb   15753 Feb 14 10:53 pickle.stat&lt;br /&gt;
 -rw-r--r-- 1 mu238 camb  324381 Feb 14 10:49 postref_cycle_1_merge.hkl&lt;br /&gt;
 -rw-r--r-- 1 mu238 camb  157260 Feb 14 10:49 postref_cycle_1_merge.mtz&lt;br /&gt;
 -rw-r--r-- 1 mu238 camb  324515 Feb 14 10:51 postref_cycle_2_merge.hkl&lt;br /&gt;
 -rw-r--r-- 1 mu238 camb  157260 Feb 14 10:51 postref_cycle_2_merge.mtz&lt;br /&gt;
 -rw-r--r-- 1 mu238 camb  324716 Feb 14 10:53 postref_cycle_3_merge.hkl&lt;br /&gt;
 -rw-r--r-- 1 mu238 camb  157340 Feb 14 10:53 postref_cycle_3_merge.mtz&lt;br /&gt;
 -rw-r--r-- 1 mu238 camb 6412200 Feb 14 10:53 rejections.txt&lt;br /&gt;
&lt;br /&gt;
File log.txt contains all the merging stats. The final merged reflection set is postref_cycle_3_merge.mtz (or .hkl).&lt;/div&gt;</summary>
		<author><name>Mona</name></author>
	</entry>
	<entry>
		<id>http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=2017_prime_tutorial&amp;diff=1399</id>
		<title>2017 prime tutorial</title>
		<link rel="alternate" type="text/html" href="http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=2017_prime_tutorial&amp;diff=1399"/>
		<updated>2017-02-14T20:02:10Z</updated>

		<summary type="html">&lt;p&gt;Mona: /* Running the Program */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Post-refine and Merge Sample Data Set with PRIME (2017 Tutorial)&lt;br /&gt;
&lt;br /&gt;
In this tutorial, we will work on the integration results from the first of Tutorial 2 (Myoglobin Data). Before proceeding to running the program, we&#039;ll consider making the input file for PRIME based on the situation of this data set.&lt;br /&gt;
&lt;br /&gt;
== Generating Input File ==&lt;br /&gt;
&lt;br /&gt;
PRIME input files contain information necessary for successful post-refinement and merging steps. You can access and review the list of input parameters by running prime.run or prime.run -h to view the description of these parameters. For this tutorial we&#039;ll start building it from scratch.&lt;br /&gt;
&lt;br /&gt;
* Location of integration results&lt;br /&gt;
In this case, we know the location where the integration results (pickle files) are. We can then set,&lt;br /&gt;
&lt;br /&gt;
 data = /net/viper/raid1/mu238/XfelProject/dials17/extracted&lt;br /&gt;
&lt;br /&gt;
Note that you supply data as a multiple arguments. The value of the parameter can be a file containing list of integration results, a folder, or a wildcard argument.&lt;br /&gt;
&lt;br /&gt;
* Unit cell information &lt;br /&gt;
You can obtain the mean (or median) unit-cell dimensions from either IOTA or DIALS. In case of IOTA, prime .phil file is auto generated and this information is readily available in there. For n_residues, enter number of residues in asymmetric unit of your molecule.&lt;br /&gt;
&lt;br /&gt;
 target_unit_cell = 91.7 91.7 46 90 90 120&lt;br /&gt;
 target_space_group = P6&lt;br /&gt;
 n_residues = 128&lt;br /&gt;
&lt;br /&gt;
* Detector information&lt;br /&gt;
 pixel_size_mm = 0.172&lt;br /&gt;
&lt;br /&gt;
* Post-refinement and Scaling information&lt;br /&gt;
This is where you specify the optimal resolution cutoffs for post-refinement and merging. Note that when running for the first time on you newly collected data, you can choose the &amp;quot;expected&amp;quot; values (resolution which you see the spots at the corner or on the edge). You can then adjust these parameters when analyzing merging statistics based on the I/sigI values in the high resolution shells and rerun the program again. Note that sigma cutoffs are set to 1.5 in scaling and post-refinement steps while it&#039;s set to -3.0 so we can include negative values in the merged reflection set.  &lt;br /&gt;
 &lt;br /&gt;
 scale {&lt;br /&gt;
   d_min = 2.5&lt;br /&gt;
   d_max = 20&lt;br /&gt;
   sigma_min = 1.5&lt;br /&gt;
 }&lt;br /&gt;
 postref {&lt;br /&gt;
   scale {&lt;br /&gt;
     d_min = 2.5&lt;br /&gt;
     d_max = 20&lt;br /&gt;
     sigma_min = 1.5&lt;br /&gt;
     partiality_min = 0.1&lt;br /&gt;
   allparams {&lt;br /&gt;
     flag_on = True&lt;br /&gt;
     d_min = 2.5&lt;br /&gt;
     d_max = 20&lt;br /&gt;
     sigma_min = 1.5&lt;br /&gt;
     partiality_min = 0.1&lt;br /&gt;
     uc_tolerance = 5&lt;br /&gt;
   }&lt;br /&gt;
 }&lt;br /&gt;
 merge {&lt;br /&gt;
   d_min = 2.5&lt;br /&gt;
   d_max = 20&lt;br /&gt;
   sigma_min = -3.0&lt;br /&gt;
   partiality_min = 0.1&lt;br /&gt;
   uc_tolerance = 5&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
* Indexing ambiguity&lt;br /&gt;
For other sets that are not in polar space or have indexing ambiguity (when one or more of the unit-cell dimensions are very similar but not the same!), you can very well use the .phil file parameters thus far to proceed and run post-refinement. However, this data set is in P6 (polar space group) and therefore, the indexing ambiguity needs to be resolved prior to other refinement and merging steps.&lt;br /&gt;
&lt;br /&gt;
Other point worth noting is for any polar space groups, PRIME will automatically solve the ambiguity based on the default parameters. However, this data set has about 5,000 integration results so we want to make sure that we modify the number of images used for random and best selections.&lt;br /&gt;
&lt;br /&gt;
 indexing_ambiguity {&lt;br /&gt;
  mode = Auto&lt;br /&gt;
  index_basis_in = None&lt;br /&gt;
  assigned_basis = None&lt;br /&gt;
  d_min = 3.0&lt;br /&gt;
  d_max = 10.0&lt;br /&gt;
  sigma_min = 1.5&lt;br /&gt;
  n_sample_frames = 1000&lt;br /&gt;
  n_selected_frames = 100&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
We left other parameters to their default value and modified n_sample_frames to 1000 and n_selected_frames to 100.&lt;br /&gt;
&lt;br /&gt;
* No. of Bin&lt;br /&gt;
 n_bins = 10&lt;br /&gt;
&lt;br /&gt;
Now we have a complete .phil file ready to run.&lt;br /&gt;
&lt;br /&gt;
 data = /net/viper/raid1/mu238/XfelProject/dials17/extracted&lt;br /&gt;
 target_unit_cell = 91.7 91.7 46 90 90 120&lt;br /&gt;
 target_space_group = P6&lt;br /&gt;
 n_residues = 128&lt;br /&gt;
 pixel_size_mm = 0.172&lt;br /&gt;
 scale {&lt;br /&gt;
  d_min = 2.5&lt;br /&gt;
  d_max = 20&lt;br /&gt;
  sigma_min = 1.5&lt;br /&gt;
 }&lt;br /&gt;
 postref {&lt;br /&gt;
  scale {&lt;br /&gt;
    d_min = 2.5&lt;br /&gt;
    d_max = 20&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
  }&lt;br /&gt;
  allparams {&lt;br /&gt;
    flag_on = True&lt;br /&gt;
    d_min = 2.5&lt;br /&gt;
    d_max = 20&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
    uc_tolerance = 5&lt;br /&gt;
  }&lt;br /&gt;
 }&lt;br /&gt;
 merge {&lt;br /&gt;
  d_min = 2.5&lt;br /&gt;
  d_max = 20&lt;br /&gt;
  sigma_min = -3.0&lt;br /&gt;
  partiality_min = 0.1&lt;br /&gt;
  uc_tolerance = 5&lt;br /&gt;
 }&lt;br /&gt;
 indexing_ambiguity {&lt;br /&gt;
  mode = Auto&lt;br /&gt;
  index_basis_in = None&lt;br /&gt;
  assigned_basis = None&lt;br /&gt;
  d_min = 3.0&lt;br /&gt;
  d_max = 10.0&lt;br /&gt;
  sigma_min = 1.5&lt;br /&gt;
  n_sample_frames = 1000&lt;br /&gt;
  n_selected_frames = 100&lt;br /&gt;
 }&lt;br /&gt;
 n_bins = 10&lt;br /&gt;
&lt;br /&gt;
Copy and paste this set of parameter in an editor then save the file as &amp;quot;prime.phil&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
== Running the Program ==&lt;br /&gt;
You can run the program by giving it an input file:&lt;br /&gt;
&lt;br /&gt;
 prime.run prime.phil&lt;br /&gt;
&lt;br /&gt;
For this tutorial, PRIME will score the randomly selected 1,000 images then select the best 100 for running Brehm &amp;amp; Diederichs algorithm in Bootstrap mode. If you run the program with flag_plot=True, you&#039;ll see a plot showing two separated clusters, each representing images with matching assigned basis. &lt;br /&gt;
&lt;br /&gt;
[https://commons.wikimedia.org/wiki/File:Dials17_myo_indexing_ambiguity.png Results of Running Indexing Ambiguity with Boostrap]&lt;br /&gt;
[https://commons.wikimedia.org/wiki/File:Dials17_indexing_ambiguity_clustering.gif Results of Image Clustering]&lt;br /&gt;
&lt;br /&gt;
PRIME will select on of these two clusters and merge it to get a reference set for the Bootstrap step. Here, the remaining images will get assigned with a basis that makes it correlate best with the reference set.&lt;br /&gt;
&lt;br /&gt;
Once all images are assigned with appropriate basis, PRIME will proceed to scaling and post-refinement steps. After three post-refinement cycles (default value), the process is done and here is the output of the program.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 Isotropic B-factor:     5.30&lt;br /&gt;
 No. of reflections&lt;br /&gt;
  all:                   7786&lt;br /&gt;
  outside resolution:      51&lt;br /&gt;
  outliers:                 0&lt;br /&gt;
  total left:            7735&lt;br /&gt;
 Summary for Prime_Run_1/postref_cycle_3_merge.mtz&lt;br /&gt;
 Bin Resolution Range     Completeness       N_obs  |Rmerge  Rsplit   CC1/2   N_ind |CCiso   N_ind|CCanoma  N_ind|  I/sigI     I      sigI      I**2 &lt;br /&gt;
 --------------------------------------------------------------------------------------------------------------------------------------------------&lt;br /&gt;
 01   19.88 -    5.35 100.0    807 /    807  189.78   85.75    8.87   98.43    807    0.00      0    0.00      0     4.46      684.2    136.2   3.57&lt;br /&gt;
 02    5.35 -    4.26 100.0    782 /    782  140.90   73.61    8.89   97.67    782    0.00      0    0.00      0     5.23      794.3    140.3   2.05&lt;br /&gt;
 03    4.26 -    3.73 100.0    788 /    788  129.32   69.32    8.70   98.11    788    0.00      0    0.00      0     5.41      878.5    150.3   1.95&lt;br /&gt;
 04    3.73 -    3.39 100.0    765 /    765  117.75   70.72    9.67   97.55    765    0.00      0    0.00      0     4.12      712.3    162.4   1.88&lt;br /&gt;
 05    3.39 -    3.15 100.0    770 /    770  113.22   71.61   11.22   88.54    770    0.00      0    0.00      0     2.73      500.1    173.7   2.19&lt;br /&gt;
 06    3.15 -    2.96 100.0    767 /    767  106.12   73.19   11.07   97.21    767    0.00      0    0.00      0     2.09      404.6    183.8   2.02&lt;br /&gt;
 07    2.96 -    2.81 100.0    766 /    766  103.73   75.79   12.53   96.62    766    0.00      0    0.00      0     1.72      345.3    193.9   1.89&lt;br /&gt;
 08    2.81 -    2.69 100.0    745 /    745  101.51   76.11   12.84   96.21    745    0.00      0    0.00      0     1.49      317.3    204.1   1.98&lt;br /&gt;
 09    2.69 -    2.59 100.0    786 /    786   97.88   77.59   14.19   95.40    786    0.00      0    0.00      0     1.38      299.0    209.3   1.86&lt;br /&gt;
 10    2.59 -    2.50 100.0    759 /    759   92.53   78.61   14.72   96.51    759    0.00      0    0.00      0     1.36      312.4    218.8   2.07&lt;br /&gt;
 --------------------------------------------------------------------------------------------------------------------------------------------------&lt;br /&gt;
         TOTAL        100.0   7735 /   7735  119.73   75.51   10.45   97.21   7735    0.00      0    0.00      0     3.02      527.3    176.9   2.56&lt;br /&gt;
 --------------------------------------------------------------------------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
 Summary of CC1/2 on three crystal axes&lt;br /&gt;
 Bin Resolution Range           CC1/2                       I                           N_refl           &lt;br /&gt;
                        a*      b*      c*  |      a*        b*       c*    |    a*      b*     c*      &lt;br /&gt;
 ---------------------------------------------------------------------------------------------------------&lt;br /&gt;
 01   19.88 -    5.35   97.01   98.64   98.23      528.6      559.6     1216.7     42     51     47&lt;br /&gt;
 02    5.35 -    4.26   97.64   98.43   99.08      817.6      527.5      964.9     43     44     40&lt;br /&gt;
 03    4.26 -    3.73   96.31   98.02   97.68      605.7      682.9      856.0     39     39     41&lt;br /&gt;
 04    3.73 -    3.39   98.49   98.55   97.73      961.9      532.6      729.1     42     37     45&lt;br /&gt;
 05    3.39 -    3.15   96.88   98.38   92.69      449.5      492.1      721.6     39     39     40&lt;br /&gt;
 06    3.15 -    2.96   98.48   93.58   98.61      389.9      303.4      391.7     39     37     39&lt;br /&gt;
 07    2.96 -    2.81   96.98   98.02   95.35      361.3      331.7      383.2     42     37     43&lt;br /&gt;
 08    2.81 -    2.69   95.29   94.02   94.69      290.8      194.7      292.7     41     35     36&lt;br /&gt;
 09    2.69 -    2.59   96.55   91.88   98.57      265.7      341.4      290.2     41     35     44&lt;br /&gt;
 10    2.59 -    2.50   94.44   97.81   96.67      249.0      400.1      236.2     42     36     40&lt;br /&gt;
 ----------------------------------------------------------------------------------------------------------&lt;br /&gt;
        total           97.57   97.74   94.58      494.1      446.0      619.4    410    390    415&lt;br /&gt;
 ----------------------------------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
 Summary of refinement and merging&lt;br /&gt;
 No. good frames:                  4733&lt;br /&gt;
 No. bad cc frames:                 113&lt;br /&gt;
 No. bad G frames) :                109&lt;br /&gt;
 No. bad unit cell frames:           20&lt;br /&gt;
 No. bad gamma_e frames:             22&lt;br /&gt;
 No. bad SE:                          2&lt;br /&gt;
 No. observations:               935265&lt;br /&gt;
 Mean target value (BEFORE: Mean Median (Std.))&lt;br /&gt;
 post-refinement:                301.22       259.10 (   171.56)&lt;br /&gt;
 (x,y) restraints:              1679.63      1573.15 (   657.49)&lt;br /&gt;
 Mean target value (AFTER: Mean Median (Std.))&lt;br /&gt;
 post-refinement:                300.02       257.53 (   170.98)&lt;br /&gt;
 (x,y) restraints:              1679.90      1572.77 (   660.19)&lt;br /&gt;
 SE:                            1915.60       776.84 ( 33765.97)&lt;br /&gt;
 G:                           1.000e+00    8.971e-01 ( 8.15e-01)&lt;br /&gt;
 B:                               11.83        14.45 (    11.95)&lt;br /&gt;
 Rot.x:                           -0.08         0.00 (    12.10)&lt;br /&gt;
 Rot.y:                            0.14         0.00 (     9.62)&lt;br /&gt;
 gamma_y:                       0.00000      0.00000 (  0.00000)&lt;br /&gt;
 gamma_z:                       0.00000      0.00000 (  0.00000)&lt;br /&gt;
 gamma_0:                       0.03793      0.00019 (  0.60820)&lt;br /&gt;
 gamma_e:                      -0.12824      0.00145 (  0.60227)&lt;br /&gt;
 voigt_nu:                      0.50000      0.50000 (  0.00000)&lt;br /&gt;
 unit cell&lt;br /&gt;
   a:                             91.45        91.45 (     0.11)&lt;br /&gt;
   b:                             91.45        91.45 (     0.11)&lt;br /&gt;
   c:                             45.96        45.96 (     0.12)&lt;br /&gt;
   alpha:                         90.00        90.00 (     0.00)&lt;br /&gt;
   beta:                          90.00        90.00 (     0.00)&lt;br /&gt;
   gamma:                        120.00       120.00 (     0.00)&lt;br /&gt;
 Parmeters from integration (not-refined)&lt;br /&gt;
  Wavelength:                   0.96861      0.96861 (  0.00000)&lt;br /&gt;
  Detector distance:          303.81868    303.81868 (  0.00000)&lt;br /&gt;
 * (standard deviation)&lt;br /&gt;
&lt;br /&gt;
 Total calculation time: 542.00 seconds&lt;br /&gt;
 Finished: Tuesday 14. February 2017 10:53:18&lt;br /&gt;
&lt;br /&gt;
== Obtaining the Output ==&lt;br /&gt;
&lt;br /&gt;
Your output will be in Prime_Run_n (where n is the number of run). &lt;br /&gt;
&lt;br /&gt;
 -bash-4.1$ ls Prime_Run_1/ -l&lt;br /&gt;
 total 9076&lt;br /&gt;
 -rw-r--r-- 1 mu238 camb  879638 Feb 14 10:53 crystal.o&lt;br /&gt;
 drwxr-xr-x 2 mu238 camb     104 Feb 14 10:46 index_ambiguity&lt;br /&gt;
 drwxr-xr-x 2 mu238 camb       6 Feb 14 10:44 isoform_cluster&lt;br /&gt;
 -rw-r--r-- 1 mu238 camb   32704 Feb 14 10:53 log.txt&lt;br /&gt;
 -rw-r--r-- 1 mu238 camb  324556 Feb 14 10:47 mean_scaled_merge.hkl&lt;br /&gt;
 -rw-r--r-- 1 mu238 camb  157260 Feb 14 10:47 mean_scaled_merge.mtz&lt;br /&gt;
 -rw-r--r-- 1 mu238 camb   15753 Feb 14 10:53 pickle.stat&lt;br /&gt;
 -rw-r--r-- 1 mu238 camb  324381 Feb 14 10:49 postref_cycle_1_merge.hkl&lt;br /&gt;
 -rw-r--r-- 1 mu238 camb  157260 Feb 14 10:49 postref_cycle_1_merge.mtz&lt;br /&gt;
 -rw-r--r-- 1 mu238 camb  324515 Feb 14 10:51 postref_cycle_2_merge.hkl&lt;br /&gt;
 -rw-r--r-- 1 mu238 camb  157260 Feb 14 10:51 postref_cycle_2_merge.mtz&lt;br /&gt;
 -rw-r--r-- 1 mu238 camb  324716 Feb 14 10:53 postref_cycle_3_merge.hkl&lt;br /&gt;
 -rw-r--r-- 1 mu238 camb  157340 Feb 14 10:53 postref_cycle_3_merge.mtz&lt;br /&gt;
 -rw-r--r-- 1 mu238 camb 6412200 Feb 14 10:53 rejections.txt&lt;br /&gt;
&lt;br /&gt;
File log.txt contains all the merging stats. The final merged reflection set is postref_cycle_3_merge.mtz (or .hkl).&lt;/div&gt;</summary>
		<author><name>Mona</name></author>
	</entry>
	<entry>
		<id>http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=2017_prime_tutorial&amp;diff=1398</id>
		<title>2017 prime tutorial</title>
		<link rel="alternate" type="text/html" href="http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=2017_prime_tutorial&amp;diff=1398"/>
		<updated>2017-02-14T19:56:35Z</updated>

		<summary type="html">&lt;p&gt;Mona: /* Running the Program */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Post-refine and Merge Sample Data Set with PRIME (2017 Tutorial)&lt;br /&gt;
&lt;br /&gt;
In this tutorial, we will work on the integration results from the first of Tutorial 2 (Myoglobin Data). Before proceeding to running the program, we&#039;ll consider making the input file for PRIME based on the situation of this data set.&lt;br /&gt;
&lt;br /&gt;
== Generating Input File ==&lt;br /&gt;
&lt;br /&gt;
PRIME input files contain information necessary for successful post-refinement and merging steps. You can access and review the list of input parameters by running prime.run or prime.run -h to view the description of these parameters. For this tutorial we&#039;ll start building it from scratch.&lt;br /&gt;
&lt;br /&gt;
* Location of integration results&lt;br /&gt;
In this case, we know the location where the integration results (pickle files) are. We can then set,&lt;br /&gt;
&lt;br /&gt;
 data = /net/viper/raid1/mu238/XfelProject/dials17/extracted&lt;br /&gt;
&lt;br /&gt;
Note that you supply data as a multiple arguments. The value of the parameter can be a file containing list of integration results, a folder, or a wildcard argument.&lt;br /&gt;
&lt;br /&gt;
* Unit cell information &lt;br /&gt;
You can obtain the mean (or median) unit-cell dimensions from either IOTA or DIALS. In case of IOTA, prime .phil file is auto generated and this information is readily available in there. For n_residues, enter number of residues in asymmetric unit of your molecule.&lt;br /&gt;
&lt;br /&gt;
 target_unit_cell = 91.7 91.7 46 90 90 120&lt;br /&gt;
 target_space_group = P6&lt;br /&gt;
 n_residues = 128&lt;br /&gt;
&lt;br /&gt;
* Detector information&lt;br /&gt;
 pixel_size_mm = 0.172&lt;br /&gt;
&lt;br /&gt;
* Post-refinement and Scaling information&lt;br /&gt;
This is where you specify the optimal resolution cutoffs for post-refinement and merging. Note that when running for the first time on you newly collected data, you can choose the &amp;quot;expected&amp;quot; values (resolution which you see the spots at the corner or on the edge). You can then adjust these parameters when analyzing merging statistics based on the I/sigI values in the high resolution shells and rerun the program again. Note that sigma cutoffs are set to 1.5 in scaling and post-refinement steps while it&#039;s set to -3.0 so we can include negative values in the merged reflection set.  &lt;br /&gt;
 &lt;br /&gt;
 scale {&lt;br /&gt;
   d_min = 2.5&lt;br /&gt;
   d_max = 20&lt;br /&gt;
   sigma_min = 1.5&lt;br /&gt;
 }&lt;br /&gt;
 postref {&lt;br /&gt;
   scale {&lt;br /&gt;
     d_min = 2.5&lt;br /&gt;
     d_max = 20&lt;br /&gt;
     sigma_min = 1.5&lt;br /&gt;
     partiality_min = 0.1&lt;br /&gt;
   allparams {&lt;br /&gt;
     flag_on = True&lt;br /&gt;
     d_min = 2.5&lt;br /&gt;
     d_max = 20&lt;br /&gt;
     sigma_min = 1.5&lt;br /&gt;
     partiality_min = 0.1&lt;br /&gt;
     uc_tolerance = 5&lt;br /&gt;
   }&lt;br /&gt;
 }&lt;br /&gt;
 merge {&lt;br /&gt;
   d_min = 2.5&lt;br /&gt;
   d_max = 20&lt;br /&gt;
   sigma_min = -3.0&lt;br /&gt;
   partiality_min = 0.1&lt;br /&gt;
   uc_tolerance = 5&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
* Indexing ambiguity&lt;br /&gt;
For other sets that are not in polar space or have indexing ambiguity (when one or more of the unit-cell dimensions are very similar but not the same!), you can very well use the .phil file parameters thus far to proceed and run post-refinement. However, this data set is in P6 (polar space group) and therefore, the indexing ambiguity needs to be resolved prior to other refinement and merging steps.&lt;br /&gt;
&lt;br /&gt;
Other point worth noting is for any polar space groups, PRIME will automatically solve the ambiguity based on the default parameters. However, this data set has about 5,000 integration results so we want to make sure that we modify the number of images used for random and best selections.&lt;br /&gt;
&lt;br /&gt;
 indexing_ambiguity {&lt;br /&gt;
  mode = Auto&lt;br /&gt;
  index_basis_in = None&lt;br /&gt;
  assigned_basis = None&lt;br /&gt;
  d_min = 3.0&lt;br /&gt;
  d_max = 10.0&lt;br /&gt;
  sigma_min = 1.5&lt;br /&gt;
  n_sample_frames = 1000&lt;br /&gt;
  n_selected_frames = 100&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
We left other parameters to their default value and modified n_sample_frames to 1000 and n_selected_frames to 100.&lt;br /&gt;
&lt;br /&gt;
* No. of Bin&lt;br /&gt;
 n_bins = 10&lt;br /&gt;
&lt;br /&gt;
Now we have a complete .phil file ready to run.&lt;br /&gt;
&lt;br /&gt;
 data = /net/viper/raid1/mu238/XfelProject/dials17/extracted&lt;br /&gt;
 target_unit_cell = 91.7 91.7 46 90 90 120&lt;br /&gt;
 target_space_group = P6&lt;br /&gt;
 n_residues = 128&lt;br /&gt;
 pixel_size_mm = 0.172&lt;br /&gt;
 scale {&lt;br /&gt;
  d_min = 2.5&lt;br /&gt;
  d_max = 20&lt;br /&gt;
  sigma_min = 1.5&lt;br /&gt;
 }&lt;br /&gt;
 postref {&lt;br /&gt;
  scale {&lt;br /&gt;
    d_min = 2.5&lt;br /&gt;
    d_max = 20&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
  }&lt;br /&gt;
  allparams {&lt;br /&gt;
    flag_on = True&lt;br /&gt;
    d_min = 2.5&lt;br /&gt;
    d_max = 20&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
    uc_tolerance = 5&lt;br /&gt;
  }&lt;br /&gt;
 }&lt;br /&gt;
 merge {&lt;br /&gt;
  d_min = 2.5&lt;br /&gt;
  d_max = 20&lt;br /&gt;
  sigma_min = -3.0&lt;br /&gt;
  partiality_min = 0.1&lt;br /&gt;
  uc_tolerance = 5&lt;br /&gt;
 }&lt;br /&gt;
 indexing_ambiguity {&lt;br /&gt;
  mode = Auto&lt;br /&gt;
  index_basis_in = None&lt;br /&gt;
  assigned_basis = None&lt;br /&gt;
  d_min = 3.0&lt;br /&gt;
  d_max = 10.0&lt;br /&gt;
  sigma_min = 1.5&lt;br /&gt;
  n_sample_frames = 1000&lt;br /&gt;
  n_selected_frames = 100&lt;br /&gt;
 }&lt;br /&gt;
 n_bins = 10&lt;br /&gt;
&lt;br /&gt;
Copy and paste this set of parameter in an editor then save the file as &amp;quot;prime.phil&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
== Running the Program ==&lt;br /&gt;
You can run the program by giving it an input file:&lt;br /&gt;
&lt;br /&gt;
 prime.run prime.phil&lt;br /&gt;
&lt;br /&gt;
For this tutorial, PRIME will score the randomly selected 1,000 images then select the best 100 for running Brehm &amp;amp; Diederichs algorithm in Bootstrap mode. If you run the program with flag_plot=True, you&#039;ll see a plot showing two separated clusters, each representing images with matching assigned basis. &lt;br /&gt;
&lt;br /&gt;
[https://commons.wikimedia.org/wiki/File:Dials17_myo_indexing_ambiguity.png Results of Running Indexing Ambiguity with Boostrap]&lt;br /&gt;
&lt;br /&gt;
PRIME will select on of these two clusters and merge it to get a reference set for the Bootstrap step. Here, the remaining images will get assigned with a basis that makes it correlate best with the reference set.&lt;br /&gt;
&lt;br /&gt;
Once all images are assigned with appropriate basis, PRIME will proceed to scaling and post-refinement steps. After three post-refinement cycles (default value), the process is done and here is the output of the program.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 Isotropic B-factor:     5.30&lt;br /&gt;
 No. of reflections&lt;br /&gt;
  all:                   7786&lt;br /&gt;
  outside resolution:      51&lt;br /&gt;
  outliers:                 0&lt;br /&gt;
  total left:            7735&lt;br /&gt;
 Summary for Prime_Run_1/postref_cycle_3_merge.mtz&lt;br /&gt;
 Bin Resolution Range     Completeness       N_obs  |Rmerge  Rsplit   CC1/2   N_ind |CCiso   N_ind|CCanoma  N_ind|  I/sigI     I      sigI      I**2 &lt;br /&gt;
 --------------------------------------------------------------------------------------------------------------------------------------------------&lt;br /&gt;
 01   19.88 -    5.35 100.0    807 /    807  189.78   85.75    8.87   98.43    807    0.00      0    0.00      0     4.46      684.2    136.2   3.57&lt;br /&gt;
 02    5.35 -    4.26 100.0    782 /    782  140.90   73.61    8.89   97.67    782    0.00      0    0.00      0     5.23      794.3    140.3   2.05&lt;br /&gt;
 03    4.26 -    3.73 100.0    788 /    788  129.32   69.32    8.70   98.11    788    0.00      0    0.00      0     5.41      878.5    150.3   1.95&lt;br /&gt;
 04    3.73 -    3.39 100.0    765 /    765  117.75   70.72    9.67   97.55    765    0.00      0    0.00      0     4.12      712.3    162.4   1.88&lt;br /&gt;
 05    3.39 -    3.15 100.0    770 /    770  113.22   71.61   11.22   88.54    770    0.00      0    0.00      0     2.73      500.1    173.7   2.19&lt;br /&gt;
 06    3.15 -    2.96 100.0    767 /    767  106.12   73.19   11.07   97.21    767    0.00      0    0.00      0     2.09      404.6    183.8   2.02&lt;br /&gt;
 07    2.96 -    2.81 100.0    766 /    766  103.73   75.79   12.53   96.62    766    0.00      0    0.00      0     1.72      345.3    193.9   1.89&lt;br /&gt;
 08    2.81 -    2.69 100.0    745 /    745  101.51   76.11   12.84   96.21    745    0.00      0    0.00      0     1.49      317.3    204.1   1.98&lt;br /&gt;
 09    2.69 -    2.59 100.0    786 /    786   97.88   77.59   14.19   95.40    786    0.00      0    0.00      0     1.38      299.0    209.3   1.86&lt;br /&gt;
 10    2.59 -    2.50 100.0    759 /    759   92.53   78.61   14.72   96.51    759    0.00      0    0.00      0     1.36      312.4    218.8   2.07&lt;br /&gt;
 --------------------------------------------------------------------------------------------------------------------------------------------------&lt;br /&gt;
         TOTAL        100.0   7735 /   7735  119.73   75.51   10.45   97.21   7735    0.00      0    0.00      0     3.02      527.3    176.9   2.56&lt;br /&gt;
 --------------------------------------------------------------------------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
 Summary of CC1/2 on three crystal axes&lt;br /&gt;
 Bin Resolution Range           CC1/2                       I                           N_refl           &lt;br /&gt;
                        a*      b*      c*  |      a*        b*       c*    |    a*      b*     c*      &lt;br /&gt;
 ---------------------------------------------------------------------------------------------------------&lt;br /&gt;
 01   19.88 -    5.35   97.01   98.64   98.23      528.6      559.6     1216.7     42     51     47&lt;br /&gt;
 02    5.35 -    4.26   97.64   98.43   99.08      817.6      527.5      964.9     43     44     40&lt;br /&gt;
 03    4.26 -    3.73   96.31   98.02   97.68      605.7      682.9      856.0     39     39     41&lt;br /&gt;
 04    3.73 -    3.39   98.49   98.55   97.73      961.9      532.6      729.1     42     37     45&lt;br /&gt;
 05    3.39 -    3.15   96.88   98.38   92.69      449.5      492.1      721.6     39     39     40&lt;br /&gt;
 06    3.15 -    2.96   98.48   93.58   98.61      389.9      303.4      391.7     39     37     39&lt;br /&gt;
 07    2.96 -    2.81   96.98   98.02   95.35      361.3      331.7      383.2     42     37     43&lt;br /&gt;
 08    2.81 -    2.69   95.29   94.02   94.69      290.8      194.7      292.7     41     35     36&lt;br /&gt;
 09    2.69 -    2.59   96.55   91.88   98.57      265.7      341.4      290.2     41     35     44&lt;br /&gt;
 10    2.59 -    2.50   94.44   97.81   96.67      249.0      400.1      236.2     42     36     40&lt;br /&gt;
 ----------------------------------------------------------------------------------------------------------&lt;br /&gt;
        total           97.57   97.74   94.58      494.1      446.0      619.4    410    390    415&lt;br /&gt;
 ----------------------------------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
 Summary of refinement and merging&lt;br /&gt;
 No. good frames:                  4733&lt;br /&gt;
 No. bad cc frames:                 113&lt;br /&gt;
 No. bad G frames) :                109&lt;br /&gt;
 No. bad unit cell frames:           20&lt;br /&gt;
 No. bad gamma_e frames:             22&lt;br /&gt;
 No. bad SE:                          2&lt;br /&gt;
 No. observations:               935265&lt;br /&gt;
 Mean target value (BEFORE: Mean Median (Std.))&lt;br /&gt;
 post-refinement:                301.22       259.10 (   171.56)&lt;br /&gt;
 (x,y) restraints:              1679.63      1573.15 (   657.49)&lt;br /&gt;
 Mean target value (AFTER: Mean Median (Std.))&lt;br /&gt;
 post-refinement:                300.02       257.53 (   170.98)&lt;br /&gt;
 (x,y) restraints:              1679.90      1572.77 (   660.19)&lt;br /&gt;
 SE:                            1915.60       776.84 ( 33765.97)&lt;br /&gt;
 G:                           1.000e+00    8.971e-01 ( 8.15e-01)&lt;br /&gt;
 B:                               11.83        14.45 (    11.95)&lt;br /&gt;
 Rot.x:                           -0.08         0.00 (    12.10)&lt;br /&gt;
 Rot.y:                            0.14         0.00 (     9.62)&lt;br /&gt;
 gamma_y:                       0.00000      0.00000 (  0.00000)&lt;br /&gt;
 gamma_z:                       0.00000      0.00000 (  0.00000)&lt;br /&gt;
 gamma_0:                       0.03793      0.00019 (  0.60820)&lt;br /&gt;
 gamma_e:                      -0.12824      0.00145 (  0.60227)&lt;br /&gt;
 voigt_nu:                      0.50000      0.50000 (  0.00000)&lt;br /&gt;
 unit cell&lt;br /&gt;
   a:                             91.45        91.45 (     0.11)&lt;br /&gt;
   b:                             91.45        91.45 (     0.11)&lt;br /&gt;
   c:                             45.96        45.96 (     0.12)&lt;br /&gt;
   alpha:                         90.00        90.00 (     0.00)&lt;br /&gt;
   beta:                          90.00        90.00 (     0.00)&lt;br /&gt;
   gamma:                        120.00       120.00 (     0.00)&lt;br /&gt;
 Parmeters from integration (not-refined)&lt;br /&gt;
  Wavelength:                   0.96861      0.96861 (  0.00000)&lt;br /&gt;
  Detector distance:          303.81868    303.81868 (  0.00000)&lt;br /&gt;
 * (standard deviation)&lt;br /&gt;
&lt;br /&gt;
 Total calculation time: 542.00 seconds&lt;br /&gt;
 Finished: Tuesday 14. February 2017 10:53:18&lt;br /&gt;
&lt;br /&gt;
== Obtaining the Output ==&lt;br /&gt;
&lt;br /&gt;
Your output will be in Prime_Run_n (where n is the number of run). &lt;br /&gt;
&lt;br /&gt;
 -bash-4.1$ ls Prime_Run_1/ -l&lt;br /&gt;
 total 9076&lt;br /&gt;
 -rw-r--r-- 1 mu238 camb  879638 Feb 14 10:53 crystal.o&lt;br /&gt;
 drwxr-xr-x 2 mu238 camb     104 Feb 14 10:46 index_ambiguity&lt;br /&gt;
 drwxr-xr-x 2 mu238 camb       6 Feb 14 10:44 isoform_cluster&lt;br /&gt;
 -rw-r--r-- 1 mu238 camb   32704 Feb 14 10:53 log.txt&lt;br /&gt;
 -rw-r--r-- 1 mu238 camb  324556 Feb 14 10:47 mean_scaled_merge.hkl&lt;br /&gt;
 -rw-r--r-- 1 mu238 camb  157260 Feb 14 10:47 mean_scaled_merge.mtz&lt;br /&gt;
 -rw-r--r-- 1 mu238 camb   15753 Feb 14 10:53 pickle.stat&lt;br /&gt;
 -rw-r--r-- 1 mu238 camb  324381 Feb 14 10:49 postref_cycle_1_merge.hkl&lt;br /&gt;
 -rw-r--r-- 1 mu238 camb  157260 Feb 14 10:49 postref_cycle_1_merge.mtz&lt;br /&gt;
 -rw-r--r-- 1 mu238 camb  324515 Feb 14 10:51 postref_cycle_2_merge.hkl&lt;br /&gt;
 -rw-r--r-- 1 mu238 camb  157260 Feb 14 10:51 postref_cycle_2_merge.mtz&lt;br /&gt;
 -rw-r--r-- 1 mu238 camb  324716 Feb 14 10:53 postref_cycle_3_merge.hkl&lt;br /&gt;
 -rw-r--r-- 1 mu238 camb  157340 Feb 14 10:53 postref_cycle_3_merge.mtz&lt;br /&gt;
 -rw-r--r-- 1 mu238 camb 6412200 Feb 14 10:53 rejections.txt&lt;br /&gt;
&lt;br /&gt;
File log.txt contains all the merging stats. The final merged reflection set is postref_cycle_3_merge.mtz (or .hkl).&lt;/div&gt;</summary>
		<author><name>Mona</name></author>
	</entry>
	<entry>
		<id>http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=2017_prime_tutorial&amp;diff=1397</id>
		<title>2017 prime tutorial</title>
		<link rel="alternate" type="text/html" href="http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=2017_prime_tutorial&amp;diff=1397"/>
		<updated>2017-02-14T19:49:22Z</updated>

		<summary type="html">&lt;p&gt;Mona: /* Running the Program */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Post-refine and Merge Sample Data Set with PRIME (2017 Tutorial)&lt;br /&gt;
&lt;br /&gt;
In this tutorial, we will work on the integration results from the first of Tutorial 2 (Myoglobin Data). Before proceeding to running the program, we&#039;ll consider making the input file for PRIME based on the situation of this data set.&lt;br /&gt;
&lt;br /&gt;
== Generating Input File ==&lt;br /&gt;
&lt;br /&gt;
PRIME input files contain information necessary for successful post-refinement and merging steps. You can access and review the list of input parameters by running prime.run or prime.run -h to view the description of these parameters. For this tutorial we&#039;ll start building it from scratch.&lt;br /&gt;
&lt;br /&gt;
* Location of integration results&lt;br /&gt;
In this case, we know the location where the integration results (pickle files) are. We can then set,&lt;br /&gt;
&lt;br /&gt;
 data = /net/viper/raid1/mu238/XfelProject/dials17/extracted&lt;br /&gt;
&lt;br /&gt;
Note that you supply data as a multiple arguments. The value of the parameter can be a file containing list of integration results, a folder, or a wildcard argument.&lt;br /&gt;
&lt;br /&gt;
* Unit cell information &lt;br /&gt;
You can obtain the mean (or median) unit-cell dimensions from either IOTA or DIALS. In case of IOTA, prime .phil file is auto generated and this information is readily available in there. For n_residues, enter number of residues in asymmetric unit of your molecule.&lt;br /&gt;
&lt;br /&gt;
 target_unit_cell = 91.7 91.7 46 90 90 120&lt;br /&gt;
 target_space_group = P6&lt;br /&gt;
 n_residues = 128&lt;br /&gt;
&lt;br /&gt;
* Detector information&lt;br /&gt;
 pixel_size_mm = 0.172&lt;br /&gt;
&lt;br /&gt;
* Post-refinement and Scaling information&lt;br /&gt;
This is where you specify the optimal resolution cutoffs for post-refinement and merging. Note that when running for the first time on you newly collected data, you can choose the &amp;quot;expected&amp;quot; values (resolution which you see the spots at the corner or on the edge). You can then adjust these parameters when analyzing merging statistics based on the I/sigI values in the high resolution shells and rerun the program again. Note that sigma cutoffs are set to 1.5 in scaling and post-refinement steps while it&#039;s set to -3.0 so we can include negative values in the merged reflection set.  &lt;br /&gt;
 &lt;br /&gt;
 scale {&lt;br /&gt;
   d_min = 2.5&lt;br /&gt;
   d_max = 20&lt;br /&gt;
   sigma_min = 1.5&lt;br /&gt;
 }&lt;br /&gt;
 postref {&lt;br /&gt;
   scale {&lt;br /&gt;
     d_min = 2.5&lt;br /&gt;
     d_max = 20&lt;br /&gt;
     sigma_min = 1.5&lt;br /&gt;
     partiality_min = 0.1&lt;br /&gt;
   allparams {&lt;br /&gt;
     flag_on = True&lt;br /&gt;
     d_min = 2.5&lt;br /&gt;
     d_max = 20&lt;br /&gt;
     sigma_min = 1.5&lt;br /&gt;
     partiality_min = 0.1&lt;br /&gt;
     uc_tolerance = 5&lt;br /&gt;
   }&lt;br /&gt;
 }&lt;br /&gt;
 merge {&lt;br /&gt;
   d_min = 2.5&lt;br /&gt;
   d_max = 20&lt;br /&gt;
   sigma_min = -3.0&lt;br /&gt;
   partiality_min = 0.1&lt;br /&gt;
   uc_tolerance = 5&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
* Indexing ambiguity&lt;br /&gt;
For other sets that are not in polar space or have indexing ambiguity (when one or more of the unit-cell dimensions are very similar but not the same!), you can very well use the .phil file parameters thus far to proceed and run post-refinement. However, this data set is in P6 (polar space group) and therefore, the indexing ambiguity needs to be resolved prior to other refinement and merging steps.&lt;br /&gt;
&lt;br /&gt;
Other point worth noting is for any polar space groups, PRIME will automatically solve the ambiguity based on the default parameters. However, this data set has about 5,000 integration results so we want to make sure that we modify the number of images used for random and best selections.&lt;br /&gt;
&lt;br /&gt;
 indexing_ambiguity {&lt;br /&gt;
  mode = Auto&lt;br /&gt;
  index_basis_in = None&lt;br /&gt;
  assigned_basis = None&lt;br /&gt;
  d_min = 3.0&lt;br /&gt;
  d_max = 10.0&lt;br /&gt;
  sigma_min = 1.5&lt;br /&gt;
  n_sample_frames = 1000&lt;br /&gt;
  n_selected_frames = 100&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
We left other parameters to their default value and modified n_sample_frames to 1000 and n_selected_frames to 100.&lt;br /&gt;
&lt;br /&gt;
* No. of Bin&lt;br /&gt;
 n_bins = 10&lt;br /&gt;
&lt;br /&gt;
Now we have a complete .phil file ready to run.&lt;br /&gt;
&lt;br /&gt;
 data = /net/viper/raid1/mu238/XfelProject/dials17/extracted&lt;br /&gt;
 target_unit_cell = 91.7 91.7 46 90 90 120&lt;br /&gt;
 target_space_group = P6&lt;br /&gt;
 n_residues = 128&lt;br /&gt;
 pixel_size_mm = 0.172&lt;br /&gt;
 scale {&lt;br /&gt;
  d_min = 2.5&lt;br /&gt;
  d_max = 20&lt;br /&gt;
  sigma_min = 1.5&lt;br /&gt;
 }&lt;br /&gt;
 postref {&lt;br /&gt;
  scale {&lt;br /&gt;
    d_min = 2.5&lt;br /&gt;
    d_max = 20&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
  }&lt;br /&gt;
  allparams {&lt;br /&gt;
    flag_on = True&lt;br /&gt;
    d_min = 2.5&lt;br /&gt;
    d_max = 20&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
    uc_tolerance = 5&lt;br /&gt;
  }&lt;br /&gt;
 }&lt;br /&gt;
 merge {&lt;br /&gt;
  d_min = 2.5&lt;br /&gt;
  d_max = 20&lt;br /&gt;
  sigma_min = -3.0&lt;br /&gt;
  partiality_min = 0.1&lt;br /&gt;
  uc_tolerance = 5&lt;br /&gt;
 }&lt;br /&gt;
 indexing_ambiguity {&lt;br /&gt;
  mode = Auto&lt;br /&gt;
  index_basis_in = None&lt;br /&gt;
  assigned_basis = None&lt;br /&gt;
  d_min = 3.0&lt;br /&gt;
  d_max = 10.0&lt;br /&gt;
  sigma_min = 1.5&lt;br /&gt;
  n_sample_frames = 1000&lt;br /&gt;
  n_selected_frames = 100&lt;br /&gt;
 }&lt;br /&gt;
 n_bins = 10&lt;br /&gt;
&lt;br /&gt;
Copy and paste this set of parameter in an editor then save the file as &amp;quot;prime.phil&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
== Running the Program ==&lt;br /&gt;
You can run the program by giving it an input file:&lt;br /&gt;
&lt;br /&gt;
 prime.run prime.phil&lt;br /&gt;
&lt;br /&gt;
For this tutorial, PRIME will score the randomly selected 1,000 images then select the best 100 for running Brehm &amp;amp; Diederichs algorithm in Bootstrap mode. If you run the program with flag_plot=True, you&#039;ll see a plot showing two separated clusters, each representing images with matching assigned basis. &lt;br /&gt;
&lt;br /&gt;
[[File:Dials17 myo indexing ambiguity.png|thumb|left|Solving indexing ambiguity program in XFEL Crystallography.]]&lt;br /&gt;
PRIME will select on of these two clusters and merge it to get a reference set for the Bootstrap step. Here, the remaining images will get assigned with a basis that makes it correlate best with the reference set.&lt;br /&gt;
&lt;br /&gt;
Once all images are assigned with appropriate basis, PRIME will proceed to scaling and post-refinement steps. After three post-refinement cycles (default value), the process is done and here is the output of the program.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 Isotropic B-factor:     5.30&lt;br /&gt;
 No. of reflections&lt;br /&gt;
  all:                   7786&lt;br /&gt;
  outside resolution:      51&lt;br /&gt;
  outliers:                 0&lt;br /&gt;
  total left:            7735&lt;br /&gt;
 Summary for Prime_Run_1/postref_cycle_3_merge.mtz&lt;br /&gt;
 Bin Resolution Range     Completeness       N_obs  |Rmerge  Rsplit   CC1/2   N_ind |CCiso   N_ind|CCanoma  N_ind|  I/sigI     I      sigI      I**2 &lt;br /&gt;
 --------------------------------------------------------------------------------------------------------------------------------------------------&lt;br /&gt;
 01   19.88 -    5.35 100.0    807 /    807  189.78   85.75    8.87   98.43    807    0.00      0    0.00      0     4.46      684.2    136.2   3.57&lt;br /&gt;
 02    5.35 -    4.26 100.0    782 /    782  140.90   73.61    8.89   97.67    782    0.00      0    0.00      0     5.23      794.3    140.3   2.05&lt;br /&gt;
 03    4.26 -    3.73 100.0    788 /    788  129.32   69.32    8.70   98.11    788    0.00      0    0.00      0     5.41      878.5    150.3   1.95&lt;br /&gt;
 04    3.73 -    3.39 100.0    765 /    765  117.75   70.72    9.67   97.55    765    0.00      0    0.00      0     4.12      712.3    162.4   1.88&lt;br /&gt;
 05    3.39 -    3.15 100.0    770 /    770  113.22   71.61   11.22   88.54    770    0.00      0    0.00      0     2.73      500.1    173.7   2.19&lt;br /&gt;
 06    3.15 -    2.96 100.0    767 /    767  106.12   73.19   11.07   97.21    767    0.00      0    0.00      0     2.09      404.6    183.8   2.02&lt;br /&gt;
 07    2.96 -    2.81 100.0    766 /    766  103.73   75.79   12.53   96.62    766    0.00      0    0.00      0     1.72      345.3    193.9   1.89&lt;br /&gt;
 08    2.81 -    2.69 100.0    745 /    745  101.51   76.11   12.84   96.21    745    0.00      0    0.00      0     1.49      317.3    204.1   1.98&lt;br /&gt;
 09    2.69 -    2.59 100.0    786 /    786   97.88   77.59   14.19   95.40    786    0.00      0    0.00      0     1.38      299.0    209.3   1.86&lt;br /&gt;
 10    2.59 -    2.50 100.0    759 /    759   92.53   78.61   14.72   96.51    759    0.00      0    0.00      0     1.36      312.4    218.8   2.07&lt;br /&gt;
 --------------------------------------------------------------------------------------------------------------------------------------------------&lt;br /&gt;
         TOTAL        100.0   7735 /   7735  119.73   75.51   10.45   97.21   7735    0.00      0    0.00      0     3.02      527.3    176.9   2.56&lt;br /&gt;
 --------------------------------------------------------------------------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
 Summary of CC1/2 on three crystal axes&lt;br /&gt;
 Bin Resolution Range           CC1/2                       I                           N_refl           &lt;br /&gt;
                        a*      b*      c*  |      a*        b*       c*    |    a*      b*     c*      &lt;br /&gt;
 ---------------------------------------------------------------------------------------------------------&lt;br /&gt;
 01   19.88 -    5.35   97.01   98.64   98.23      528.6      559.6     1216.7     42     51     47&lt;br /&gt;
 02    5.35 -    4.26   97.64   98.43   99.08      817.6      527.5      964.9     43     44     40&lt;br /&gt;
 03    4.26 -    3.73   96.31   98.02   97.68      605.7      682.9      856.0     39     39     41&lt;br /&gt;
 04    3.73 -    3.39   98.49   98.55   97.73      961.9      532.6      729.1     42     37     45&lt;br /&gt;
 05    3.39 -    3.15   96.88   98.38   92.69      449.5      492.1      721.6     39     39     40&lt;br /&gt;
 06    3.15 -    2.96   98.48   93.58   98.61      389.9      303.4      391.7     39     37     39&lt;br /&gt;
 07    2.96 -    2.81   96.98   98.02   95.35      361.3      331.7      383.2     42     37     43&lt;br /&gt;
 08    2.81 -    2.69   95.29   94.02   94.69      290.8      194.7      292.7     41     35     36&lt;br /&gt;
 09    2.69 -    2.59   96.55   91.88   98.57      265.7      341.4      290.2     41     35     44&lt;br /&gt;
 10    2.59 -    2.50   94.44   97.81   96.67      249.0      400.1      236.2     42     36     40&lt;br /&gt;
 ----------------------------------------------------------------------------------------------------------&lt;br /&gt;
        total           97.57   97.74   94.58      494.1      446.0      619.4    410    390    415&lt;br /&gt;
 ----------------------------------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
 Summary of refinement and merging&lt;br /&gt;
 No. good frames:                  4733&lt;br /&gt;
 No. bad cc frames:                 113&lt;br /&gt;
 No. bad G frames) :                109&lt;br /&gt;
 No. bad unit cell frames:           20&lt;br /&gt;
 No. bad gamma_e frames:             22&lt;br /&gt;
 No. bad SE:                          2&lt;br /&gt;
 No. observations:               935265&lt;br /&gt;
 Mean target value (BEFORE: Mean Median (Std.))&lt;br /&gt;
 post-refinement:                301.22       259.10 (   171.56)&lt;br /&gt;
 (x,y) restraints:              1679.63      1573.15 (   657.49)&lt;br /&gt;
 Mean target value (AFTER: Mean Median (Std.))&lt;br /&gt;
 post-refinement:                300.02       257.53 (   170.98)&lt;br /&gt;
 (x,y) restraints:              1679.90      1572.77 (   660.19)&lt;br /&gt;
 SE:                            1915.60       776.84 ( 33765.97)&lt;br /&gt;
 G:                           1.000e+00    8.971e-01 ( 8.15e-01)&lt;br /&gt;
 B:                               11.83        14.45 (    11.95)&lt;br /&gt;
 Rot.x:                           -0.08         0.00 (    12.10)&lt;br /&gt;
 Rot.y:                            0.14         0.00 (     9.62)&lt;br /&gt;
 gamma_y:                       0.00000      0.00000 (  0.00000)&lt;br /&gt;
 gamma_z:                       0.00000      0.00000 (  0.00000)&lt;br /&gt;
 gamma_0:                       0.03793      0.00019 (  0.60820)&lt;br /&gt;
 gamma_e:                      -0.12824      0.00145 (  0.60227)&lt;br /&gt;
 voigt_nu:                      0.50000      0.50000 (  0.00000)&lt;br /&gt;
 unit cell&lt;br /&gt;
   a:                             91.45        91.45 (     0.11)&lt;br /&gt;
   b:                             91.45        91.45 (     0.11)&lt;br /&gt;
   c:                             45.96        45.96 (     0.12)&lt;br /&gt;
   alpha:                         90.00        90.00 (     0.00)&lt;br /&gt;
   beta:                          90.00        90.00 (     0.00)&lt;br /&gt;
   gamma:                        120.00       120.00 (     0.00)&lt;br /&gt;
 Parmeters from integration (not-refined)&lt;br /&gt;
  Wavelength:                   0.96861      0.96861 (  0.00000)&lt;br /&gt;
  Detector distance:          303.81868    303.81868 (  0.00000)&lt;br /&gt;
 * (standard deviation)&lt;br /&gt;
&lt;br /&gt;
 Total calculation time: 542.00 seconds&lt;br /&gt;
 Finished: Tuesday 14. February 2017 10:53:18&lt;br /&gt;
&lt;br /&gt;
== Obtaining the Output ==&lt;br /&gt;
&lt;br /&gt;
Your output will be in Prime_Run_n (where n is the number of run). &lt;br /&gt;
&lt;br /&gt;
 -bash-4.1$ ls Prime_Run_1/ -l&lt;br /&gt;
 total 9076&lt;br /&gt;
 -rw-r--r-- 1 mu238 camb  879638 Feb 14 10:53 crystal.o&lt;br /&gt;
 drwxr-xr-x 2 mu238 camb     104 Feb 14 10:46 index_ambiguity&lt;br /&gt;
 drwxr-xr-x 2 mu238 camb       6 Feb 14 10:44 isoform_cluster&lt;br /&gt;
 -rw-r--r-- 1 mu238 camb   32704 Feb 14 10:53 log.txt&lt;br /&gt;
 -rw-r--r-- 1 mu238 camb  324556 Feb 14 10:47 mean_scaled_merge.hkl&lt;br /&gt;
 -rw-r--r-- 1 mu238 camb  157260 Feb 14 10:47 mean_scaled_merge.mtz&lt;br /&gt;
 -rw-r--r-- 1 mu238 camb   15753 Feb 14 10:53 pickle.stat&lt;br /&gt;
 -rw-r--r-- 1 mu238 camb  324381 Feb 14 10:49 postref_cycle_1_merge.hkl&lt;br /&gt;
 -rw-r--r-- 1 mu238 camb  157260 Feb 14 10:49 postref_cycle_1_merge.mtz&lt;br /&gt;
 -rw-r--r-- 1 mu238 camb  324515 Feb 14 10:51 postref_cycle_2_merge.hkl&lt;br /&gt;
 -rw-r--r-- 1 mu238 camb  157260 Feb 14 10:51 postref_cycle_2_merge.mtz&lt;br /&gt;
 -rw-r--r-- 1 mu238 camb  324716 Feb 14 10:53 postref_cycle_3_merge.hkl&lt;br /&gt;
 -rw-r--r-- 1 mu238 camb  157340 Feb 14 10:53 postref_cycle_3_merge.mtz&lt;br /&gt;
 -rw-r--r-- 1 mu238 camb 6412200 Feb 14 10:53 rejections.txt&lt;br /&gt;
&lt;br /&gt;
File log.txt contains all the merging stats. The final merged reflection set is postref_cycle_3_merge.mtz (or .hkl).&lt;/div&gt;</summary>
		<author><name>Mona</name></author>
	</entry>
	<entry>
		<id>http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=2017_prime_tutorial&amp;diff=1396</id>
		<title>2017 prime tutorial</title>
		<link rel="alternate" type="text/html" href="http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=2017_prime_tutorial&amp;diff=1396"/>
		<updated>2017-02-14T19:47:35Z</updated>

		<summary type="html">&lt;p&gt;Mona: /* Running the Program */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Post-refine and Merge Sample Data Set with PRIME (2017 Tutorial)&lt;br /&gt;
&lt;br /&gt;
In this tutorial, we will work on the integration results from the first of Tutorial 2 (Myoglobin Data). Before proceeding to running the program, we&#039;ll consider making the input file for PRIME based on the situation of this data set.&lt;br /&gt;
&lt;br /&gt;
== Generating Input File ==&lt;br /&gt;
&lt;br /&gt;
PRIME input files contain information necessary for successful post-refinement and merging steps. You can access and review the list of input parameters by running prime.run or prime.run -h to view the description of these parameters. For this tutorial we&#039;ll start building it from scratch.&lt;br /&gt;
&lt;br /&gt;
* Location of integration results&lt;br /&gt;
In this case, we know the location where the integration results (pickle files) are. We can then set,&lt;br /&gt;
&lt;br /&gt;
 data = /net/viper/raid1/mu238/XfelProject/dials17/extracted&lt;br /&gt;
&lt;br /&gt;
Note that you supply data as a multiple arguments. The value of the parameter can be a file containing list of integration results, a folder, or a wildcard argument.&lt;br /&gt;
&lt;br /&gt;
* Unit cell information &lt;br /&gt;
You can obtain the mean (or median) unit-cell dimensions from either IOTA or DIALS. In case of IOTA, prime .phil file is auto generated and this information is readily available in there. For n_residues, enter number of residues in asymmetric unit of your molecule.&lt;br /&gt;
&lt;br /&gt;
 target_unit_cell = 91.7 91.7 46 90 90 120&lt;br /&gt;
 target_space_group = P6&lt;br /&gt;
 n_residues = 128&lt;br /&gt;
&lt;br /&gt;
* Detector information&lt;br /&gt;
 pixel_size_mm = 0.172&lt;br /&gt;
&lt;br /&gt;
* Post-refinement and Scaling information&lt;br /&gt;
This is where you specify the optimal resolution cutoffs for post-refinement and merging. Note that when running for the first time on you newly collected data, you can choose the &amp;quot;expected&amp;quot; values (resolution which you see the spots at the corner or on the edge). You can then adjust these parameters when analyzing merging statistics based on the I/sigI values in the high resolution shells and rerun the program again. Note that sigma cutoffs are set to 1.5 in scaling and post-refinement steps while it&#039;s set to -3.0 so we can include negative values in the merged reflection set.  &lt;br /&gt;
 &lt;br /&gt;
 scale {&lt;br /&gt;
   d_min = 2.5&lt;br /&gt;
   d_max = 20&lt;br /&gt;
   sigma_min = 1.5&lt;br /&gt;
 }&lt;br /&gt;
 postref {&lt;br /&gt;
   scale {&lt;br /&gt;
     d_min = 2.5&lt;br /&gt;
     d_max = 20&lt;br /&gt;
     sigma_min = 1.5&lt;br /&gt;
     partiality_min = 0.1&lt;br /&gt;
   allparams {&lt;br /&gt;
     flag_on = True&lt;br /&gt;
     d_min = 2.5&lt;br /&gt;
     d_max = 20&lt;br /&gt;
     sigma_min = 1.5&lt;br /&gt;
     partiality_min = 0.1&lt;br /&gt;
     uc_tolerance = 5&lt;br /&gt;
   }&lt;br /&gt;
 }&lt;br /&gt;
 merge {&lt;br /&gt;
   d_min = 2.5&lt;br /&gt;
   d_max = 20&lt;br /&gt;
   sigma_min = -3.0&lt;br /&gt;
   partiality_min = 0.1&lt;br /&gt;
   uc_tolerance = 5&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
* Indexing ambiguity&lt;br /&gt;
For other sets that are not in polar space or have indexing ambiguity (when one or more of the unit-cell dimensions are very similar but not the same!), you can very well use the .phil file parameters thus far to proceed and run post-refinement. However, this data set is in P6 (polar space group) and therefore, the indexing ambiguity needs to be resolved prior to other refinement and merging steps.&lt;br /&gt;
&lt;br /&gt;
Other point worth noting is for any polar space groups, PRIME will automatically solve the ambiguity based on the default parameters. However, this data set has about 5,000 integration results so we want to make sure that we modify the number of images used for random and best selections.&lt;br /&gt;
&lt;br /&gt;
 indexing_ambiguity {&lt;br /&gt;
  mode = Auto&lt;br /&gt;
  index_basis_in = None&lt;br /&gt;
  assigned_basis = None&lt;br /&gt;
  d_min = 3.0&lt;br /&gt;
  d_max = 10.0&lt;br /&gt;
  sigma_min = 1.5&lt;br /&gt;
  n_sample_frames = 1000&lt;br /&gt;
  n_selected_frames = 100&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
We left other parameters to their default value and modified n_sample_frames to 1000 and n_selected_frames to 100.&lt;br /&gt;
&lt;br /&gt;
* No. of Bin&lt;br /&gt;
 n_bins = 10&lt;br /&gt;
&lt;br /&gt;
Now we have a complete .phil file ready to run.&lt;br /&gt;
&lt;br /&gt;
 data = /net/viper/raid1/mu238/XfelProject/dials17/extracted&lt;br /&gt;
 target_unit_cell = 91.7 91.7 46 90 90 120&lt;br /&gt;
 target_space_group = P6&lt;br /&gt;
 n_residues = 128&lt;br /&gt;
 pixel_size_mm = 0.172&lt;br /&gt;
 scale {&lt;br /&gt;
  d_min = 2.5&lt;br /&gt;
  d_max = 20&lt;br /&gt;
  sigma_min = 1.5&lt;br /&gt;
 }&lt;br /&gt;
 postref {&lt;br /&gt;
  scale {&lt;br /&gt;
    d_min = 2.5&lt;br /&gt;
    d_max = 20&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
  }&lt;br /&gt;
  allparams {&lt;br /&gt;
    flag_on = True&lt;br /&gt;
    d_min = 2.5&lt;br /&gt;
    d_max = 20&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
    uc_tolerance = 5&lt;br /&gt;
  }&lt;br /&gt;
 }&lt;br /&gt;
 merge {&lt;br /&gt;
  d_min = 2.5&lt;br /&gt;
  d_max = 20&lt;br /&gt;
  sigma_min = -3.0&lt;br /&gt;
  partiality_min = 0.1&lt;br /&gt;
  uc_tolerance = 5&lt;br /&gt;
 }&lt;br /&gt;
 indexing_ambiguity {&lt;br /&gt;
  mode = Auto&lt;br /&gt;
  index_basis_in = None&lt;br /&gt;
  assigned_basis = None&lt;br /&gt;
  d_min = 3.0&lt;br /&gt;
  d_max = 10.0&lt;br /&gt;
  sigma_min = 1.5&lt;br /&gt;
  n_sample_frames = 1000&lt;br /&gt;
  n_selected_frames = 100&lt;br /&gt;
 }&lt;br /&gt;
 n_bins = 10&lt;br /&gt;
&lt;br /&gt;
Copy and paste this set of parameter in an editor then save the file as &amp;quot;prime.phil&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
== Running the Program ==&lt;br /&gt;
You can run the program by giving it an input file:&lt;br /&gt;
&lt;br /&gt;
 prime.run prime.phil&lt;br /&gt;
&lt;br /&gt;
For this tutorial, PRIME will score the randomly selected 1,000 images then select the best 100 for running Brehm &amp;amp; Diederichs algorithm in Bootstrap mode. If you run the program with flag_plot=True, you&#039;ll see a plot showing two separated clusters, each representing images with matching assigned basis. &lt;br /&gt;
&lt;br /&gt;
[[File:Dials17 myo indexing ambiguity.png|thumb|left|Solving indexing ambiguity program in XFEL Crystallography.]]&lt;br /&gt;
PRIME will select on of these two clusters and merge it to get a reference set for the Bootstrap step. Here, the remaining images will get assigned with a basis that makes it correlate best with the reference set.&lt;br /&gt;
&lt;br /&gt;
Once all images are assigned with appropriate basis, PRIME will proceed to scaling and post-refinement steps. After three post-refinement cycles (default value), the process is done and here is the output of the program.&lt;br /&gt;
&lt;br /&gt;
 Isotropic B-factor:     5.30&lt;br /&gt;
 No. of reflections&lt;br /&gt;
  all:                   7786&lt;br /&gt;
  outside resolution:      51&lt;br /&gt;
  outliers:                 0&lt;br /&gt;
  total left:            7735&lt;br /&gt;
 Summary for Prime_Run_1/postref_cycle_3_merge.mtz&lt;br /&gt;
 Bin Resolution Range     Completeness       N_obs  |Rmerge  Rsplit   CC1/2   N_ind |CCiso   N_ind|CCanoma  N_ind|  I/sigI     I      sigI      I**2 &lt;br /&gt;
 --------------------------------------------------------------------------------------------------------------------------------------------------&lt;br /&gt;
 01   19.88 -    5.35 100.0    807 /    807  189.78   85.75    8.87   98.43    807    0.00      0    0.00      0     4.46      684.2    136.2   3.57&lt;br /&gt;
 02    5.35 -    4.26 100.0    782 /    782  140.90   73.61    8.89   97.67    782    0.00      0    0.00      0     5.23      794.3    140.3   2.05&lt;br /&gt;
 03    4.26 -    3.73 100.0    788 /    788  129.32   69.32    8.70   98.11    788    0.00      0    0.00      0     5.41      878.5    150.3   1.95&lt;br /&gt;
 04    3.73 -    3.39 100.0    765 /    765  117.75   70.72    9.67   97.55    765    0.00      0    0.00      0     4.12      712.3    162.4   1.88&lt;br /&gt;
 05    3.39 -    3.15 100.0    770 /    770  113.22   71.61   11.22   88.54    770    0.00      0    0.00      0     2.73      500.1    173.7   2.19&lt;br /&gt;
 06    3.15 -    2.96 100.0    767 /    767  106.12   73.19   11.07   97.21    767    0.00      0    0.00      0     2.09      404.6    183.8   2.02&lt;br /&gt;
 07    2.96 -    2.81 100.0    766 /    766  103.73   75.79   12.53   96.62    766    0.00      0    0.00      0     1.72      345.3    193.9   1.89&lt;br /&gt;
 08    2.81 -    2.69 100.0    745 /    745  101.51   76.11   12.84   96.21    745    0.00      0    0.00      0     1.49      317.3    204.1   1.98&lt;br /&gt;
 09    2.69 -    2.59 100.0    786 /    786   97.88   77.59   14.19   95.40    786    0.00      0    0.00      0     1.38      299.0    209.3   1.86&lt;br /&gt;
 10    2.59 -    2.50 100.0    759 /    759   92.53   78.61   14.72   96.51    759    0.00      0    0.00      0     1.36      312.4    218.8   2.07&lt;br /&gt;
 --------------------------------------------------------------------------------------------------------------------------------------------------&lt;br /&gt;
         TOTAL        100.0   7735 /   7735  119.73   75.51   10.45   97.21   7735    0.00      0    0.00      0     3.02      527.3    176.9   2.56&lt;br /&gt;
 --------------------------------------------------------------------------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
 Summary of CC1/2 on three crystal axes&lt;br /&gt;
 Bin Resolution Range           CC1/2                       I                           N_refl           &lt;br /&gt;
                        a*      b*      c*  |      a*        b*       c*    |    a*      b*     c*      &lt;br /&gt;
 ---------------------------------------------------------------------------------------------------------&lt;br /&gt;
 01   19.88 -    5.35   97.01   98.64   98.23      528.6      559.6     1216.7     42     51     47&lt;br /&gt;
 02    5.35 -    4.26   97.64   98.43   99.08      817.6      527.5      964.9     43     44     40&lt;br /&gt;
 03    4.26 -    3.73   96.31   98.02   97.68      605.7      682.9      856.0     39     39     41&lt;br /&gt;
 04    3.73 -    3.39   98.49   98.55   97.73      961.9      532.6      729.1     42     37     45&lt;br /&gt;
 05    3.39 -    3.15   96.88   98.38   92.69      449.5      492.1      721.6     39     39     40&lt;br /&gt;
 06    3.15 -    2.96   98.48   93.58   98.61      389.9      303.4      391.7     39     37     39&lt;br /&gt;
 07    2.96 -    2.81   96.98   98.02   95.35      361.3      331.7      383.2     42     37     43&lt;br /&gt;
 08    2.81 -    2.69   95.29   94.02   94.69      290.8      194.7      292.7     41     35     36&lt;br /&gt;
 09    2.69 -    2.59   96.55   91.88   98.57      265.7      341.4      290.2     41     35     44&lt;br /&gt;
 10    2.59 -    2.50   94.44   97.81   96.67      249.0      400.1      236.2     42     36     40&lt;br /&gt;
 ----------------------------------------------------------------------------------------------------------&lt;br /&gt;
        total           97.57   97.74   94.58      494.1      446.0      619.4    410    390    415&lt;br /&gt;
 ----------------------------------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
 Summary of refinement and merging&lt;br /&gt;
 No. good frames:                  4733&lt;br /&gt;
 No. bad cc frames:                 113&lt;br /&gt;
 No. bad G frames) :                109&lt;br /&gt;
 No. bad unit cell frames:           20&lt;br /&gt;
 No. bad gamma_e frames:             22&lt;br /&gt;
 No. bad SE:                          2&lt;br /&gt;
 No. observations:               935265&lt;br /&gt;
 Mean target value (BEFORE: Mean Median (Std.))&lt;br /&gt;
 post-refinement:                301.22       259.10 (   171.56)&lt;br /&gt;
 (x,y) restraints:              1679.63      1573.15 (   657.49)&lt;br /&gt;
 Mean target value (AFTER: Mean Median (Std.))&lt;br /&gt;
 post-refinement:                300.02       257.53 (   170.98)&lt;br /&gt;
 (x,y) restraints:              1679.90      1572.77 (   660.19)&lt;br /&gt;
 SE:                            1915.60       776.84 ( 33765.97)&lt;br /&gt;
 G:                           1.000e+00    8.971e-01 ( 8.15e-01)&lt;br /&gt;
 B:                               11.83        14.45 (    11.95)&lt;br /&gt;
 Rot.x:                           -0.08         0.00 (    12.10)&lt;br /&gt;
 Rot.y:                            0.14         0.00 (     9.62)&lt;br /&gt;
 gamma_y:                       0.00000      0.00000 (  0.00000)&lt;br /&gt;
 gamma_z:                       0.00000      0.00000 (  0.00000)&lt;br /&gt;
 gamma_0:                       0.03793      0.00019 (  0.60820)&lt;br /&gt;
 gamma_e:                      -0.12824      0.00145 (  0.60227)&lt;br /&gt;
 voigt_nu:                      0.50000      0.50000 (  0.00000)&lt;br /&gt;
 unit cell&lt;br /&gt;
   a:                             91.45        91.45 (     0.11)&lt;br /&gt;
   b:                             91.45        91.45 (     0.11)&lt;br /&gt;
   c:                             45.96        45.96 (     0.12)&lt;br /&gt;
   alpha:                         90.00        90.00 (     0.00)&lt;br /&gt;
   beta:                          90.00        90.00 (     0.00)&lt;br /&gt;
   gamma:                        120.00       120.00 (     0.00)&lt;br /&gt;
 Parmeters from integration (not-refined)&lt;br /&gt;
  Wavelength:                   0.96861      0.96861 (  0.00000)&lt;br /&gt;
  Detector distance:          303.81868    303.81868 (  0.00000)&lt;br /&gt;
 * (standard deviation)&lt;br /&gt;
&lt;br /&gt;
 Total calculation time: 542.00 seconds&lt;br /&gt;
 Finished: Tuesday 14. February 2017 10:53:18&lt;br /&gt;
&lt;br /&gt;
== Obtaining the Output ==&lt;br /&gt;
&lt;br /&gt;
Your output will be in Prime_Run_n (where n is the number of run). &lt;br /&gt;
&lt;br /&gt;
 -bash-4.1$ ls Prime_Run_1/ -l&lt;br /&gt;
 total 9076&lt;br /&gt;
 -rw-r--r-- 1 mu238 camb  879638 Feb 14 10:53 crystal.o&lt;br /&gt;
 drwxr-xr-x 2 mu238 camb     104 Feb 14 10:46 index_ambiguity&lt;br /&gt;
 drwxr-xr-x 2 mu238 camb       6 Feb 14 10:44 isoform_cluster&lt;br /&gt;
 -rw-r--r-- 1 mu238 camb   32704 Feb 14 10:53 log.txt&lt;br /&gt;
 -rw-r--r-- 1 mu238 camb  324556 Feb 14 10:47 mean_scaled_merge.hkl&lt;br /&gt;
 -rw-r--r-- 1 mu238 camb  157260 Feb 14 10:47 mean_scaled_merge.mtz&lt;br /&gt;
 -rw-r--r-- 1 mu238 camb   15753 Feb 14 10:53 pickle.stat&lt;br /&gt;
 -rw-r--r-- 1 mu238 camb  324381 Feb 14 10:49 postref_cycle_1_merge.hkl&lt;br /&gt;
 -rw-r--r-- 1 mu238 camb  157260 Feb 14 10:49 postref_cycle_1_merge.mtz&lt;br /&gt;
 -rw-r--r-- 1 mu238 camb  324515 Feb 14 10:51 postref_cycle_2_merge.hkl&lt;br /&gt;
 -rw-r--r-- 1 mu238 camb  157260 Feb 14 10:51 postref_cycle_2_merge.mtz&lt;br /&gt;
 -rw-r--r-- 1 mu238 camb  324716 Feb 14 10:53 postref_cycle_3_merge.hkl&lt;br /&gt;
 -rw-r--r-- 1 mu238 camb  157340 Feb 14 10:53 postref_cycle_3_merge.mtz&lt;br /&gt;
 -rw-r--r-- 1 mu238 camb 6412200 Feb 14 10:53 rejections.txt&lt;br /&gt;
&lt;br /&gt;
File log.txt contains all the merging stats. The final merged reflection set is postref_cycle_3_merge.mtz (or .hkl).&lt;/div&gt;</summary>
		<author><name>Mona</name></author>
	</entry>
	<entry>
		<id>http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=Cctbx.prime&amp;diff=1395</id>
		<title>Cctbx.prime</title>
		<link rel="alternate" type="text/html" href="http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=Cctbx.prime&amp;diff=1395"/>
		<updated>2017-02-14T19:25:55Z</updated>

		<summary type="html">&lt;p&gt;Mona: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Prime: &#039;&#039;&#039;p&#039;&#039;&#039;ost-&#039;&#039;&#039;r&#039;&#039;&#039;ef&#039;&#039;&#039;i&#039;&#039;&#039;nement and &#039;&#039;&#039;me&#039;&#039;&#039;rging ==&lt;br /&gt;
With the latest update, prime can be used to process data on multiple nodes (on a queuing system). At the moment, only LSF (bsub) is supported. See documentation below for more information on how to use the queuing system.&lt;br /&gt;
&lt;br /&gt;
This major update replaces prime.postrefine with &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.run &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Step-by-step guidelines to post-refine and merge XFEL diffraction images. For more detail and citation, see &lt;br /&gt;
&amp;quot;Enabling X-ray Free Electron Laser Crystallography for Challenging Biological Systems from a Limited Number of Crystals&amp;quot;&lt;br /&gt;
[http://elifesciences.org/content/4/e05421 &amp;quot;DOI: http://dx.doi.org/10.7554/eLife.05421&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
== Prime is gui-ed == &lt;br /&gt;
Thanks to Dr. Lyubimov, PRIME is also available as a Graphic User Interface program. Try it by running&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Click to see [https://commons.wikimedia.org/wiki/File:PRIME_main.png &amp;quot;PRIME main gui&amp;quot;] and [https://commons.wikimedia.org/wiki/File:PRIME_advanced_options.png &amp;quot;Advanced options&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
== Getting started == &lt;br /&gt;
&#039;&#039;&#039;Generating input phil file&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
Like most programs developed under &#039;&#039;cctbx&#039;&#039; framework, &#039;&#039;prime&#039;&#039; reads in input .phil file, which stores all the parameters needed to run post-refinement and merging steps. To generate the template .phil file, do the dry run by calling&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ prime.run&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
An example of the template .phil file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
data = None&lt;br /&gt;
run_no = None&lt;br /&gt;
title = None&lt;br /&gt;
scale {&lt;br /&gt;
  d_min = 0.1&lt;br /&gt;
  d_max = 99&lt;br /&gt;
  sigma_min = 1.5&lt;br /&gt;
}&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can save the content of the output to any file name - in this tutorial, let&#039;s save it to thermolysin.phil.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;First look at your phil file&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
To run prime, set the required parameters to match with your experiments (you can leave other parameters with their default values - or just delete them from you .phil file). The most interesting parameters are shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
data = /path/to/your/integarion/result/pickle_files&lt;br /&gt;
run_no = 001&lt;br /&gt;
title = First trial for thermolysin&lt;br /&gt;
scale {&lt;br /&gt;
  d_min = 2.1&lt;br /&gt;
  d_max = 45&lt;br /&gt;
  sigma_min = 1.5&lt;br /&gt;
}&lt;br /&gt;
postref {&lt;br /&gt;
  scale {&lt;br /&gt;
    d_min = 2.1&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
  }&lt;br /&gt;
  crystal_orientation {&lt;br /&gt;
    flag_on = True&lt;br /&gt;
    d_min = 2.1&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
  }&lt;br /&gt;
  reflecting_range {&lt;br /&gt;
    flag_on = True&lt;br /&gt;
    d_min = 2.1&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
  }&lt;br /&gt;
  unit_cell {&lt;br /&gt;
    flag_on = True&lt;br /&gt;
    d_min = 2.1&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
    uc_tolerance = 3&lt;br /&gt;
  }&lt;br /&gt;
  allparams {&lt;br /&gt;
    flag_on = False&lt;br /&gt;
    d_min = 2.1&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
    uc_tolerance = 3&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
merge {&lt;br /&gt;
  d_min = 2.1&lt;br /&gt;
  d_max = 45&lt;br /&gt;
  sigma_min = 1.5&lt;br /&gt;
  partiality_min = 0.1&lt;br /&gt;
  uc_tolerance = 3&lt;br /&gt;
}&lt;br /&gt;
target_unit_cell = 93.99,93.99,130.87,90,90,120&lt;br /&gt;
target_space_group = P 61 2 2&lt;br /&gt;
pixel_size_mm = 0.102&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You should pay attention to d_min and d_max for the refinement and merging parameters. If you use IOTA to integrate the images, IOTA will output .phil file for prime that has the optimal resolution range. If not, a few trial-and-error runs may be required to get the best resolution range for your dataset. Use merging statistics output by prime and check the values of CC1/2 and I/sigI to find out your optimal resolution range.&lt;br /&gt;
&lt;br /&gt;
Cell parameters (target_unit_cell and target_space_group) are required to run prime. Target cell parameter is used to remove some outlier images by controlling uc_tolerance parameter (the default value of tolerate range is 3% different). Space group parameter is used in removing outliers and merging with the given symmetry.&lt;br /&gt;
&lt;br /&gt;
Don&#039;t forget also to change your pixel size in millimeters. Check what your detector is and note down its pixel size. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Running post-refinement&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
Once you have the input .phil file, you can run &#039;&#039;prime&#039;&#039; by calling&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.run thermolysin.phil&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;Prime&#039;&#039; will post-refine and merge for reflection sets using three (default value) macrocycles. At the end of the run, you can obtain merging statistics in the last cycle - all other cycle statistics are also available in log.txt.&lt;br /&gt;
&lt;br /&gt;
An example of merging statistics:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Summary for 001/postref_cycle_1_merge.mtz&lt;br /&gt;
Bin Resolution Range     Completeness      &amp;lt;N_obs&amp;gt;  |Rsplit  CC1/2  N_ind |CCanom   N_ind| &amp;lt;I/sigI&amp;gt;   &amp;lt;I&amp;gt;&lt;br /&gt;
-------------------------------------------------------------------------------------------------------------&lt;br /&gt;
02    5.70 -    4.52 100.0   1055 /   1055   65.89   16.02   89.15   1055    0.00      0    20.17    2101.97&lt;br /&gt;
03    4.52 -    3.95 100.0   1032 /   1032   61.53   14.48   92.03   1032    0.00      0    20.39    2529.90&lt;br /&gt;
04    3.95 -    3.59 100.0   1016 /   1016   54.15   15.61   90.13   1016    0.00      0    16.69    1971.43&lt;br /&gt;
05    3.59 -    3.33 100.0   1004 /   1004   42.67   17.66   89.23   1004    0.00      0    14.21    1502.14&lt;br /&gt;
06    3.33 -    3.14 100.0   1013 /   1013   32.77   20.40   84.26   1013    0.00      0    11.76    1077.60&lt;br /&gt;
07    3.14 -    2.98 100.0    995 /    995   27.36   23.00   78.72    995    0.00      0    11.58     935.37&lt;br /&gt;
08    2.98 -    2.85 100.0   1006 /   1006   23.57   22.63   82.26   1006    0.00      0    10.56     722.62&lt;br /&gt;
09    2.85 -    2.74 100.0    986 /    986   16.64   28.51   72.90    985    0.00      0    10.01     591.56&lt;br /&gt;
10    2.74 -    2.65  99.9    989 /    990   12.41   31.35   72.95    987    0.00      0     9.91     515.07&lt;br /&gt;
11    2.65 -    2.56  99.7    979 /    982    9.35   37.14   65.31    970    0.00      0     9.31     438.96&lt;br /&gt;
12    2.56 -    2.49  98.0    979 /    999    6.06   45.98   45.37    930    0.00      0     9.45     390.05&lt;br /&gt;
13    2.49 -    2.42  95.1    931 /    979    4.46   50.68   34.20    834    0.00      0     8.93     334.80&lt;br /&gt;
14    2.42 -    2.37  91.7    896 /    977    3.35   55.66   37.15    729    0.00      0     9.27     320.17&lt;br /&gt;
15    2.37 -    2.31  83.9    829 /    988    2.61   56.92   43.21    600    0.00      0     9.60     296.67&lt;br /&gt;
16    2.31 -    2.26  72.4    702 /    969    1.97   65.81   26.89    386    0.00      0    10.29     284.39&lt;br /&gt;
17    2.26 -    2.22  59.1    582 /    985    1.75   64.72   31.28    275    0.00      0     9.87     284.06&lt;br /&gt;
18    2.22 -    2.18  52.9    513 /    970    1.51   71.27   16.86    188    0.00      0     8.93     215.31&lt;br /&gt;
19    2.18 -    2.14  35.7    349 /    978    1.32   62.26   68.25     90    0.00      0     8.22     199.09&lt;br /&gt;
20    2.14 -    2.10  23.1    227 /    981    1.20   92.14   -9.20     42    0.00      0     8.59     224.44&lt;br /&gt;
-------------------------------------------------------------------------------------------------------------&lt;br /&gt;
        TOTAL         85.9  17224 /  20046   27.11   21.11   92.07  15305    0.00      0    12.87     999.53&lt;br /&gt;
-------------------------------------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
Summary of refinement and merging&lt;br /&gt;
 No. good frames:                  1809&lt;br /&gt;
 No. bad cc frames:                 153&lt;br /&gt;
 No. bad G frames) :                  0&lt;br /&gt;
 No. bad unit cell frames:            5&lt;br /&gt;
 No. bad gamma_e frames:              0&lt;br /&gt;
 No. bad SE:                          0&lt;br /&gt;
 No. observations:               466997&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Solving indexing ambiguity (New) == &lt;br /&gt;
* SOFTWARE UPDATE REQUIRED *&lt;br /&gt;
With the latest version (Aug 31, 2016), you can solve the indexing ambiguity problem directly in prime. The Brehm &amp;amp; Diederichs algorithms ([http://dx.doi.org/10.1107/S1399004713025431 &amp;quot;doi:10.1107/S1399004713025431&amp;quot;]) have been implemented with bootstrap capability to handle large dataset.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Merohedral Twinning&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
For merohedral twinning (27 space groups e.g. P6), the indexing choices will be determined automatically in prime. Use this default setting in your .phil file,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
indexing_ambiguity {&lt;br /&gt;
  mode = Auto&lt;br /&gt;
  index_basis_in = None&lt;br /&gt;
  assigned_basis = None&lt;br /&gt;
  n_sample_frames = 300&lt;br /&gt;
  n_selected_frames = 100&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
The n_sample_frames parameter indicates no. of images that will be used for the calculation of the scoring function. After that, only n_selected_images will be used in the B&amp;amp;D algorithms. This saves a lot of computing time since only the selected images will be used for the determination of the ambiguity. You can change these two parameters to fit with your experiments. The default values are 300 and 100 (give 300 - use 100).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Pseudo-Merohedral Twinning&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
For pseudo-merohedral twinning, due to different possibilities for the indexing choice, prime doesn&#039;t determine these choices automatically. If you suspect that you may have pseudo twinning (b and c are similar, beta angle is almost 90 degree but not quite), you have an option to force prime to determine the ambiguity according to your choices.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
indexing_ambiguity {&lt;br /&gt;
  mode = Forced&lt;br /&gt;
  index_basis_in = None&lt;br /&gt;
  assigned_basis = -h,l,k&lt;br /&gt;
  assigned_basis = -k, l, h&lt;br /&gt;
  n_sample_frames = 300&lt;br /&gt;
  n_selected_frames = 100&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When you set indexing_ambiguity.mode to Forced, you can assign indexing choices according to your problem. In this example, two more choices (-h, l, k and -k, l, h) were assigned as the indexing choice.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Reusing the solution&#039;&#039;&#039; &amp;lt;br&amp;gt;&lt;br /&gt;
At the end of the run, your solution pickle is saved to your_run_no/index_ambiguity/solution_pickle.pickle. If you don&#039;t want to spend time solving the ambiguity again in the next run, you can reuse this solution pickle by setting these parameters:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
indexing_ambiguity {&lt;br /&gt;
  mode = Auto&lt;br /&gt;
  index_basis_in = your_run_no/index_ambiguity/solution_pickle.pickle&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will bypass the indexing ambiguity module. Prime will use the solution file to perform normal post-refinement and merging.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Using an external reference set&#039;&#039;&#039; &amp;lt;br&amp;gt;&lt;br /&gt;
To use another isomorphous dataset (e.g. from a synchrotron experiment) as a reference set to solve the ambiguity, you can specify an mtz file as part of these parameters:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
indexing_ambiguity {&lt;br /&gt;
  mode = Auto&lt;br /&gt;
  index_basis_in = path/to/your/mtz/file.mtz&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Again, you can choose to do Auto or Forced (with a list of assigned_basis parameters) depending on your problem.&lt;br /&gt;
&lt;br /&gt;
== More detail with input parameters ==&lt;br /&gt;
Now that you have your first trial merged data set, you can explore different parameter settings to merge or to obtain the Bijvoet pairs (I+/I-) for your anomalous data set.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Anomalous data:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
target_anomalous_flag = True&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
In the last cycle, prime will output a reflection set with I+ and I-.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Number of micro- and macrocycles&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
n_postref_cycle = 3&lt;br /&gt;
n_postref_sub_cycle = 1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Number of bins for merging statistics&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
n_bins = 20&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Help with input parameters ==&lt;br /&gt;
&lt;br /&gt;
Most input parameters are self-explained. However, you can run -h switch to view help information for each parameter.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.run -h&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Running on multiple nodes ==&lt;br /&gt;
For LCLS users (or other users with LSF bsub), you can use psana (or your) queuing system to parallelize the entire process. For example, if you want to run your job on 100 nodes using psanq, you can specify:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
queue {&lt;br /&gt;
  mode = bsub&lt;br /&gt;
  qname = psanaq&lt;br /&gt;
  n_nodes = 100&lt;br /&gt;
}&lt;br /&gt;
timeout_seconds = 300&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Prime will divide all the images into 100 batches and submit them to different nodes. It will wait until all images in every batches are done before returning to the merging step (or the exit step in the manual mode). You can control timeout_seconds parameter to tell prime how long it should wait for all the image batches to finish. Usually, this timeout parameter is not used (all images should return before 300 seconds) but in case, you need to wait longer or shorter, you can modify this parameter.&lt;/div&gt;</summary>
		<author><name>Mona</name></author>
	</entry>
	<entry>
		<id>http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=Cctbx.prime&amp;diff=1394</id>
		<title>Cctbx.prime</title>
		<link rel="alternate" type="text/html" href="http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=Cctbx.prime&amp;diff=1394"/>
		<updated>2017-02-14T19:24:16Z</updated>

		<summary type="html">&lt;p&gt;Mona: /* Getting started */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Prime: &#039;&#039;&#039;p&#039;&#039;&#039;ost-&#039;&#039;&#039;r&#039;&#039;&#039;ef&#039;&#039;&#039;i&#039;&#039;&#039;nement and &#039;&#039;&#039;me&#039;&#039;&#039;rging ==&lt;br /&gt;
With the latest update, prime can be used to process data on multiple nodes (on a queuing system). At the moment, only LSF (bsub) is supported. See documentation below for more information on how to use the queuing system.&lt;br /&gt;
&lt;br /&gt;
This major update replaces prime.postrefine with &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.run &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Step-by-step guidelines to post-refine and merge XFEL diffraction images. For more detail and citation, see &lt;br /&gt;
&amp;quot;Enabling X-ray Free Electron Laser Crystallography for Challenging Biological Systems from a Limited Number of Crystals&amp;quot;&lt;br /&gt;
[http://elifesciences.org/content/4/e05421 &amp;quot;DOI: http://dx.doi.org/10.7554/eLife.05421&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
== Prime is gui-ed == &lt;br /&gt;
Thanks to Dr. Lyubimov, PRIME is also available as a Graphic User Interface program. Try it by running&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Click to see [https://commons.wikimedia.org/wiki/File:PRIME_main.png &amp;quot;PRIME main gui&amp;quot;] and [https://commons.wikimedia.org/wiki/File:PRIME_advanced_options.png &amp;quot;Advanced options&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
== Getting started == &lt;br /&gt;
&#039;&#039;&#039;Generating input phil file&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
Like most programs developed under &#039;&#039;cctbx&#039;&#039; framework, &#039;&#039;prime&#039;&#039; reads in input .phil file, which stores all the parameters needed to run post-refinement and merging steps. To generate the template .phil file, do the dry run by calling&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ prime.run&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
An example of the template .phil file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
data = None&lt;br /&gt;
run_no = None&lt;br /&gt;
title = None&lt;br /&gt;
scale {&lt;br /&gt;
  d_min = 0.1&lt;br /&gt;
  d_max = 99&lt;br /&gt;
  sigma_min = 1.5&lt;br /&gt;
}&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can save the content of the output to any file name - in this tutorial, let&#039;s save it to thermolysin.phil.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;First look at your phil file&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
To run prime, set the required parameters to match with your experiments (you can leave other parameters with their default values - or just delete them from you .phil file). The most interesting parameters are shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
data = /path/to/your/integarion/result/pickle_files&lt;br /&gt;
run_no = 001&lt;br /&gt;
title = First trial for thermolysin&lt;br /&gt;
scale {&lt;br /&gt;
  d_min = 2.1&lt;br /&gt;
  d_max = 45&lt;br /&gt;
  sigma_min = 1.5&lt;br /&gt;
}&lt;br /&gt;
postref {&lt;br /&gt;
  scale {&lt;br /&gt;
    d_min = 2.1&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
  }&lt;br /&gt;
  crystal_orientation {&lt;br /&gt;
    flag_on = True&lt;br /&gt;
    d_min = 2.1&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
  }&lt;br /&gt;
  reflecting_range {&lt;br /&gt;
    flag_on = True&lt;br /&gt;
    d_min = 2.1&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
  }&lt;br /&gt;
  unit_cell {&lt;br /&gt;
    flag_on = True&lt;br /&gt;
    d_min = 2.1&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
    uc_tolerance = 3&lt;br /&gt;
  }&lt;br /&gt;
  allparams {&lt;br /&gt;
    flag_on = False&lt;br /&gt;
    d_min = 2.1&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
    uc_tolerance = 3&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
merge {&lt;br /&gt;
  d_min = 2.1&lt;br /&gt;
  d_max = 45&lt;br /&gt;
  sigma_min = 1.5&lt;br /&gt;
  partiality_min = 0.1&lt;br /&gt;
  uc_tolerance = 3&lt;br /&gt;
}&lt;br /&gt;
target_unit_cell = 93.99,93.99,130.87,90,90,120&lt;br /&gt;
target_space_group = P 61 2 2&lt;br /&gt;
pixel_size_mm = 0.102&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You should pay attention to d_min and d_max for the refinement and merging parameters. If you use IOTA to integrate the images, IOTA will output .phil file for prime that has the optimal resolution range. If not, a few trial-and-error runs may be required to get the best resolution range for your dataset. Use merging statistics output by prime and check the values of CC1/2 and I/sigI to find out your optimal resolution range.&lt;br /&gt;
&lt;br /&gt;
Cell parameters (target_unit_cell and target_space_group) are required to run prime. Target cell parameter is used to remove some outlier images by controlling uc_tolerance parameter (the default value of tolerate range is 3% different). Space group parameter is used in removing outliers and merging with the given symmetry.&lt;br /&gt;
&lt;br /&gt;
Don&#039;t forget also to change your pixel size in millimeters. Check what your detector is and note down its pixel size. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Running post-refinement&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
Once you have the input .phil file, you can run &#039;&#039;prime&#039;&#039; by calling&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.run thermolysin.phil&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;Prime&#039;&#039; will post-refine and merge for reflection sets using three (default value) macrocycles. At the end of the run, you can obtain merging statistics in the last cycle - all other cycle statistics are also available in log.txt.&lt;br /&gt;
&lt;br /&gt;
An example of merging statistics:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Summary for 001/postref_cycle_1_merge.mtz&lt;br /&gt;
Bin Resolution Range     Completeness      &amp;lt;N_obs&amp;gt;  |Rsplit  CC1/2  N_ind |CCanom   N_ind| &amp;lt;I/sigI&amp;gt;   &amp;lt;I&amp;gt;&lt;br /&gt;
-------------------------------------------------------------------------------------------------------------&lt;br /&gt;
02    5.70 -    4.52 100.0   1055 /   1055   65.89   16.02   89.15   1055    0.00      0    20.17    2101.97&lt;br /&gt;
03    4.52 -    3.95 100.0   1032 /   1032   61.53   14.48   92.03   1032    0.00      0    20.39    2529.90&lt;br /&gt;
04    3.95 -    3.59 100.0   1016 /   1016   54.15   15.61   90.13   1016    0.00      0    16.69    1971.43&lt;br /&gt;
05    3.59 -    3.33 100.0   1004 /   1004   42.67   17.66   89.23   1004    0.00      0    14.21    1502.14&lt;br /&gt;
06    3.33 -    3.14 100.0   1013 /   1013   32.77   20.40   84.26   1013    0.00      0    11.76    1077.60&lt;br /&gt;
07    3.14 -    2.98 100.0    995 /    995   27.36   23.00   78.72    995    0.00      0    11.58     935.37&lt;br /&gt;
08    2.98 -    2.85 100.0   1006 /   1006   23.57   22.63   82.26   1006    0.00      0    10.56     722.62&lt;br /&gt;
09    2.85 -    2.74 100.0    986 /    986   16.64   28.51   72.90    985    0.00      0    10.01     591.56&lt;br /&gt;
10    2.74 -    2.65  99.9    989 /    990   12.41   31.35   72.95    987    0.00      0     9.91     515.07&lt;br /&gt;
11    2.65 -    2.56  99.7    979 /    982    9.35   37.14   65.31    970    0.00      0     9.31     438.96&lt;br /&gt;
12    2.56 -    2.49  98.0    979 /    999    6.06   45.98   45.37    930    0.00      0     9.45     390.05&lt;br /&gt;
13    2.49 -    2.42  95.1    931 /    979    4.46   50.68   34.20    834    0.00      0     8.93     334.80&lt;br /&gt;
14    2.42 -    2.37  91.7    896 /    977    3.35   55.66   37.15    729    0.00      0     9.27     320.17&lt;br /&gt;
15    2.37 -    2.31  83.9    829 /    988    2.61   56.92   43.21    600    0.00      0     9.60     296.67&lt;br /&gt;
16    2.31 -    2.26  72.4    702 /    969    1.97   65.81   26.89    386    0.00      0    10.29     284.39&lt;br /&gt;
17    2.26 -    2.22  59.1    582 /    985    1.75   64.72   31.28    275    0.00      0     9.87     284.06&lt;br /&gt;
18    2.22 -    2.18  52.9    513 /    970    1.51   71.27   16.86    188    0.00      0     8.93     215.31&lt;br /&gt;
19    2.18 -    2.14  35.7    349 /    978    1.32   62.26   68.25     90    0.00      0     8.22     199.09&lt;br /&gt;
20    2.14 -    2.10  23.1    227 /    981    1.20   92.14   -9.20     42    0.00      0     8.59     224.44&lt;br /&gt;
-------------------------------------------------------------------------------------------------------------&lt;br /&gt;
        TOTAL         85.9  17224 /  20046   27.11   21.11   92.07  15305    0.00      0    12.87     999.53&lt;br /&gt;
-------------------------------------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
Summary of refinement and merging&lt;br /&gt;
 No. good frames:                  1809&lt;br /&gt;
 No. bad cc frames:                 153&lt;br /&gt;
 No. bad G frames) :                  0&lt;br /&gt;
 No. bad unit cell frames:            5&lt;br /&gt;
 No. bad gamma_e frames:              0&lt;br /&gt;
 No. bad SE:                          0&lt;br /&gt;
 No. observations:               466997&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Solving indexing ambiguity (New) == &lt;br /&gt;
* SOFTWARE UPDATE REQUIRED *&lt;br /&gt;
With the latest version (Aug 31, 2016), you can solve the indexing ambiguity problem directly in prime. The Brehm &amp;amp; Diederichs algorithms ([http://dx.doi.org/10.1107/S1399004713025431 &amp;quot;doi:10.1107/S1399004713025431&amp;quot;]) have been implemented with bootstrap capability to handle large dataset.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Merohedral Twinning&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
For merohedral twinning (27 space groups e.g. P6), the indexing choices will be determined automatically in prime. Use this default setting in your .phil file,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
indexing_ambiguity {&lt;br /&gt;
  mode = Auto&lt;br /&gt;
  index_basis_in = None&lt;br /&gt;
  assigned_basis = None&lt;br /&gt;
  n_sample_frames = 300&lt;br /&gt;
  n_selected_frames = 100&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
The n_sample_frames parameter indicates no. of images that will be used for the calculation of the scoring function. After that, only n_selected_images will be used in the B&amp;amp;D algorithms. This saves a lot of computing time since only the selected images will be used for the determination of the ambiguity. You can change these two parameters to fit with your experiments. The default values are 300 and 100 (give 300 - use 100).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Pseudo-Merohedral Twinning&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
For pseudo-merohedral twinning, due to different possibilities for the indexing choice, prime doesn&#039;t determine these choices automatically. If you suspect that you may have pseudo twinning (b and c are similar, beta angle is almost 90 degree but not quite), you have an option to force prime to determine the ambiguity according to your choices.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
indexing_ambiguity {&lt;br /&gt;
  mode = Forced&lt;br /&gt;
  index_basis_in = None&lt;br /&gt;
  assigned_basis = -h,l,k&lt;br /&gt;
  assigned_basis = -k, l, h&lt;br /&gt;
  n_sample_frames = 300&lt;br /&gt;
  n_selected_frames = 100&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When you set indexing_ambiguity.mode to Forced, you can assign indexing choices according to your problem. In this example, two more choices (-h, l, k and -k, l, h) were assigned as the indexing choice.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Reusing the solution&#039;&#039;&#039; &amp;lt;br&amp;gt;&lt;br /&gt;
At the end of the run, your solution pickle is saved to your_run_no/index_ambiguity/solution_pickle.pickle. If you don&#039;t want to spend time solving the ambiguity again in the next run, you can reuse this solution pickle by setting these parameters:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
indexing_ambiguity {&lt;br /&gt;
  mode = Auto&lt;br /&gt;
  index_basis_in = your_run_no/index_ambiguity/solution_pickle.pickle&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will bypass the indexing ambiguity module. Prime will use the solution file to perform normal post-refinement and merging.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Using an external reference set&#039;&#039;&#039; &amp;lt;br&amp;gt;&lt;br /&gt;
To use another isomorphous dataset (e.g. from a synchrotron experiment) as a reference set to solve the ambiguity, you can specify an mtz file as part of these parameters:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
indexing_ambiguity {&lt;br /&gt;
  mode = Auto&lt;br /&gt;
  index_basis_in = path/to/your/mtz/file.mtz&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Again, you can choose to do Auto or Forced (with a list of assigned_basis parameters) depending on your problem.&lt;br /&gt;
&lt;br /&gt;
== More detail with input parameters ==&lt;br /&gt;
Now that you have your first trial merged data set, you can explore different parameter settings to merge or to obtain the Bijvoet pairs (I+/I-) for your anomalous data set.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Anomalous data:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
target_anomalous_flag = True&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
In the last cycle, prime will output a reflection set with I+ and I-.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Number of micro- and macrocycles&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
n_postref_cycle = 3&lt;br /&gt;
n_postref_sub_cycle = 1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Number of bins for merging statistics&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
n_bins = 20&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Help with input parameters ==&lt;br /&gt;
&lt;br /&gt;
Most input parameters are self-explained. However, you can run -h switch to view help information for each parameter.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.run -h&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Running in manual mode ==&lt;br /&gt;
With the same phil file, you can run prime manually. This gives you more freedom in terms of parameter settings at different stages (generating reference set, post-refining images, and merging) or at different cycle of post-refinement.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example A&#039;&#039;&#039;: I want to generate a reference set then post-refine all the images on the &#039;&#039;&#039;scale factors only&#039;&#039;&#039; for &#039;&#039;&#039;three cycles&#039;&#039;&#039; then refine &#039;&#039;&#039;all parameters&#039;&#039;&#039; in the &#039;&#039;&#039;4th cycle&#039;&#039;&#039;. To do this, you can follow these steps:&lt;br /&gt;
&lt;br /&gt;
To generate a reference set,&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.genref prime.phil&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
To post-refine on scale factors only, modify your .phil file so that all parameters are turned &#039;&#039;off&#039;&#039;.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
scale {&lt;br /&gt;
  d_min = 2.5&lt;br /&gt;
  d_max = 45&lt;br /&gt;
  sigma_min = 1.5&lt;br /&gt;
}&lt;br /&gt;
postref {&lt;br /&gt;
  residual_threshold = 5&lt;br /&gt;
  residual_threshold_xy = 5&lt;br /&gt;
  scale {&lt;br /&gt;
    d_min = 2.5&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
  }&lt;br /&gt;
  crystal_orientation {&lt;br /&gt;
    flag_on = False&lt;br /&gt;
    d_min = 2.5&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
  }&lt;br /&gt;
  reflecting_range {&lt;br /&gt;
    flag_on = False&lt;br /&gt;
    d_min = 2.5&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
  }&lt;br /&gt;
  unit_cell {&lt;br /&gt;
    flag_on = False&lt;br /&gt;
    d_min = 2.5&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
    uc_tolerance = 5&lt;br /&gt;
  }&lt;br /&gt;
  allparams {&lt;br /&gt;
    flag_on = False&lt;br /&gt;
    d_min = 2.5&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
    uc_tolerance = 5&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
...&lt;br /&gt;
n_postref_cycle = 3&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then run,&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.postrefine prime.phil&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
To refine all parameters one more cycle, update your .phil file again (flag_on = True)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
  allparams {&lt;br /&gt;
    flag_on = True&lt;br /&gt;
    d_min = 2.5&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
    uc_tolerance = 5&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
...&lt;br /&gt;
n_postref_cycle = 1&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then run,&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.postrefine prime.phil&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
To obtain the final merged mtz, run&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.merge prime.phil&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Running on multiple nodes ==&lt;br /&gt;
For LCLS users (or other users with LSF bsub), you can use psana (or your) queuing system to parallelize the entire process. For example, if you want to run your job on 100 nodes using psanq, you can specify:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
queue {&lt;br /&gt;
  mode = bsub&lt;br /&gt;
  qname = psanaq&lt;br /&gt;
  n_nodes = 100&lt;br /&gt;
}&lt;br /&gt;
timeout_seconds = 300&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Prime will divide all the images into 100 batches and submit them to different nodes. It will wait until all images in every batches are done before returning to the merging step (or the exit step in the manual mode). You can control timeout_seconds parameter to tell prime how long it should wait for all the image batches to finish. Usually, this timeout parameter is not used (all images should return before 300 seconds) but in case, you need to wait longer or shorter, you can modify this parameter.&lt;/div&gt;</summary>
		<author><name>Mona</name></author>
	</entry>
	<entry>
		<id>http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=Cctbx.prime&amp;diff=1393</id>
		<title>Cctbx.prime</title>
		<link rel="alternate" type="text/html" href="http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=Cctbx.prime&amp;diff=1393"/>
		<updated>2017-02-14T19:23:39Z</updated>

		<summary type="html">&lt;p&gt;Mona: /* Prime: post-refinement and merging */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Prime: &#039;&#039;&#039;p&#039;&#039;&#039;ost-&#039;&#039;&#039;r&#039;&#039;&#039;ef&#039;&#039;&#039;i&#039;&#039;&#039;nement and &#039;&#039;&#039;me&#039;&#039;&#039;rging ==&lt;br /&gt;
With the latest update, prime can be used to process data on multiple nodes (on a queuing system). At the moment, only LSF (bsub) is supported. See documentation below for more information on how to use the queuing system.&lt;br /&gt;
&lt;br /&gt;
This major update replaces prime.postrefine with &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.run &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Step-by-step guidelines to post-refine and merge XFEL diffraction images. For more detail and citation, see &lt;br /&gt;
&amp;quot;Enabling X-ray Free Electron Laser Crystallography for Challenging Biological Systems from a Limited Number of Crystals&amp;quot;&lt;br /&gt;
[http://elifesciences.org/content/4/e05421 &amp;quot;DOI: http://dx.doi.org/10.7554/eLife.05421&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
== Prime is gui-ed == &lt;br /&gt;
Thanks to Dr. Lyubimov, PRIME is also available as a Graphic User Interface program. Try it by running&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Click to see [https://commons.wikimedia.org/wiki/File:PRIME_main.png &amp;quot;PRIME main gui&amp;quot;] and [https://commons.wikimedia.org/wiki/File:PRIME_advanced_options.png &amp;quot;Advanced options&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
== Getting started == &lt;br /&gt;
&#039;&#039;&#039;Generating input phil file&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
Like most programs developed under &#039;&#039;cctbx&#039;&#039; framework, &#039;&#039;prime&#039;&#039; reads in input .phil file, which stores all the parameters needed to run post-refinement and merging steps. To generate the template .phil file, do the dry run by calling&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ prime.run&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
An example of the template .phil file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
data = None&lt;br /&gt;
run_no = None&lt;br /&gt;
title = None&lt;br /&gt;
scale {&lt;br /&gt;
  d_min = 0.1&lt;br /&gt;
  d_max = 99&lt;br /&gt;
  sigma_min = 1.5&lt;br /&gt;
}&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can save the content of the output to any file name - in this tutorial, let&#039;s save it to thermolysin.phil.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;First look at your phil file&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
To run prime, set the required parameters to match with your experiments (you can leave other parameters with their default values - or just delete them from you .phil file). The most interesting parameters are shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
data = /path/to/your/integarion/result/pickle_files&lt;br /&gt;
run_no = 001&lt;br /&gt;
title = First trial for thermolysin&lt;br /&gt;
scale {&lt;br /&gt;
  d_min = 2.1&lt;br /&gt;
  d_max = 45&lt;br /&gt;
  sigma_min = 1.5&lt;br /&gt;
}&lt;br /&gt;
postref {&lt;br /&gt;
  scale {&lt;br /&gt;
    d_min = 2.1&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
  }&lt;br /&gt;
  crystal_orientation {&lt;br /&gt;
    flag_on = True&lt;br /&gt;
    d_min = 2.1&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
  }&lt;br /&gt;
  reflecting_range {&lt;br /&gt;
    flag_on = True&lt;br /&gt;
    d_min = 2.1&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
  }&lt;br /&gt;
  unit_cell {&lt;br /&gt;
    flag_on = True&lt;br /&gt;
    d_min = 2.1&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
    uc_tolerance = 3&lt;br /&gt;
  }&lt;br /&gt;
  allparams {&lt;br /&gt;
    flag_on = False&lt;br /&gt;
    d_min = 2.1&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
    uc_tolerance = 3&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
merge {&lt;br /&gt;
  d_min = 2.1&lt;br /&gt;
  d_max = 45&lt;br /&gt;
  sigma_min = 1.5&lt;br /&gt;
  partiality_min = 0.1&lt;br /&gt;
  uc_tolerance = 3&lt;br /&gt;
}&lt;br /&gt;
target_unit_cell = 93.99,93.99,130.87,90,90,120&lt;br /&gt;
target_space_group = P 61 2 2&lt;br /&gt;
pixel_size_mm = 0.102&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You should pay attention to d_min and d_max for the refinement and merging parameters. If you use IOTA to integrate the images, IOTA will output .phil file for prime that has the optimal resolution range. If not, a few trial-and-error runs may be required to get the best resolution range for your dataset. Use merging statistics output by prime and check the values of CC1/2 and I/sigI to find out your optimal resolution range.&lt;br /&gt;
&lt;br /&gt;
Cell parameters (target_unit_cell and target_space_group) are required to run prime. Target cell parameter is used to remove some outlier images by controlling uc_tolerance parameter (the default value of tolerate range is 3% different). Space group parameter is used in removing outliers and merging with the given symmetry.&lt;br /&gt;
&lt;br /&gt;
Don&#039;t forget also to change your pixel size in millimeters. Check what your detector is and note down its pixel size. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Running post-refinement in automatic mode&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
Once you have the input .phil file, you can run &#039;&#039;prime&#039;&#039; by calling&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.run thermolysin.phil&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;Prime&#039;&#039; will post-refine and merge for reflection sets using three (default value) macrocycles. At the end of the run, you can obtain merging statistics in the last cycle - all other cycle statistics are also available in log.txt.&lt;br /&gt;
&lt;br /&gt;
An example of merging statistics:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Summary for 001/postref_cycle_1_merge.mtz&lt;br /&gt;
Bin Resolution Range     Completeness      &amp;lt;N_obs&amp;gt;  |Rsplit  CC1/2  N_ind |CCanom   N_ind| &amp;lt;I/sigI&amp;gt;   &amp;lt;I&amp;gt;&lt;br /&gt;
-------------------------------------------------------------------------------------------------------------&lt;br /&gt;
02    5.70 -    4.52 100.0   1055 /   1055   65.89   16.02   89.15   1055    0.00      0    20.17    2101.97&lt;br /&gt;
03    4.52 -    3.95 100.0   1032 /   1032   61.53   14.48   92.03   1032    0.00      0    20.39    2529.90&lt;br /&gt;
04    3.95 -    3.59 100.0   1016 /   1016   54.15   15.61   90.13   1016    0.00      0    16.69    1971.43&lt;br /&gt;
05    3.59 -    3.33 100.0   1004 /   1004   42.67   17.66   89.23   1004    0.00      0    14.21    1502.14&lt;br /&gt;
06    3.33 -    3.14 100.0   1013 /   1013   32.77   20.40   84.26   1013    0.00      0    11.76    1077.60&lt;br /&gt;
07    3.14 -    2.98 100.0    995 /    995   27.36   23.00   78.72    995    0.00      0    11.58     935.37&lt;br /&gt;
08    2.98 -    2.85 100.0   1006 /   1006   23.57   22.63   82.26   1006    0.00      0    10.56     722.62&lt;br /&gt;
09    2.85 -    2.74 100.0    986 /    986   16.64   28.51   72.90    985    0.00      0    10.01     591.56&lt;br /&gt;
10    2.74 -    2.65  99.9    989 /    990   12.41   31.35   72.95    987    0.00      0     9.91     515.07&lt;br /&gt;
11    2.65 -    2.56  99.7    979 /    982    9.35   37.14   65.31    970    0.00      0     9.31     438.96&lt;br /&gt;
12    2.56 -    2.49  98.0    979 /    999    6.06   45.98   45.37    930    0.00      0     9.45     390.05&lt;br /&gt;
13    2.49 -    2.42  95.1    931 /    979    4.46   50.68   34.20    834    0.00      0     8.93     334.80&lt;br /&gt;
14    2.42 -    2.37  91.7    896 /    977    3.35   55.66   37.15    729    0.00      0     9.27     320.17&lt;br /&gt;
15    2.37 -    2.31  83.9    829 /    988    2.61   56.92   43.21    600    0.00      0     9.60     296.67&lt;br /&gt;
16    2.31 -    2.26  72.4    702 /    969    1.97   65.81   26.89    386    0.00      0    10.29     284.39&lt;br /&gt;
17    2.26 -    2.22  59.1    582 /    985    1.75   64.72   31.28    275    0.00      0     9.87     284.06&lt;br /&gt;
18    2.22 -    2.18  52.9    513 /    970    1.51   71.27   16.86    188    0.00      0     8.93     215.31&lt;br /&gt;
19    2.18 -    2.14  35.7    349 /    978    1.32   62.26   68.25     90    0.00      0     8.22     199.09&lt;br /&gt;
20    2.14 -    2.10  23.1    227 /    981    1.20   92.14   -9.20     42    0.00      0     8.59     224.44&lt;br /&gt;
-------------------------------------------------------------------------------------------------------------&lt;br /&gt;
        TOTAL         85.9  17224 /  20046   27.11   21.11   92.07  15305    0.00      0    12.87     999.53&lt;br /&gt;
-------------------------------------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
Summary of refinement and merging&lt;br /&gt;
 No. good frames:                  1809&lt;br /&gt;
 No. bad cc frames:                 153&lt;br /&gt;
 No. bad G frames) :                  0&lt;br /&gt;
 No. bad unit cell frames:            5&lt;br /&gt;
 No. bad gamma_e frames:              0&lt;br /&gt;
 No. bad SE:                          0&lt;br /&gt;
 No. observations:               466997&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Solving indexing ambiguity (New) == &lt;br /&gt;
* SOFTWARE UPDATE REQUIRED *&lt;br /&gt;
With the latest version (Aug 31, 2016), you can solve the indexing ambiguity problem directly in prime. The Brehm &amp;amp; Diederichs algorithms ([http://dx.doi.org/10.1107/S1399004713025431 &amp;quot;doi:10.1107/S1399004713025431&amp;quot;]) have been implemented with bootstrap capability to handle large dataset.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Merohedral Twinning&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
For merohedral twinning (27 space groups e.g. P6), the indexing choices will be determined automatically in prime. Use this default setting in your .phil file,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
indexing_ambiguity {&lt;br /&gt;
  mode = Auto&lt;br /&gt;
  index_basis_in = None&lt;br /&gt;
  assigned_basis = None&lt;br /&gt;
  n_sample_frames = 300&lt;br /&gt;
  n_selected_frames = 100&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
The n_sample_frames parameter indicates no. of images that will be used for the calculation of the scoring function. After that, only n_selected_images will be used in the B&amp;amp;D algorithms. This saves a lot of computing time since only the selected images will be used for the determination of the ambiguity. You can change these two parameters to fit with your experiments. The default values are 300 and 100 (give 300 - use 100).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Pseudo-Merohedral Twinning&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
For pseudo-merohedral twinning, due to different possibilities for the indexing choice, prime doesn&#039;t determine these choices automatically. If you suspect that you may have pseudo twinning (b and c are similar, beta angle is almost 90 degree but not quite), you have an option to force prime to determine the ambiguity according to your choices.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
indexing_ambiguity {&lt;br /&gt;
  mode = Forced&lt;br /&gt;
  index_basis_in = None&lt;br /&gt;
  assigned_basis = -h,l,k&lt;br /&gt;
  assigned_basis = -k, l, h&lt;br /&gt;
  n_sample_frames = 300&lt;br /&gt;
  n_selected_frames = 100&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When you set indexing_ambiguity.mode to Forced, you can assign indexing choices according to your problem. In this example, two more choices (-h, l, k and -k, l, h) were assigned as the indexing choice.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Reusing the solution&#039;&#039;&#039; &amp;lt;br&amp;gt;&lt;br /&gt;
At the end of the run, your solution pickle is saved to your_run_no/index_ambiguity/solution_pickle.pickle. If you don&#039;t want to spend time solving the ambiguity again in the next run, you can reuse this solution pickle by setting these parameters:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
indexing_ambiguity {&lt;br /&gt;
  mode = Auto&lt;br /&gt;
  index_basis_in = your_run_no/index_ambiguity/solution_pickle.pickle&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will bypass the indexing ambiguity module. Prime will use the solution file to perform normal post-refinement and merging.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Using an external reference set&#039;&#039;&#039; &amp;lt;br&amp;gt;&lt;br /&gt;
To use another isomorphous dataset (e.g. from a synchrotron experiment) as a reference set to solve the ambiguity, you can specify an mtz file as part of these parameters:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
indexing_ambiguity {&lt;br /&gt;
  mode = Auto&lt;br /&gt;
  index_basis_in = path/to/your/mtz/file.mtz&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Again, you can choose to do Auto or Forced (with a list of assigned_basis parameters) depending on your problem.&lt;br /&gt;
&lt;br /&gt;
== More detail with input parameters ==&lt;br /&gt;
Now that you have your first trial merged data set, you can explore different parameter settings to merge or to obtain the Bijvoet pairs (I+/I-) for your anomalous data set.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Anomalous data:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
target_anomalous_flag = True&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
In the last cycle, prime will output a reflection set with I+ and I-.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Number of micro- and macrocycles&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
n_postref_cycle = 3&lt;br /&gt;
n_postref_sub_cycle = 1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Number of bins for merging statistics&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
n_bins = 20&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Help with input parameters ==&lt;br /&gt;
&lt;br /&gt;
Most input parameters are self-explained. However, you can run -h switch to view help information for each parameter.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.run -h&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Running in manual mode ==&lt;br /&gt;
With the same phil file, you can run prime manually. This gives you more freedom in terms of parameter settings at different stages (generating reference set, post-refining images, and merging) or at different cycle of post-refinement.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example A&#039;&#039;&#039;: I want to generate a reference set then post-refine all the images on the &#039;&#039;&#039;scale factors only&#039;&#039;&#039; for &#039;&#039;&#039;three cycles&#039;&#039;&#039; then refine &#039;&#039;&#039;all parameters&#039;&#039;&#039; in the &#039;&#039;&#039;4th cycle&#039;&#039;&#039;. To do this, you can follow these steps:&lt;br /&gt;
&lt;br /&gt;
To generate a reference set,&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.genref prime.phil&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
To post-refine on scale factors only, modify your .phil file so that all parameters are turned &#039;&#039;off&#039;&#039;.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
scale {&lt;br /&gt;
  d_min = 2.5&lt;br /&gt;
  d_max = 45&lt;br /&gt;
  sigma_min = 1.5&lt;br /&gt;
}&lt;br /&gt;
postref {&lt;br /&gt;
  residual_threshold = 5&lt;br /&gt;
  residual_threshold_xy = 5&lt;br /&gt;
  scale {&lt;br /&gt;
    d_min = 2.5&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
  }&lt;br /&gt;
  crystal_orientation {&lt;br /&gt;
    flag_on = False&lt;br /&gt;
    d_min = 2.5&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
  }&lt;br /&gt;
  reflecting_range {&lt;br /&gt;
    flag_on = False&lt;br /&gt;
    d_min = 2.5&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
  }&lt;br /&gt;
  unit_cell {&lt;br /&gt;
    flag_on = False&lt;br /&gt;
    d_min = 2.5&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
    uc_tolerance = 5&lt;br /&gt;
  }&lt;br /&gt;
  allparams {&lt;br /&gt;
    flag_on = False&lt;br /&gt;
    d_min = 2.5&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
    uc_tolerance = 5&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
...&lt;br /&gt;
n_postref_cycle = 3&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then run,&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.postrefine prime.phil&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
To refine all parameters one more cycle, update your .phil file again (flag_on = True)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
  allparams {&lt;br /&gt;
    flag_on = True&lt;br /&gt;
    d_min = 2.5&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
    uc_tolerance = 5&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
...&lt;br /&gt;
n_postref_cycle = 1&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then run,&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.postrefine prime.phil&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
To obtain the final merged mtz, run&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.merge prime.phil&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Running on multiple nodes ==&lt;br /&gt;
For LCLS users (or other users with LSF bsub), you can use psana (or your) queuing system to parallelize the entire process. For example, if you want to run your job on 100 nodes using psanq, you can specify:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
queue {&lt;br /&gt;
  mode = bsub&lt;br /&gt;
  qname = psanaq&lt;br /&gt;
  n_nodes = 100&lt;br /&gt;
}&lt;br /&gt;
timeout_seconds = 300&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Prime will divide all the images into 100 batches and submit them to different nodes. It will wait until all images in every batches are done before returning to the merging step (or the exit step in the manual mode). You can control timeout_seconds parameter to tell prime how long it should wait for all the image batches to finish. Usually, this timeout parameter is not used (all images should return before 300 seconds) but in case, you need to wait longer or shorter, you can modify this parameter.&lt;/div&gt;</summary>
		<author><name>Mona</name></author>
	</entry>
	<entry>
		<id>http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=2017_prime_tutorial&amp;diff=1392</id>
		<title>2017 prime tutorial</title>
		<link rel="alternate" type="text/html" href="http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=2017_prime_tutorial&amp;diff=1392"/>
		<updated>2017-02-14T19:22:04Z</updated>

		<summary type="html">&lt;p&gt;Mona: /* Generating Input File */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Post-refine and Merge Sample Data Set with PRIME (2017 Tutorial)&lt;br /&gt;
&lt;br /&gt;
In this tutorial, we will work on the integration results from the first of Tutorial 2 (Myoglobin Data). Before proceeding to running the program, we&#039;ll consider making the input file for PRIME based on the situation of this data set.&lt;br /&gt;
&lt;br /&gt;
== Generating Input File ==&lt;br /&gt;
&lt;br /&gt;
PRIME input files contain information necessary for successful post-refinement and merging steps. You can access and review the list of input parameters by running prime.run or prime.run -h to view the description of these parameters. For this tutorial we&#039;ll start building it from scratch.&lt;br /&gt;
&lt;br /&gt;
* Location of integration results&lt;br /&gt;
In this case, we know the location where the integration results (pickle files) are. We can then set,&lt;br /&gt;
&lt;br /&gt;
 data = /net/viper/raid1/mu238/XfelProject/dials17/extracted&lt;br /&gt;
&lt;br /&gt;
Note that you supply data as a multiple arguments. The value of the parameter can be a file containing list of integration results, a folder, or a wildcard argument.&lt;br /&gt;
&lt;br /&gt;
* Unit cell information &lt;br /&gt;
You can obtain the mean (or median) unit-cell dimensions from either IOTA or DIALS. In case of IOTA, prime .phil file is auto generated and this information is readily available in there. For n_residues, enter number of residues in asymmetric unit of your molecule.&lt;br /&gt;
&lt;br /&gt;
 target_unit_cell = 91.7 91.7 46 90 90 120&lt;br /&gt;
 target_space_group = P6&lt;br /&gt;
 n_residues = 128&lt;br /&gt;
&lt;br /&gt;
* Detector information&lt;br /&gt;
 pixel_size_mm = 0.172&lt;br /&gt;
&lt;br /&gt;
* Post-refinement and Scaling information&lt;br /&gt;
This is where you specify the optimal resolution cutoffs for post-refinement and merging. Note that when running for the first time on you newly collected data, you can choose the &amp;quot;expected&amp;quot; values (resolution which you see the spots at the corner or on the edge). You can then adjust these parameters when analyzing merging statistics based on the I/sigI values in the high resolution shells and rerun the program again. Note that sigma cutoffs are set to 1.5 in scaling and post-refinement steps while it&#039;s set to -3.0 so we can include negative values in the merged reflection set.  &lt;br /&gt;
 &lt;br /&gt;
 scale {&lt;br /&gt;
   d_min = 2.5&lt;br /&gt;
   d_max = 20&lt;br /&gt;
   sigma_min = 1.5&lt;br /&gt;
 }&lt;br /&gt;
 postref {&lt;br /&gt;
   scale {&lt;br /&gt;
     d_min = 2.5&lt;br /&gt;
     d_max = 20&lt;br /&gt;
     sigma_min = 1.5&lt;br /&gt;
     partiality_min = 0.1&lt;br /&gt;
   allparams {&lt;br /&gt;
     flag_on = True&lt;br /&gt;
     d_min = 2.5&lt;br /&gt;
     d_max = 20&lt;br /&gt;
     sigma_min = 1.5&lt;br /&gt;
     partiality_min = 0.1&lt;br /&gt;
     uc_tolerance = 5&lt;br /&gt;
   }&lt;br /&gt;
 }&lt;br /&gt;
 merge {&lt;br /&gt;
   d_min = 2.5&lt;br /&gt;
   d_max = 20&lt;br /&gt;
   sigma_min = -3.0&lt;br /&gt;
   partiality_min = 0.1&lt;br /&gt;
   uc_tolerance = 5&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
* Indexing ambiguity&lt;br /&gt;
For other sets that are not in polar space or have indexing ambiguity (when one or more of the unit-cell dimensions are very similar but not the same!), you can very well use the .phil file parameters thus far to proceed and run post-refinement. However, this data set is in P6 (polar space group) and therefore, the indexing ambiguity needs to be resolved prior to other refinement and merging steps.&lt;br /&gt;
&lt;br /&gt;
Other point worth noting is for any polar space groups, PRIME will automatically solve the ambiguity based on the default parameters. However, this data set has about 5,000 integration results so we want to make sure that we modify the number of images used for random and best selections.&lt;br /&gt;
&lt;br /&gt;
 indexing_ambiguity {&lt;br /&gt;
  mode = Auto&lt;br /&gt;
  index_basis_in = None&lt;br /&gt;
  assigned_basis = None&lt;br /&gt;
  d_min = 3.0&lt;br /&gt;
  d_max = 10.0&lt;br /&gt;
  sigma_min = 1.5&lt;br /&gt;
  n_sample_frames = 1000&lt;br /&gt;
  n_selected_frames = 100&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
We left other parameters to their default value and modified n_sample_frames to 1000 and n_selected_frames to 100.&lt;br /&gt;
&lt;br /&gt;
* No. of Bin&lt;br /&gt;
 n_bins = 10&lt;br /&gt;
&lt;br /&gt;
Now we have a complete .phil file ready to run.&lt;br /&gt;
&lt;br /&gt;
 data = /net/viper/raid1/mu238/XfelProject/dials17/extracted&lt;br /&gt;
 target_unit_cell = 91.7 91.7 46 90 90 120&lt;br /&gt;
 target_space_group = P6&lt;br /&gt;
 n_residues = 128&lt;br /&gt;
 pixel_size_mm = 0.172&lt;br /&gt;
 scale {&lt;br /&gt;
  d_min = 2.5&lt;br /&gt;
  d_max = 20&lt;br /&gt;
  sigma_min = 1.5&lt;br /&gt;
 }&lt;br /&gt;
 postref {&lt;br /&gt;
  scale {&lt;br /&gt;
    d_min = 2.5&lt;br /&gt;
    d_max = 20&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
  }&lt;br /&gt;
  allparams {&lt;br /&gt;
    flag_on = True&lt;br /&gt;
    d_min = 2.5&lt;br /&gt;
    d_max = 20&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
    uc_tolerance = 5&lt;br /&gt;
  }&lt;br /&gt;
 }&lt;br /&gt;
 merge {&lt;br /&gt;
  d_min = 2.5&lt;br /&gt;
  d_max = 20&lt;br /&gt;
  sigma_min = -3.0&lt;br /&gt;
  partiality_min = 0.1&lt;br /&gt;
  uc_tolerance = 5&lt;br /&gt;
 }&lt;br /&gt;
 indexing_ambiguity {&lt;br /&gt;
  mode = Auto&lt;br /&gt;
  index_basis_in = None&lt;br /&gt;
  assigned_basis = None&lt;br /&gt;
  d_min = 3.0&lt;br /&gt;
  d_max = 10.0&lt;br /&gt;
  sigma_min = 1.5&lt;br /&gt;
  n_sample_frames = 1000&lt;br /&gt;
  n_selected_frames = 100&lt;br /&gt;
 }&lt;br /&gt;
 n_bins = 10&lt;br /&gt;
&lt;br /&gt;
Copy and paste this set of parameter in an editor then save the file as &amp;quot;prime.phil&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
== Running the Program ==&lt;br /&gt;
You can run the program by giving it an input file:&lt;br /&gt;
&lt;br /&gt;
 prime.run prime.phil&lt;br /&gt;
&lt;br /&gt;
For this tutorial, PRIME will score the randomly selected 1,000 images then select the best 100 for running Brehm &amp;amp; Diederichs algorithm in Bootstrap mode. If you run the program with flag_plot=True, you&#039;ll see a plot showing two separated clusters, each representing images with matching assigned basis. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PRIME will select on of these two clusters and merge it to get a reference set for the Bootstrap step. Here, the remaining images will get assigned with a basis that makes it correlate best with the reference set.&lt;br /&gt;
&lt;br /&gt;
Once all images are assigned with appropriate basis, PRIME will proceed to scaling and post-refinement steps. After three post-refinement cycles (default value), the process is done and here is the output of the program.&lt;br /&gt;
&lt;br /&gt;
 Isotropic B-factor:     5.30&lt;br /&gt;
 No. of reflections&lt;br /&gt;
  all:                   7786&lt;br /&gt;
  outside resolution:      51&lt;br /&gt;
  outliers:                 0&lt;br /&gt;
  total left:            7735&lt;br /&gt;
 Summary for Prime_Run_1/postref_cycle_3_merge.mtz&lt;br /&gt;
 Bin Resolution Range     Completeness       N_obs  |Rmerge  Rsplit   CC1/2   N_ind |CCiso   N_ind|CCanoma  N_ind|  I/sigI     I      sigI      I**2 &lt;br /&gt;
 --------------------------------------------------------------------------------------------------------------------------------------------------&lt;br /&gt;
 01   19.88 -    5.35 100.0    807 /    807  189.78   85.75    8.87   98.43    807    0.00      0    0.00      0     4.46      684.2    136.2   3.57&lt;br /&gt;
 02    5.35 -    4.26 100.0    782 /    782  140.90   73.61    8.89   97.67    782    0.00      0    0.00      0     5.23      794.3    140.3   2.05&lt;br /&gt;
 03    4.26 -    3.73 100.0    788 /    788  129.32   69.32    8.70   98.11    788    0.00      0    0.00      0     5.41      878.5    150.3   1.95&lt;br /&gt;
 04    3.73 -    3.39 100.0    765 /    765  117.75   70.72    9.67   97.55    765    0.00      0    0.00      0     4.12      712.3    162.4   1.88&lt;br /&gt;
 05    3.39 -    3.15 100.0    770 /    770  113.22   71.61   11.22   88.54    770    0.00      0    0.00      0     2.73      500.1    173.7   2.19&lt;br /&gt;
 06    3.15 -    2.96 100.0    767 /    767  106.12   73.19   11.07   97.21    767    0.00      0    0.00      0     2.09      404.6    183.8   2.02&lt;br /&gt;
 07    2.96 -    2.81 100.0    766 /    766  103.73   75.79   12.53   96.62    766    0.00      0    0.00      0     1.72      345.3    193.9   1.89&lt;br /&gt;
 08    2.81 -    2.69 100.0    745 /    745  101.51   76.11   12.84   96.21    745    0.00      0    0.00      0     1.49      317.3    204.1   1.98&lt;br /&gt;
 09    2.69 -    2.59 100.0    786 /    786   97.88   77.59   14.19   95.40    786    0.00      0    0.00      0     1.38      299.0    209.3   1.86&lt;br /&gt;
 10    2.59 -    2.50 100.0    759 /    759   92.53   78.61   14.72   96.51    759    0.00      0    0.00      0     1.36      312.4    218.8   2.07&lt;br /&gt;
 --------------------------------------------------------------------------------------------------------------------------------------------------&lt;br /&gt;
         TOTAL        100.0   7735 /   7735  119.73   75.51   10.45   97.21   7735    0.00      0    0.00      0     3.02      527.3    176.9   2.56&lt;br /&gt;
 --------------------------------------------------------------------------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
 Summary of CC1/2 on three crystal axes&lt;br /&gt;
 Bin Resolution Range           CC1/2                       I                           N_refl           &lt;br /&gt;
                        a*      b*      c*  |      a*        b*       c*    |    a*      b*     c*      &lt;br /&gt;
 ---------------------------------------------------------------------------------------------------------&lt;br /&gt;
 01   19.88 -    5.35   97.01   98.64   98.23      528.6      559.6     1216.7     42     51     47&lt;br /&gt;
 02    5.35 -    4.26   97.64   98.43   99.08      817.6      527.5      964.9     43     44     40&lt;br /&gt;
 03    4.26 -    3.73   96.31   98.02   97.68      605.7      682.9      856.0     39     39     41&lt;br /&gt;
 04    3.73 -    3.39   98.49   98.55   97.73      961.9      532.6      729.1     42     37     45&lt;br /&gt;
 05    3.39 -    3.15   96.88   98.38   92.69      449.5      492.1      721.6     39     39     40&lt;br /&gt;
 06    3.15 -    2.96   98.48   93.58   98.61      389.9      303.4      391.7     39     37     39&lt;br /&gt;
 07    2.96 -    2.81   96.98   98.02   95.35      361.3      331.7      383.2     42     37     43&lt;br /&gt;
 08    2.81 -    2.69   95.29   94.02   94.69      290.8      194.7      292.7     41     35     36&lt;br /&gt;
 09    2.69 -    2.59   96.55   91.88   98.57      265.7      341.4      290.2     41     35     44&lt;br /&gt;
 10    2.59 -    2.50   94.44   97.81   96.67      249.0      400.1      236.2     42     36     40&lt;br /&gt;
 ----------------------------------------------------------------------------------------------------------&lt;br /&gt;
        total           97.57   97.74   94.58      494.1      446.0      619.4    410    390    415&lt;br /&gt;
 ----------------------------------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
 Summary of refinement and merging&lt;br /&gt;
 No. good frames:                  4733&lt;br /&gt;
 No. bad cc frames:                 113&lt;br /&gt;
 No. bad G frames) :                109&lt;br /&gt;
 No. bad unit cell frames:           20&lt;br /&gt;
 No. bad gamma_e frames:             22&lt;br /&gt;
 No. bad SE:                          2&lt;br /&gt;
 No. observations:               935265&lt;br /&gt;
 Mean target value (BEFORE: Mean Median (Std.))&lt;br /&gt;
 post-refinement:                301.22       259.10 (   171.56)&lt;br /&gt;
 (x,y) restraints:              1679.63      1573.15 (   657.49)&lt;br /&gt;
 Mean target value (AFTER: Mean Median (Std.))&lt;br /&gt;
 post-refinement:                300.02       257.53 (   170.98)&lt;br /&gt;
 (x,y) restraints:              1679.90      1572.77 (   660.19)&lt;br /&gt;
 SE:                            1915.60       776.84 ( 33765.97)&lt;br /&gt;
 G:                           1.000e+00    8.971e-01 ( 8.15e-01)&lt;br /&gt;
 B:                               11.83        14.45 (    11.95)&lt;br /&gt;
 Rot.x:                           -0.08         0.00 (    12.10)&lt;br /&gt;
 Rot.y:                            0.14         0.00 (     9.62)&lt;br /&gt;
 gamma_y:                       0.00000      0.00000 (  0.00000)&lt;br /&gt;
 gamma_z:                       0.00000      0.00000 (  0.00000)&lt;br /&gt;
 gamma_0:                       0.03793      0.00019 (  0.60820)&lt;br /&gt;
 gamma_e:                      -0.12824      0.00145 (  0.60227)&lt;br /&gt;
 voigt_nu:                      0.50000      0.50000 (  0.00000)&lt;br /&gt;
 unit cell&lt;br /&gt;
   a:                             91.45        91.45 (     0.11)&lt;br /&gt;
   b:                             91.45        91.45 (     0.11)&lt;br /&gt;
   c:                             45.96        45.96 (     0.12)&lt;br /&gt;
   alpha:                         90.00        90.00 (     0.00)&lt;br /&gt;
   beta:                          90.00        90.00 (     0.00)&lt;br /&gt;
   gamma:                        120.00       120.00 (     0.00)&lt;br /&gt;
 Parmeters from integration (not-refined)&lt;br /&gt;
  Wavelength:                   0.96861      0.96861 (  0.00000)&lt;br /&gt;
  Detector distance:          303.81868    303.81868 (  0.00000)&lt;br /&gt;
 * (standard deviation)&lt;br /&gt;
&lt;br /&gt;
 Total calculation time: 542.00 seconds&lt;br /&gt;
 Finished: Tuesday 14. February 2017 10:53:18&lt;br /&gt;
&lt;br /&gt;
== Obtaining the Output ==&lt;br /&gt;
&lt;br /&gt;
Your output will be in Prime_Run_n (where n is the number of run). &lt;br /&gt;
&lt;br /&gt;
 -bash-4.1$ ls Prime_Run_1/ -l&lt;br /&gt;
 total 9076&lt;br /&gt;
 -rw-r--r-- 1 mu238 camb  879638 Feb 14 10:53 crystal.o&lt;br /&gt;
 drwxr-xr-x 2 mu238 camb     104 Feb 14 10:46 index_ambiguity&lt;br /&gt;
 drwxr-xr-x 2 mu238 camb       6 Feb 14 10:44 isoform_cluster&lt;br /&gt;
 -rw-r--r-- 1 mu238 camb   32704 Feb 14 10:53 log.txt&lt;br /&gt;
 -rw-r--r-- 1 mu238 camb  324556 Feb 14 10:47 mean_scaled_merge.hkl&lt;br /&gt;
 -rw-r--r-- 1 mu238 camb  157260 Feb 14 10:47 mean_scaled_merge.mtz&lt;br /&gt;
 -rw-r--r-- 1 mu238 camb   15753 Feb 14 10:53 pickle.stat&lt;br /&gt;
 -rw-r--r-- 1 mu238 camb  324381 Feb 14 10:49 postref_cycle_1_merge.hkl&lt;br /&gt;
 -rw-r--r-- 1 mu238 camb  157260 Feb 14 10:49 postref_cycle_1_merge.mtz&lt;br /&gt;
 -rw-r--r-- 1 mu238 camb  324515 Feb 14 10:51 postref_cycle_2_merge.hkl&lt;br /&gt;
 -rw-r--r-- 1 mu238 camb  157260 Feb 14 10:51 postref_cycle_2_merge.mtz&lt;br /&gt;
 -rw-r--r-- 1 mu238 camb  324716 Feb 14 10:53 postref_cycle_3_merge.hkl&lt;br /&gt;
 -rw-r--r-- 1 mu238 camb  157340 Feb 14 10:53 postref_cycle_3_merge.mtz&lt;br /&gt;
 -rw-r--r-- 1 mu238 camb 6412200 Feb 14 10:53 rejections.txt&lt;br /&gt;
&lt;br /&gt;
File log.txt contains all the merging stats. The final merged reflection set is postref_cycle_3_merge.mtz (or .hkl).&lt;/div&gt;</summary>
		<author><name>Mona</name></author>
	</entry>
	<entry>
		<id>http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=2017_prime_tutorial&amp;diff=1391</id>
		<title>2017 prime tutorial</title>
		<link rel="alternate" type="text/html" href="http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=2017_prime_tutorial&amp;diff=1391"/>
		<updated>2017-02-14T19:18:28Z</updated>

		<summary type="html">&lt;p&gt;Mona: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Post-refine and Merge Sample Data Set with PRIME (2017 Tutorial)&lt;br /&gt;
&lt;br /&gt;
In this tutorial, we will work on the integration results from the first of Tutorial 2 (Myoglobin Data). Before proceeding to running the program, we&#039;ll consider making the input file for PRIME based on the situation of this data set.&lt;br /&gt;
&lt;br /&gt;
== Generating Input File ==&lt;br /&gt;
&lt;br /&gt;
PRIME input files contain information necessary for successful post-refinement and merging steps. You can access and review the list of input parameters by running prime.run or prime.run -h to view the description of these parameters. For this tutorial we&#039;ll start building it from scratch.&lt;br /&gt;
&lt;br /&gt;
* Location of integration results&lt;br /&gt;
In this case, we know the location where the integration results (pickle files) are. We can then set,&lt;br /&gt;
&lt;br /&gt;
 data = /net/viper/raid1/mu238/XfelProject/dials17/extracted&lt;br /&gt;
&lt;br /&gt;
Note that you supply data as a multiple arguments. The value of the parameter can be a file containing list of integration results, a folder, or a wildcard argument.&lt;br /&gt;
&lt;br /&gt;
* Unit cell information &lt;br /&gt;
You can obtain the mean (or median) unit-cell dimensions from either IOTA or DIALS. In case of IOTA, prime .phil file is auto generated and this information is readily available in there. For n_residues, enter number of residues in asymmetric unit of your molecule.&lt;br /&gt;
&lt;br /&gt;
 target_unit_cell = 91.7 91.7 46 90 90 120&lt;br /&gt;
 target_space_group = P6&lt;br /&gt;
 n_residues = 128&lt;br /&gt;
&lt;br /&gt;
* Detector information&lt;br /&gt;
 pixel_size_mm = 0.172&lt;br /&gt;
&lt;br /&gt;
* Post-refinement and Scaling information&lt;br /&gt;
This is where you specify the optimal resolution cutoffs for post-refinement and merging. Note that when running for the first time on you newly collected data, you can choose the &amp;quot;expected&amp;quot; values (resolution which you see the spots at the corner or on the edge). You can then adjust these parameters when analyzing merging statistics based on the I/sigI values in the high resolution shells and rerun the program again. Note that sigma cutoffs are set to 1.5 in scaling and post-refinement steps while it&#039;s set to -3.0 so we can include negative values in the merged reflection set.  &lt;br /&gt;
 &lt;br /&gt;
 scale {&lt;br /&gt;
   d_min = 2.5&lt;br /&gt;
   d_max = 20&lt;br /&gt;
   sigma_min = 1.5&lt;br /&gt;
 }&lt;br /&gt;
 postref {&lt;br /&gt;
   scale {&lt;br /&gt;
     d_min = 2.5&lt;br /&gt;
     d_max = 20&lt;br /&gt;
     sigma_min = 1.5&lt;br /&gt;
     partiality_min = 0.1&lt;br /&gt;
   allparams {&lt;br /&gt;
     flag_on = True&lt;br /&gt;
     d_min = 2.5&lt;br /&gt;
     d_max = 20&lt;br /&gt;
     sigma_min = 1.5&lt;br /&gt;
     partiality_min = 0.1&lt;br /&gt;
     uc_tolerance = 5&lt;br /&gt;
   }&lt;br /&gt;
 }&lt;br /&gt;
 merge {&lt;br /&gt;
   d_min = 2.5&lt;br /&gt;
   d_max = 20&lt;br /&gt;
   sigma_min = -3.0&lt;br /&gt;
   partiality_min = 0.1&lt;br /&gt;
   uc_tolerance = 5&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
* Indexing ambiguity&lt;br /&gt;
For other sets that are not in polar space or have indexing ambiguity (when one or more of the unit-cell dimensions are very similar but not the same!), you can very well use the .phil file parameters thus far to proceed and run post-refinement. However, this data set is in P6 (polar space group) and therefore, the indexing ambiguity needs to be resolved prior to other refinement and merging steps.&lt;br /&gt;
&lt;br /&gt;
Other point worth noting is for any polar space groups, PRIME will automatically solve the ambiguity based on the default parameters. However, this data set has about 5,000 integration results so we want to make sure that we modify the number of images used for random and best selections.&lt;br /&gt;
&lt;br /&gt;
 indexing_ambiguity {&lt;br /&gt;
  mode = Auto&lt;br /&gt;
  index_basis_in = None&lt;br /&gt;
  assigned_basis = None&lt;br /&gt;
  d_min = 3.0&lt;br /&gt;
  d_max = 10.0&lt;br /&gt;
  sigma_min = 1.5&lt;br /&gt;
  n_sample_frames = 1000&lt;br /&gt;
  n_selected_frames = 100&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
We left other parameters to their default value and modified n_sample_frames to 1000 and n_selected_frames to 100.&lt;br /&gt;
&lt;br /&gt;
* No. of Bin&lt;br /&gt;
 n_bins = 10&lt;br /&gt;
&lt;br /&gt;
Now we have a complete .phil file ready to run.&lt;br /&gt;
&lt;br /&gt;
 data = /net/viper/raid1/mu238/XfelProject/dials17/extracted&lt;br /&gt;
 target_unit_cell = 91.7 91.7 46 90 90 120&lt;br /&gt;
 target_space_group = P6&lt;br /&gt;
 n_residues = 128&lt;br /&gt;
 pixel_size_mm = 0.172&lt;br /&gt;
 scale {&lt;br /&gt;
  d_min = 2.5&lt;br /&gt;
  d_max = 20&lt;br /&gt;
  sigma_min = 1.5&lt;br /&gt;
 }&lt;br /&gt;
 postref {&lt;br /&gt;
  scale {&lt;br /&gt;
    d_min = 2.5&lt;br /&gt;
    d_max = 20&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
  }&lt;br /&gt;
  allparams {&lt;br /&gt;
    flag_on = True&lt;br /&gt;
    d_min = 2.5&lt;br /&gt;
    d_max = 20&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
    uc_tolerance = 5&lt;br /&gt;
  }&lt;br /&gt;
 }&lt;br /&gt;
 merge {&lt;br /&gt;
  d_min = 2.5&lt;br /&gt;
  d_max = 20&lt;br /&gt;
  sigma_min = -3.0&lt;br /&gt;
  partiality_min = 0.1&lt;br /&gt;
  uc_tolerance = 5&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
 indexing_ambiguity {&lt;br /&gt;
  mode = Auto&lt;br /&gt;
  index_basis_in = None&lt;br /&gt;
  assigned_basis = None&lt;br /&gt;
  d_min = 3.0&lt;br /&gt;
  d_max = 10.0&lt;br /&gt;
  sigma_min = 1.5&lt;br /&gt;
  n_sample_frames = 1000&lt;br /&gt;
  n_selected_frames = 100&lt;br /&gt;
 }&lt;br /&gt;
 n_bins = 10&lt;br /&gt;
&lt;br /&gt;
Copy and paste this set of parameter in an editor then save the file as &amp;quot;prime.phil&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
== Running the Program ==&lt;br /&gt;
You can run the program by giving it an input file:&lt;br /&gt;
&lt;br /&gt;
 prime.run prime.phil&lt;br /&gt;
&lt;br /&gt;
For this tutorial, PRIME will score the randomly selected 1,000 images then select the best 100 for running Brehm &amp;amp; Diederichs algorithm in Bootstrap mode. If you run the program with flag_plot=True, you&#039;ll see a plot showing two separated clusters, each representing images with matching assigned basis. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PRIME will select on of these two clusters and merge it to get a reference set for the Bootstrap step. Here, the remaining images will get assigned with a basis that makes it correlate best with the reference set.&lt;br /&gt;
&lt;br /&gt;
Once all images are assigned with appropriate basis, PRIME will proceed to scaling and post-refinement steps. After three post-refinement cycles (default value), the process is done and here is the output of the program.&lt;br /&gt;
&lt;br /&gt;
 Isotropic B-factor:     5.30&lt;br /&gt;
 No. of reflections&lt;br /&gt;
  all:                   7786&lt;br /&gt;
  outside resolution:      51&lt;br /&gt;
  outliers:                 0&lt;br /&gt;
  total left:            7735&lt;br /&gt;
 Summary for Prime_Run_1/postref_cycle_3_merge.mtz&lt;br /&gt;
 Bin Resolution Range     Completeness       N_obs  |Rmerge  Rsplit   CC1/2   N_ind |CCiso   N_ind|CCanoma  N_ind|  I/sigI     I      sigI      I**2 &lt;br /&gt;
 --------------------------------------------------------------------------------------------------------------------------------------------------&lt;br /&gt;
 01   19.88 -    5.35 100.0    807 /    807  189.78   85.75    8.87   98.43    807    0.00      0    0.00      0     4.46      684.2    136.2   3.57&lt;br /&gt;
 02    5.35 -    4.26 100.0    782 /    782  140.90   73.61    8.89   97.67    782    0.00      0    0.00      0     5.23      794.3    140.3   2.05&lt;br /&gt;
 03    4.26 -    3.73 100.0    788 /    788  129.32   69.32    8.70   98.11    788    0.00      0    0.00      0     5.41      878.5    150.3   1.95&lt;br /&gt;
 04    3.73 -    3.39 100.0    765 /    765  117.75   70.72    9.67   97.55    765    0.00      0    0.00      0     4.12      712.3    162.4   1.88&lt;br /&gt;
 05    3.39 -    3.15 100.0    770 /    770  113.22   71.61   11.22   88.54    770    0.00      0    0.00      0     2.73      500.1    173.7   2.19&lt;br /&gt;
 06    3.15 -    2.96 100.0    767 /    767  106.12   73.19   11.07   97.21    767    0.00      0    0.00      0     2.09      404.6    183.8   2.02&lt;br /&gt;
 07    2.96 -    2.81 100.0    766 /    766  103.73   75.79   12.53   96.62    766    0.00      0    0.00      0     1.72      345.3    193.9   1.89&lt;br /&gt;
 08    2.81 -    2.69 100.0    745 /    745  101.51   76.11   12.84   96.21    745    0.00      0    0.00      0     1.49      317.3    204.1   1.98&lt;br /&gt;
 09    2.69 -    2.59 100.0    786 /    786   97.88   77.59   14.19   95.40    786    0.00      0    0.00      0     1.38      299.0    209.3   1.86&lt;br /&gt;
 10    2.59 -    2.50 100.0    759 /    759   92.53   78.61   14.72   96.51    759    0.00      0    0.00      0     1.36      312.4    218.8   2.07&lt;br /&gt;
 --------------------------------------------------------------------------------------------------------------------------------------------------&lt;br /&gt;
         TOTAL        100.0   7735 /   7735  119.73   75.51   10.45   97.21   7735    0.00      0    0.00      0     3.02      527.3    176.9   2.56&lt;br /&gt;
 --------------------------------------------------------------------------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
 Summary of CC1/2 on three crystal axes&lt;br /&gt;
 Bin Resolution Range           CC1/2                       I                           N_refl           &lt;br /&gt;
                        a*      b*      c*  |      a*        b*       c*    |    a*      b*     c*      &lt;br /&gt;
 ---------------------------------------------------------------------------------------------------------&lt;br /&gt;
 01   19.88 -    5.35   97.01   98.64   98.23      528.6      559.6     1216.7     42     51     47&lt;br /&gt;
 02    5.35 -    4.26   97.64   98.43   99.08      817.6      527.5      964.9     43     44     40&lt;br /&gt;
 03    4.26 -    3.73   96.31   98.02   97.68      605.7      682.9      856.0     39     39     41&lt;br /&gt;
 04    3.73 -    3.39   98.49   98.55   97.73      961.9      532.6      729.1     42     37     45&lt;br /&gt;
 05    3.39 -    3.15   96.88   98.38   92.69      449.5      492.1      721.6     39     39     40&lt;br /&gt;
 06    3.15 -    2.96   98.48   93.58   98.61      389.9      303.4      391.7     39     37     39&lt;br /&gt;
 07    2.96 -    2.81   96.98   98.02   95.35      361.3      331.7      383.2     42     37     43&lt;br /&gt;
 08    2.81 -    2.69   95.29   94.02   94.69      290.8      194.7      292.7     41     35     36&lt;br /&gt;
 09    2.69 -    2.59   96.55   91.88   98.57      265.7      341.4      290.2     41     35     44&lt;br /&gt;
 10    2.59 -    2.50   94.44   97.81   96.67      249.0      400.1      236.2     42     36     40&lt;br /&gt;
 ----------------------------------------------------------------------------------------------------------&lt;br /&gt;
        total           97.57   97.74   94.58      494.1      446.0      619.4    410    390    415&lt;br /&gt;
 ----------------------------------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
 Summary of refinement and merging&lt;br /&gt;
 No. good frames:                  4733&lt;br /&gt;
 No. bad cc frames:                 113&lt;br /&gt;
 No. bad G frames) :                109&lt;br /&gt;
 No. bad unit cell frames:           20&lt;br /&gt;
 No. bad gamma_e frames:             22&lt;br /&gt;
 No. bad SE:                          2&lt;br /&gt;
 No. observations:               935265&lt;br /&gt;
 Mean target value (BEFORE: Mean Median (Std.))&lt;br /&gt;
 post-refinement:                301.22       259.10 (   171.56)&lt;br /&gt;
 (x,y) restraints:              1679.63      1573.15 (   657.49)&lt;br /&gt;
 Mean target value (AFTER: Mean Median (Std.))&lt;br /&gt;
 post-refinement:                300.02       257.53 (   170.98)&lt;br /&gt;
 (x,y) restraints:              1679.90      1572.77 (   660.19)&lt;br /&gt;
 SE:                            1915.60       776.84 ( 33765.97)&lt;br /&gt;
 G:                           1.000e+00    8.971e-01 ( 8.15e-01)&lt;br /&gt;
 B:                               11.83        14.45 (    11.95)&lt;br /&gt;
 Rot.x:                           -0.08         0.00 (    12.10)&lt;br /&gt;
 Rot.y:                            0.14         0.00 (     9.62)&lt;br /&gt;
 gamma_y:                       0.00000      0.00000 (  0.00000)&lt;br /&gt;
 gamma_z:                       0.00000      0.00000 (  0.00000)&lt;br /&gt;
 gamma_0:                       0.03793      0.00019 (  0.60820)&lt;br /&gt;
 gamma_e:                      -0.12824      0.00145 (  0.60227)&lt;br /&gt;
 voigt_nu:                      0.50000      0.50000 (  0.00000)&lt;br /&gt;
 unit cell&lt;br /&gt;
   a:                             91.45        91.45 (     0.11)&lt;br /&gt;
   b:                             91.45        91.45 (     0.11)&lt;br /&gt;
   c:                             45.96        45.96 (     0.12)&lt;br /&gt;
   alpha:                         90.00        90.00 (     0.00)&lt;br /&gt;
   beta:                          90.00        90.00 (     0.00)&lt;br /&gt;
   gamma:                        120.00       120.00 (     0.00)&lt;br /&gt;
 Parmeters from integration (not-refined)&lt;br /&gt;
  Wavelength:                   0.96861      0.96861 (  0.00000)&lt;br /&gt;
  Detector distance:          303.81868    303.81868 (  0.00000)&lt;br /&gt;
 * (standard deviation)&lt;br /&gt;
&lt;br /&gt;
 Total calculation time: 542.00 seconds&lt;br /&gt;
 Finished: Tuesday 14. February 2017 10:53:18&lt;br /&gt;
&lt;br /&gt;
== Obtaining the Output ==&lt;br /&gt;
&lt;br /&gt;
Your output will be in Prime_Run_n (where n is the number of run). &lt;br /&gt;
&lt;br /&gt;
 -bash-4.1$ ls Prime_Run_1/ -l&lt;br /&gt;
 total 9076&lt;br /&gt;
 -rw-r--r-- 1 mu238 camb  879638 Feb 14 10:53 crystal.o&lt;br /&gt;
 drwxr-xr-x 2 mu238 camb     104 Feb 14 10:46 index_ambiguity&lt;br /&gt;
 drwxr-xr-x 2 mu238 camb       6 Feb 14 10:44 isoform_cluster&lt;br /&gt;
 -rw-r--r-- 1 mu238 camb   32704 Feb 14 10:53 log.txt&lt;br /&gt;
 -rw-r--r-- 1 mu238 camb  324556 Feb 14 10:47 mean_scaled_merge.hkl&lt;br /&gt;
 -rw-r--r-- 1 mu238 camb  157260 Feb 14 10:47 mean_scaled_merge.mtz&lt;br /&gt;
 -rw-r--r-- 1 mu238 camb   15753 Feb 14 10:53 pickle.stat&lt;br /&gt;
 -rw-r--r-- 1 mu238 camb  324381 Feb 14 10:49 postref_cycle_1_merge.hkl&lt;br /&gt;
 -rw-r--r-- 1 mu238 camb  157260 Feb 14 10:49 postref_cycle_1_merge.mtz&lt;br /&gt;
 -rw-r--r-- 1 mu238 camb  324515 Feb 14 10:51 postref_cycle_2_merge.hkl&lt;br /&gt;
 -rw-r--r-- 1 mu238 camb  157260 Feb 14 10:51 postref_cycle_2_merge.mtz&lt;br /&gt;
 -rw-r--r-- 1 mu238 camb  324716 Feb 14 10:53 postref_cycle_3_merge.hkl&lt;br /&gt;
 -rw-r--r-- 1 mu238 camb  157340 Feb 14 10:53 postref_cycle_3_merge.mtz&lt;br /&gt;
 -rw-r--r-- 1 mu238 camb 6412200 Feb 14 10:53 rejections.txt&lt;br /&gt;
&lt;br /&gt;
File log.txt contains all the merging stats. The final merged reflection set is postref_cycle_3_merge.mtz (or .hkl).&lt;/div&gt;</summary>
		<author><name>Mona</name></author>
	</entry>
	<entry>
		<id>http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=2017_prime_tutorial&amp;diff=1390</id>
		<title>2017 prime tutorial</title>
		<link rel="alternate" type="text/html" href="http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=2017_prime_tutorial&amp;diff=1390"/>
		<updated>2017-02-14T19:12:54Z</updated>

		<summary type="html">&lt;p&gt;Mona: /* Running the Program */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Post-refine and Merge Sample Data Set with PRIME (2017 Tutorial)&lt;br /&gt;
&lt;br /&gt;
In this tutorial, we will work on the integration results from the first of Tutorial 2 (Myoglobin Data). Before proceeding to running the program, we&#039;ll consider making the input file for PRIME based on the situation of this data set.&lt;br /&gt;
&lt;br /&gt;
== Generating Input File ==&lt;br /&gt;
&lt;br /&gt;
PRIME input files contain information necessary for successful post-refinement and merging steps. You can access and review the list of input parameters by running prime.run or prime.run -h to view the description of these parameters. For this tutorial we&#039;ll start building it from scratch.&lt;br /&gt;
&lt;br /&gt;
* Location of integration results&lt;br /&gt;
In this case, we know the location where the integration results (pickle files) are. We can then set,&lt;br /&gt;
&lt;br /&gt;
 data = /net/viper/raid1/mu238/XfelProject/dials17/extracted&lt;br /&gt;
&lt;br /&gt;
Note that you supply data as a multiple arguments. The value of the parameter can be a file containing list of integration results, a folder, or a wildcard argument.&lt;br /&gt;
&lt;br /&gt;
* Unit cell information &lt;br /&gt;
You can obtain the mean (or median) unit-cell dimensions from either IOTA or DIALS. In case of IOTA, prime .phil file is auto generated and this information is readily available in there. For n_residues, enter number of residues in asymmetric unit of your molecule.&lt;br /&gt;
&lt;br /&gt;
 target_unit_cell = 91.7 91.7 46 90 90 120&lt;br /&gt;
 target_space_group = P6&lt;br /&gt;
 n_residues = 128&lt;br /&gt;
&lt;br /&gt;
* Detector information&lt;br /&gt;
 pixel_size_mm = 0.172&lt;br /&gt;
&lt;br /&gt;
* Post-refinement and Scaling information&lt;br /&gt;
This is where you specify the optimal resolution cutoffs for post-refinement and merging. Note that when running for the first time on you newly collected data, you can choose the &amp;quot;expected&amp;quot; values (resolution which you see the spots at the corner or on the edge). You can then adjust these parameters when analyzing merging statistics based on the I/sigI values in the high resolution shells and rerun the program again. Note that sigma cutoffs are set to 1.5 in scaling and post-refinement steps while it&#039;s set to -3.0 so we can include negative values in the merged reflection set.  &lt;br /&gt;
 &lt;br /&gt;
 scale {&lt;br /&gt;
   d_min = 2.5&lt;br /&gt;
   d_max = 20&lt;br /&gt;
   sigma_min = 1.5&lt;br /&gt;
 }&lt;br /&gt;
 postref {&lt;br /&gt;
   scale {&lt;br /&gt;
     d_min = 2.5&lt;br /&gt;
     d_max = 20&lt;br /&gt;
     sigma_min = 1.5&lt;br /&gt;
     partiality_min = 0.1&lt;br /&gt;
   allparams {&lt;br /&gt;
     flag_on = True&lt;br /&gt;
     d_min = 2.5&lt;br /&gt;
     d_max = 20&lt;br /&gt;
     sigma_min = 1.5&lt;br /&gt;
     partiality_min = 0.1&lt;br /&gt;
     uc_tolerance = 5&lt;br /&gt;
   }&lt;br /&gt;
 }&lt;br /&gt;
 merge {&lt;br /&gt;
   d_min = 2.5&lt;br /&gt;
   d_max = 20&lt;br /&gt;
   sigma_min = -3.0&lt;br /&gt;
   partiality_min = 0.1&lt;br /&gt;
   uc_tolerance = 5&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
* Indexing ambiguity&lt;br /&gt;
For other sets that are not in polar space or have indexing ambiguity (when one or more of the unit-cell dimensions are very similar but not the same!), you can very well use the .phil file parameters thus far to proceed and run post-refinement. However, this data set is in P6 (polar space group) and therefore, the indexing ambiguity needs to be resolved prior to other refinement and merging steps.&lt;br /&gt;
&lt;br /&gt;
Other point worth noting is for any polar space groups, PRIME will automatically solve the ambiguity based on the default parameters. However, this data set has about 5,000 integration results so we want to make sure that we modify the number of images used for random and best selections.&lt;br /&gt;
&lt;br /&gt;
 indexing_ambiguity {&lt;br /&gt;
  mode = Auto&lt;br /&gt;
  index_basis_in = None&lt;br /&gt;
  assigned_basis = None&lt;br /&gt;
  d_min = 3.0&lt;br /&gt;
  d_max = 10.0&lt;br /&gt;
  sigma_min = 1.5&lt;br /&gt;
  n_sample_frames = 1000&lt;br /&gt;
  n_selected_frames = 100&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
We left other parameters to their default value and modified n_sample_frames to 1000 and n_selected_frames to 100.&lt;br /&gt;
&lt;br /&gt;
* No. of Bin&lt;br /&gt;
 n_bins = 10&lt;br /&gt;
&lt;br /&gt;
Now we have a complete .phil file ready to run.&lt;br /&gt;
&lt;br /&gt;
 data = /net/viper/raid1/mu238/XfelProject/dials17/extracted&lt;br /&gt;
 target_unit_cell = 91.7 91.7 46 90 90 120&lt;br /&gt;
 target_space_group = P6&lt;br /&gt;
 n_residues = 128&lt;br /&gt;
 pixel_size_mm = 0.172&lt;br /&gt;
 scale {&lt;br /&gt;
  d_min = 2.5&lt;br /&gt;
  d_max = 20&lt;br /&gt;
  sigma_min = 1.5&lt;br /&gt;
 }&lt;br /&gt;
 postref {&lt;br /&gt;
  scale {&lt;br /&gt;
    d_min = 2.5&lt;br /&gt;
    d_max = 20&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
  }&lt;br /&gt;
  allparams {&lt;br /&gt;
    flag_on = True&lt;br /&gt;
    d_min = 2.5&lt;br /&gt;
    d_max = 20&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
    uc_tolerance = 5&lt;br /&gt;
  }&lt;br /&gt;
 }&lt;br /&gt;
 merge {&lt;br /&gt;
  d_min = 2.5&lt;br /&gt;
  d_max = 20&lt;br /&gt;
  sigma_min = -3.0&lt;br /&gt;
  partiality_min = 0.1&lt;br /&gt;
  uc_tolerance = 5&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
 indexing_ambiguity {&lt;br /&gt;
  mode = Auto&lt;br /&gt;
  index_basis_in = None&lt;br /&gt;
  assigned_basis = None&lt;br /&gt;
  d_min = 3.0&lt;br /&gt;
  d_max = 10.0&lt;br /&gt;
  sigma_min = 1.5&lt;br /&gt;
  n_sample_frames = 1000&lt;br /&gt;
  n_selected_frames = 100&lt;br /&gt;
 }&lt;br /&gt;
 n_bins = 10&lt;br /&gt;
&lt;br /&gt;
Copy and paste this set of parameter in an editor then save the file as &amp;quot;prime.phil&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
== Running the Program ==&lt;br /&gt;
You can run the program by giving it an input file:&lt;br /&gt;
&lt;br /&gt;
 prime.run prime.phil&lt;br /&gt;
&lt;br /&gt;
For this tutorial, PRIME will score the randomly selected 1,000 images then select the best 100 for running Brehm &amp;amp; Diederichs algorithm in Bootstrap mode. If you run the program with flag_plot=True, you&#039;ll see a plot showing two separated clusters, each representing images with matching assigned basis. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PRIME will select on of these two clusters and merge it to get a reference set for the Bootstrap step. Here, the remaining images will get assigned with a basis that makes it correlate best with the reference set.&lt;br /&gt;
&lt;br /&gt;
Once all images are assigned with appropriate basis, PRIME will proceed to scaling and post-refinement steps. After three post-refinement cycles (default value), the process is done and here is the output of the program.&lt;br /&gt;
&lt;br /&gt;
 Isotropic B-factor:     5.30&lt;br /&gt;
 No. of reflections&lt;br /&gt;
  all:                   7786&lt;br /&gt;
  outside resolution:      51&lt;br /&gt;
  outliers:                 0&lt;br /&gt;
  total left:            7735&lt;br /&gt;
 Summary for Prime_Run_1/postref_cycle_3_merge.mtz&lt;br /&gt;
 Bin Resolution Range     Completeness       N_obs  |Rmerge  Rsplit   CC1/2   N_ind |CCiso   N_ind|CCanoma  N_ind|  I/sigI     I      sigI      I**2 &lt;br /&gt;
 --------------------------------------------------------------------------------------------------------------------------------------------------&lt;br /&gt;
 01   19.88 -    5.35 100.0    807 /    807  189.78   85.75    8.87   98.43    807    0.00      0    0.00      0     4.46      684.2    136.2   3.57&lt;br /&gt;
 02    5.35 -    4.26 100.0    782 /    782  140.90   73.61    8.89   97.67    782    0.00      0    0.00      0     5.23      794.3    140.3   2.05&lt;br /&gt;
 03    4.26 -    3.73 100.0    788 /    788  129.32   69.32    8.70   98.11    788    0.00      0    0.00      0     5.41      878.5    150.3   1.95&lt;br /&gt;
 04    3.73 -    3.39 100.0    765 /    765  117.75   70.72    9.67   97.55    765    0.00      0    0.00      0     4.12      712.3    162.4   1.88&lt;br /&gt;
 05    3.39 -    3.15 100.0    770 /    770  113.22   71.61   11.22   88.54    770    0.00      0    0.00      0     2.73      500.1    173.7   2.19&lt;br /&gt;
 06    3.15 -    2.96 100.0    767 /    767  106.12   73.19   11.07   97.21    767    0.00      0    0.00      0     2.09      404.6    183.8   2.02&lt;br /&gt;
 07    2.96 -    2.81 100.0    766 /    766  103.73   75.79   12.53   96.62    766    0.00      0    0.00      0     1.72      345.3    193.9   1.89&lt;br /&gt;
 08    2.81 -    2.69 100.0    745 /    745  101.51   76.11   12.84   96.21    745    0.00      0    0.00      0     1.49      317.3    204.1   1.98&lt;br /&gt;
 09    2.69 -    2.59 100.0    786 /    786   97.88   77.59   14.19   95.40    786    0.00      0    0.00      0     1.38      299.0    209.3   1.86&lt;br /&gt;
 10    2.59 -    2.50 100.0    759 /    759   92.53   78.61   14.72   96.51    759    0.00      0    0.00      0     1.36      312.4    218.8   2.07&lt;br /&gt;
 --------------------------------------------------------------------------------------------------------------------------------------------------&lt;br /&gt;
         TOTAL        100.0   7735 /   7735  119.73   75.51   10.45   97.21   7735    0.00      0    0.00      0     3.02      527.3    176.9   2.56&lt;br /&gt;
 --------------------------------------------------------------------------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
 Summary of CC1/2 on three crystal axes&lt;br /&gt;
 Bin Resolution Range           CC1/2                       I                           N_refl           &lt;br /&gt;
                        a*      b*      c*  |      a*        b*       c*    |    a*      b*     c*      &lt;br /&gt;
 ---------------------------------------------------------------------------------------------------------&lt;br /&gt;
 01   19.88 -    5.35   97.01   98.64   98.23      528.6      559.6     1216.7     42     51     47&lt;br /&gt;
 02    5.35 -    4.26   97.64   98.43   99.08      817.6      527.5      964.9     43     44     40&lt;br /&gt;
 03    4.26 -    3.73   96.31   98.02   97.68      605.7      682.9      856.0     39     39     41&lt;br /&gt;
 04    3.73 -    3.39   98.49   98.55   97.73      961.9      532.6      729.1     42     37     45&lt;br /&gt;
 05    3.39 -    3.15   96.88   98.38   92.69      449.5      492.1      721.6     39     39     40&lt;br /&gt;
 06    3.15 -    2.96   98.48   93.58   98.61      389.9      303.4      391.7     39     37     39&lt;br /&gt;
 07    2.96 -    2.81   96.98   98.02   95.35      361.3      331.7      383.2     42     37     43&lt;br /&gt;
 08    2.81 -    2.69   95.29   94.02   94.69      290.8      194.7      292.7     41     35     36&lt;br /&gt;
 09    2.69 -    2.59   96.55   91.88   98.57      265.7      341.4      290.2     41     35     44&lt;br /&gt;
 10    2.59 -    2.50   94.44   97.81   96.67      249.0      400.1      236.2     42     36     40&lt;br /&gt;
 ----------------------------------------------------------------------------------------------------------&lt;br /&gt;
        total           97.57   97.74   94.58      494.1      446.0      619.4    410    390    415&lt;br /&gt;
 ----------------------------------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
 Summary of refinement and merging&lt;br /&gt;
 No. good frames:                  4733&lt;br /&gt;
 No. bad cc frames:                 113&lt;br /&gt;
 No. bad G frames) :                109&lt;br /&gt;
 No. bad unit cell frames:           20&lt;br /&gt;
 No. bad gamma_e frames:             22&lt;br /&gt;
 No. bad SE:                          2&lt;br /&gt;
 No. observations:               935265&lt;br /&gt;
 Mean target value (BEFORE: Mean Median (Std.))&lt;br /&gt;
 post-refinement:                301.22       259.10 (   171.56)&lt;br /&gt;
 (x,y) restraints:              1679.63      1573.15 (   657.49)&lt;br /&gt;
 Mean target value (AFTER: Mean Median (Std.))&lt;br /&gt;
 post-refinement:                300.02       257.53 (   170.98)&lt;br /&gt;
 (x,y) restraints:              1679.90      1572.77 (   660.19)&lt;br /&gt;
 SE:                            1915.60       776.84 ( 33765.97)&lt;br /&gt;
 G:                           1.000e+00    8.971e-01 ( 8.15e-01)&lt;br /&gt;
 B:                               11.83        14.45 (    11.95)&lt;br /&gt;
 Rot.x:                           -0.08         0.00 (    12.10)&lt;br /&gt;
 Rot.y:                            0.14         0.00 (     9.62)&lt;br /&gt;
 gamma_y:                       0.00000      0.00000 (  0.00000)&lt;br /&gt;
 gamma_z:                       0.00000      0.00000 (  0.00000)&lt;br /&gt;
 gamma_0:                       0.03793      0.00019 (  0.60820)&lt;br /&gt;
 gamma_e:                      -0.12824      0.00145 (  0.60227)&lt;br /&gt;
 voigt_nu:                      0.50000      0.50000 (  0.00000)&lt;br /&gt;
 unit cell&lt;br /&gt;
   a:                             91.45        91.45 (     0.11)&lt;br /&gt;
   b:                             91.45        91.45 (     0.11)&lt;br /&gt;
   c:                             45.96        45.96 (     0.12)&lt;br /&gt;
   alpha:                         90.00        90.00 (     0.00)&lt;br /&gt;
   beta:                          90.00        90.00 (     0.00)&lt;br /&gt;
   gamma:                        120.00       120.00 (     0.00)&lt;br /&gt;
 Parmeters from integration (not-refined)&lt;br /&gt;
  Wavelength:                   0.96861      0.96861 (  0.00000)&lt;br /&gt;
  Detector distance:          303.81868    303.81868 (  0.00000)&lt;br /&gt;
 * (standard deviation)&lt;br /&gt;
&lt;br /&gt;
 Total calculation time: 542.00 seconds&lt;br /&gt;
 Finished: Tuesday 14. February 2017 10:53:18&lt;/div&gt;</summary>
		<author><name>Mona</name></author>
	</entry>
	<entry>
		<id>http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=2017_prime_tutorial&amp;diff=1389</id>
		<title>2017 prime tutorial</title>
		<link rel="alternate" type="text/html" href="http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=2017_prime_tutorial&amp;diff=1389"/>
		<updated>2017-02-14T19:12:15Z</updated>

		<summary type="html">&lt;p&gt;Mona: /* Running the Program */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Post-refine and Merge Sample Data Set with PRIME (2017 Tutorial)&lt;br /&gt;
&lt;br /&gt;
In this tutorial, we will work on the integration results from the first of Tutorial 2 (Myoglobin Data). Before proceeding to running the program, we&#039;ll consider making the input file for PRIME based on the situation of this data set.&lt;br /&gt;
&lt;br /&gt;
== Generating Input File ==&lt;br /&gt;
&lt;br /&gt;
PRIME input files contain information necessary for successful post-refinement and merging steps. You can access and review the list of input parameters by running prime.run or prime.run -h to view the description of these parameters. For this tutorial we&#039;ll start building it from scratch.&lt;br /&gt;
&lt;br /&gt;
* Location of integration results&lt;br /&gt;
In this case, we know the location where the integration results (pickle files) are. We can then set,&lt;br /&gt;
&lt;br /&gt;
 data = /net/viper/raid1/mu238/XfelProject/dials17/extracted&lt;br /&gt;
&lt;br /&gt;
Note that you supply data as a multiple arguments. The value of the parameter can be a file containing list of integration results, a folder, or a wildcard argument.&lt;br /&gt;
&lt;br /&gt;
* Unit cell information &lt;br /&gt;
You can obtain the mean (or median) unit-cell dimensions from either IOTA or DIALS. In case of IOTA, prime .phil file is auto generated and this information is readily available in there. For n_residues, enter number of residues in asymmetric unit of your molecule.&lt;br /&gt;
&lt;br /&gt;
 target_unit_cell = 91.7 91.7 46 90 90 120&lt;br /&gt;
 target_space_group = P6&lt;br /&gt;
 n_residues = 128&lt;br /&gt;
&lt;br /&gt;
* Detector information&lt;br /&gt;
 pixel_size_mm = 0.172&lt;br /&gt;
&lt;br /&gt;
* Post-refinement and Scaling information&lt;br /&gt;
This is where you specify the optimal resolution cutoffs for post-refinement and merging. Note that when running for the first time on you newly collected data, you can choose the &amp;quot;expected&amp;quot; values (resolution which you see the spots at the corner or on the edge). You can then adjust these parameters when analyzing merging statistics based on the I/sigI values in the high resolution shells and rerun the program again. Note that sigma cutoffs are set to 1.5 in scaling and post-refinement steps while it&#039;s set to -3.0 so we can include negative values in the merged reflection set.  &lt;br /&gt;
 &lt;br /&gt;
 scale {&lt;br /&gt;
   d_min = 2.5&lt;br /&gt;
   d_max = 20&lt;br /&gt;
   sigma_min = 1.5&lt;br /&gt;
 }&lt;br /&gt;
 postref {&lt;br /&gt;
   scale {&lt;br /&gt;
     d_min = 2.5&lt;br /&gt;
     d_max = 20&lt;br /&gt;
     sigma_min = 1.5&lt;br /&gt;
     partiality_min = 0.1&lt;br /&gt;
   allparams {&lt;br /&gt;
     flag_on = True&lt;br /&gt;
     d_min = 2.5&lt;br /&gt;
     d_max = 20&lt;br /&gt;
     sigma_min = 1.5&lt;br /&gt;
     partiality_min = 0.1&lt;br /&gt;
     uc_tolerance = 5&lt;br /&gt;
   }&lt;br /&gt;
 }&lt;br /&gt;
 merge {&lt;br /&gt;
   d_min = 2.5&lt;br /&gt;
   d_max = 20&lt;br /&gt;
   sigma_min = -3.0&lt;br /&gt;
   partiality_min = 0.1&lt;br /&gt;
   uc_tolerance = 5&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
* Indexing ambiguity&lt;br /&gt;
For other sets that are not in polar space or have indexing ambiguity (when one or more of the unit-cell dimensions are very similar but not the same!), you can very well use the .phil file parameters thus far to proceed and run post-refinement. However, this data set is in P6 (polar space group) and therefore, the indexing ambiguity needs to be resolved prior to other refinement and merging steps.&lt;br /&gt;
&lt;br /&gt;
Other point worth noting is for any polar space groups, PRIME will automatically solve the ambiguity based on the default parameters. However, this data set has about 5,000 integration results so we want to make sure that we modify the number of images used for random and best selections.&lt;br /&gt;
&lt;br /&gt;
 indexing_ambiguity {&lt;br /&gt;
  mode = Auto&lt;br /&gt;
  index_basis_in = None&lt;br /&gt;
  assigned_basis = None&lt;br /&gt;
  d_min = 3.0&lt;br /&gt;
  d_max = 10.0&lt;br /&gt;
  sigma_min = 1.5&lt;br /&gt;
  n_sample_frames = 1000&lt;br /&gt;
  n_selected_frames = 100&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
We left other parameters to their default value and modified n_sample_frames to 1000 and n_selected_frames to 100.&lt;br /&gt;
&lt;br /&gt;
* No. of Bin&lt;br /&gt;
 n_bins = 10&lt;br /&gt;
&lt;br /&gt;
Now we have a complete .phil file ready to run.&lt;br /&gt;
&lt;br /&gt;
 data = /net/viper/raid1/mu238/XfelProject/dials17/extracted&lt;br /&gt;
 target_unit_cell = 91.7 91.7 46 90 90 120&lt;br /&gt;
 target_space_group = P6&lt;br /&gt;
 n_residues = 128&lt;br /&gt;
 pixel_size_mm = 0.172&lt;br /&gt;
 scale {&lt;br /&gt;
  d_min = 2.5&lt;br /&gt;
  d_max = 20&lt;br /&gt;
  sigma_min = 1.5&lt;br /&gt;
 }&lt;br /&gt;
 postref {&lt;br /&gt;
  scale {&lt;br /&gt;
    d_min = 2.5&lt;br /&gt;
    d_max = 20&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
  }&lt;br /&gt;
  allparams {&lt;br /&gt;
    flag_on = True&lt;br /&gt;
    d_min = 2.5&lt;br /&gt;
    d_max = 20&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
    uc_tolerance = 5&lt;br /&gt;
  }&lt;br /&gt;
 }&lt;br /&gt;
 merge {&lt;br /&gt;
  d_min = 2.5&lt;br /&gt;
  d_max = 20&lt;br /&gt;
  sigma_min = -3.0&lt;br /&gt;
  partiality_min = 0.1&lt;br /&gt;
  uc_tolerance = 5&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
 indexing_ambiguity {&lt;br /&gt;
  mode = Auto&lt;br /&gt;
  index_basis_in = None&lt;br /&gt;
  assigned_basis = None&lt;br /&gt;
  d_min = 3.0&lt;br /&gt;
  d_max = 10.0&lt;br /&gt;
  sigma_min = 1.5&lt;br /&gt;
  n_sample_frames = 1000&lt;br /&gt;
  n_selected_frames = 100&lt;br /&gt;
 }&lt;br /&gt;
 n_bins = 10&lt;br /&gt;
&lt;br /&gt;
Copy and paste this set of parameter in an editor then save the file as &amp;quot;prime.phil&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
== Running the Program ==&lt;br /&gt;
You can run the program by giving it an input file:&lt;br /&gt;
&lt;br /&gt;
 prime.run prime.phil&lt;br /&gt;
&lt;br /&gt;
For this tutorial, PRIME will score the randomly selected 1,000 images then select the best 100 for running Brehm &amp;amp; Diederichs algorithm in Bootstrap mode. If you run the program with flag_plot=True, you&#039;ll see a plot showing two separated clusters, each representing images with matching assigned basis. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PRIME will select on of these two clusters and merge it to get a reference set for the Bootstrap step. Here, the remaining images will get assigned with a basis that makes it correlate best with the reference set.&lt;br /&gt;
&lt;br /&gt;
Once all images are assigned with appropriate basis, PRIME will proceed to scaling and post-refinement steps. After three post-refinement cycles (default value), the process is done and here is the output of the program.&lt;br /&gt;
&lt;br /&gt;
 Isotropic B-factor:     5.30&lt;br /&gt;
 No. of reflections&lt;br /&gt;
  all:                   7786&lt;br /&gt;
  outside resolution:      51&lt;br /&gt;
  outliers:                 0&lt;br /&gt;
  total left:            7735&lt;br /&gt;
 Summary for Prime_Run_1/postref_cycle_3_merge.mtz&lt;br /&gt;
 Bin Resolution Range     Completeness       N_obs  |Rmerge  Rsplit   CC1/2   N_ind |CCiso   N_ind|CCanoma  N_ind|  I/sigI     I      sigI      I**2 &lt;br /&gt;
 --------------------------------------------------------------------------------------------------------------------------------------------------&lt;br /&gt;
 01   19.88 -    5.35 100.0    807 /    807  189.78   85.75    8.87   98.43    807    0.00      0    0.00      0     4.46      684.2    136.2   3.57&lt;br /&gt;
 02    5.35 -    4.26 100.0    782 /    782  140.90   73.61    8.89   97.67    782    0.00      0    0.00      0     5.23      794.3    140.3   2.05&lt;br /&gt;
 03    4.26 -    3.73 100.0    788 /    788  129.32   69.32    8.70   98.11    788    0.00      0    0.00      0     5.41      878.5    150.3   1.95&lt;br /&gt;
 04    3.73 -    3.39 100.0    765 /    765  117.75   70.72    9.67   97.55    765    0.00      0    0.00      0     4.12      712.3    162.4   1.88&lt;br /&gt;
 05    3.39 -    3.15 100.0    770 /    770  113.22   71.61   11.22   88.54    770    0.00      0    0.00      0     2.73      500.1    173.7   2.19&lt;br /&gt;
 06    3.15 -    2.96 100.0    767 /    767  106.12   73.19   11.07   97.21    767    0.00      0    0.00      0     2.09      404.6    183.8   2.02&lt;br /&gt;
 07    2.96 -    2.81 100.0    766 /    766  103.73   75.79   12.53   96.62    766    0.00      0    0.00      0     1.72      345.3    193.9   1.89&lt;br /&gt;
 08    2.81 -    2.69 100.0    745 /    745  101.51   76.11   12.84   96.21    745    0.00      0    0.00      0     1.49      317.3    204.1   1.98&lt;br /&gt;
 09    2.69 -    2.59 100.0    786 /    786   97.88   77.59   14.19   95.40    786    0.00      0    0.00      0     1.38      299.0    209.3   1.86&lt;br /&gt;
 10    2.59 -    2.50 100.0    759 /    759   92.53   78.61   14.72   96.51    759    0.00      0    0.00      0     1.36      312.4    218.8   2.07&lt;br /&gt;
 --------------------------------------------------------------------------------------------------------------------------------------------------&lt;br /&gt;
        TOTAL        100.0   7735 /   7735  119.73   75.51   10.45   97.21   7735    0.00      0    0.00      0     3.02      527.3    176.9   2.56&lt;br /&gt;
 --------------------------------------------------------------------------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
 Summary of CC1/2 on three crystal axes&lt;br /&gt;
 Bin Resolution Range           CC1/2                       I                           N_refl           &lt;br /&gt;
                        a*      b*      c*  |      a*        b*       c*    |    a*      b*     c*      &lt;br /&gt;
 ---------------------------------------------------------------------------------------------------------&lt;br /&gt;
 01   19.88 -    5.35   97.01   98.64   98.23      528.6      559.6     1216.7     42     51     47&lt;br /&gt;
 02    5.35 -    4.26   97.64   98.43   99.08      817.6      527.5      964.9     43     44     40&lt;br /&gt;
 03    4.26 -    3.73   96.31   98.02   97.68      605.7      682.9      856.0     39     39     41&lt;br /&gt;
 04    3.73 -    3.39   98.49   98.55   97.73      961.9      532.6      729.1     42     37     45&lt;br /&gt;
 05    3.39 -    3.15   96.88   98.38   92.69      449.5      492.1      721.6     39     39     40&lt;br /&gt;
 06    3.15 -    2.96   98.48   93.58   98.61      389.9      303.4      391.7     39     37     39&lt;br /&gt;
 07    2.96 -    2.81   96.98   98.02   95.35      361.3      331.7      383.2     42     37     43&lt;br /&gt;
 08    2.81 -    2.69   95.29   94.02   94.69      290.8      194.7      292.7     41     35     36&lt;br /&gt;
 09    2.69 -    2.59   96.55   91.88   98.57      265.7      341.4      290.2     41     35     44&lt;br /&gt;
 10    2.59 -    2.50   94.44   97.81   96.67      249.0      400.1      236.2     42     36     40&lt;br /&gt;
 ----------------------------------------------------------------------------------------------------------&lt;br /&gt;
       total           97.57   97.74   94.58      494.1      446.0      619.4    410    390    415&lt;br /&gt;
 ----------------------------------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
 Summary of refinement and merging&lt;br /&gt;
 No. good frames:                  4733&lt;br /&gt;
 No. bad cc frames:                 113&lt;br /&gt;
 No. bad G frames) :                109&lt;br /&gt;
 No. bad unit cell frames:           20&lt;br /&gt;
 No. bad gamma_e frames:             22&lt;br /&gt;
 No. bad SE:                          2&lt;br /&gt;
 No. observations:               935265&lt;br /&gt;
 Mean target value (BEFORE: Mean Median (Std.))&lt;br /&gt;
 post-refinement:                301.22       259.10 (   171.56)&lt;br /&gt;
 (x,y) restraints:              1679.63      1573.15 (   657.49)&lt;br /&gt;
 Mean target value (AFTER: Mean Median (Std.))&lt;br /&gt;
 post-refinement:                300.02       257.53 (   170.98)&lt;br /&gt;
 (x,y) restraints:              1679.90      1572.77 (   660.19)&lt;br /&gt;
 SE:                            1915.60       776.84 ( 33765.97)&lt;br /&gt;
 G:                           1.000e+00    8.971e-01 ( 8.15e-01)&lt;br /&gt;
 B:                               11.83        14.45 (    11.95)&lt;br /&gt;
 Rot.x:                           -0.08         0.00 (    12.10)&lt;br /&gt;
 Rot.y:                            0.14         0.00 (     9.62)&lt;br /&gt;
 gamma_y:                       0.00000      0.00000 (  0.00000)&lt;br /&gt;
 gamma_z:                       0.00000      0.00000 (  0.00000)&lt;br /&gt;
 gamma_0:                       0.03793      0.00019 (  0.60820)&lt;br /&gt;
 gamma_e:                      -0.12824      0.00145 (  0.60227)&lt;br /&gt;
 voigt_nu:                      0.50000      0.50000 (  0.00000)&lt;br /&gt;
 unit cell&lt;br /&gt;
   a:                             91.45        91.45 (     0.11)&lt;br /&gt;
   b:                             91.45        91.45 (     0.11)&lt;br /&gt;
   c:                             45.96        45.96 (     0.12)&lt;br /&gt;
   alpha:                         90.00        90.00 (     0.00)&lt;br /&gt;
   beta:                          90.00        90.00 (     0.00)&lt;br /&gt;
   gamma:                        120.00       120.00 (     0.00)&lt;br /&gt;
 Parmeters from integration (not-refined)&lt;br /&gt;
  Wavelength:                   0.96861      0.96861 (  0.00000)&lt;br /&gt;
  Detector distance:          303.81868    303.81868 (  0.00000)&lt;br /&gt;
 * (standard deviation)&lt;br /&gt;
&lt;br /&gt;
 Total calculation time: 542.00 seconds&lt;br /&gt;
 Finished: Tuesday 14. February 2017 10:53:18&lt;/div&gt;</summary>
		<author><name>Mona</name></author>
	</entry>
	<entry>
		<id>http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=2017_prime_tutorial&amp;diff=1388</id>
		<title>2017 prime tutorial</title>
		<link rel="alternate" type="text/html" href="http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=2017_prime_tutorial&amp;diff=1388"/>
		<updated>2017-02-14T19:10:10Z</updated>

		<summary type="html">&lt;p&gt;Mona: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Post-refine and Merge Sample Data Set with PRIME (2017 Tutorial)&lt;br /&gt;
&lt;br /&gt;
In this tutorial, we will work on the integration results from the first of Tutorial 2 (Myoglobin Data). Before proceeding to running the program, we&#039;ll consider making the input file for PRIME based on the situation of this data set.&lt;br /&gt;
&lt;br /&gt;
== Generating Input File ==&lt;br /&gt;
&lt;br /&gt;
PRIME input files contain information necessary for successful post-refinement and merging steps. You can access and review the list of input parameters by running prime.run or prime.run -h to view the description of these parameters. For this tutorial we&#039;ll start building it from scratch.&lt;br /&gt;
&lt;br /&gt;
* Location of integration results&lt;br /&gt;
In this case, we know the location where the integration results (pickle files) are. We can then set,&lt;br /&gt;
&lt;br /&gt;
 data = /net/viper/raid1/mu238/XfelProject/dials17/extracted&lt;br /&gt;
&lt;br /&gt;
Note that you supply data as a multiple arguments. The value of the parameter can be a file containing list of integration results, a folder, or a wildcard argument.&lt;br /&gt;
&lt;br /&gt;
* Unit cell information &lt;br /&gt;
You can obtain the mean (or median) unit-cell dimensions from either IOTA or DIALS. In case of IOTA, prime .phil file is auto generated and this information is readily available in there. For n_residues, enter number of residues in asymmetric unit of your molecule.&lt;br /&gt;
&lt;br /&gt;
 target_unit_cell = 91.7 91.7 46 90 90 120&lt;br /&gt;
 target_space_group = P6&lt;br /&gt;
 n_residues = 128&lt;br /&gt;
&lt;br /&gt;
* Detector information&lt;br /&gt;
 pixel_size_mm = 0.172&lt;br /&gt;
&lt;br /&gt;
* Post-refinement and Scaling information&lt;br /&gt;
This is where you specify the optimal resolution cutoffs for post-refinement and merging. Note that when running for the first time on you newly collected data, you can choose the &amp;quot;expected&amp;quot; values (resolution which you see the spots at the corner or on the edge). You can then adjust these parameters when analyzing merging statistics based on the I/sigI values in the high resolution shells and rerun the program again. Note that sigma cutoffs are set to 1.5 in scaling and post-refinement steps while it&#039;s set to -3.0 so we can include negative values in the merged reflection set.  &lt;br /&gt;
 &lt;br /&gt;
 scale {&lt;br /&gt;
   d_min = 2.5&lt;br /&gt;
   d_max = 20&lt;br /&gt;
   sigma_min = 1.5&lt;br /&gt;
 }&lt;br /&gt;
 postref {&lt;br /&gt;
   scale {&lt;br /&gt;
     d_min = 2.5&lt;br /&gt;
     d_max = 20&lt;br /&gt;
     sigma_min = 1.5&lt;br /&gt;
     partiality_min = 0.1&lt;br /&gt;
   allparams {&lt;br /&gt;
     flag_on = True&lt;br /&gt;
     d_min = 2.5&lt;br /&gt;
     d_max = 20&lt;br /&gt;
     sigma_min = 1.5&lt;br /&gt;
     partiality_min = 0.1&lt;br /&gt;
     uc_tolerance = 5&lt;br /&gt;
   }&lt;br /&gt;
 }&lt;br /&gt;
 merge {&lt;br /&gt;
   d_min = 2.5&lt;br /&gt;
   d_max = 20&lt;br /&gt;
   sigma_min = -3.0&lt;br /&gt;
   partiality_min = 0.1&lt;br /&gt;
   uc_tolerance = 5&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
* Indexing ambiguity&lt;br /&gt;
For other sets that are not in polar space or have indexing ambiguity (when one or more of the unit-cell dimensions are very similar but not the same!), you can very well use the .phil file parameters thus far to proceed and run post-refinement. However, this data set is in P6 (polar space group) and therefore, the indexing ambiguity needs to be resolved prior to other refinement and merging steps.&lt;br /&gt;
&lt;br /&gt;
Other point worth noting is for any polar space groups, PRIME will automatically solve the ambiguity based on the default parameters. However, this data set has about 5,000 integration results so we want to make sure that we modify the number of images used for random and best selections.&lt;br /&gt;
&lt;br /&gt;
 indexing_ambiguity {&lt;br /&gt;
  mode = Auto&lt;br /&gt;
  index_basis_in = None&lt;br /&gt;
  assigned_basis = None&lt;br /&gt;
  d_min = 3.0&lt;br /&gt;
  d_max = 10.0&lt;br /&gt;
  sigma_min = 1.5&lt;br /&gt;
  n_sample_frames = 1000&lt;br /&gt;
  n_selected_frames = 100&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
We left other parameters to their default value and modified n_sample_frames to 1000 and n_selected_frames to 100.&lt;br /&gt;
&lt;br /&gt;
* No. of Bin&lt;br /&gt;
 n_bins = 10&lt;br /&gt;
&lt;br /&gt;
Now we have a complete .phil file ready to run.&lt;br /&gt;
&lt;br /&gt;
 data = /net/viper/raid1/mu238/XfelProject/dials17/extracted&lt;br /&gt;
 target_unit_cell = 91.7 91.7 46 90 90 120&lt;br /&gt;
 target_space_group = P6&lt;br /&gt;
 n_residues = 128&lt;br /&gt;
 pixel_size_mm = 0.172&lt;br /&gt;
 scale {&lt;br /&gt;
  d_min = 2.5&lt;br /&gt;
  d_max = 20&lt;br /&gt;
  sigma_min = 1.5&lt;br /&gt;
 }&lt;br /&gt;
 postref {&lt;br /&gt;
  scale {&lt;br /&gt;
    d_min = 2.5&lt;br /&gt;
    d_max = 20&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
  }&lt;br /&gt;
  allparams {&lt;br /&gt;
    flag_on = True&lt;br /&gt;
    d_min = 2.5&lt;br /&gt;
    d_max = 20&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
    uc_tolerance = 5&lt;br /&gt;
  }&lt;br /&gt;
 }&lt;br /&gt;
 merge {&lt;br /&gt;
  d_min = 2.5&lt;br /&gt;
  d_max = 20&lt;br /&gt;
  sigma_min = -3.0&lt;br /&gt;
  partiality_min = 0.1&lt;br /&gt;
  uc_tolerance = 5&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
 indexing_ambiguity {&lt;br /&gt;
  mode = Auto&lt;br /&gt;
  index_basis_in = None&lt;br /&gt;
  assigned_basis = None&lt;br /&gt;
  d_min = 3.0&lt;br /&gt;
  d_max = 10.0&lt;br /&gt;
  sigma_min = 1.5&lt;br /&gt;
  n_sample_frames = 1000&lt;br /&gt;
  n_selected_frames = 100&lt;br /&gt;
 }&lt;br /&gt;
 n_bins = 10&lt;br /&gt;
&lt;br /&gt;
Copy and paste this set of parameter in an editor then save the file as &amp;quot;prime.phil&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
== Running the Program ==&lt;br /&gt;
You can run the program by giving it an input file:&lt;br /&gt;
&lt;br /&gt;
 prime.run prime.phil&lt;br /&gt;
&lt;br /&gt;
For this tutorial, PRIME will score the randomly selected 1,000 images then select the best 100 for running Brehm &amp;amp; Diederichs algorithm in Bootstrap mode. If you run the program with flag_plot=True, you&#039;ll see a plot showing two separated clusters, each representing images with matching assigned basis. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PRIME will select on of these two clusters and merge it to get a reference set for the Bootstrap step. Here, the remaining images will get assigned with a basis that makes it correlate best with the reference set.&lt;br /&gt;
&lt;br /&gt;
Once all images are assigned with appropriate basis, PRIME will proceed to scaling and post-refinement steps. After three post-refinement cycles (default value), the process is done and here is the output of the program.&lt;br /&gt;
&lt;br /&gt;
 Isotropic B-factor:     5.30&lt;br /&gt;
 No. of reflections&lt;br /&gt;
  all:                   7786&lt;br /&gt;
  outside resolution:      51&lt;br /&gt;
  outliers:                 0&lt;br /&gt;
  total left:            7735&lt;br /&gt;
 Summary for Prime_Run_1/postref_cycle_3_merge.mtz&lt;br /&gt;
 Bin Resolution Range     Completeness      &amp;lt;N_obs&amp;gt; |Rmerge  Rsplit   CC1/2   N_ind |CCiso   N_ind|CCanoma  N_ind| &amp;lt;I/sigI&amp;gt;   &amp;lt;I&amp;gt;    &amp;lt;sigI&amp;gt;    &amp;lt;I**2&amp;gt;&lt;br /&gt;
 --------------------------------------------------------------------------------------------------------------------------------------------------&lt;br /&gt;
 01   19.88 -    5.35 100.0    807 /    807  189.78   85.75    8.87   98.43    807    0.00      0    0.00      0     4.46      684.2    136.2   3.57&lt;br /&gt;
 02    5.35 -    4.26 100.0    782 /    782  140.90   73.61    8.89   97.67    782    0.00      0    0.00      0     5.23      794.3    140.3   2.05&lt;br /&gt;
 03    4.26 -    3.73 100.0    788 /    788  129.32   69.32    8.70   98.11    788    0.00      0    0.00      0     5.41      878.5    150.3   1.95&lt;br /&gt;
 04    3.73 -    3.39 100.0    765 /    765  117.75   70.72    9.67   97.55    765    0.00      0    0.00      0     4.12      712.3    162.4   1.88&lt;br /&gt;
 05    3.39 -    3.15 100.0    770 /    770  113.22   71.61   11.22   88.54    770    0.00      0    0.00      0     2.73      500.1    173.7   2.19&lt;br /&gt;
 06    3.15 -    2.96 100.0    767 /    767  106.12   73.19   11.07   97.21    767    0.00      0    0.00      0     2.09      404.6    183.8   2.02&lt;br /&gt;
 07    2.96 -    2.81 100.0    766 /    766  103.73   75.79   12.53   96.62    766    0.00      0    0.00      0     1.72      345.3    193.9   1.89&lt;br /&gt;
 08    2.81 -    2.69 100.0    745 /    745  101.51   76.11   12.84   96.21    745    0.00      0    0.00      0     1.49      317.3    204.1   1.98&lt;br /&gt;
 09    2.69 -    2.59 100.0    786 /    786   97.88   77.59   14.19   95.40    786    0.00      0    0.00      0     1.38      299.0    209.3   1.86&lt;br /&gt;
 10    2.59 -    2.50 100.0    759 /    759   92.53   78.61   14.72   96.51    759    0.00      0    0.00      0     1.36      312.4    218.8   2.07&lt;br /&gt;
 --------------------------------------------------------------------------------------------------------------------------------------------------&lt;br /&gt;
        TOTAL        100.0   7735 /   7735  119.73   75.51   10.45   97.21   7735    0.00      0    0.00      0     3.02      527.3    176.9   2.56&lt;br /&gt;
 --------------------------------------------------------------------------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
 Summary of CC1/2 on three crystal axes&lt;br /&gt;
 Bin Resolution Range           CC1/2                      &amp;lt;I&amp;gt;                          N_refl           &lt;br /&gt;
                        a*      b*      c*  |      a*        b*       c*    |    a*      b*     c*      &lt;br /&gt;
 ---------------------------------------------------------------------------------------------------------&lt;br /&gt;
 01   19.88 -    5.35   97.01   98.64   98.23      528.6      559.6     1216.7     42     51     47&lt;br /&gt;
 02    5.35 -    4.26   97.64   98.43   99.08      817.6      527.5      964.9     43     44     40&lt;br /&gt;
 03    4.26 -    3.73   96.31   98.02   97.68      605.7      682.9      856.0     39     39     41&lt;br /&gt;
 04    3.73 -    3.39   98.49   98.55   97.73      961.9      532.6      729.1     42     37     45&lt;br /&gt;
 05    3.39 -    3.15   96.88   98.38   92.69      449.5      492.1      721.6     39     39     40&lt;br /&gt;
 06    3.15 -    2.96   98.48   93.58   98.61      389.9      303.4      391.7     39     37     39&lt;br /&gt;
 07    2.96 -    2.81   96.98   98.02   95.35      361.3      331.7      383.2     42     37     43&lt;br /&gt;
 08    2.81 -    2.69   95.29   94.02   94.69      290.8      194.7      292.7     41     35     36&lt;br /&gt;
 09    2.69 -    2.59   96.55   91.88   98.57      265.7      341.4      290.2     41     35     44&lt;br /&gt;
 10    2.59 -    2.50   94.44   97.81   96.67      249.0      400.1      236.2     42     36     40&lt;br /&gt;
 ----------------------------------------------------------------------------------------------------------&lt;br /&gt;
       total           97.57   97.74   94.58      494.1      446.0      619.4    410    390    415&lt;br /&gt;
 ----------------------------------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 Summary of refinement and merging&lt;br /&gt;
 No. good frames:                  4733&lt;br /&gt;
 No. bad cc frames:                 113&lt;br /&gt;
 No. bad G frames) :                109&lt;br /&gt;
 No. bad unit cell frames:           20&lt;br /&gt;
 No. bad gamma_e frames:             22&lt;br /&gt;
 No. bad SE:                          2&lt;br /&gt;
 No. observations:               935265&lt;br /&gt;
 Mean target value (BEFORE: Mean Median (Std.))&lt;br /&gt;
 post-refinement:                301.22       259.10 (   171.56)&lt;br /&gt;
 (x,y) restraints:              1679.63      1573.15 (   657.49)&lt;br /&gt;
 Mean target value (AFTER: Mean Median (Std.))&lt;br /&gt;
 post-refinement:                300.02       257.53 (   170.98)&lt;br /&gt;
 (x,y) restraints:              1679.90      1572.77 (   660.19)&lt;br /&gt;
 SE:                            1915.60       776.84 ( 33765.97)&lt;br /&gt;
 G:                           1.000e+00    8.971e-01 ( 8.15e-01)&lt;br /&gt;
 B:                               11.83        14.45 (    11.95)&lt;br /&gt;
 Rot.x:                           -0.08         0.00 (    12.10)&lt;br /&gt;
 Rot.y:                            0.14         0.00 (     9.62)&lt;br /&gt;
 gamma_y:                       0.00000      0.00000 (  0.00000)&lt;br /&gt;
 gamma_z:                       0.00000      0.00000 (  0.00000)&lt;br /&gt;
 gamma_0:                       0.03793      0.00019 (  0.60820)&lt;br /&gt;
 gamma_e:                      -0.12824      0.00145 (  0.60227)&lt;br /&gt;
 voigt_nu:                      0.50000      0.50000 (  0.00000)&lt;br /&gt;
 unit cell&lt;br /&gt;
   a:                             91.45        91.45 (     0.11)&lt;br /&gt;
   b:                             91.45        91.45 (     0.11)&lt;br /&gt;
   c:                             45.96        45.96 (     0.12)&lt;br /&gt;
   alpha:                         90.00        90.00 (     0.00)&lt;br /&gt;
   beta:                          90.00        90.00 (     0.00)&lt;br /&gt;
   gamma:                        120.00       120.00 (     0.00)&lt;br /&gt;
 Parmeters from integration (not-refined)&lt;br /&gt;
  Wavelength:                   0.96861      0.96861 (  0.00000)&lt;br /&gt;
  Detector distance:          303.81868    303.81868 (  0.00000)&lt;br /&gt;
 * (standard deviation)&lt;br /&gt;
&lt;br /&gt;
 Total calculation time: 542.00 seconds&lt;br /&gt;
 Finished: Tuesday 14. February 2017 10:53:18&lt;/div&gt;</summary>
		<author><name>Mona</name></author>
	</entry>
	<entry>
		<id>http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=2017_prime_tutorial&amp;diff=1387</id>
		<title>2017 prime tutorial</title>
		<link rel="alternate" type="text/html" href="http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=2017_prime_tutorial&amp;diff=1387"/>
		<updated>2017-02-14T18:41:12Z</updated>

		<summary type="html">&lt;p&gt;Mona: /* Generating input file */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Post-refine and Merge Sample Data Set with PRIME (2017 Tutorial)&lt;br /&gt;
&lt;br /&gt;
In this tutorial, we will work on the integration results from the first of Tutorial 2 (Myoglobin Data). Before proceeding to running the program, we&#039;ll consider making the input file for PRIME based on the situation of this data set.&lt;br /&gt;
&lt;br /&gt;
== Generating input file ==&lt;br /&gt;
&lt;br /&gt;
PRIME input files contain information necessary for successful post-refinement and merging steps. You can access and review the list of input parameters by running prime.run or prime.run -h to view the description of these parameters. For this tutorial we&#039;ll start building it from scratch.&lt;br /&gt;
&lt;br /&gt;
* Location of integration results&lt;br /&gt;
In this case, we know the location where the integration results (pickle files) are. We can then set,&lt;br /&gt;
&lt;br /&gt;
 data = /net/viper/raid1/mu238/XfelProject/dials17/extracted&lt;br /&gt;
&lt;br /&gt;
Note that you supply data as a multiple arguments. The value of the parameter can be a file containing list of integration results, a folder, or a wildcard argument.&lt;br /&gt;
&lt;br /&gt;
* Unit cell information &lt;br /&gt;
You can obtain the mean (or median) unit-cell dimensions from either IOTA or DIALS. In case of IOTA, prime .phil file is auto generated and this information is readily available in there. For n_residues, enter number of residues in asymmetric unit of your molecule.&lt;br /&gt;
&lt;br /&gt;
 target_unit_cell = 91.7 91.7 46 90 90 120&lt;br /&gt;
 target_space_group = P6&lt;br /&gt;
 n_residues = 128&lt;br /&gt;
&lt;br /&gt;
* Detector information&lt;br /&gt;
 pixel_size_mm = 0.172&lt;br /&gt;
&lt;br /&gt;
* Post-refinement and Scaling information&lt;br /&gt;
This is where you specify the optimal resolution cutoffs for post-refinement and merging. Note that when running for the first time on you newly collected data, you can choose the &amp;quot;expected&amp;quot; values (resolution which you see the spots at the corner or on the edge). You can then adjust these parameters when analyzing merging statistics based on the I/sigI values in the high resolution shells and rerun the program again. Note that sigma cutoffs are set to 1.5 in scaling and post-refinement steps while it&#039;s set to -3.0 so we can include negative values in the merged reflection set.  &lt;br /&gt;
 &lt;br /&gt;
 scale {&lt;br /&gt;
   d_min = 2.5&lt;br /&gt;
   d_max = 20&lt;br /&gt;
   sigma_min = 1.5&lt;br /&gt;
 }&lt;br /&gt;
 postref {&lt;br /&gt;
   scale {&lt;br /&gt;
     d_min = 2.5&lt;br /&gt;
     d_max = 20&lt;br /&gt;
     sigma_min = 1.5&lt;br /&gt;
     partiality_min = 0.1&lt;br /&gt;
   allparams {&lt;br /&gt;
     flag_on = True&lt;br /&gt;
     d_min = 2.5&lt;br /&gt;
     d_max = 20&lt;br /&gt;
     sigma_min = 1.5&lt;br /&gt;
     partiality_min = 0.1&lt;br /&gt;
     uc_tolerance = 5&lt;br /&gt;
   }&lt;br /&gt;
 }&lt;br /&gt;
 merge {&lt;br /&gt;
   d_min = 2.5&lt;br /&gt;
   d_max = 20&lt;br /&gt;
   sigma_min = -3.0&lt;br /&gt;
   partiality_min = 0.1&lt;br /&gt;
   uc_tolerance = 5&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
* Indexing ambiguity&lt;br /&gt;
For other sets that are not in polar space or have indexing ambiguity (when one or more of the unit-cell dimensions are very similar but not the same!), you can very well use the .phil file parameters thus far to proceed and run post-refinement. However, this data set is in P6 (polar space group) and therefore, the indexing ambiguity needs to be resolved prior to other refinement and merging steps.&lt;br /&gt;
&lt;br /&gt;
Other point worth noting is for any polar space groups, PRIME will automatically solve the ambiguity based on the default parameters. However, this data set has about 5,000 integration results so we want to make sure that we modify the number of images used for random and best selections.&lt;br /&gt;
&lt;br /&gt;
 indexing_ambiguity {&lt;br /&gt;
  mode = Auto&lt;br /&gt;
  index_basis_in = None&lt;br /&gt;
  assigned_basis = None&lt;br /&gt;
  d_min = 3.0&lt;br /&gt;
  d_max = 10.0&lt;br /&gt;
  sigma_min = 1.5&lt;br /&gt;
  n_sample_frames = 1000&lt;br /&gt;
  n_selected_frames = 100&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
We left other parameters to their default value and modified n_sample_frames to 1000 and n_selected_frames to 100.&lt;br /&gt;
&lt;br /&gt;
* No. of Bin&lt;br /&gt;
 n_bins = 10&lt;br /&gt;
&lt;br /&gt;
Now we have a complete .phil file ready to run.&lt;/div&gt;</summary>
		<author><name>Mona</name></author>
	</entry>
	<entry>
		<id>http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=2017_prime_tutorial&amp;diff=1386</id>
		<title>2017 prime tutorial</title>
		<link rel="alternate" type="text/html" href="http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=2017_prime_tutorial&amp;diff=1386"/>
		<updated>2017-02-14T18:38:56Z</updated>

		<summary type="html">&lt;p&gt;Mona: /* Generating input file */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Post-refine and Merge Sample Data Set with PRIME (2017 Tutorial)&lt;br /&gt;
&lt;br /&gt;
In this tutorial, we will work on the integration results from the first of Tutorial 2 (Myoglobin Data). Before proceeding to running the program, we&#039;ll consider making the input file for PRIME based on the situation of this data set.&lt;br /&gt;
&lt;br /&gt;
== Generating input file ==&lt;br /&gt;
&lt;br /&gt;
PRIME input files contain information necessary for successful post-refinement and merging steps. You can access and review the list of input parameters by running prime.run or prime.run -h to view the description of these parameters. For this tutorial we&#039;ll start building it from scratch.&lt;br /&gt;
&lt;br /&gt;
* Location of integration results&lt;br /&gt;
In this case, we know the location where the integration results (pickle files) are. We can then set,&lt;br /&gt;
&lt;br /&gt;
 data = /net/viper/raid1/mu238/XfelProject/dials17/extracted&lt;br /&gt;
&lt;br /&gt;
Note that you supply data as a multiple arguments. The value of the parameter can be a file containing list of integration results, a folder, or a wildcard argument.&lt;br /&gt;
&lt;br /&gt;
* Unit cell information &lt;br /&gt;
You can obtain the mean (or median) unit-cell dimensions from either IOTA or DIALS. In case of IOTA, prime .phil file is auto generated and this information is readily available in there. For n_residues, enter number of residues in asymmetric unit of your molecule.&lt;br /&gt;
&lt;br /&gt;
 target_unit_cell = 91.7 91.7 46 90 90 120&lt;br /&gt;
 target_space_group = P6&lt;br /&gt;
 n_residues = 128&lt;br /&gt;
&lt;br /&gt;
* Detector information&lt;br /&gt;
 pixel_size_mm = 0.172&lt;br /&gt;
&lt;br /&gt;
* Post-refinement and Scaling information&lt;br /&gt;
This is where you specify the optimal resolution cutoffs for post-refinement and merging. Note that when running for the first time on you newly collected data, you can choose the &amp;quot;expected&amp;quot; values (resolution which you see the spots at the corner or on the edge). You can then adjust these parameters when analyzing merging statistics based on the I/sigI values in the high resolution shells and rerun the program again. Note that sigma cutoffs are set to 1.5 in scaling and post-refinement steps while it&#039;s set to -3.0 so we can include negative values in the merged reflection set.  &lt;br /&gt;
 &lt;br /&gt;
 scale {&lt;br /&gt;
   d_min = 2.5&lt;br /&gt;
   d_max = 20&lt;br /&gt;
   sigma_min = 1.5&lt;br /&gt;
 }&lt;br /&gt;
 postref {&lt;br /&gt;
   scale {&lt;br /&gt;
     d_min = 2.5&lt;br /&gt;
     d_max = 20&lt;br /&gt;
     sigma_min = 1.5&lt;br /&gt;
     partiality_min = 0.1&lt;br /&gt;
   allparams {&lt;br /&gt;
     flag_on = True&lt;br /&gt;
     d_min = 2.5&lt;br /&gt;
     d_max = 20&lt;br /&gt;
     sigma_min = 1.5&lt;br /&gt;
     partiality_min = 0.1&lt;br /&gt;
     uc_tolerance = 5&lt;br /&gt;
   }&lt;br /&gt;
 }&lt;br /&gt;
 merge {&lt;br /&gt;
   d_min = 2.5&lt;br /&gt;
   d_max = 20&lt;br /&gt;
   sigma_min = -3.0&lt;br /&gt;
   partiality_min = 0.1&lt;br /&gt;
   uc_tolerance = 5&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
* Indexing ambiguity&lt;br /&gt;
For other sets that are not in polar space or have indexing ambiguity (when one or more of the unit-cell dimensions are very similar but not the same!), you can very well use the .phil file parameters thus far to proceed and run post-refinement. However, this data set is in P6 (polar space group) and therefore, the indexing ambiguity needs to be resolved prior to other refinement and merging steps.&lt;br /&gt;
&lt;br /&gt;
Other point worth noting is for any polar space groups, PRIME will automatically solve the ambiguity based on the default parameters. However, this data set has about 5,000 integration results so we want to make sure that we modify the number of images used for random and best selections.&lt;br /&gt;
&lt;br /&gt;
 indexing_ambiguity {&lt;br /&gt;
  mode = Auto&lt;br /&gt;
  index_basis_in = None&lt;br /&gt;
  assigned_basis = None&lt;br /&gt;
  d_min = 3.0&lt;br /&gt;
  d_max = 10.0&lt;br /&gt;
  sigma_min = 1.5&lt;br /&gt;
  n_sample_frames = 1000&lt;br /&gt;
  n_selected_frames = 100&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
We left other parameters to their default value and modified n_sample_frames to 1000 and n_selected_frames to 100.&lt;br /&gt;
&lt;br /&gt;
Now we have a complete .phil file ready to run.&lt;/div&gt;</summary>
		<author><name>Mona</name></author>
	</entry>
	<entry>
		<id>http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=2017_prime_tutorial&amp;diff=1385</id>
		<title>2017 prime tutorial</title>
		<link rel="alternate" type="text/html" href="http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=2017_prime_tutorial&amp;diff=1385"/>
		<updated>2017-02-14T18:19:30Z</updated>

		<summary type="html">&lt;p&gt;Mona: /* Generating input file */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Post-refine and Merge Sample Data Set with PRIME (2017 Tutorial)&lt;br /&gt;
&lt;br /&gt;
In this tutorial, we will work on the integration results from the first of Tutorial 2 (Myoglobin Data). Before proceeding to running the program, we&#039;ll consider making the input file for PRIME based on the situation of this data set.&lt;br /&gt;
&lt;br /&gt;
== Generating input file ==&lt;br /&gt;
&lt;br /&gt;
PRIME input files contain information necessary for successful post-refinement and merging steps. You can access and review the list of input parameters by running prime.run or prime.run -h to view the description of these parameters. For this tutorial we&#039;ll start building it from scratch.&lt;br /&gt;
&lt;br /&gt;
* Location of integration results&lt;br /&gt;
In this case, we know the location where the integration results (pickle files) are. We can then set,&lt;br /&gt;
&lt;br /&gt;
 data = /net/viper/raid1/mu238/XfelProject/dials17/extracted&lt;br /&gt;
&lt;br /&gt;
Note that you supply data as a multiple arguments. The value of the parameter can be a file containing list of integration results, a folder, or a wildcard argument.&lt;br /&gt;
&lt;br /&gt;
* Unit cell information &lt;br /&gt;
You can obtain the mean (or median) unit-cell dimensions from either IOTA or DIALS. In case of IOTA, prime .phil file is auto generated and this information is readily available in there. For n_residues, enter number of residues in asymmetric unit of your molecule.&lt;br /&gt;
&lt;br /&gt;
 target_unit_cell = 91.7 91.7 46 90 90 120&lt;br /&gt;
 target_space_group = P6&lt;br /&gt;
 n_residues = 128&lt;br /&gt;
&lt;br /&gt;
* Detector information&lt;br /&gt;
 pixel_size_mm = 0.172&lt;br /&gt;
&lt;br /&gt;
* Post-refinement and Scaling information&lt;br /&gt;
This is where you specify the optimal resolution cutoffs for post-refinement and merging. Note that when running for the first time on you newly collected data, you can choose the &amp;quot;expected&amp;quot; values (resolution which you see the spots at the corner or on the edge). You can then adjust these parameters when analyzing merging statistics depending on the I/sigI values in the high resolution shells and rerun the program again.&lt;br /&gt;
 &lt;br /&gt;
 scale {&lt;br /&gt;
   d_min = 2.5&lt;br /&gt;
   d_max = 20&lt;br /&gt;
   sigma_min = 1.5&lt;br /&gt;
 }&lt;br /&gt;
 postref {&lt;br /&gt;
   scale {&lt;br /&gt;
     d_min = 2.5&lt;br /&gt;
     d_max = 20&lt;br /&gt;
     sigma_min = 1.5&lt;br /&gt;
     partiality_min = 0.1&lt;br /&gt;
   allparams {&lt;br /&gt;
     flag_on = True&lt;br /&gt;
     d_min = 2.5&lt;br /&gt;
     d_max = 20&lt;br /&gt;
     sigma_min = 1.5&lt;br /&gt;
     partiality_min = 0.1&lt;br /&gt;
     uc_tolerance = 5&lt;br /&gt;
   }&lt;br /&gt;
 }&lt;br /&gt;
 merge {&lt;br /&gt;
   d_min = 2.5&lt;br /&gt;
   d_max = 20&lt;br /&gt;
   sigma_min = -3.0&lt;br /&gt;
   partiality_min = 0.1&lt;br /&gt;
   uc_tolerance = 5&lt;br /&gt;
 }&lt;/div&gt;</summary>
		<author><name>Mona</name></author>
	</entry>
	<entry>
		<id>http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=2017_prime_tutorial&amp;diff=1384</id>
		<title>2017 prime tutorial</title>
		<link rel="alternate" type="text/html" href="http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=2017_prime_tutorial&amp;diff=1384"/>
		<updated>2017-02-14T18:18:20Z</updated>

		<summary type="html">&lt;p&gt;Mona: /* Generating input file */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Post-refine and Merge Sample Data Set with PRIME (2017 Tutorial)&lt;br /&gt;
&lt;br /&gt;
In this tutorial, we will work on the integration results from the first of Tutorial 2 (Myoglobin Data). Before proceeding to running the program, we&#039;ll consider making the input file for PRIME based on the situation of this data set.&lt;br /&gt;
&lt;br /&gt;
== Generating input file ==&lt;br /&gt;
&lt;br /&gt;
PRIME input files contain information necessary for successful post-refinement and merging steps. You can access and review the list of input parameters by running prime.run or prime.run -h to view the description of these parameters. For this tutorial we&#039;ll start building in from the start.&lt;br /&gt;
&lt;br /&gt;
* Location of integration results&lt;br /&gt;
In this case, we know the location where the integration results (pickle files) are. We can then set,&lt;br /&gt;
&lt;br /&gt;
 data = /net/viper/raid1/mu238/XfelProject/dials17/extracted&lt;br /&gt;
&lt;br /&gt;
Note that you supply data as a multiple arguments. The value of the parameter can be a file containing list of integration results, a folder, or a wildcard argument.&lt;br /&gt;
&lt;br /&gt;
* Unit cell information &lt;br /&gt;
You can obtain the mean (or median) unit-cell dimensions from either IOTA or DIALS. In case of IOTA, prime .phil file is auto generated and this information is readily available in there. For n_residues, enter number of residues in asymmetric unit of your molecule.&lt;br /&gt;
&lt;br /&gt;
 target_unit_cell = 91.7 91.7 46 90 90 120&lt;br /&gt;
 target_space_group = P6&lt;br /&gt;
 n_residues = 128&lt;br /&gt;
&lt;br /&gt;
* Detector information&lt;br /&gt;
 pixel_size_mm = 0.172&lt;br /&gt;
&lt;br /&gt;
* Post-refinement and Scaling information&lt;br /&gt;
This is where you specify the optimal resolution cutoffs for post-refinement and merging. Note that when running for the first time on you newly collected data, you can choose the &amp;quot;expected&amp;quot; values (resolution which you see the spots at the corner or on the edge). You can then adjust these parameters when analyzing merging statistics depending on the I/sigI values in the high resolution shells and rerun the program again.&lt;br /&gt;
 &lt;br /&gt;
 scale {&lt;br /&gt;
   d_min = 2.5&lt;br /&gt;
   d_max = 20&lt;br /&gt;
   sigma_min = 1.5&lt;br /&gt;
 }&lt;br /&gt;
 postref {&lt;br /&gt;
   scale {&lt;br /&gt;
     d_min = 2.5&lt;br /&gt;
     d_max = 20&lt;br /&gt;
     sigma_min = 1.5&lt;br /&gt;
     partiality_min = 0.1&lt;br /&gt;
   allparams {&lt;br /&gt;
     flag_on = True&lt;br /&gt;
     d_min = 2.5&lt;br /&gt;
     d_max = 20&lt;br /&gt;
     sigma_min = 1.5&lt;br /&gt;
     partiality_min = 0.1&lt;br /&gt;
     uc_tolerance = 5&lt;br /&gt;
   }&lt;br /&gt;
 }&lt;br /&gt;
 merge {&lt;br /&gt;
   d_min = 2.5&lt;br /&gt;
   d_max = 20&lt;br /&gt;
   sigma_min = -3.0&lt;br /&gt;
   partiality_min = 0.1&lt;br /&gt;
   uc_tolerance = 5&lt;br /&gt;
 }&lt;/div&gt;</summary>
		<author><name>Mona</name></author>
	</entry>
	<entry>
		<id>http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=2017_prime_tutorial&amp;diff=1383</id>
		<title>2017 prime tutorial</title>
		<link rel="alternate" type="text/html" href="http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=2017_prime_tutorial&amp;diff=1383"/>
		<updated>2017-02-14T18:17:35Z</updated>

		<summary type="html">&lt;p&gt;Mona: /* Generating input file */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Post-refine and Merge Sample Data Set with PRIME (2017 Tutorial)&lt;br /&gt;
&lt;br /&gt;
In this tutorial, we will work on the integration results from the first of Tutorial 2 (Myoglobin Data). Before proceeding to running the program, we&#039;ll consider making the input file for PRIME based on the situation of this data set.&lt;br /&gt;
&lt;br /&gt;
== Generating input file ==&lt;br /&gt;
&lt;br /&gt;
PRIME input files contain information necessary for successful post-refinement and merging steps. You can access and review the list of input parameters by running prime.run or prime.run -h to view the description of these parameters. For this tutorial we&#039;ll start building in from the start.&lt;br /&gt;
&lt;br /&gt;
* Location of integration results&lt;br /&gt;
In this case, we know the location where the integration results (pickle files) are. We can then set,&lt;br /&gt;
&lt;br /&gt;
 data = /net/viper/raid1/mu238/XfelProject/dials17/extracted&lt;br /&gt;
&lt;br /&gt;
Note that you supply data as a multiple arguments. The value of the parameter can be a file containing list of integration results, a folder, or a wildcard argument.&lt;br /&gt;
&lt;br /&gt;
* Unit cell information &lt;br /&gt;
You can obtain the mean (or median) unit-cell dimensions from either IOTA or DIALS. In case of IOTA, prime .phil file is auto generated and this information is readily available in there. For n_residues, enter number of residues in asymmetric unit of your molecule.&lt;br /&gt;
&lt;br /&gt;
 target_unit_cell = 91.7 91.7 46 90 90 120&lt;br /&gt;
 target_space_group = P6&lt;br /&gt;
 n_residues = 128&lt;br /&gt;
&lt;br /&gt;
* Detector information&lt;br /&gt;
 pixel_size_mm = 0.172&lt;br /&gt;
&lt;br /&gt;
* Post-refinement and Scaling information&lt;br /&gt;
This is where you specify the optimal resolution cutoffs for post-refinement and merging. Note that when running for the first time on you newly collected data, you can choose the &amp;quot;expected&amp;quot; values (resolution which you see the spots at the corner or on the edge. You can then adjust these parameters when analyzing merging statistics depending on the &amp;lt;I/sigI&amp;gt; values in the high resolution shells and rerun the program again.&lt;br /&gt;
 &lt;br /&gt;
 scale {&lt;br /&gt;
   d_min = 2.5&lt;br /&gt;
   d_max = 20&lt;br /&gt;
   sigma_min = 1.5&lt;br /&gt;
 }&lt;br /&gt;
 postref {&lt;br /&gt;
   scale {&lt;br /&gt;
     d_min = 2.5&lt;br /&gt;
     d_max = 20&lt;br /&gt;
     sigma_min = 1.5&lt;br /&gt;
     partiality_min = 0.1&lt;br /&gt;
   allparams {&lt;br /&gt;
     flag_on = True&lt;br /&gt;
     d_min = 2.5&lt;br /&gt;
     d_max = 20&lt;br /&gt;
     sigma_min = 1.5&lt;br /&gt;
     partiality_min = 0.1&lt;br /&gt;
     uc_tolerance = 5&lt;br /&gt;
   }&lt;br /&gt;
 }&lt;br /&gt;
 merge {&lt;br /&gt;
   d_min = 2.5&lt;br /&gt;
   d_max = 20&lt;br /&gt;
   sigma_min = -3.0&lt;br /&gt;
   partiality_min = 0.1&lt;br /&gt;
   uc_tolerance = 5&lt;br /&gt;
 }&lt;/div&gt;</summary>
		<author><name>Mona</name></author>
	</entry>
	<entry>
		<id>http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=2017_prime_tutorial&amp;diff=1382</id>
		<title>2017 prime tutorial</title>
		<link rel="alternate" type="text/html" href="http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=2017_prime_tutorial&amp;diff=1382"/>
		<updated>2017-02-14T18:15:35Z</updated>

		<summary type="html">&lt;p&gt;Mona: /* Generating input file */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Post-refine and Merge Sample Data Set with PRIME (2017 Tutorial)&lt;br /&gt;
&lt;br /&gt;
In this tutorial, we will work on the integration results from the first of Tutorial 2 (Myoglobin Data). Before proceeding to running the program, we&#039;ll consider making the input file for PRIME based on the situation of this data set.&lt;br /&gt;
&lt;br /&gt;
== Generating input file ==&lt;br /&gt;
&lt;br /&gt;
PRIME input files contain information necessary for successful post-refinement and merging steps. You can access and review the list of input parameters by running prime.run or prime.run -h to view the description of these parameters. For this tutorial we&#039;ll start building in from the start.&lt;br /&gt;
&lt;br /&gt;
* Location of integration results&lt;br /&gt;
In this case, we know the location where the integration results (pickle files) are. We can then set,&lt;br /&gt;
&lt;br /&gt;
 data = /net/viper/raid1/mu238/XfelProject/dials17/extracted&lt;br /&gt;
&lt;br /&gt;
Note that you supply data as a multiple arguments. The value of the parameter can be a file containing list of integration results, a folder, or a wildcard argument.&lt;br /&gt;
&lt;br /&gt;
* Unit cell information &lt;br /&gt;
You can obtain the mean (or median) unit-cell dimensions from either IOTA or DIALS. In case of IOTA, prime .phil file is auto generated and this information is readily available in there. For n_residues, enter number of residues in asymmetric unit of your molecule.&lt;br /&gt;
&lt;br /&gt;
 target_unit_cell = 91.7 91.7 46 90 90 120&lt;br /&gt;
 target_space_group = P6&lt;br /&gt;
 n_residues = 128&lt;br /&gt;
&lt;br /&gt;
* Detector information&lt;br /&gt;
 pixel_size_mm = 0.172&lt;br /&gt;
&lt;br /&gt;
* Post-refinement and Scaling information&lt;br /&gt;
This is where you specify the optimal resolution cutoffs for post-refinement and merging. Note that when running for the first time on you newly collected data, you can choose the &amp;quot;expected&amp;quot; values (resolution which you see the spots at the corner or on the edge. You can then adjust these parameters when analyzing merging statistics depending on the &amp;lt;I/sigI&amp;gt; values in the high resolution shells and rerun the program again.&lt;br /&gt;
 &lt;br /&gt;
 x&lt;br /&gt;
 scale {&lt;br /&gt;
    d_min = 2.5&lt;br /&gt;
    d_max = 20&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
 }&lt;br /&gt;
 postref {&lt;br /&gt;
   scale {&lt;br /&gt;
     d_min = 2.5&lt;br /&gt;
     d_max = 20&lt;br /&gt;
     sigma_min = 1.5&lt;br /&gt;
     partiality_min = 0.1&lt;br /&gt;
   allparams {&lt;br /&gt;
     flag_on = True&lt;br /&gt;
     d_min = 2.5&lt;br /&gt;
     d_max = 20&lt;br /&gt;
     sigma_min = 1.5&lt;br /&gt;
     partiality_min = 0.1&lt;br /&gt;
     uc_tolerance = 5&lt;br /&gt;
   }&lt;br /&gt;
 }&lt;br /&gt;
 merge {&lt;br /&gt;
  d_min = 2.5&lt;br /&gt;
  d_max = 20&lt;br /&gt;
  sigma_min = -3.0&lt;br /&gt;
  partiality_min = 0.1&lt;br /&gt;
  uc_tolerance = 5&lt;br /&gt;
 }&lt;/div&gt;</summary>
		<author><name>Mona</name></author>
	</entry>
	<entry>
		<id>http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=2017_prime_tutorial&amp;diff=1381</id>
		<title>2017 prime tutorial</title>
		<link rel="alternate" type="text/html" href="http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=2017_prime_tutorial&amp;diff=1381"/>
		<updated>2017-02-14T18:13:59Z</updated>

		<summary type="html">&lt;p&gt;Mona: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Post-refine and Merge Sample Data Set with PRIME (2017 Tutorial)&lt;br /&gt;
&lt;br /&gt;
In this tutorial, we will work on the integration results from the first of Tutorial 2 (Myoglobin Data). Before proceeding to running the program, we&#039;ll consider making the input file for PRIME based on the situation of this data set.&lt;br /&gt;
&lt;br /&gt;
== Generating input file ==&lt;br /&gt;
&lt;br /&gt;
PRIME input files contain information necessary for successful post-refinement and merging steps. You can access and review the list of input parameters by running prime.run or prime.run -h to view the description of these parameters. For this tutorial we&#039;ll start building in from the start.&lt;br /&gt;
&lt;br /&gt;
* Location of integration results&lt;br /&gt;
In this case, we know the location where the integration results (pickle files) are. We can then set,&lt;br /&gt;
&lt;br /&gt;
 data = /net/viper/raid1/mu238/XfelProject/dials17/extracted&lt;br /&gt;
&lt;br /&gt;
Note that you supply data as a multiple arguments. The value of the parameter can be a file containing list of integration results, a folder, or a wildcard argument.&lt;br /&gt;
&lt;br /&gt;
* Unit cell information &lt;br /&gt;
You can obtain the mean (or median) unit-cell dimensions from either IOTA or DIALS. In case of IOTA, prime .phil file is auto generated and this information is readily available in there. For n_residues, enter number of residues in asymmetric unit of your molecule.&lt;br /&gt;
&lt;br /&gt;
 target_unit_cell = 91.7 91.7 46 90 90 120&lt;br /&gt;
 target_space_group = P6&lt;br /&gt;
 n_residues = 128&lt;br /&gt;
&lt;br /&gt;
* Detector information&lt;br /&gt;
 pixel_size_mm = 0.172&lt;br /&gt;
&lt;br /&gt;
* Post-refinement and Scaling information&lt;br /&gt;
This is where you specify the optimal resolution cutoffs for post-refinement and merging. Note that when running for the first time on you newly collected data, you can choose the &amp;quot;expected&amp;quot; values (resolution which you see the spots at the corner or on the edge. You can then adjust these parameters when analyzing merging statistics depending on the &amp;lt;I/sigI&amp;gt; values in the high resolution shells and rerun the program again.&lt;br /&gt;
 &lt;br /&gt;
 scale {&lt;br /&gt;
    d_min = 2.5&lt;br /&gt;
    d_max = 20&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
 }&lt;br /&gt;
 postref {&lt;br /&gt;
   scale {&lt;br /&gt;
     d_min = 2.5&lt;br /&gt;
     d_max = 20&lt;br /&gt;
     sigma_min = 1.5&lt;br /&gt;
     partiality_min = 0.1&lt;br /&gt;
   allparams {&lt;br /&gt;
     flag_on = True&lt;br /&gt;
     d_min = 2.5&lt;br /&gt;
     d_max = 20&lt;br /&gt;
     sigma_min = 1.5&lt;br /&gt;
     partiality_min = 0.1&lt;br /&gt;
     uc_tolerance = 5&lt;br /&gt;
   }&lt;br /&gt;
 }&lt;/div&gt;</summary>
		<author><name>Mona</name></author>
	</entry>
	<entry>
		<id>http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=2017_prime_tutorial&amp;diff=1380</id>
		<title>2017 prime tutorial</title>
		<link rel="alternate" type="text/html" href="http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=2017_prime_tutorial&amp;diff=1380"/>
		<updated>2017-02-14T18:12:30Z</updated>

		<summary type="html">&lt;p&gt;Mona: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Post-refine and Merge Sample Data Set with PRIME (2017 Tutorial)&lt;br /&gt;
&lt;br /&gt;
In this tutorial, we will work on the integration results from the first of Tutorial 2 (Myoglobin Data). Before proceeding to running the program, we&#039;ll consider making the input file for PRIME based on the situation of this data set.&lt;br /&gt;
&lt;br /&gt;
== Generating input file ==&lt;br /&gt;
&lt;br /&gt;
PRIME input files contain information necessary for successful post-refinement and merging steps. You can access and review the list of input parameters by running prime.run or prime.run -h to view the description of these parameters. For this tutorial we&#039;ll start building in from the start.&lt;br /&gt;
&lt;br /&gt;
* Location of integration results&lt;br /&gt;
In this case, we know the location where the integration results (pickle files) are. We can then set,&lt;br /&gt;
&lt;br /&gt;
 data = /net/viper/raid1/mu238/XfelProject/dials17/extracted&lt;br /&gt;
&lt;br /&gt;
Note that you supply data as a multiple arguments. The value of the parameter can be a file containing list of integration results, a folder, or a wildcard argument.&lt;br /&gt;
&lt;br /&gt;
* Unit cell information &lt;br /&gt;
You can obtain the mean (or median) unit-cell dimensions from either IOTA or DIALS. In case of IOTA, prime .phil file is auto generated and this information is readily available in there. For n_residues, enter number of residues in asymmetric unit of your molecule.&lt;br /&gt;
&lt;br /&gt;
 target_unit_cell = 91.7 91.7 46 90 90 120&lt;br /&gt;
 target_space_group = P6&lt;br /&gt;
 n_residues = 128&lt;br /&gt;
&lt;br /&gt;
* Detector information&lt;br /&gt;
 pixel_size_mm = 0.172&lt;br /&gt;
&lt;br /&gt;
* Post-refinement and Scaling information&lt;br /&gt;
This is where you specify the optimal resolution cutoffs for post-refinement and merging. Note that when running for the first time on you newly collected data, you can choose the &amp;quot;expected&amp;quot; values (resolution which you see the spots at the corner or on the edge. You can then adjust these parameters when analyzing merging statistics depending on the &amp;lt;I/sigI&amp;gt; values in the high resolution shells and rerun the program again.&lt;br /&gt;
 &lt;br /&gt;
 scale {&lt;br /&gt;
    d_min = 2.5&lt;br /&gt;
    d_max = 20&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
 }&lt;br /&gt;
 postref {&lt;br /&gt;
   scale {&lt;br /&gt;
     d_min = 2.5&lt;br /&gt;
     d_max = 20&lt;br /&gt;
     sigma_min = 1.5&lt;br /&gt;
     partiality_min = 0.1&lt;br /&gt;
 }&lt;/div&gt;</summary>
		<author><name>Mona</name></author>
	</entry>
	<entry>
		<id>http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=2017_prime_tutorial&amp;diff=1379</id>
		<title>2017 prime tutorial</title>
		<link rel="alternate" type="text/html" href="http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=2017_prime_tutorial&amp;diff=1379"/>
		<updated>2017-02-14T18:12:08Z</updated>

		<summary type="html">&lt;p&gt;Mona: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Post-refine and Merge Sample Data Set with PRIME (2017 Tutorial)&lt;br /&gt;
&lt;br /&gt;
In this tutorial, we will work on the integration results from the first of Tutorial 2 (Myoglobin Data). Before proceeding to running the program, we&#039;ll consider making the input file for PRIME based on the situation of this data set.&lt;br /&gt;
&lt;br /&gt;
== Generating input file ==&lt;br /&gt;
&lt;br /&gt;
PRIME input files contain information necessary for successful post-refinement and merging steps. You can access and review the list of input parameters by running prime.run or prime.run -h to view the description of these parameters. For this tutorial we&#039;ll start building in from the start.&lt;br /&gt;
&lt;br /&gt;
* Location of integration results&lt;br /&gt;
In this case, we know the location where the integration results (pickle files) are. We can then set,&lt;br /&gt;
&lt;br /&gt;
 data = /net/viper/raid1/mu238/XfelProject/dials17/extracted&lt;br /&gt;
&lt;br /&gt;
Note that you supply data as a multiple arguments. The value of the parameter can be a file containing list of integration results, a folder, or a wildcard argument.&lt;br /&gt;
&lt;br /&gt;
* Unit cell information &lt;br /&gt;
You can obtain the mean (or median) unit-cell dimensions from either IOTA or DIALS. In case of IOTA, prime .phil file is auto generated and this information is readily available in there. For n_residues, enter number of residues in asymmetric unit of your molecule.&lt;br /&gt;
&lt;br /&gt;
 target_unit_cell = 91.7 91.7 46 90 90 120&lt;br /&gt;
 target_space_group = P6&lt;br /&gt;
 n_residues = 128&lt;br /&gt;
&lt;br /&gt;
* Detector information&lt;br /&gt;
 pixel_size_mm = 0.172&lt;br /&gt;
&lt;br /&gt;
* Post-refinement and Scaling information&lt;br /&gt;
This is where you specify the optimal resolution cutoffs for post-refinement and merging. Note that when running for the first time on you newly collected data, you can choose the &amp;quot;expected&amp;quot; values (resolution which you see the spots at the corner or on the edge. You can then adjust these parameters when analyzing merging statistics depending on the &amp;lt;I/sigI&amp;gt; values in the high resolution shells and rerun the program again.&lt;br /&gt;
 &lt;br /&gt;
 scale {&lt;br /&gt;
    d_min = 2.5&lt;br /&gt;
    d_max = 20&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
 }&lt;br /&gt;
 postref {&lt;br /&gt;
   scale {&lt;br /&gt;
     d_min = 2.5&lt;br /&gt;
     d_max = 20&lt;br /&gt;
     sigma_min = 1.5&lt;br /&gt;
     partiality_min = 0.1&lt;br /&gt;
}&lt;/div&gt;</summary>
		<author><name>Mona</name></author>
	</entry>
	<entry>
		<id>http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=2017_prime_tutorial&amp;diff=1378</id>
		<title>2017 prime tutorial</title>
		<link rel="alternate" type="text/html" href="http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=2017_prime_tutorial&amp;diff=1378"/>
		<updated>2017-02-14T18:01:07Z</updated>

		<summary type="html">&lt;p&gt;Mona: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Post-refine and Merge Sample Data Set with PRIME (2017 Tutorial)&lt;br /&gt;
&lt;br /&gt;
In this tutorial, we will work on the integration results from the first of Tutorial 2 (Myoglobin Data). Before proceeding to running the program, we&#039;ll consider making the input file for PRIME based on the situation of this data set.&lt;br /&gt;
&lt;br /&gt;
== Generating input file ==&lt;br /&gt;
&lt;br /&gt;
PRIME input files contain information necessary for successful post-refinement and merging steps. You can access and review the list of input parameters by running prime.run or prime.run -h to view the description of these parameters. For this tutorial we&#039;ll start building in from the start.&lt;br /&gt;
&lt;br /&gt;
* Location of integration results&lt;br /&gt;
In this case, we know the location where the integration results (pickle files) are. We can then set,&lt;br /&gt;
&lt;br /&gt;
 data = /net/viper/raid1/mu238/XfelProject/dials17/extracted&lt;br /&gt;
&lt;br /&gt;
Note that you supply data as a multiple arguments. The value of the parameter can be a file containing list of integration results, a folder, or a wildcard argument.&lt;/div&gt;</summary>
		<author><name>Mona</name></author>
	</entry>
	<entry>
		<id>http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=2017_prime_tutorial&amp;diff=1377</id>
		<title>2017 prime tutorial</title>
		<link rel="alternate" type="text/html" href="http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=2017_prime_tutorial&amp;diff=1377"/>
		<updated>2017-02-14T18:00:03Z</updated>

		<summary type="html">&lt;p&gt;Mona: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Post-refine and Merge Sample Data Set with PRIME (2017 Tutorial)&lt;br /&gt;
&lt;br /&gt;
In this tutorial, we will work on the integration results from the first of Tutorial 2 (Myoglobin Data). Before proceeding to running the program, we&#039;ll consider making the input file for PRIME based on the situation of this data set.&lt;br /&gt;
&lt;br /&gt;
== Generating input file ==&lt;br /&gt;
&lt;br /&gt;
PRIME input files contain information necessary for successful post-refinement and merging steps. You can access and review the list of input parameters by running prime.run or prime.run -h to view the description of these parameters. For this tutorial we&#039;ll start building in from the start.&lt;br /&gt;
&lt;br /&gt;
* Location of integration results&lt;br /&gt;
In this case, we know the location where the integration results (pickle files) are. We can then set,&lt;br /&gt;
&lt;br /&gt;
data = /net/viper/raid1/mu238/XfelProject/dials17/extracted&lt;br /&gt;
&lt;br /&gt;
Note that you supply data as a multiple arguments. The value of the parameter can be a file containing list of integration results, a folder, or a wildcard argument.&lt;/div&gt;</summary>
		<author><name>Mona</name></author>
	</entry>
	<entry>
		<id>http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=2017_prime_tutorial&amp;diff=1376</id>
		<title>2017 prime tutorial</title>
		<link rel="alternate" type="text/html" href="http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=2017_prime_tutorial&amp;diff=1376"/>
		<updated>2017-02-14T17:53:34Z</updated>

		<summary type="html">&lt;p&gt;Mona: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Post-refine and Merge Sample Data Set with PRIME (2017 Tutorial)&lt;br /&gt;
&lt;br /&gt;
In this tutorial, we will work on the integration results from the first of Tutorial 2 (Myoglobin Data). Before proceeding to running the program, we&#039;ll consider making the input file for PRIME based on the situation of this data set.&lt;/div&gt;</summary>
		<author><name>Mona</name></author>
	</entry>
	<entry>
		<id>http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=2017_prime_tutorial&amp;diff=1375</id>
		<title>2017 prime tutorial</title>
		<link rel="alternate" type="text/html" href="http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=2017_prime_tutorial&amp;diff=1375"/>
		<updated>2017-02-14T17:43:55Z</updated>

		<summary type="html">&lt;p&gt;Mona: Created page with &amp;quot;Post-refine and Merge Sample Data Set with PRIME (2017 Tutorial)&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Post-refine and Merge Sample Data Set with PRIME (2017 Tutorial)&lt;/div&gt;</summary>
		<author><name>Mona</name></author>
	</entry>
	<entry>
		<id>http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=2017_Tutorials&amp;diff=1374</id>
		<title>2017 Tutorials</title>
		<link rel="alternate" type="text/html" href="http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=2017_Tutorials&amp;diff=1374"/>
		<updated>2017-02-14T17:39:29Z</updated>

		<summary type="html">&lt;p&gt;Mona: /* 10:15 am: Tutorials 2 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Feb 16th =&lt;br /&gt;
&lt;br /&gt;
9:00am: Session 1&lt;br /&gt;
Nick Sauter: Welcome and &amp;quot;Trials and tribulations merging still image data&amp;quot;&lt;br /&gt;
Aaron Brewster: &amp;quot;Metrology and non-isomorphism: hidden challenges in still image data reduction&amp;quot;&lt;br /&gt;
Axel Brunger: &amp;quot;Data processing of XFEL data from a limited number of crystals&amp;quot;&lt;br /&gt;
10:20am: Break&lt;br /&gt;
10:40am: Session 2&lt;br /&gt;
Art Lyubimov: &amp;quot;IOTA: Integration optimization, triage and analysis tool for XFEL data processing&amp;quot;&lt;br /&gt;
Monarin Uervirojnangkoorn:  &amp;quot;Up and Running with Prime&amp;quot;&lt;br /&gt;
Jacques-Philippe Colletier: &amp;quot;Mosquito larvicide BinAB revealed by de novo phasing with an X-ray laser&amp;quot;&lt;br /&gt;
James Holton: &amp;quot;What if? Using at-scale image simulations to optimize data processing algorithms&amp;quot;&lt;br /&gt;
Noon: Working Lunch - Roundtable discussion of data processing challenges&lt;br /&gt;
1:00pm: Session 3&lt;br /&gt;
Graeme Winter and Richard Gildea:  &amp;quot;DIALS - new methods for processing X-ray diffraction data&amp;quot;&lt;br /&gt;
James Parkhurst: &amp;quot;Robust background modelling in the presence of outliers in DIALS&amp;quot;&lt;br /&gt;
Jan Kern:  TBD&lt;br /&gt;
Franklin Fuller:  &amp;quot;Drop-by-Drop Transient Serial Crystallography of Metalloenzymes at an X-ray free electron laser&amp;quot;&lt;br /&gt;
Iris Young:  &amp;quot;Room temperature studies of the oxygen-evolving complex of photosystem II using an X-ray free electron laser (XFEL)&amp;quot;&lt;br /&gt;
2:40pm: Break&lt;br /&gt;
3:00pm: Session 4&lt;br /&gt;
Aina Cohen: TBD&lt;br /&gt;
Rahel Woldeyes:  &amp;quot;Using X-ray Free Electron lasers to visualize solvent in the M2 proton channel&amp;quot;&lt;br /&gt;
Danny Axford: &amp;quot;Highly efficient serial data collection from high-density fixed targets&amp;quot;&lt;br /&gt;
Christoph Mueller-Dieckmann: &amp;quot;Serial Synchrotron Crystallography at the ESRF using a high viscosity extruder&amp;quot;&lt;br /&gt;
Allen Orville:  TBD&lt;br /&gt;
= Feb 17th =&lt;br /&gt;
&lt;br /&gt;
== 9am: Tutorials 1 ==&lt;br /&gt;
Aaron Brewster and Iris Young: cctbx.xfel&lt;br /&gt;
Break: 10:00 am&lt;br /&gt;
== 10:15 am: Tutorials 2 ==&lt;br /&gt;
* Aaron Brewster and James Parkhurst: dials.stills_process&lt;br /&gt;
* Art Lyubimov: IOTA&lt;br /&gt;
* Monarin Uervirojnangkoorn: [[2017_prime_tutorial | PRIME]]&lt;br /&gt;
* Nick Sauter: [[2017_cxi_merge_tutorial | cxi.merge]]&lt;br /&gt;
&lt;br /&gt;
== 12:15pm-2:30pm:  Round table discussion. == &lt;br /&gt;
Topics will include:&lt;br /&gt;
Is the current software meeting needs?&lt;br /&gt;
What are essential/timely avenues most useful for near-term development (first half of 2017)?&lt;br /&gt;
Where should we be going next (longer term future)?&lt;br /&gt;
Time resolved experiments?&lt;br /&gt;
Synchrotron serial crystallography?&lt;br /&gt;
== 2:30-4pm: Breakout sessions: ==&lt;br /&gt;
users work with developers and instructors on their own data.  Hands-on walkthroughs and data analysis.&lt;/div&gt;</summary>
		<author><name>Mona</name></author>
	</entry>
	<entry>
		<id>http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=Cctbx.prime&amp;diff=1291</id>
		<title>Cctbx.prime</title>
		<link rel="alternate" type="text/html" href="http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=Cctbx.prime&amp;diff=1291"/>
		<updated>2016-08-31T22:28:09Z</updated>

		<summary type="html">&lt;p&gt;Mona: /* Solving indexing ambiguity (New) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Prime: &#039;&#039;&#039;p&#039;&#039;&#039;ost-&#039;&#039;&#039;r&#039;&#039;&#039;ef&#039;&#039;&#039;i&#039;&#039;&#039;nement and &#039;&#039;&#039;me&#039;&#039;&#039;rging ==&lt;br /&gt;
With the latest update, prime can be used to process data on multiple nodes (on a queuing system). At the moment, only LSF (bsub) is supported. See documentation below for more information on how to use the queuing system.&lt;br /&gt;
&lt;br /&gt;
This major update replaces prime.postrefine with &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.run &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For auto mode, you can still use prime.run with your parameter phil file like before. For manual mode, the available sub commands in prime are:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.genref #generates a reference set from given integration results&lt;br /&gt;
prime.postrefine #refines all images&lt;br /&gt;
prime.merge #merges all refined results for an mtz file&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can choose to run these commands independently (ideally in the above order) using the same phil file. See [https://commons.wikimedia.org/wiki/File:Prime_flowcharts.tif &amp;quot;PRIME flowchart&amp;quot;]. This will give you the freedom to change something (e.g. set of parameters to refine, resolution cut-off, etc.) at different stages of the post-refinement and merging. See running prime in manual mode for more detail.&lt;br /&gt;
&lt;br /&gt;
Step-by-step guidelines to post-refine and merge XFEL diffraction images. For more detail and citation, see &lt;br /&gt;
&amp;quot;Enabling X-ray Free Electron Laser Crystallography for Challenging Biological Systems from a Limited Number of Crystals&amp;quot;&lt;br /&gt;
[http://elifesciences.org/content/4/e05421 &amp;quot;DOI: http://dx.doi.org/10.7554/eLife.05421&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
== Prime is gui-ed == &lt;br /&gt;
Thanks to Dr. Lyubimov, PRIME is also available as a Graphic User Interface program. Try it by running&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Click to see [https://commons.wikimedia.org/wiki/File:PRIME_main.png &amp;quot;PRIME main gui&amp;quot;] and [https://commons.wikimedia.org/wiki/File:PRIME_advanced_options.png &amp;quot;Advanced options&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
== Getting started == &lt;br /&gt;
&#039;&#039;&#039;Generating input phil file&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
Like most programs developed under &#039;&#039;cctbx&#039;&#039; framework, &#039;&#039;prime&#039;&#039; reads in input .phil file, which stores all the parameters needed to run post-refinement and merging steps. To generate the template .phil file, do the dry run by calling&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ prime.run&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
An example of the template .phil file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
data = None&lt;br /&gt;
run_no = None&lt;br /&gt;
title = None&lt;br /&gt;
scale {&lt;br /&gt;
  d_min = 0.1&lt;br /&gt;
  d_max = 99&lt;br /&gt;
  sigma_min = 1.5&lt;br /&gt;
}&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can save the content of the output to any file name - in this tutorial, let&#039;s save it to thermolysin.phil.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;First look at your phil file&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
To run prime, set the required parameters to match with your experiments (you can leave other parameters with their default values - or just delete them from you .phil file). The most interesting parameters are shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
data = /path/to/your/integarion/result/pickle_files&lt;br /&gt;
run_no = 001&lt;br /&gt;
title = First trial for thermolysin&lt;br /&gt;
scale {&lt;br /&gt;
  d_min = 2.1&lt;br /&gt;
  d_max = 45&lt;br /&gt;
  sigma_min = 1.5&lt;br /&gt;
}&lt;br /&gt;
postref {&lt;br /&gt;
  scale {&lt;br /&gt;
    d_min = 2.1&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
  }&lt;br /&gt;
  crystal_orientation {&lt;br /&gt;
    flag_on = True&lt;br /&gt;
    d_min = 2.1&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
  }&lt;br /&gt;
  reflecting_range {&lt;br /&gt;
    flag_on = True&lt;br /&gt;
    d_min = 2.1&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
  }&lt;br /&gt;
  unit_cell {&lt;br /&gt;
    flag_on = True&lt;br /&gt;
    d_min = 2.1&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
    uc_tolerance = 3&lt;br /&gt;
  }&lt;br /&gt;
  allparams {&lt;br /&gt;
    flag_on = False&lt;br /&gt;
    d_min = 2.1&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
    uc_tolerance = 3&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
merge {&lt;br /&gt;
  d_min = 2.1&lt;br /&gt;
  d_max = 45&lt;br /&gt;
  sigma_min = 1.5&lt;br /&gt;
  partiality_min = 0.1&lt;br /&gt;
  uc_tolerance = 3&lt;br /&gt;
}&lt;br /&gt;
target_unit_cell = 93.99,93.99,130.87,90,90,120&lt;br /&gt;
target_space_group = P 61 2 2&lt;br /&gt;
pixel_size_mm = 0.102&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You should pay attention to d_min and d_max for the refinement and merging parameters. If you use IOTA to integrate the images, IOTA will output .phil file for prime that has the optimal resolution range. If not, a few trial-and-error runs may be required to get the best resolution range for your dataset. Use merging statistics output by prime and check the values of CC1/2 and I/sigI to find out your optimal resolution range.&lt;br /&gt;
&lt;br /&gt;
Cell parameters (target_unit_cell and target_space_group) are required to run prime. Target cell parameter is used to remove some outlier images by controlling uc_tolerance parameter (the default value of tolerate range is 3% different). Space group parameter is used in removing outliers and merging with the given symmetry.&lt;br /&gt;
&lt;br /&gt;
Don&#039;t forget also to change your pixel size in millimeters. Check what your detector is and note down its pixel size. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Running post-refinement in automatic mode&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
Once you have the input .phil file, you can run &#039;&#039;prime&#039;&#039; by calling&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.run thermolysin.phil&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;Prime&#039;&#039; will post-refine and merge for reflection sets using three (default value) macrocycles. At the end of the run, you can obtain merging statistics in the last cycle - all other cycle statistics are also available in log.txt.&lt;br /&gt;
&lt;br /&gt;
An example of merging statistics:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Summary for 001/postref_cycle_1_merge.mtz&lt;br /&gt;
Bin Resolution Range     Completeness      &amp;lt;N_obs&amp;gt;  |Rsplit  CC1/2  N_ind |CCanom   N_ind| &amp;lt;I/sigI&amp;gt;   &amp;lt;I&amp;gt;&lt;br /&gt;
-------------------------------------------------------------------------------------------------------------&lt;br /&gt;
02    5.70 -    4.52 100.0   1055 /   1055   65.89   16.02   89.15   1055    0.00      0    20.17    2101.97&lt;br /&gt;
03    4.52 -    3.95 100.0   1032 /   1032   61.53   14.48   92.03   1032    0.00      0    20.39    2529.90&lt;br /&gt;
04    3.95 -    3.59 100.0   1016 /   1016   54.15   15.61   90.13   1016    0.00      0    16.69    1971.43&lt;br /&gt;
05    3.59 -    3.33 100.0   1004 /   1004   42.67   17.66   89.23   1004    0.00      0    14.21    1502.14&lt;br /&gt;
06    3.33 -    3.14 100.0   1013 /   1013   32.77   20.40   84.26   1013    0.00      0    11.76    1077.60&lt;br /&gt;
07    3.14 -    2.98 100.0    995 /    995   27.36   23.00   78.72    995    0.00      0    11.58     935.37&lt;br /&gt;
08    2.98 -    2.85 100.0   1006 /   1006   23.57   22.63   82.26   1006    0.00      0    10.56     722.62&lt;br /&gt;
09    2.85 -    2.74 100.0    986 /    986   16.64   28.51   72.90    985    0.00      0    10.01     591.56&lt;br /&gt;
10    2.74 -    2.65  99.9    989 /    990   12.41   31.35   72.95    987    0.00      0     9.91     515.07&lt;br /&gt;
11    2.65 -    2.56  99.7    979 /    982    9.35   37.14   65.31    970    0.00      0     9.31     438.96&lt;br /&gt;
12    2.56 -    2.49  98.0    979 /    999    6.06   45.98   45.37    930    0.00      0     9.45     390.05&lt;br /&gt;
13    2.49 -    2.42  95.1    931 /    979    4.46   50.68   34.20    834    0.00      0     8.93     334.80&lt;br /&gt;
14    2.42 -    2.37  91.7    896 /    977    3.35   55.66   37.15    729    0.00      0     9.27     320.17&lt;br /&gt;
15    2.37 -    2.31  83.9    829 /    988    2.61   56.92   43.21    600    0.00      0     9.60     296.67&lt;br /&gt;
16    2.31 -    2.26  72.4    702 /    969    1.97   65.81   26.89    386    0.00      0    10.29     284.39&lt;br /&gt;
17    2.26 -    2.22  59.1    582 /    985    1.75   64.72   31.28    275    0.00      0     9.87     284.06&lt;br /&gt;
18    2.22 -    2.18  52.9    513 /    970    1.51   71.27   16.86    188    0.00      0     8.93     215.31&lt;br /&gt;
19    2.18 -    2.14  35.7    349 /    978    1.32   62.26   68.25     90    0.00      0     8.22     199.09&lt;br /&gt;
20    2.14 -    2.10  23.1    227 /    981    1.20   92.14   -9.20     42    0.00      0     8.59     224.44&lt;br /&gt;
-------------------------------------------------------------------------------------------------------------&lt;br /&gt;
        TOTAL         85.9  17224 /  20046   27.11   21.11   92.07  15305    0.00      0    12.87     999.53&lt;br /&gt;
-------------------------------------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
Summary of refinement and merging&lt;br /&gt;
 No. good frames:                  1809&lt;br /&gt;
 No. bad cc frames:                 153&lt;br /&gt;
 No. bad G frames) :                  0&lt;br /&gt;
 No. bad unit cell frames:            5&lt;br /&gt;
 No. bad gamma_e frames:              0&lt;br /&gt;
 No. bad SE:                          0&lt;br /&gt;
 No. observations:               466997&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Solving indexing ambiguity (New) == &lt;br /&gt;
* SOFTWARE UPDATE REQUIRED *&lt;br /&gt;
With the latest version (Aug 31, 2016), you can solve the indexing ambiguity problem directly in prime. The Brehm &amp;amp; Diederichs algorithms ([http://dx.doi.org/10.1107/S1399004713025431 &amp;quot;doi:10.1107/S1399004713025431&amp;quot;]) have been implemented with bootstrap capability to handle large dataset.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Merohedral Twinning&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
For merohedral twinning (27 space groups e.g. P6), the indexing choices will be determined automatically in prime. Use this default setting in your .phil file,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
indexing_ambiguity {&lt;br /&gt;
  mode = Auto&lt;br /&gt;
  index_basis_in = None&lt;br /&gt;
  assigned_basis = None&lt;br /&gt;
  n_sample_frames = 300&lt;br /&gt;
  n_selected_frames = 100&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
The n_sample_frames parameter indicates no. of images that will be used for the calculation of the scoring function. After that, only n_selected_images will be used in the B&amp;amp;D algorithms. This saves a lot of computing time since only the selected images will be used for the determination of the ambiguity. You can change these two parameters to fit with your experiments. The default values are 300 and 100 (give 300 - use 100).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Pseudo-Merohedral Twinning&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
For pseudo-merohedral twinning, due to different possibilities for the indexing choice, prime doesn&#039;t determine these choices automatically. If you suspect that you may have pseudo twinning (b and c are similar, beta angle is almost 90 degree but not quite), you have an option to force prime to determine the ambiguity according to your choices.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
indexing_ambiguity {&lt;br /&gt;
  mode = Forced&lt;br /&gt;
  index_basis_in = None&lt;br /&gt;
  assigned_basis = -h,l,k&lt;br /&gt;
  assigned_basis = -k, l, h&lt;br /&gt;
  n_sample_frames = 300&lt;br /&gt;
  n_selected_frames = 100&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When you set indexing_ambiguity.mode to Forced, you can assign indexing choices according to your problem. In this example, two more choices (-h, l, k and -k, l, h) were assigned as the indexing choice.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Reusing the solution&#039;&#039;&#039; &amp;lt;br&amp;gt;&lt;br /&gt;
At the end of the run, your solution pickle is saved to your_run_no/index_ambiguity/solution_pickle.pickle. If you don&#039;t want to spend time solving the ambiguity again in the next run, you can reuse this solution pickle by setting these parameters:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
indexing_ambiguity {&lt;br /&gt;
  mode = Auto&lt;br /&gt;
  index_basis_in = your_run_no/index_ambiguity/solution_pickle.pickle&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will bypass the indexing ambiguity module. Prime will use the solution file to perform normal post-refinement and merging.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Using an external reference set&#039;&#039;&#039; &amp;lt;br&amp;gt;&lt;br /&gt;
To use another isomorphous dataset (e.g. from a synchrotron experiment) as a reference set to solve the ambiguity, you can specify an mtz file as part of these parameters:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
indexing_ambiguity {&lt;br /&gt;
  mode = Auto&lt;br /&gt;
  index_basis_in = path/to/your/mtz/file.mtz&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Again, you can choose to do Auto or Forced (with a list of assigned_basis parameters) depending on your problem.&lt;br /&gt;
&lt;br /&gt;
== More detail with input parameters ==&lt;br /&gt;
Now that you have your first trial merged data set, you can explore different parameter settings to merge or to obtain the Bijvoet pairs (I+/I-) for your anomalous data set.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Anomalous data:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
target_anomalous_flag = True&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
In the last cycle, prime will output a reflection set with I+ and I-.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Number of micro- and macrocycles&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
n_postref_cycle = 3&lt;br /&gt;
n_postref_sub_cycle = 1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Number of bins for merging statistics&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
n_bins = 20&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Help with input parameters ==&lt;br /&gt;
&lt;br /&gt;
Most input parameters are self-explained. However, you can run -h switch to view help information for each parameter.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.run -h&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Running in manual mode ==&lt;br /&gt;
With the same phil file, you can run prime manually. This gives you more freedom in terms of parameter settings at different stages (generating reference set, post-refining images, and merging) or at different cycle of post-refinement.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example A&#039;&#039;&#039;: I want to generate a reference set then post-refine all the images on the &#039;&#039;&#039;scale factors only&#039;&#039;&#039; for &#039;&#039;&#039;three cycles&#039;&#039;&#039; then refine &#039;&#039;&#039;all parameters&#039;&#039;&#039; in the &#039;&#039;&#039;4th cycle&#039;&#039;&#039;. To do this, you can follow these steps:&lt;br /&gt;
&lt;br /&gt;
To generate a reference set,&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.genref prime.phil&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
To post-refine on scale factors only, modify your .phil file so that all parameters are turned &#039;&#039;off&#039;&#039;.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
scale {&lt;br /&gt;
  d_min = 2.5&lt;br /&gt;
  d_max = 45&lt;br /&gt;
  sigma_min = 1.5&lt;br /&gt;
}&lt;br /&gt;
postref {&lt;br /&gt;
  residual_threshold = 5&lt;br /&gt;
  residual_threshold_xy = 5&lt;br /&gt;
  scale {&lt;br /&gt;
    d_min = 2.5&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
  }&lt;br /&gt;
  crystal_orientation {&lt;br /&gt;
    flag_on = False&lt;br /&gt;
    d_min = 2.5&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
  }&lt;br /&gt;
  reflecting_range {&lt;br /&gt;
    flag_on = False&lt;br /&gt;
    d_min = 2.5&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
  }&lt;br /&gt;
  unit_cell {&lt;br /&gt;
    flag_on = False&lt;br /&gt;
    d_min = 2.5&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
    uc_tolerance = 5&lt;br /&gt;
  }&lt;br /&gt;
  allparams {&lt;br /&gt;
    flag_on = False&lt;br /&gt;
    d_min = 2.5&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
    uc_tolerance = 5&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
...&lt;br /&gt;
n_postref_cycle = 3&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then run,&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.postrefine prime.phil&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
To refine all parameters one more cycle, update your .phil file again (flag_on = True)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
  allparams {&lt;br /&gt;
    flag_on = True&lt;br /&gt;
    d_min = 2.5&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
    uc_tolerance = 5&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
...&lt;br /&gt;
n_postref_cycle = 1&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then run,&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.postrefine prime.phil&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
To obtain the final merged mtz, run&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.merge prime.phil&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Running on multiple nodes ==&lt;br /&gt;
For LCLS users (or other users with LSF bsub), you can use psana (or your) queuing system to parallelize the entire process. For example, if you want to run your job on 100 nodes using psanq, you can specify:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
queue {&lt;br /&gt;
  mode = bsub&lt;br /&gt;
  qname = psanaq&lt;br /&gt;
  n_nodes = 100&lt;br /&gt;
}&lt;br /&gt;
timeout_seconds = 300&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Prime will divide all the images into 100 batches and submit them to different nodes. It will wait until all images in every batches are done before returning to the merging step (or the exit step in the manual mode). You can control timeout_seconds parameter to tell prime how long it should wait for all the image batches to finish. Usually, this timeout parameter is not used (all images should return before 300 seconds) but in case, you need to wait longer or shorter, you can modify this parameter.&lt;/div&gt;</summary>
		<author><name>Mona</name></author>
	</entry>
	<entry>
		<id>http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=Cctbx.prime&amp;diff=1290</id>
		<title>Cctbx.prime</title>
		<link rel="alternate" type="text/html" href="http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=Cctbx.prime&amp;diff=1290"/>
		<updated>2016-08-31T22:27:44Z</updated>

		<summary type="html">&lt;p&gt;Mona: /* Solving indexing ambiguity (New) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Prime: &#039;&#039;&#039;p&#039;&#039;&#039;ost-&#039;&#039;&#039;r&#039;&#039;&#039;ef&#039;&#039;&#039;i&#039;&#039;&#039;nement and &#039;&#039;&#039;me&#039;&#039;&#039;rging ==&lt;br /&gt;
With the latest update, prime can be used to process data on multiple nodes (on a queuing system). At the moment, only LSF (bsub) is supported. See documentation below for more information on how to use the queuing system.&lt;br /&gt;
&lt;br /&gt;
This major update replaces prime.postrefine with &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.run &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For auto mode, you can still use prime.run with your parameter phil file like before. For manual mode, the available sub commands in prime are:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.genref #generates a reference set from given integration results&lt;br /&gt;
prime.postrefine #refines all images&lt;br /&gt;
prime.merge #merges all refined results for an mtz file&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can choose to run these commands independently (ideally in the above order) using the same phil file. See [https://commons.wikimedia.org/wiki/File:Prime_flowcharts.tif &amp;quot;PRIME flowchart&amp;quot;]. This will give you the freedom to change something (e.g. set of parameters to refine, resolution cut-off, etc.) at different stages of the post-refinement and merging. See running prime in manual mode for more detail.&lt;br /&gt;
&lt;br /&gt;
Step-by-step guidelines to post-refine and merge XFEL diffraction images. For more detail and citation, see &lt;br /&gt;
&amp;quot;Enabling X-ray Free Electron Laser Crystallography for Challenging Biological Systems from a Limited Number of Crystals&amp;quot;&lt;br /&gt;
[http://elifesciences.org/content/4/e05421 &amp;quot;DOI: http://dx.doi.org/10.7554/eLife.05421&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
== Prime is gui-ed == &lt;br /&gt;
Thanks to Dr. Lyubimov, PRIME is also available as a Graphic User Interface program. Try it by running&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Click to see [https://commons.wikimedia.org/wiki/File:PRIME_main.png &amp;quot;PRIME main gui&amp;quot;] and [https://commons.wikimedia.org/wiki/File:PRIME_advanced_options.png &amp;quot;Advanced options&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
== Getting started == &lt;br /&gt;
&#039;&#039;&#039;Generating input phil file&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
Like most programs developed under &#039;&#039;cctbx&#039;&#039; framework, &#039;&#039;prime&#039;&#039; reads in input .phil file, which stores all the parameters needed to run post-refinement and merging steps. To generate the template .phil file, do the dry run by calling&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ prime.run&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
An example of the template .phil file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
data = None&lt;br /&gt;
run_no = None&lt;br /&gt;
title = None&lt;br /&gt;
scale {&lt;br /&gt;
  d_min = 0.1&lt;br /&gt;
  d_max = 99&lt;br /&gt;
  sigma_min = 1.5&lt;br /&gt;
}&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can save the content of the output to any file name - in this tutorial, let&#039;s save it to thermolysin.phil.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;First look at your phil file&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
To run prime, set the required parameters to match with your experiments (you can leave other parameters with their default values - or just delete them from you .phil file). The most interesting parameters are shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
data = /path/to/your/integarion/result/pickle_files&lt;br /&gt;
run_no = 001&lt;br /&gt;
title = First trial for thermolysin&lt;br /&gt;
scale {&lt;br /&gt;
  d_min = 2.1&lt;br /&gt;
  d_max = 45&lt;br /&gt;
  sigma_min = 1.5&lt;br /&gt;
}&lt;br /&gt;
postref {&lt;br /&gt;
  scale {&lt;br /&gt;
    d_min = 2.1&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
  }&lt;br /&gt;
  crystal_orientation {&lt;br /&gt;
    flag_on = True&lt;br /&gt;
    d_min = 2.1&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
  }&lt;br /&gt;
  reflecting_range {&lt;br /&gt;
    flag_on = True&lt;br /&gt;
    d_min = 2.1&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
  }&lt;br /&gt;
  unit_cell {&lt;br /&gt;
    flag_on = True&lt;br /&gt;
    d_min = 2.1&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
    uc_tolerance = 3&lt;br /&gt;
  }&lt;br /&gt;
  allparams {&lt;br /&gt;
    flag_on = False&lt;br /&gt;
    d_min = 2.1&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
    uc_tolerance = 3&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
merge {&lt;br /&gt;
  d_min = 2.1&lt;br /&gt;
  d_max = 45&lt;br /&gt;
  sigma_min = 1.5&lt;br /&gt;
  partiality_min = 0.1&lt;br /&gt;
  uc_tolerance = 3&lt;br /&gt;
}&lt;br /&gt;
target_unit_cell = 93.99,93.99,130.87,90,90,120&lt;br /&gt;
target_space_group = P 61 2 2&lt;br /&gt;
pixel_size_mm = 0.102&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You should pay attention to d_min and d_max for the refinement and merging parameters. If you use IOTA to integrate the images, IOTA will output .phil file for prime that has the optimal resolution range. If not, a few trial-and-error runs may be required to get the best resolution range for your dataset. Use merging statistics output by prime and check the values of CC1/2 and I/sigI to find out your optimal resolution range.&lt;br /&gt;
&lt;br /&gt;
Cell parameters (target_unit_cell and target_space_group) are required to run prime. Target cell parameter is used to remove some outlier images by controlling uc_tolerance parameter (the default value of tolerate range is 3% different). Space group parameter is used in removing outliers and merging with the given symmetry.&lt;br /&gt;
&lt;br /&gt;
Don&#039;t forget also to change your pixel size in millimeters. Check what your detector is and note down its pixel size. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Running post-refinement in automatic mode&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
Once you have the input .phil file, you can run &#039;&#039;prime&#039;&#039; by calling&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.run thermolysin.phil&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;Prime&#039;&#039; will post-refine and merge for reflection sets using three (default value) macrocycles. At the end of the run, you can obtain merging statistics in the last cycle - all other cycle statistics are also available in log.txt.&lt;br /&gt;
&lt;br /&gt;
An example of merging statistics:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Summary for 001/postref_cycle_1_merge.mtz&lt;br /&gt;
Bin Resolution Range     Completeness      &amp;lt;N_obs&amp;gt;  |Rsplit  CC1/2  N_ind |CCanom   N_ind| &amp;lt;I/sigI&amp;gt;   &amp;lt;I&amp;gt;&lt;br /&gt;
-------------------------------------------------------------------------------------------------------------&lt;br /&gt;
02    5.70 -    4.52 100.0   1055 /   1055   65.89   16.02   89.15   1055    0.00      0    20.17    2101.97&lt;br /&gt;
03    4.52 -    3.95 100.0   1032 /   1032   61.53   14.48   92.03   1032    0.00      0    20.39    2529.90&lt;br /&gt;
04    3.95 -    3.59 100.0   1016 /   1016   54.15   15.61   90.13   1016    0.00      0    16.69    1971.43&lt;br /&gt;
05    3.59 -    3.33 100.0   1004 /   1004   42.67   17.66   89.23   1004    0.00      0    14.21    1502.14&lt;br /&gt;
06    3.33 -    3.14 100.0   1013 /   1013   32.77   20.40   84.26   1013    0.00      0    11.76    1077.60&lt;br /&gt;
07    3.14 -    2.98 100.0    995 /    995   27.36   23.00   78.72    995    0.00      0    11.58     935.37&lt;br /&gt;
08    2.98 -    2.85 100.0   1006 /   1006   23.57   22.63   82.26   1006    0.00      0    10.56     722.62&lt;br /&gt;
09    2.85 -    2.74 100.0    986 /    986   16.64   28.51   72.90    985    0.00      0    10.01     591.56&lt;br /&gt;
10    2.74 -    2.65  99.9    989 /    990   12.41   31.35   72.95    987    0.00      0     9.91     515.07&lt;br /&gt;
11    2.65 -    2.56  99.7    979 /    982    9.35   37.14   65.31    970    0.00      0     9.31     438.96&lt;br /&gt;
12    2.56 -    2.49  98.0    979 /    999    6.06   45.98   45.37    930    0.00      0     9.45     390.05&lt;br /&gt;
13    2.49 -    2.42  95.1    931 /    979    4.46   50.68   34.20    834    0.00      0     8.93     334.80&lt;br /&gt;
14    2.42 -    2.37  91.7    896 /    977    3.35   55.66   37.15    729    0.00      0     9.27     320.17&lt;br /&gt;
15    2.37 -    2.31  83.9    829 /    988    2.61   56.92   43.21    600    0.00      0     9.60     296.67&lt;br /&gt;
16    2.31 -    2.26  72.4    702 /    969    1.97   65.81   26.89    386    0.00      0    10.29     284.39&lt;br /&gt;
17    2.26 -    2.22  59.1    582 /    985    1.75   64.72   31.28    275    0.00      0     9.87     284.06&lt;br /&gt;
18    2.22 -    2.18  52.9    513 /    970    1.51   71.27   16.86    188    0.00      0     8.93     215.31&lt;br /&gt;
19    2.18 -    2.14  35.7    349 /    978    1.32   62.26   68.25     90    0.00      0     8.22     199.09&lt;br /&gt;
20    2.14 -    2.10  23.1    227 /    981    1.20   92.14   -9.20     42    0.00      0     8.59     224.44&lt;br /&gt;
-------------------------------------------------------------------------------------------------------------&lt;br /&gt;
        TOTAL         85.9  17224 /  20046   27.11   21.11   92.07  15305    0.00      0    12.87     999.53&lt;br /&gt;
-------------------------------------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
Summary of refinement and merging&lt;br /&gt;
 No. good frames:                  1809&lt;br /&gt;
 No. bad cc frames:                 153&lt;br /&gt;
 No. bad G frames) :                  0&lt;br /&gt;
 No. bad unit cell frames:            5&lt;br /&gt;
 No. bad gamma_e frames:              0&lt;br /&gt;
 No. bad SE:                          0&lt;br /&gt;
 No. observations:               466997&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Solving indexing ambiguity (New) == &lt;br /&gt;
* SOFTWARE UPDATE REQUIRED *&lt;br /&gt;
With the latest version (Aug 31, 2016), you can solve the indexing ambiguity problem directly in prime. The Brehm &amp;amp; Diederichs algorithms ([http://dx.doi.org/10.1107/S1399004713025431, &amp;quot;doi:10.1107/S1399004713025431&amp;quot;]) have been implemented with bootstrap capability to handle large dataset.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Merohedral Twinning&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
For merohedral twinning (27 space groups e.g. P6), the indexing choices will be determined automatically in prime. Use this default setting in your .phil file,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
indexing_ambiguity {&lt;br /&gt;
  mode = Auto&lt;br /&gt;
  index_basis_in = None&lt;br /&gt;
  assigned_basis = None&lt;br /&gt;
  n_sample_frames = 300&lt;br /&gt;
  n_selected_frames = 100&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
The n_sample_frames parameter indicates no. of images that will be used for the calculation of the scoring function. After that, only n_selected_images will be used in the B&amp;amp;D algorithms. This saves a lot of computing time since only the selected images will be used for the determination of the ambiguity. You can change these two parameters to fit with your experiments. The default values are 300 and 100 (give 300 - use 100).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Pseudo-Merohedral Twinning&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
For pseudo-merohedral twinning, due to different possibilities for the indexing choice, prime doesn&#039;t determine these choices automatically. If you suspect that you may have pseudo twinning (b and c are similar, beta angle is almost 90 degree but not quite), you have an option to force prime to determine the ambiguity according to your choices.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
indexing_ambiguity {&lt;br /&gt;
  mode = Forced&lt;br /&gt;
  index_basis_in = None&lt;br /&gt;
  assigned_basis = -h,l,k&lt;br /&gt;
  assigned_basis = -k, l, h&lt;br /&gt;
  n_sample_frames = 300&lt;br /&gt;
  n_selected_frames = 100&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When you set indexing_ambiguity.mode to Forced, you can assign indexing choices according to your problem. In this example, two more choices (-h, l, k and -k, l, h) were assigned as the indexing choice.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Reusing the solution&#039;&#039;&#039; &amp;lt;br&amp;gt;&lt;br /&gt;
At the end of the run, your solution pickle is saved to your_run_no/index_ambiguity/solution_pickle.pickle. If you don&#039;t want to spend time solving the ambiguity again in the next run, you can reuse this solution pickle by setting these parameters:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
indexing_ambiguity {&lt;br /&gt;
  mode = Auto&lt;br /&gt;
  index_basis_in = your_run_no/index_ambiguity/solution_pickle.pickle&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will bypass the indexing ambiguity module. Prime will use the solution file to perform normal post-refinement and merging.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Using an external reference set&#039;&#039;&#039; &amp;lt;br&amp;gt;&lt;br /&gt;
To use another isomorphous dataset (e.g. from a synchrotron experiment) as a reference set to solve the ambiguity, you can specify an mtz file as part of these parameters:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
indexing_ambiguity {&lt;br /&gt;
  mode = Auto&lt;br /&gt;
  index_basis_in = path/to/your/mtz/file.mtz&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Again, you can choose to do Auto or Forced (with a list of assigned_basis parameters) depending on your problem.&lt;br /&gt;
&lt;br /&gt;
== More detail with input parameters ==&lt;br /&gt;
Now that you have your first trial merged data set, you can explore different parameter settings to merge or to obtain the Bijvoet pairs (I+/I-) for your anomalous data set.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Anomalous data:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
target_anomalous_flag = True&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
In the last cycle, prime will output a reflection set with I+ and I-.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Number of micro- and macrocycles&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
n_postref_cycle = 3&lt;br /&gt;
n_postref_sub_cycle = 1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Number of bins for merging statistics&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
n_bins = 20&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Help with input parameters ==&lt;br /&gt;
&lt;br /&gt;
Most input parameters are self-explained. However, you can run -h switch to view help information for each parameter.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.run -h&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Running in manual mode ==&lt;br /&gt;
With the same phil file, you can run prime manually. This gives you more freedom in terms of parameter settings at different stages (generating reference set, post-refining images, and merging) or at different cycle of post-refinement.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example A&#039;&#039;&#039;: I want to generate a reference set then post-refine all the images on the &#039;&#039;&#039;scale factors only&#039;&#039;&#039; for &#039;&#039;&#039;three cycles&#039;&#039;&#039; then refine &#039;&#039;&#039;all parameters&#039;&#039;&#039; in the &#039;&#039;&#039;4th cycle&#039;&#039;&#039;. To do this, you can follow these steps:&lt;br /&gt;
&lt;br /&gt;
To generate a reference set,&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.genref prime.phil&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
To post-refine on scale factors only, modify your .phil file so that all parameters are turned &#039;&#039;off&#039;&#039;.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
scale {&lt;br /&gt;
  d_min = 2.5&lt;br /&gt;
  d_max = 45&lt;br /&gt;
  sigma_min = 1.5&lt;br /&gt;
}&lt;br /&gt;
postref {&lt;br /&gt;
  residual_threshold = 5&lt;br /&gt;
  residual_threshold_xy = 5&lt;br /&gt;
  scale {&lt;br /&gt;
    d_min = 2.5&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
  }&lt;br /&gt;
  crystal_orientation {&lt;br /&gt;
    flag_on = False&lt;br /&gt;
    d_min = 2.5&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
  }&lt;br /&gt;
  reflecting_range {&lt;br /&gt;
    flag_on = False&lt;br /&gt;
    d_min = 2.5&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
  }&lt;br /&gt;
  unit_cell {&lt;br /&gt;
    flag_on = False&lt;br /&gt;
    d_min = 2.5&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
    uc_tolerance = 5&lt;br /&gt;
  }&lt;br /&gt;
  allparams {&lt;br /&gt;
    flag_on = False&lt;br /&gt;
    d_min = 2.5&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
    uc_tolerance = 5&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
...&lt;br /&gt;
n_postref_cycle = 3&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then run,&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.postrefine prime.phil&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
To refine all parameters one more cycle, update your .phil file again (flag_on = True)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
  allparams {&lt;br /&gt;
    flag_on = True&lt;br /&gt;
    d_min = 2.5&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
    uc_tolerance = 5&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
...&lt;br /&gt;
n_postref_cycle = 1&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then run,&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.postrefine prime.phil&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
To obtain the final merged mtz, run&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.merge prime.phil&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Running on multiple nodes ==&lt;br /&gt;
For LCLS users (or other users with LSF bsub), you can use psana (or your) queuing system to parallelize the entire process. For example, if you want to run your job on 100 nodes using psanq, you can specify:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
queue {&lt;br /&gt;
  mode = bsub&lt;br /&gt;
  qname = psanaq&lt;br /&gt;
  n_nodes = 100&lt;br /&gt;
}&lt;br /&gt;
timeout_seconds = 300&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Prime will divide all the images into 100 batches and submit them to different nodes. It will wait until all images in every batches are done before returning to the merging step (or the exit step in the manual mode). You can control timeout_seconds parameter to tell prime how long it should wait for all the image batches to finish. Usually, this timeout parameter is not used (all images should return before 300 seconds) but in case, you need to wait longer or shorter, you can modify this parameter.&lt;/div&gt;</summary>
		<author><name>Mona</name></author>
	</entry>
	<entry>
		<id>http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=Cctbx.prime&amp;diff=1289</id>
		<title>Cctbx.prime</title>
		<link rel="alternate" type="text/html" href="http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=Cctbx.prime&amp;diff=1289"/>
		<updated>2016-08-31T22:25:12Z</updated>

		<summary type="html">&lt;p&gt;Mona: /* Solving indexing ambiguity (New) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Prime: &#039;&#039;&#039;p&#039;&#039;&#039;ost-&#039;&#039;&#039;r&#039;&#039;&#039;ef&#039;&#039;&#039;i&#039;&#039;&#039;nement and &#039;&#039;&#039;me&#039;&#039;&#039;rging ==&lt;br /&gt;
With the latest update, prime can be used to process data on multiple nodes (on a queuing system). At the moment, only LSF (bsub) is supported. See documentation below for more information on how to use the queuing system.&lt;br /&gt;
&lt;br /&gt;
This major update replaces prime.postrefine with &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.run &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For auto mode, you can still use prime.run with your parameter phil file like before. For manual mode, the available sub commands in prime are:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.genref #generates a reference set from given integration results&lt;br /&gt;
prime.postrefine #refines all images&lt;br /&gt;
prime.merge #merges all refined results for an mtz file&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can choose to run these commands independently (ideally in the above order) using the same phil file. See [https://commons.wikimedia.org/wiki/File:Prime_flowcharts.tif &amp;quot;PRIME flowchart&amp;quot;]. This will give you the freedom to change something (e.g. set of parameters to refine, resolution cut-off, etc.) at different stages of the post-refinement and merging. See running prime in manual mode for more detail.&lt;br /&gt;
&lt;br /&gt;
Step-by-step guidelines to post-refine and merge XFEL diffraction images. For more detail and citation, see &lt;br /&gt;
&amp;quot;Enabling X-ray Free Electron Laser Crystallography for Challenging Biological Systems from a Limited Number of Crystals&amp;quot;&lt;br /&gt;
[http://elifesciences.org/content/4/e05421 &amp;quot;DOI: http://dx.doi.org/10.7554/eLife.05421&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
== Prime is gui-ed == &lt;br /&gt;
Thanks to Dr. Lyubimov, PRIME is also available as a Graphic User Interface program. Try it by running&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Click to see [https://commons.wikimedia.org/wiki/File:PRIME_main.png &amp;quot;PRIME main gui&amp;quot;] and [https://commons.wikimedia.org/wiki/File:PRIME_advanced_options.png &amp;quot;Advanced options&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
== Getting started == &lt;br /&gt;
&#039;&#039;&#039;Generating input phil file&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
Like most programs developed under &#039;&#039;cctbx&#039;&#039; framework, &#039;&#039;prime&#039;&#039; reads in input .phil file, which stores all the parameters needed to run post-refinement and merging steps. To generate the template .phil file, do the dry run by calling&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ prime.run&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
An example of the template .phil file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
data = None&lt;br /&gt;
run_no = None&lt;br /&gt;
title = None&lt;br /&gt;
scale {&lt;br /&gt;
  d_min = 0.1&lt;br /&gt;
  d_max = 99&lt;br /&gt;
  sigma_min = 1.5&lt;br /&gt;
}&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can save the content of the output to any file name - in this tutorial, let&#039;s save it to thermolysin.phil.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;First look at your phil file&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
To run prime, set the required parameters to match with your experiments (you can leave other parameters with their default values - or just delete them from you .phil file). The most interesting parameters are shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
data = /path/to/your/integarion/result/pickle_files&lt;br /&gt;
run_no = 001&lt;br /&gt;
title = First trial for thermolysin&lt;br /&gt;
scale {&lt;br /&gt;
  d_min = 2.1&lt;br /&gt;
  d_max = 45&lt;br /&gt;
  sigma_min = 1.5&lt;br /&gt;
}&lt;br /&gt;
postref {&lt;br /&gt;
  scale {&lt;br /&gt;
    d_min = 2.1&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
  }&lt;br /&gt;
  crystal_orientation {&lt;br /&gt;
    flag_on = True&lt;br /&gt;
    d_min = 2.1&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
  }&lt;br /&gt;
  reflecting_range {&lt;br /&gt;
    flag_on = True&lt;br /&gt;
    d_min = 2.1&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
  }&lt;br /&gt;
  unit_cell {&lt;br /&gt;
    flag_on = True&lt;br /&gt;
    d_min = 2.1&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
    uc_tolerance = 3&lt;br /&gt;
  }&lt;br /&gt;
  allparams {&lt;br /&gt;
    flag_on = False&lt;br /&gt;
    d_min = 2.1&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
    uc_tolerance = 3&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
merge {&lt;br /&gt;
  d_min = 2.1&lt;br /&gt;
  d_max = 45&lt;br /&gt;
  sigma_min = 1.5&lt;br /&gt;
  partiality_min = 0.1&lt;br /&gt;
  uc_tolerance = 3&lt;br /&gt;
}&lt;br /&gt;
target_unit_cell = 93.99,93.99,130.87,90,90,120&lt;br /&gt;
target_space_group = P 61 2 2&lt;br /&gt;
pixel_size_mm = 0.102&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You should pay attention to d_min and d_max for the refinement and merging parameters. If you use IOTA to integrate the images, IOTA will output .phil file for prime that has the optimal resolution range. If not, a few trial-and-error runs may be required to get the best resolution range for your dataset. Use merging statistics output by prime and check the values of CC1/2 and I/sigI to find out your optimal resolution range.&lt;br /&gt;
&lt;br /&gt;
Cell parameters (target_unit_cell and target_space_group) are required to run prime. Target cell parameter is used to remove some outlier images by controlling uc_tolerance parameter (the default value of tolerate range is 3% different). Space group parameter is used in removing outliers and merging with the given symmetry.&lt;br /&gt;
&lt;br /&gt;
Don&#039;t forget also to change your pixel size in millimeters. Check what your detector is and note down its pixel size. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Running post-refinement in automatic mode&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
Once you have the input .phil file, you can run &#039;&#039;prime&#039;&#039; by calling&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.run thermolysin.phil&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;Prime&#039;&#039; will post-refine and merge for reflection sets using three (default value) macrocycles. At the end of the run, you can obtain merging statistics in the last cycle - all other cycle statistics are also available in log.txt.&lt;br /&gt;
&lt;br /&gt;
An example of merging statistics:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Summary for 001/postref_cycle_1_merge.mtz&lt;br /&gt;
Bin Resolution Range     Completeness      &amp;lt;N_obs&amp;gt;  |Rsplit  CC1/2  N_ind |CCanom   N_ind| &amp;lt;I/sigI&amp;gt;   &amp;lt;I&amp;gt;&lt;br /&gt;
-------------------------------------------------------------------------------------------------------------&lt;br /&gt;
02    5.70 -    4.52 100.0   1055 /   1055   65.89   16.02   89.15   1055    0.00      0    20.17    2101.97&lt;br /&gt;
03    4.52 -    3.95 100.0   1032 /   1032   61.53   14.48   92.03   1032    0.00      0    20.39    2529.90&lt;br /&gt;
04    3.95 -    3.59 100.0   1016 /   1016   54.15   15.61   90.13   1016    0.00      0    16.69    1971.43&lt;br /&gt;
05    3.59 -    3.33 100.0   1004 /   1004   42.67   17.66   89.23   1004    0.00      0    14.21    1502.14&lt;br /&gt;
06    3.33 -    3.14 100.0   1013 /   1013   32.77   20.40   84.26   1013    0.00      0    11.76    1077.60&lt;br /&gt;
07    3.14 -    2.98 100.0    995 /    995   27.36   23.00   78.72    995    0.00      0    11.58     935.37&lt;br /&gt;
08    2.98 -    2.85 100.0   1006 /   1006   23.57   22.63   82.26   1006    0.00      0    10.56     722.62&lt;br /&gt;
09    2.85 -    2.74 100.0    986 /    986   16.64   28.51   72.90    985    0.00      0    10.01     591.56&lt;br /&gt;
10    2.74 -    2.65  99.9    989 /    990   12.41   31.35   72.95    987    0.00      0     9.91     515.07&lt;br /&gt;
11    2.65 -    2.56  99.7    979 /    982    9.35   37.14   65.31    970    0.00      0     9.31     438.96&lt;br /&gt;
12    2.56 -    2.49  98.0    979 /    999    6.06   45.98   45.37    930    0.00      0     9.45     390.05&lt;br /&gt;
13    2.49 -    2.42  95.1    931 /    979    4.46   50.68   34.20    834    0.00      0     8.93     334.80&lt;br /&gt;
14    2.42 -    2.37  91.7    896 /    977    3.35   55.66   37.15    729    0.00      0     9.27     320.17&lt;br /&gt;
15    2.37 -    2.31  83.9    829 /    988    2.61   56.92   43.21    600    0.00      0     9.60     296.67&lt;br /&gt;
16    2.31 -    2.26  72.4    702 /    969    1.97   65.81   26.89    386    0.00      0    10.29     284.39&lt;br /&gt;
17    2.26 -    2.22  59.1    582 /    985    1.75   64.72   31.28    275    0.00      0     9.87     284.06&lt;br /&gt;
18    2.22 -    2.18  52.9    513 /    970    1.51   71.27   16.86    188    0.00      0     8.93     215.31&lt;br /&gt;
19    2.18 -    2.14  35.7    349 /    978    1.32   62.26   68.25     90    0.00      0     8.22     199.09&lt;br /&gt;
20    2.14 -    2.10  23.1    227 /    981    1.20   92.14   -9.20     42    0.00      0     8.59     224.44&lt;br /&gt;
-------------------------------------------------------------------------------------------------------------&lt;br /&gt;
        TOTAL         85.9  17224 /  20046   27.11   21.11   92.07  15305    0.00      0    12.87     999.53&lt;br /&gt;
-------------------------------------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
Summary of refinement and merging&lt;br /&gt;
 No. good frames:                  1809&lt;br /&gt;
 No. bad cc frames:                 153&lt;br /&gt;
 No. bad G frames) :                  0&lt;br /&gt;
 No. bad unit cell frames:            5&lt;br /&gt;
 No. bad gamma_e frames:              0&lt;br /&gt;
 No. bad SE:                          0&lt;br /&gt;
 No. observations:               466997&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Solving indexing ambiguity (New) == &lt;br /&gt;
* SOFTWARE UPDATE REQUIRED *&lt;br /&gt;
With the latest version (Aug 31, 2016), you can solve the indexing ambiguity problem directly in prime. The Brehm &amp;amp; Diederichs algorithms (doi:10.1107/S1399004713025431) have been implemented with bootstrap capability to handle large dataset.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Merohedral Twinning&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
For merohedral twinning (27 space groups e.g. P6), the indexing choices will be determined automatically in prime. Use this default setting in your .phil file,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
indexing_ambiguity {&lt;br /&gt;
  mode = Auto&lt;br /&gt;
  index_basis_in = None&lt;br /&gt;
  assigned_basis = None&lt;br /&gt;
  n_sample_frames = 300&lt;br /&gt;
  n_selected_frames = 100&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
The n_sample_frames parameter indicates no. of images that will be used for the calculation of the scoring function. After that, only n_selected_images will be used in the B&amp;amp;D algorithms. This saves a lot of computing time since only the selected images will be used for the determination of the ambiguity. You can change these two parameters to fit with your experiments. The default values are 300 and 100 (give 300 - use 100).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Pseudo-Merohedral Twinning&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
For pseudo-merohedral twinning, due to different possibilities for the indexing choice, prime doesn&#039;t determine these choices automatically. If you suspect that you may have pseudo twinning (b and c are similar, beta angle is almost 90 degree but not quite), you have an option to force prime to determine the ambiguity according to your choices.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
indexing_ambiguity {&lt;br /&gt;
  mode = Forced&lt;br /&gt;
  index_basis_in = None&lt;br /&gt;
  assigned_basis = -h,l,k&lt;br /&gt;
  assigned_basis = -k, l, h&lt;br /&gt;
  n_sample_frames = 300&lt;br /&gt;
  n_selected_frames = 100&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When you set indexing_ambiguity.mode to Forced, you can assign indexing choices according to your problem. In this example, two more choices (-h, l, k and -k, l, h) were assigned as the indexing choice.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Reusing the solution&#039;&#039;&#039; &amp;lt;br&amp;gt;&lt;br /&gt;
At the end of the run, your solution pickle is saved to your_run_no/index_ambiguity/solution_pickle.pickle. If you don&#039;t want to spend time solving the ambiguity again in the next run, you can reuse this solution pickle by setting these parameters:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
indexing_ambiguity {&lt;br /&gt;
  mode = Auto&lt;br /&gt;
  index_basis_in = your_run_no/index_ambiguity/solution_pickle.pickle&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will bypass the indexing ambiguity module. Prime will use the solution file to perform normal post-refinement and merging.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Using an external reference set&#039;&#039;&#039; &amp;lt;br&amp;gt;&lt;br /&gt;
To use another isomorphous dataset (e.g. from a synchrotron experiment) as a reference set to solve the ambiguity, you can specify an mtz file as part of these parameters:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
indexing_ambiguity {&lt;br /&gt;
  mode = Auto&lt;br /&gt;
  index_basis_in = path/to/your/mtz/file.mtz&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Again, you can choose to do Auto or Forced (with a list of assigned_basis parameters) depending on your problem.&lt;br /&gt;
&lt;br /&gt;
== More detail with input parameters ==&lt;br /&gt;
Now that you have your first trial merged data set, you can explore different parameter settings to merge or to obtain the Bijvoet pairs (I+/I-) for your anomalous data set.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Anomalous data:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
target_anomalous_flag = True&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
In the last cycle, prime will output a reflection set with I+ and I-.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Number of micro- and macrocycles&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
n_postref_cycle = 3&lt;br /&gt;
n_postref_sub_cycle = 1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Number of bins for merging statistics&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
n_bins = 20&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Help with input parameters ==&lt;br /&gt;
&lt;br /&gt;
Most input parameters are self-explained. However, you can run -h switch to view help information for each parameter.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.run -h&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Running in manual mode ==&lt;br /&gt;
With the same phil file, you can run prime manually. This gives you more freedom in terms of parameter settings at different stages (generating reference set, post-refining images, and merging) or at different cycle of post-refinement.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example A&#039;&#039;&#039;: I want to generate a reference set then post-refine all the images on the &#039;&#039;&#039;scale factors only&#039;&#039;&#039; for &#039;&#039;&#039;three cycles&#039;&#039;&#039; then refine &#039;&#039;&#039;all parameters&#039;&#039;&#039; in the &#039;&#039;&#039;4th cycle&#039;&#039;&#039;. To do this, you can follow these steps:&lt;br /&gt;
&lt;br /&gt;
To generate a reference set,&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.genref prime.phil&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
To post-refine on scale factors only, modify your .phil file so that all parameters are turned &#039;&#039;off&#039;&#039;.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
scale {&lt;br /&gt;
  d_min = 2.5&lt;br /&gt;
  d_max = 45&lt;br /&gt;
  sigma_min = 1.5&lt;br /&gt;
}&lt;br /&gt;
postref {&lt;br /&gt;
  residual_threshold = 5&lt;br /&gt;
  residual_threshold_xy = 5&lt;br /&gt;
  scale {&lt;br /&gt;
    d_min = 2.5&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
  }&lt;br /&gt;
  crystal_orientation {&lt;br /&gt;
    flag_on = False&lt;br /&gt;
    d_min = 2.5&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
  }&lt;br /&gt;
  reflecting_range {&lt;br /&gt;
    flag_on = False&lt;br /&gt;
    d_min = 2.5&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
  }&lt;br /&gt;
  unit_cell {&lt;br /&gt;
    flag_on = False&lt;br /&gt;
    d_min = 2.5&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
    uc_tolerance = 5&lt;br /&gt;
  }&lt;br /&gt;
  allparams {&lt;br /&gt;
    flag_on = False&lt;br /&gt;
    d_min = 2.5&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
    uc_tolerance = 5&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
...&lt;br /&gt;
n_postref_cycle = 3&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then run,&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.postrefine prime.phil&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
To refine all parameters one more cycle, update your .phil file again (flag_on = True)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
  allparams {&lt;br /&gt;
    flag_on = True&lt;br /&gt;
    d_min = 2.5&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
    uc_tolerance = 5&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
...&lt;br /&gt;
n_postref_cycle = 1&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then run,&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.postrefine prime.phil&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
To obtain the final merged mtz, run&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.merge prime.phil&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Running on multiple nodes ==&lt;br /&gt;
For LCLS users (or other users with LSF bsub), you can use psana (or your) queuing system to parallelize the entire process. For example, if you want to run your job on 100 nodes using psanq, you can specify:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
queue {&lt;br /&gt;
  mode = bsub&lt;br /&gt;
  qname = psanaq&lt;br /&gt;
  n_nodes = 100&lt;br /&gt;
}&lt;br /&gt;
timeout_seconds = 300&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Prime will divide all the images into 100 batches and submit them to different nodes. It will wait until all images in every batches are done before returning to the merging step (or the exit step in the manual mode). You can control timeout_seconds parameter to tell prime how long it should wait for all the image batches to finish. Usually, this timeout parameter is not used (all images should return before 300 seconds) but in case, you need to wait longer or shorter, you can modify this parameter.&lt;/div&gt;</summary>
		<author><name>Mona</name></author>
	</entry>
	<entry>
		<id>http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=Cctbx.prime&amp;diff=1288</id>
		<title>Cctbx.prime</title>
		<link rel="alternate" type="text/html" href="http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=Cctbx.prime&amp;diff=1288"/>
		<updated>2016-08-31T21:41:57Z</updated>

		<summary type="html">&lt;p&gt;Mona: /* Solving indexing ambiguity (New) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Prime: &#039;&#039;&#039;p&#039;&#039;&#039;ost-&#039;&#039;&#039;r&#039;&#039;&#039;ef&#039;&#039;&#039;i&#039;&#039;&#039;nement and &#039;&#039;&#039;me&#039;&#039;&#039;rging ==&lt;br /&gt;
With the latest update, prime can be used to process data on multiple nodes (on a queuing system). At the moment, only LSF (bsub) is supported. See documentation below for more information on how to use the queuing system.&lt;br /&gt;
&lt;br /&gt;
This major update replaces prime.postrefine with &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.run &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For auto mode, you can still use prime.run with your parameter phil file like before. For manual mode, the available sub commands in prime are:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.genref #generates a reference set from given integration results&lt;br /&gt;
prime.postrefine #refines all images&lt;br /&gt;
prime.merge #merges all refined results for an mtz file&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can choose to run these commands independently (ideally in the above order) using the same phil file. See [https://commons.wikimedia.org/wiki/File:Prime_flowcharts.tif &amp;quot;PRIME flowchart&amp;quot;]. This will give you the freedom to change something (e.g. set of parameters to refine, resolution cut-off, etc.) at different stages of the post-refinement and merging. See running prime in manual mode for more detail.&lt;br /&gt;
&lt;br /&gt;
Step-by-step guidelines to post-refine and merge XFEL diffraction images. For more detail and citation, see &lt;br /&gt;
&amp;quot;Enabling X-ray Free Electron Laser Crystallography for Challenging Biological Systems from a Limited Number of Crystals&amp;quot;&lt;br /&gt;
[http://elifesciences.org/content/4/e05421 &amp;quot;DOI: http://dx.doi.org/10.7554/eLife.05421&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
== Prime is gui-ed == &lt;br /&gt;
Thanks to Dr. Lyubimov, PRIME is also available as a Graphic User Interface program. Try it by running&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Click to see [https://commons.wikimedia.org/wiki/File:PRIME_main.png &amp;quot;PRIME main gui&amp;quot;] and [https://commons.wikimedia.org/wiki/File:PRIME_advanced_options.png &amp;quot;Advanced options&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
== Getting started == &lt;br /&gt;
&#039;&#039;&#039;Generating input phil file&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
Like most programs developed under &#039;&#039;cctbx&#039;&#039; framework, &#039;&#039;prime&#039;&#039; reads in input .phil file, which stores all the parameters needed to run post-refinement and merging steps. To generate the template .phil file, do the dry run by calling&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ prime.run&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
An example of the template .phil file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
data = None&lt;br /&gt;
run_no = None&lt;br /&gt;
title = None&lt;br /&gt;
scale {&lt;br /&gt;
  d_min = 0.1&lt;br /&gt;
  d_max = 99&lt;br /&gt;
  sigma_min = 1.5&lt;br /&gt;
}&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can save the content of the output to any file name - in this tutorial, let&#039;s save it to thermolysin.phil.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;First look at your phil file&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
To run prime, set the required parameters to match with your experiments (you can leave other parameters with their default values - or just delete them from you .phil file). The most interesting parameters are shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
data = /path/to/your/integarion/result/pickle_files&lt;br /&gt;
run_no = 001&lt;br /&gt;
title = First trial for thermolysin&lt;br /&gt;
scale {&lt;br /&gt;
  d_min = 2.1&lt;br /&gt;
  d_max = 45&lt;br /&gt;
  sigma_min = 1.5&lt;br /&gt;
}&lt;br /&gt;
postref {&lt;br /&gt;
  scale {&lt;br /&gt;
    d_min = 2.1&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
  }&lt;br /&gt;
  crystal_orientation {&lt;br /&gt;
    flag_on = True&lt;br /&gt;
    d_min = 2.1&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
  }&lt;br /&gt;
  reflecting_range {&lt;br /&gt;
    flag_on = True&lt;br /&gt;
    d_min = 2.1&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
  }&lt;br /&gt;
  unit_cell {&lt;br /&gt;
    flag_on = True&lt;br /&gt;
    d_min = 2.1&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
    uc_tolerance = 3&lt;br /&gt;
  }&lt;br /&gt;
  allparams {&lt;br /&gt;
    flag_on = False&lt;br /&gt;
    d_min = 2.1&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
    uc_tolerance = 3&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
merge {&lt;br /&gt;
  d_min = 2.1&lt;br /&gt;
  d_max = 45&lt;br /&gt;
  sigma_min = 1.5&lt;br /&gt;
  partiality_min = 0.1&lt;br /&gt;
  uc_tolerance = 3&lt;br /&gt;
}&lt;br /&gt;
target_unit_cell = 93.99,93.99,130.87,90,90,120&lt;br /&gt;
target_space_group = P 61 2 2&lt;br /&gt;
pixel_size_mm = 0.102&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You should pay attention to d_min and d_max for the refinement and merging parameters. If you use IOTA to integrate the images, IOTA will output .phil file for prime that has the optimal resolution range. If not, a few trial-and-error runs may be required to get the best resolution range for your dataset. Use merging statistics output by prime and check the values of CC1/2 and I/sigI to find out your optimal resolution range.&lt;br /&gt;
&lt;br /&gt;
Cell parameters (target_unit_cell and target_space_group) are required to run prime. Target cell parameter is used to remove some outlier images by controlling uc_tolerance parameter (the default value of tolerate range is 3% different). Space group parameter is used in removing outliers and merging with the given symmetry.&lt;br /&gt;
&lt;br /&gt;
Don&#039;t forget also to change your pixel size in millimeters. Check what your detector is and note down its pixel size. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Running post-refinement in automatic mode&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
Once you have the input .phil file, you can run &#039;&#039;prime&#039;&#039; by calling&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.run thermolysin.phil&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;Prime&#039;&#039; will post-refine and merge for reflection sets using three (default value) macrocycles. At the end of the run, you can obtain merging statistics in the last cycle - all other cycle statistics are also available in log.txt.&lt;br /&gt;
&lt;br /&gt;
An example of merging statistics:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Summary for 001/postref_cycle_1_merge.mtz&lt;br /&gt;
Bin Resolution Range     Completeness      &amp;lt;N_obs&amp;gt;  |Rsplit  CC1/2  N_ind |CCanom   N_ind| &amp;lt;I/sigI&amp;gt;   &amp;lt;I&amp;gt;&lt;br /&gt;
-------------------------------------------------------------------------------------------------------------&lt;br /&gt;
02    5.70 -    4.52 100.0   1055 /   1055   65.89   16.02   89.15   1055    0.00      0    20.17    2101.97&lt;br /&gt;
03    4.52 -    3.95 100.0   1032 /   1032   61.53   14.48   92.03   1032    0.00      0    20.39    2529.90&lt;br /&gt;
04    3.95 -    3.59 100.0   1016 /   1016   54.15   15.61   90.13   1016    0.00      0    16.69    1971.43&lt;br /&gt;
05    3.59 -    3.33 100.0   1004 /   1004   42.67   17.66   89.23   1004    0.00      0    14.21    1502.14&lt;br /&gt;
06    3.33 -    3.14 100.0   1013 /   1013   32.77   20.40   84.26   1013    0.00      0    11.76    1077.60&lt;br /&gt;
07    3.14 -    2.98 100.0    995 /    995   27.36   23.00   78.72    995    0.00      0    11.58     935.37&lt;br /&gt;
08    2.98 -    2.85 100.0   1006 /   1006   23.57   22.63   82.26   1006    0.00      0    10.56     722.62&lt;br /&gt;
09    2.85 -    2.74 100.0    986 /    986   16.64   28.51   72.90    985    0.00      0    10.01     591.56&lt;br /&gt;
10    2.74 -    2.65  99.9    989 /    990   12.41   31.35   72.95    987    0.00      0     9.91     515.07&lt;br /&gt;
11    2.65 -    2.56  99.7    979 /    982    9.35   37.14   65.31    970    0.00      0     9.31     438.96&lt;br /&gt;
12    2.56 -    2.49  98.0    979 /    999    6.06   45.98   45.37    930    0.00      0     9.45     390.05&lt;br /&gt;
13    2.49 -    2.42  95.1    931 /    979    4.46   50.68   34.20    834    0.00      0     8.93     334.80&lt;br /&gt;
14    2.42 -    2.37  91.7    896 /    977    3.35   55.66   37.15    729    0.00      0     9.27     320.17&lt;br /&gt;
15    2.37 -    2.31  83.9    829 /    988    2.61   56.92   43.21    600    0.00      0     9.60     296.67&lt;br /&gt;
16    2.31 -    2.26  72.4    702 /    969    1.97   65.81   26.89    386    0.00      0    10.29     284.39&lt;br /&gt;
17    2.26 -    2.22  59.1    582 /    985    1.75   64.72   31.28    275    0.00      0     9.87     284.06&lt;br /&gt;
18    2.22 -    2.18  52.9    513 /    970    1.51   71.27   16.86    188    0.00      0     8.93     215.31&lt;br /&gt;
19    2.18 -    2.14  35.7    349 /    978    1.32   62.26   68.25     90    0.00      0     8.22     199.09&lt;br /&gt;
20    2.14 -    2.10  23.1    227 /    981    1.20   92.14   -9.20     42    0.00      0     8.59     224.44&lt;br /&gt;
-------------------------------------------------------------------------------------------------------------&lt;br /&gt;
        TOTAL         85.9  17224 /  20046   27.11   21.11   92.07  15305    0.00      0    12.87     999.53&lt;br /&gt;
-------------------------------------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
Summary of refinement and merging&lt;br /&gt;
 No. good frames:                  1809&lt;br /&gt;
 No. bad cc frames:                 153&lt;br /&gt;
 No. bad G frames) :                  0&lt;br /&gt;
 No. bad unit cell frames:            5&lt;br /&gt;
 No. bad gamma_e frames:              0&lt;br /&gt;
 No. bad SE:                          0&lt;br /&gt;
 No. observations:               466997&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Solving indexing ambiguity (New) == &lt;br /&gt;
* SOFTWARE UPDATE REQUIRED *&lt;br /&gt;
With the latest version (Aug 31, 2016), you can solve the indexing ambiguity problem directly in prime. The Brehm &amp;amp; Diederichs algorithms (doi:10.1107/S1399004713025431) have been implemented with bootstrap capability to handle large dataset.&lt;br /&gt;
&#039;&#039;&#039;Merohedral Twinning&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
For merohedral twinning (27 space groups e.g. P6), the indexing choices will be determined automatically in prime. Use this default setting in your .phil file,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
indexing_ambiguity {&lt;br /&gt;
  mode = Auto&lt;br /&gt;
  index_basis_in = None&lt;br /&gt;
  assigned_basis = None&lt;br /&gt;
  n_sample_frames = 300&lt;br /&gt;
  n_selected_frames = 100&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
The n_sample_frames parameter indicates no. of images that will be used for the calculation of the scoring function. After that, only n_selected_images will be used in the B&amp;amp;D algorithms. This saves a lot of computing time since only the selected images will be used for the determination of the ambiguity. You can change these two parameters to fit with your experiments. The default values are 300 and 100 (give 300 - use 100).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Pseudo-Merohedral Twinning&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
For pseudo-merohedral twinning, due to different possibilities for the indexing choice, prime doesn&#039;t determine these choices automatically. If you suspect that you may have pseudo twinning (b and c are similar, beta angle is almost 90 degree but not quite), you have an option to force prime to determine the ambiguity according to your choices.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
indexing_ambiguity {&lt;br /&gt;
  mode = Forced&lt;br /&gt;
  index_basis_in = None&lt;br /&gt;
  assigned_basis = -h,l,k&lt;br /&gt;
  assigned_basis = -k, l, h&lt;br /&gt;
  n_sample_frames = 300&lt;br /&gt;
  n_selected_frames = 100&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When you set indexing_ambiguity.mode to Forced, you can assign indexing choices according to your problem. In this example, two more choices (-h, l, k and -k, l, h) were assigned as the indexing choice.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Reusing the solution&#039;&#039;&#039; &amp;lt;br&amp;gt;&lt;br /&gt;
At the end of the run, your solution pickle is saved to your_run_no/index_ambiguity/solution_pickle.pickle. If you don&#039;t want to spend time solving the ambiguity again in the next run, you can reuse this solution pickle by setting these parameters:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
indexing_ambiguity {&lt;br /&gt;
  mode = Auto&lt;br /&gt;
  index_basis_in = your_run_no/index_ambiguity/solution_pickle.pickle&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will bypass the indexing ambiguity module. Prime will use the solution file to perform normal post-refinement and merging.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Using an external reference set&#039;&#039;&#039; &amp;lt;br&amp;gt;&lt;br /&gt;
To use another isomorphous dataset (e.g. from a synchrotron experiment) as a reference set to solve the ambiguity, you can specify an mtz file as part of these parameters:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
indexing_ambiguity {&lt;br /&gt;
  mode = Auto&lt;br /&gt;
  index_basis_in = path/to/your/mtz/file.mtz&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Again, you can choose to do Auto or Forced (with a list of assigned_basis parameters) depending on your problem.&lt;br /&gt;
&lt;br /&gt;
== More detail with input parameters ==&lt;br /&gt;
Now that you have your first trial merged data set, you can explore different parameter settings to merge or to obtain the Bijvoet pairs (I+/I-) for your anomalous data set.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Anomalous data:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
target_anomalous_flag = True&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
In the last cycle, prime will output a reflection set with I+ and I-.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Number of micro- and macrocycles&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
n_postref_cycle = 3&lt;br /&gt;
n_postref_sub_cycle = 1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Number of bins for merging statistics&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
n_bins = 20&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Help with input parameters ==&lt;br /&gt;
&lt;br /&gt;
Most input parameters are self-explained. However, you can run -h switch to view help information for each parameter.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.run -h&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Running in manual mode ==&lt;br /&gt;
With the same phil file, you can run prime manually. This gives you more freedom in terms of parameter settings at different stages (generating reference set, post-refining images, and merging) or at different cycle of post-refinement.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example A&#039;&#039;&#039;: I want to generate a reference set then post-refine all the images on the &#039;&#039;&#039;scale factors only&#039;&#039;&#039; for &#039;&#039;&#039;three cycles&#039;&#039;&#039; then refine &#039;&#039;&#039;all parameters&#039;&#039;&#039; in the &#039;&#039;&#039;4th cycle&#039;&#039;&#039;. To do this, you can follow these steps:&lt;br /&gt;
&lt;br /&gt;
To generate a reference set,&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.genref prime.phil&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
To post-refine on scale factors only, modify your .phil file so that all parameters are turned &#039;&#039;off&#039;&#039;.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
scale {&lt;br /&gt;
  d_min = 2.5&lt;br /&gt;
  d_max = 45&lt;br /&gt;
  sigma_min = 1.5&lt;br /&gt;
}&lt;br /&gt;
postref {&lt;br /&gt;
  residual_threshold = 5&lt;br /&gt;
  residual_threshold_xy = 5&lt;br /&gt;
  scale {&lt;br /&gt;
    d_min = 2.5&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
  }&lt;br /&gt;
  crystal_orientation {&lt;br /&gt;
    flag_on = False&lt;br /&gt;
    d_min = 2.5&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
  }&lt;br /&gt;
  reflecting_range {&lt;br /&gt;
    flag_on = False&lt;br /&gt;
    d_min = 2.5&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
  }&lt;br /&gt;
  unit_cell {&lt;br /&gt;
    flag_on = False&lt;br /&gt;
    d_min = 2.5&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
    uc_tolerance = 5&lt;br /&gt;
  }&lt;br /&gt;
  allparams {&lt;br /&gt;
    flag_on = False&lt;br /&gt;
    d_min = 2.5&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
    uc_tolerance = 5&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
...&lt;br /&gt;
n_postref_cycle = 3&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then run,&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.postrefine prime.phil&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
To refine all parameters one more cycle, update your .phil file again (flag_on = True)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
  allparams {&lt;br /&gt;
    flag_on = True&lt;br /&gt;
    d_min = 2.5&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
    uc_tolerance = 5&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
...&lt;br /&gt;
n_postref_cycle = 1&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then run,&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.postrefine prime.phil&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
To obtain the final merged mtz, run&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.merge prime.phil&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Running on multiple nodes ==&lt;br /&gt;
For LCLS users (or other users with LSF bsub), you can use psana (or your) queuing system to parallelize the entire process. For example, if you want to run your job on 100 nodes using psanq, you can specify:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
queue {&lt;br /&gt;
  mode = bsub&lt;br /&gt;
  qname = psanaq&lt;br /&gt;
  n_nodes = 100&lt;br /&gt;
}&lt;br /&gt;
timeout_seconds = 300&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Prime will divide all the images into 100 batches and submit them to different nodes. It will wait until all images in every batches are done before returning to the merging step (or the exit step in the manual mode). You can control timeout_seconds parameter to tell prime how long it should wait for all the image batches to finish. Usually, this timeout parameter is not used (all images should return before 300 seconds) but in case, you need to wait longer or shorter, you can modify this parameter.&lt;/div&gt;</summary>
		<author><name>Mona</name></author>
	</entry>
	<entry>
		<id>http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=Cctbx.prime&amp;diff=1287</id>
		<title>Cctbx.prime</title>
		<link rel="alternate" type="text/html" href="http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=Cctbx.prime&amp;diff=1287"/>
		<updated>2016-08-31T20:05:40Z</updated>

		<summary type="html">&lt;p&gt;Mona: /* Solving indexing ambiguity (New) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Prime: &#039;&#039;&#039;p&#039;&#039;&#039;ost-&#039;&#039;&#039;r&#039;&#039;&#039;ef&#039;&#039;&#039;i&#039;&#039;&#039;nement and &#039;&#039;&#039;me&#039;&#039;&#039;rging ==&lt;br /&gt;
With the latest update, prime can be used to process data on multiple nodes (on a queuing system). At the moment, only LSF (bsub) is supported. See documentation below for more information on how to use the queuing system.&lt;br /&gt;
&lt;br /&gt;
This major update replaces prime.postrefine with &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.run &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For auto mode, you can still use prime.run with your parameter phil file like before. For manual mode, the available sub commands in prime are:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.genref #generates a reference set from given integration results&lt;br /&gt;
prime.postrefine #refines all images&lt;br /&gt;
prime.merge #merges all refined results for an mtz file&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can choose to run these commands independently (ideally in the above order) using the same phil file. See [https://commons.wikimedia.org/wiki/File:Prime_flowcharts.tif &amp;quot;PRIME flowchart&amp;quot;]. This will give you the freedom to change something (e.g. set of parameters to refine, resolution cut-off, etc.) at different stages of the post-refinement and merging. See running prime in manual mode for more detail.&lt;br /&gt;
&lt;br /&gt;
Step-by-step guidelines to post-refine and merge XFEL diffraction images. For more detail and citation, see &lt;br /&gt;
&amp;quot;Enabling X-ray Free Electron Laser Crystallography for Challenging Biological Systems from a Limited Number of Crystals&amp;quot;&lt;br /&gt;
[http://elifesciences.org/content/4/e05421 &amp;quot;DOI: http://dx.doi.org/10.7554/eLife.05421&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
== Prime is gui-ed == &lt;br /&gt;
Thanks to Dr. Lyubimov, PRIME is also available as a Graphic User Interface program. Try it by running&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Click to see [https://commons.wikimedia.org/wiki/File:PRIME_main.png &amp;quot;PRIME main gui&amp;quot;] and [https://commons.wikimedia.org/wiki/File:PRIME_advanced_options.png &amp;quot;Advanced options&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
== Getting started == &lt;br /&gt;
&#039;&#039;&#039;Generating input phil file&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
Like most programs developed under &#039;&#039;cctbx&#039;&#039; framework, &#039;&#039;prime&#039;&#039; reads in input .phil file, which stores all the parameters needed to run post-refinement and merging steps. To generate the template .phil file, do the dry run by calling&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ prime.run&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
An example of the template .phil file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
data = None&lt;br /&gt;
run_no = None&lt;br /&gt;
title = None&lt;br /&gt;
scale {&lt;br /&gt;
  d_min = 0.1&lt;br /&gt;
  d_max = 99&lt;br /&gt;
  sigma_min = 1.5&lt;br /&gt;
}&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can save the content of the output to any file name - in this tutorial, let&#039;s save it to thermolysin.phil.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;First look at your phil file&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
To run prime, set the required parameters to match with your experiments (you can leave other parameters with their default values - or just delete them from you .phil file). The most interesting parameters are shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
data = /path/to/your/integarion/result/pickle_files&lt;br /&gt;
run_no = 001&lt;br /&gt;
title = First trial for thermolysin&lt;br /&gt;
scale {&lt;br /&gt;
  d_min = 2.1&lt;br /&gt;
  d_max = 45&lt;br /&gt;
  sigma_min = 1.5&lt;br /&gt;
}&lt;br /&gt;
postref {&lt;br /&gt;
  scale {&lt;br /&gt;
    d_min = 2.1&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
  }&lt;br /&gt;
  crystal_orientation {&lt;br /&gt;
    flag_on = True&lt;br /&gt;
    d_min = 2.1&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
  }&lt;br /&gt;
  reflecting_range {&lt;br /&gt;
    flag_on = True&lt;br /&gt;
    d_min = 2.1&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
  }&lt;br /&gt;
  unit_cell {&lt;br /&gt;
    flag_on = True&lt;br /&gt;
    d_min = 2.1&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
    uc_tolerance = 3&lt;br /&gt;
  }&lt;br /&gt;
  allparams {&lt;br /&gt;
    flag_on = False&lt;br /&gt;
    d_min = 2.1&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
    uc_tolerance = 3&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
merge {&lt;br /&gt;
  d_min = 2.1&lt;br /&gt;
  d_max = 45&lt;br /&gt;
  sigma_min = 1.5&lt;br /&gt;
  partiality_min = 0.1&lt;br /&gt;
  uc_tolerance = 3&lt;br /&gt;
}&lt;br /&gt;
target_unit_cell = 93.99,93.99,130.87,90,90,120&lt;br /&gt;
target_space_group = P 61 2 2&lt;br /&gt;
pixel_size_mm = 0.102&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You should pay attention to d_min and d_max for the refinement and merging parameters. If you use IOTA to integrate the images, IOTA will output .phil file for prime that has the optimal resolution range. If not, a few trial-and-error runs may be required to get the best resolution range for your dataset. Use merging statistics output by prime and check the values of CC1/2 and I/sigI to find out your optimal resolution range.&lt;br /&gt;
&lt;br /&gt;
Cell parameters (target_unit_cell and target_space_group) are required to run prime. Target cell parameter is used to remove some outlier images by controlling uc_tolerance parameter (the default value of tolerate range is 3% different). Space group parameter is used in removing outliers and merging with the given symmetry.&lt;br /&gt;
&lt;br /&gt;
Don&#039;t forget also to change your pixel size in millimeters. Check what your detector is and note down its pixel size. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Running post-refinement in automatic mode&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
Once you have the input .phil file, you can run &#039;&#039;prime&#039;&#039; by calling&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.run thermolysin.phil&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;Prime&#039;&#039; will post-refine and merge for reflection sets using three (default value) macrocycles. At the end of the run, you can obtain merging statistics in the last cycle - all other cycle statistics are also available in log.txt.&lt;br /&gt;
&lt;br /&gt;
An example of merging statistics:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Summary for 001/postref_cycle_1_merge.mtz&lt;br /&gt;
Bin Resolution Range     Completeness      &amp;lt;N_obs&amp;gt;  |Rsplit  CC1/2  N_ind |CCanom   N_ind| &amp;lt;I/sigI&amp;gt;   &amp;lt;I&amp;gt;&lt;br /&gt;
-------------------------------------------------------------------------------------------------------------&lt;br /&gt;
02    5.70 -    4.52 100.0   1055 /   1055   65.89   16.02   89.15   1055    0.00      0    20.17    2101.97&lt;br /&gt;
03    4.52 -    3.95 100.0   1032 /   1032   61.53   14.48   92.03   1032    0.00      0    20.39    2529.90&lt;br /&gt;
04    3.95 -    3.59 100.0   1016 /   1016   54.15   15.61   90.13   1016    0.00      0    16.69    1971.43&lt;br /&gt;
05    3.59 -    3.33 100.0   1004 /   1004   42.67   17.66   89.23   1004    0.00      0    14.21    1502.14&lt;br /&gt;
06    3.33 -    3.14 100.0   1013 /   1013   32.77   20.40   84.26   1013    0.00      0    11.76    1077.60&lt;br /&gt;
07    3.14 -    2.98 100.0    995 /    995   27.36   23.00   78.72    995    0.00      0    11.58     935.37&lt;br /&gt;
08    2.98 -    2.85 100.0   1006 /   1006   23.57   22.63   82.26   1006    0.00      0    10.56     722.62&lt;br /&gt;
09    2.85 -    2.74 100.0    986 /    986   16.64   28.51   72.90    985    0.00      0    10.01     591.56&lt;br /&gt;
10    2.74 -    2.65  99.9    989 /    990   12.41   31.35   72.95    987    0.00      0     9.91     515.07&lt;br /&gt;
11    2.65 -    2.56  99.7    979 /    982    9.35   37.14   65.31    970    0.00      0     9.31     438.96&lt;br /&gt;
12    2.56 -    2.49  98.0    979 /    999    6.06   45.98   45.37    930    0.00      0     9.45     390.05&lt;br /&gt;
13    2.49 -    2.42  95.1    931 /    979    4.46   50.68   34.20    834    0.00      0     8.93     334.80&lt;br /&gt;
14    2.42 -    2.37  91.7    896 /    977    3.35   55.66   37.15    729    0.00      0     9.27     320.17&lt;br /&gt;
15    2.37 -    2.31  83.9    829 /    988    2.61   56.92   43.21    600    0.00      0     9.60     296.67&lt;br /&gt;
16    2.31 -    2.26  72.4    702 /    969    1.97   65.81   26.89    386    0.00      0    10.29     284.39&lt;br /&gt;
17    2.26 -    2.22  59.1    582 /    985    1.75   64.72   31.28    275    0.00      0     9.87     284.06&lt;br /&gt;
18    2.22 -    2.18  52.9    513 /    970    1.51   71.27   16.86    188    0.00      0     8.93     215.31&lt;br /&gt;
19    2.18 -    2.14  35.7    349 /    978    1.32   62.26   68.25     90    0.00      0     8.22     199.09&lt;br /&gt;
20    2.14 -    2.10  23.1    227 /    981    1.20   92.14   -9.20     42    0.00      0     8.59     224.44&lt;br /&gt;
-------------------------------------------------------------------------------------------------------------&lt;br /&gt;
        TOTAL         85.9  17224 /  20046   27.11   21.11   92.07  15305    0.00      0    12.87     999.53&lt;br /&gt;
-------------------------------------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
Summary of refinement and merging&lt;br /&gt;
 No. good frames:                  1809&lt;br /&gt;
 No. bad cc frames:                 153&lt;br /&gt;
 No. bad G frames) :                  0&lt;br /&gt;
 No. bad unit cell frames:            5&lt;br /&gt;
 No. bad gamma_e frames:              0&lt;br /&gt;
 No. bad SE:                          0&lt;br /&gt;
 No. observations:               466997&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Solving indexing ambiguity (New) == &lt;br /&gt;
* SOFTWARE UPDATE REQUIRED *&lt;br /&gt;
With the latest version (Aug 31, 2016), you can solve the indexing ambiguity problem directly in prime. The Brehm &amp;amp; Diederichs algorithms (doi:10.1107/S1399004713025431) have been implemented with bootstrap capability to handle large dataset.&lt;br /&gt;
&#039;&#039;&#039;Merohedral Twinning&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
For merohedral twinning (27 space groups e.g. P6), the indexing choices will be determined automatically in prime. Use this default setting in your .phil file,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
indexing_ambiguity {&lt;br /&gt;
  mode = Auto&lt;br /&gt;
  index_basis_in = None&lt;br /&gt;
  assigned_basis = None&lt;br /&gt;
  n_sample_frames = 300&lt;br /&gt;
  n_selected_frames = 100&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
The n_sample_frames parameter indicates no. of images that will be used for the calculation of the scoring function. After that, only n_selected_images will be used in the B&amp;amp;D algorithms. This saves a lot of computing time since only the selected images will be used for the determination of the ambiguity. You can change these two parameters to fit with your experiments. The default values are 300 and 100 (give 300 - use 100).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Pseudo-Merohedral Twinning&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
For pseudo-merohedral twinning, due to different possibilities for the indexing choice, prime doesn&#039;t determine these choices automatically. If you suspect that you may have pseudo twinning (b and c are similar, beta angle is almost 90 degree but not quite), you have an option to force prime to determine the ambiguity according to your choices.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
indexing_ambiguity {&lt;br /&gt;
  mode = Forced&lt;br /&gt;
  index_basis_in = None&lt;br /&gt;
  assigned_basis = -h,l,k&lt;br /&gt;
  assigned_basis = -k, l, h&lt;br /&gt;
  n_sample_frames = 300&lt;br /&gt;
  n_selected_frames = 100&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When you set indexing_ambiguity.mode to Forced, you can assign indexing choices according to your problem. In this example, two more choices (-h, l, k and -k, l, h) were assigned as the indexing choice.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Reusing the solution&#039;&#039;&#039; &amp;lt;br&amp;gt;&lt;br /&gt;
At the end of the run, your solution pickle is saved to your_run_no/index_ambiguity/solution_pickle.pickle. If you don&#039;t want to spend time solving the ambiguity again in the next run, you can reuse this solution pickle by setting these parameters:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
indexing_ambiguity {&lt;br /&gt;
  mode = Auto&lt;br /&gt;
  index_basis_in = your_run_no/index_ambiguity/solution_pickle.pickle&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will bypass the indexing ambiguity module. Prime will use the solution file to perform normal post-refinement and merging.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Using an external reference set&#039;&#039;&#039; &amp;lt;br&amp;gt;&lt;br /&gt;
To use another isomorphous dataset (e.g. from a synchrotron experiment), you can specify an mtz file as part of these parameters:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
indexing_ambiguity {&lt;br /&gt;
  mode = Auto&lt;br /&gt;
  index_basis_in = path/to/your/mtz/file.mtz&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Again, you can choose to do Auto or Forced (with a list of assigned_basis parameters) depending on your problem.&lt;br /&gt;
&lt;br /&gt;
== More detail with input parameters ==&lt;br /&gt;
Now that you have your first trial merged data set, you can explore different parameter settings to merge or to obtain the Bijvoet pairs (I+/I-) for your anomalous data set.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Anomalous data:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
target_anomalous_flag = True&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
In the last cycle, prime will output a reflection set with I+ and I-.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Number of micro- and macrocycles&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
n_postref_cycle = 3&lt;br /&gt;
n_postref_sub_cycle = 1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Number of bins for merging statistics&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
n_bins = 20&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Help with input parameters ==&lt;br /&gt;
&lt;br /&gt;
Most input parameters are self-explained. However, you can run -h switch to view help information for each parameter.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.run -h&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Running in manual mode ==&lt;br /&gt;
With the same phil file, you can run prime manually. This gives you more freedom in terms of parameter settings at different stages (generating reference set, post-refining images, and merging) or at different cycle of post-refinement.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example A&#039;&#039;&#039;: I want to generate a reference set then post-refine all the images on the &#039;&#039;&#039;scale factors only&#039;&#039;&#039; for &#039;&#039;&#039;three cycles&#039;&#039;&#039; then refine &#039;&#039;&#039;all parameters&#039;&#039;&#039; in the &#039;&#039;&#039;4th cycle&#039;&#039;&#039;. To do this, you can follow these steps:&lt;br /&gt;
&lt;br /&gt;
To generate a reference set,&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.genref prime.phil&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
To post-refine on scale factors only, modify your .phil file so that all parameters are turned &#039;&#039;off&#039;&#039;.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
scale {&lt;br /&gt;
  d_min = 2.5&lt;br /&gt;
  d_max = 45&lt;br /&gt;
  sigma_min = 1.5&lt;br /&gt;
}&lt;br /&gt;
postref {&lt;br /&gt;
  residual_threshold = 5&lt;br /&gt;
  residual_threshold_xy = 5&lt;br /&gt;
  scale {&lt;br /&gt;
    d_min = 2.5&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
  }&lt;br /&gt;
  crystal_orientation {&lt;br /&gt;
    flag_on = False&lt;br /&gt;
    d_min = 2.5&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
  }&lt;br /&gt;
  reflecting_range {&lt;br /&gt;
    flag_on = False&lt;br /&gt;
    d_min = 2.5&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
  }&lt;br /&gt;
  unit_cell {&lt;br /&gt;
    flag_on = False&lt;br /&gt;
    d_min = 2.5&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
    uc_tolerance = 5&lt;br /&gt;
  }&lt;br /&gt;
  allparams {&lt;br /&gt;
    flag_on = False&lt;br /&gt;
    d_min = 2.5&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
    uc_tolerance = 5&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
...&lt;br /&gt;
n_postref_cycle = 3&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then run,&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.postrefine prime.phil&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
To refine all parameters one more cycle, update your .phil file again (flag_on = True)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
  allparams {&lt;br /&gt;
    flag_on = True&lt;br /&gt;
    d_min = 2.5&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
    uc_tolerance = 5&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
...&lt;br /&gt;
n_postref_cycle = 1&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then run,&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.postrefine prime.phil&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
To obtain the final merged mtz, run&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.merge prime.phil&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Running on multiple nodes ==&lt;br /&gt;
For LCLS users (or other users with LSF bsub), you can use psana (or your) queuing system to parallelize the entire process. For example, if you want to run your job on 100 nodes using psanq, you can specify:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
queue {&lt;br /&gt;
  mode = bsub&lt;br /&gt;
  qname = psanaq&lt;br /&gt;
  n_nodes = 100&lt;br /&gt;
}&lt;br /&gt;
timeout_seconds = 300&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Prime will divide all the images into 100 batches and submit them to different nodes. It will wait until all images in every batches are done before returning to the merging step (or the exit step in the manual mode). You can control timeout_seconds parameter to tell prime how long it should wait for all the image batches to finish. Usually, this timeout parameter is not used (all images should return before 300 seconds) but in case, you need to wait longer or shorter, you can modify this parameter.&lt;/div&gt;</summary>
		<author><name>Mona</name></author>
	</entry>
	<entry>
		<id>http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=Cctbx.prime&amp;diff=1286</id>
		<title>Cctbx.prime</title>
		<link rel="alternate" type="text/html" href="http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=Cctbx.prime&amp;diff=1286"/>
		<updated>2016-08-31T20:01:01Z</updated>

		<summary type="html">&lt;p&gt;Mona: /* Solving indexing ambiguity (New) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Prime: &#039;&#039;&#039;p&#039;&#039;&#039;ost-&#039;&#039;&#039;r&#039;&#039;&#039;ef&#039;&#039;&#039;i&#039;&#039;&#039;nement and &#039;&#039;&#039;me&#039;&#039;&#039;rging ==&lt;br /&gt;
With the latest update, prime can be used to process data on multiple nodes (on a queuing system). At the moment, only LSF (bsub) is supported. See documentation below for more information on how to use the queuing system.&lt;br /&gt;
&lt;br /&gt;
This major update replaces prime.postrefine with &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.run &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For auto mode, you can still use prime.run with your parameter phil file like before. For manual mode, the available sub commands in prime are:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.genref #generates a reference set from given integration results&lt;br /&gt;
prime.postrefine #refines all images&lt;br /&gt;
prime.merge #merges all refined results for an mtz file&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can choose to run these commands independently (ideally in the above order) using the same phil file. See [https://commons.wikimedia.org/wiki/File:Prime_flowcharts.tif &amp;quot;PRIME flowchart&amp;quot;]. This will give you the freedom to change something (e.g. set of parameters to refine, resolution cut-off, etc.) at different stages of the post-refinement and merging. See running prime in manual mode for more detail.&lt;br /&gt;
&lt;br /&gt;
Step-by-step guidelines to post-refine and merge XFEL diffraction images. For more detail and citation, see &lt;br /&gt;
&amp;quot;Enabling X-ray Free Electron Laser Crystallography for Challenging Biological Systems from a Limited Number of Crystals&amp;quot;&lt;br /&gt;
[http://elifesciences.org/content/4/e05421 &amp;quot;DOI: http://dx.doi.org/10.7554/eLife.05421&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
== Prime is gui-ed == &lt;br /&gt;
Thanks to Dr. Lyubimov, PRIME is also available as a Graphic User Interface program. Try it by running&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Click to see [https://commons.wikimedia.org/wiki/File:PRIME_main.png &amp;quot;PRIME main gui&amp;quot;] and [https://commons.wikimedia.org/wiki/File:PRIME_advanced_options.png &amp;quot;Advanced options&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
== Getting started == &lt;br /&gt;
&#039;&#039;&#039;Generating input phil file&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
Like most programs developed under &#039;&#039;cctbx&#039;&#039; framework, &#039;&#039;prime&#039;&#039; reads in input .phil file, which stores all the parameters needed to run post-refinement and merging steps. To generate the template .phil file, do the dry run by calling&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ prime.run&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
An example of the template .phil file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
data = None&lt;br /&gt;
run_no = None&lt;br /&gt;
title = None&lt;br /&gt;
scale {&lt;br /&gt;
  d_min = 0.1&lt;br /&gt;
  d_max = 99&lt;br /&gt;
  sigma_min = 1.5&lt;br /&gt;
}&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can save the content of the output to any file name - in this tutorial, let&#039;s save it to thermolysin.phil.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;First look at your phil file&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
To run prime, set the required parameters to match with your experiments (you can leave other parameters with their default values - or just delete them from you .phil file). The most interesting parameters are shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
data = /path/to/your/integarion/result/pickle_files&lt;br /&gt;
run_no = 001&lt;br /&gt;
title = First trial for thermolysin&lt;br /&gt;
scale {&lt;br /&gt;
  d_min = 2.1&lt;br /&gt;
  d_max = 45&lt;br /&gt;
  sigma_min = 1.5&lt;br /&gt;
}&lt;br /&gt;
postref {&lt;br /&gt;
  scale {&lt;br /&gt;
    d_min = 2.1&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
  }&lt;br /&gt;
  crystal_orientation {&lt;br /&gt;
    flag_on = True&lt;br /&gt;
    d_min = 2.1&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
  }&lt;br /&gt;
  reflecting_range {&lt;br /&gt;
    flag_on = True&lt;br /&gt;
    d_min = 2.1&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
  }&lt;br /&gt;
  unit_cell {&lt;br /&gt;
    flag_on = True&lt;br /&gt;
    d_min = 2.1&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
    uc_tolerance = 3&lt;br /&gt;
  }&lt;br /&gt;
  allparams {&lt;br /&gt;
    flag_on = False&lt;br /&gt;
    d_min = 2.1&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
    uc_tolerance = 3&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
merge {&lt;br /&gt;
  d_min = 2.1&lt;br /&gt;
  d_max = 45&lt;br /&gt;
  sigma_min = 1.5&lt;br /&gt;
  partiality_min = 0.1&lt;br /&gt;
  uc_tolerance = 3&lt;br /&gt;
}&lt;br /&gt;
target_unit_cell = 93.99,93.99,130.87,90,90,120&lt;br /&gt;
target_space_group = P 61 2 2&lt;br /&gt;
pixel_size_mm = 0.102&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You should pay attention to d_min and d_max for the refinement and merging parameters. If you use IOTA to integrate the images, IOTA will output .phil file for prime that has the optimal resolution range. If not, a few trial-and-error runs may be required to get the best resolution range for your dataset. Use merging statistics output by prime and check the values of CC1/2 and I/sigI to find out your optimal resolution range.&lt;br /&gt;
&lt;br /&gt;
Cell parameters (target_unit_cell and target_space_group) are required to run prime. Target cell parameter is used to remove some outlier images by controlling uc_tolerance parameter (the default value of tolerate range is 3% different). Space group parameter is used in removing outliers and merging with the given symmetry.&lt;br /&gt;
&lt;br /&gt;
Don&#039;t forget also to change your pixel size in millimeters. Check what your detector is and note down its pixel size. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Running post-refinement in automatic mode&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
Once you have the input .phil file, you can run &#039;&#039;prime&#039;&#039; by calling&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.run thermolysin.phil&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;Prime&#039;&#039; will post-refine and merge for reflection sets using three (default value) macrocycles. At the end of the run, you can obtain merging statistics in the last cycle - all other cycle statistics are also available in log.txt.&lt;br /&gt;
&lt;br /&gt;
An example of merging statistics:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Summary for 001/postref_cycle_1_merge.mtz&lt;br /&gt;
Bin Resolution Range     Completeness      &amp;lt;N_obs&amp;gt;  |Rsplit  CC1/2  N_ind |CCanom   N_ind| &amp;lt;I/sigI&amp;gt;   &amp;lt;I&amp;gt;&lt;br /&gt;
-------------------------------------------------------------------------------------------------------------&lt;br /&gt;
02    5.70 -    4.52 100.0   1055 /   1055   65.89   16.02   89.15   1055    0.00      0    20.17    2101.97&lt;br /&gt;
03    4.52 -    3.95 100.0   1032 /   1032   61.53   14.48   92.03   1032    0.00      0    20.39    2529.90&lt;br /&gt;
04    3.95 -    3.59 100.0   1016 /   1016   54.15   15.61   90.13   1016    0.00      0    16.69    1971.43&lt;br /&gt;
05    3.59 -    3.33 100.0   1004 /   1004   42.67   17.66   89.23   1004    0.00      0    14.21    1502.14&lt;br /&gt;
06    3.33 -    3.14 100.0   1013 /   1013   32.77   20.40   84.26   1013    0.00      0    11.76    1077.60&lt;br /&gt;
07    3.14 -    2.98 100.0    995 /    995   27.36   23.00   78.72    995    0.00      0    11.58     935.37&lt;br /&gt;
08    2.98 -    2.85 100.0   1006 /   1006   23.57   22.63   82.26   1006    0.00      0    10.56     722.62&lt;br /&gt;
09    2.85 -    2.74 100.0    986 /    986   16.64   28.51   72.90    985    0.00      0    10.01     591.56&lt;br /&gt;
10    2.74 -    2.65  99.9    989 /    990   12.41   31.35   72.95    987    0.00      0     9.91     515.07&lt;br /&gt;
11    2.65 -    2.56  99.7    979 /    982    9.35   37.14   65.31    970    0.00      0     9.31     438.96&lt;br /&gt;
12    2.56 -    2.49  98.0    979 /    999    6.06   45.98   45.37    930    0.00      0     9.45     390.05&lt;br /&gt;
13    2.49 -    2.42  95.1    931 /    979    4.46   50.68   34.20    834    0.00      0     8.93     334.80&lt;br /&gt;
14    2.42 -    2.37  91.7    896 /    977    3.35   55.66   37.15    729    0.00      0     9.27     320.17&lt;br /&gt;
15    2.37 -    2.31  83.9    829 /    988    2.61   56.92   43.21    600    0.00      0     9.60     296.67&lt;br /&gt;
16    2.31 -    2.26  72.4    702 /    969    1.97   65.81   26.89    386    0.00      0    10.29     284.39&lt;br /&gt;
17    2.26 -    2.22  59.1    582 /    985    1.75   64.72   31.28    275    0.00      0     9.87     284.06&lt;br /&gt;
18    2.22 -    2.18  52.9    513 /    970    1.51   71.27   16.86    188    0.00      0     8.93     215.31&lt;br /&gt;
19    2.18 -    2.14  35.7    349 /    978    1.32   62.26   68.25     90    0.00      0     8.22     199.09&lt;br /&gt;
20    2.14 -    2.10  23.1    227 /    981    1.20   92.14   -9.20     42    0.00      0     8.59     224.44&lt;br /&gt;
-------------------------------------------------------------------------------------------------------------&lt;br /&gt;
        TOTAL         85.9  17224 /  20046   27.11   21.11   92.07  15305    0.00      0    12.87     999.53&lt;br /&gt;
-------------------------------------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
Summary of refinement and merging&lt;br /&gt;
 No. good frames:                  1809&lt;br /&gt;
 No. bad cc frames:                 153&lt;br /&gt;
 No. bad G frames) :                  0&lt;br /&gt;
 No. bad unit cell frames:            5&lt;br /&gt;
 No. bad gamma_e frames:              0&lt;br /&gt;
 No. bad SE:                          0&lt;br /&gt;
 No. observations:               466997&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Solving indexing ambiguity (New) == &lt;br /&gt;
* SOFTWARE UPDATE REQUIRED *&lt;br /&gt;
With the latest version (Aug 31, 2016), you can solve the indexing ambiguity problem directly in prime. The Brehm &amp;amp; Diederichs algorithms (doi:10.1107/S1399004713025431) have been implemented with bootstrap capability to handle large dataset.&lt;br /&gt;
&lt;br /&gt;
For merohedral twining group, the indexing choices will be determined automatically in prime. Use this default setting in your .phil file,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
indexing_ambiguity {&lt;br /&gt;
  mode = Auto&lt;br /&gt;
  index_basis_in = None&lt;br /&gt;
  assigned_basis = None&lt;br /&gt;
  n_sample_frames = 300&lt;br /&gt;
  n_selected_frames = 100&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
The n_sample_frames parameter indicates no. of images that will be used for the calculation of the scoring function. After that, only n_selected_images will be used in the B&amp;amp;D algorithms. This saves a lot of computing time since only the selected images will be used for the determination of the ambiguity. You can change these two parameters to fit with your experiments. The default values are 300 and 100 (give 300 - use 100).&lt;br /&gt;
&lt;br /&gt;
For pseudo-merohedral twinning, due to different possibilities for the indexing choice, prime doesn&#039;t determine these choices automatically. If you suspect that you may have pseudo twinning (b and c are similar, beta angle is almost 90 degree but not quite), you have an option to force prime to determine the ambiguity according to your choices.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
indexing_ambiguity {&lt;br /&gt;
  mode = Forced&lt;br /&gt;
  index_basis_in = None&lt;br /&gt;
  assigned_basis = -h,l,k&lt;br /&gt;
  assigned_basis = -k, l, h&lt;br /&gt;
  n_sample_frames = 300&lt;br /&gt;
  n_selected_frames = 100&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When you set indexing_ambiguity.mode to Forced, you can assign indexing choices according to your problem. In this example, two more choices (-h, l, k and -k, l, h) were assigned as the indexing choice.&lt;br /&gt;
&lt;br /&gt;
At the end of the run, your solution pickle is saved to your_run_no/index_ambiguity/solution_pickle.pickle. If you don&#039;t want to spend time solving the ambiguity again in the next run, you can reuse this solution pickle by setting these parameters:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
indexing_ambiguity {&lt;br /&gt;
  mode = Auto&lt;br /&gt;
  index_basis_in = your_run_no/index_ambiguity/solution_pickle.pickle&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will bypass the indexing ambiguity module. Prime will use the solution file to perform normal post-refinement and merging.&lt;br /&gt;
&lt;br /&gt;
To use another isomorphous dataset (e.g. from synchrotron experiment), you can specify the mtz file as part of these parameters:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
indexing_ambiguity {&lt;br /&gt;
  mode = Auto&lt;br /&gt;
  index_basis_in = path/to/your/mtz/file.mtz&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Again, you can choose to do Auto or Forced (with a list of assigned_basis parameters) depending on your problem.&lt;br /&gt;
&lt;br /&gt;
== More detail with input parameters ==&lt;br /&gt;
Now that you have your first trial merged data set, you can explore different parameter settings to merge or to obtain the Bijvoet pairs (I+/I-) for your anomalous data set.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Anomalous data:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
target_anomalous_flag = True&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
In the last cycle, prime will output a reflection set with I+ and I-.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Number of micro- and macrocycles&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
n_postref_cycle = 3&lt;br /&gt;
n_postref_sub_cycle = 1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Number of bins for merging statistics&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
n_bins = 20&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Help with input parameters ==&lt;br /&gt;
&lt;br /&gt;
Most input parameters are self-explained. However, you can run -h switch to view help information for each parameter.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.run -h&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Running in manual mode ==&lt;br /&gt;
With the same phil file, you can run prime manually. This gives you more freedom in terms of parameter settings at different stages (generating reference set, post-refining images, and merging) or at different cycle of post-refinement.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example A&#039;&#039;&#039;: I want to generate a reference set then post-refine all the images on the &#039;&#039;&#039;scale factors only&#039;&#039;&#039; for &#039;&#039;&#039;three cycles&#039;&#039;&#039; then refine &#039;&#039;&#039;all parameters&#039;&#039;&#039; in the &#039;&#039;&#039;4th cycle&#039;&#039;&#039;. To do this, you can follow these steps:&lt;br /&gt;
&lt;br /&gt;
To generate a reference set,&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.genref prime.phil&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
To post-refine on scale factors only, modify your .phil file so that all parameters are turned &#039;&#039;off&#039;&#039;.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
scale {&lt;br /&gt;
  d_min = 2.5&lt;br /&gt;
  d_max = 45&lt;br /&gt;
  sigma_min = 1.5&lt;br /&gt;
}&lt;br /&gt;
postref {&lt;br /&gt;
  residual_threshold = 5&lt;br /&gt;
  residual_threshold_xy = 5&lt;br /&gt;
  scale {&lt;br /&gt;
    d_min = 2.5&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
  }&lt;br /&gt;
  crystal_orientation {&lt;br /&gt;
    flag_on = False&lt;br /&gt;
    d_min = 2.5&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
  }&lt;br /&gt;
  reflecting_range {&lt;br /&gt;
    flag_on = False&lt;br /&gt;
    d_min = 2.5&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
  }&lt;br /&gt;
  unit_cell {&lt;br /&gt;
    flag_on = False&lt;br /&gt;
    d_min = 2.5&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
    uc_tolerance = 5&lt;br /&gt;
  }&lt;br /&gt;
  allparams {&lt;br /&gt;
    flag_on = False&lt;br /&gt;
    d_min = 2.5&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
    uc_tolerance = 5&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
...&lt;br /&gt;
n_postref_cycle = 3&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then run,&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.postrefine prime.phil&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
To refine all parameters one more cycle, update your .phil file again (flag_on = True)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
  allparams {&lt;br /&gt;
    flag_on = True&lt;br /&gt;
    d_min = 2.5&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
    uc_tolerance = 5&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
...&lt;br /&gt;
n_postref_cycle = 1&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then run,&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.postrefine prime.phil&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
To obtain the final merged mtz, run&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.merge prime.phil&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Running on multiple nodes ==&lt;br /&gt;
For LCLS users (or other users with LSF bsub), you can use psana (or your) queuing system to parallelize the entire process. For example, if you want to run your job on 100 nodes using psanq, you can specify:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
queue {&lt;br /&gt;
  mode = bsub&lt;br /&gt;
  qname = psanaq&lt;br /&gt;
  n_nodes = 100&lt;br /&gt;
}&lt;br /&gt;
timeout_seconds = 300&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Prime will divide all the images into 100 batches and submit them to different nodes. It will wait until all images in every batches are done before returning to the merging step (or the exit step in the manual mode). You can control timeout_seconds parameter to tell prime how long it should wait for all the image batches to finish. Usually, this timeout parameter is not used (all images should return before 300 seconds) but in case, you need to wait longer or shorter, you can modify this parameter.&lt;/div&gt;</summary>
		<author><name>Mona</name></author>
	</entry>
	<entry>
		<id>http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=Cctbx.prime&amp;diff=1285</id>
		<title>Cctbx.prime</title>
		<link rel="alternate" type="text/html" href="http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=Cctbx.prime&amp;diff=1285"/>
		<updated>2016-08-31T20:00:10Z</updated>

		<summary type="html">&lt;p&gt;Mona: /* Solving indexing ambiguity (New) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Prime: &#039;&#039;&#039;p&#039;&#039;&#039;ost-&#039;&#039;&#039;r&#039;&#039;&#039;ef&#039;&#039;&#039;i&#039;&#039;&#039;nement and &#039;&#039;&#039;me&#039;&#039;&#039;rging ==&lt;br /&gt;
With the latest update, prime can be used to process data on multiple nodes (on a queuing system). At the moment, only LSF (bsub) is supported. See documentation below for more information on how to use the queuing system.&lt;br /&gt;
&lt;br /&gt;
This major update replaces prime.postrefine with &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.run &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For auto mode, you can still use prime.run with your parameter phil file like before. For manual mode, the available sub commands in prime are:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.genref #generates a reference set from given integration results&lt;br /&gt;
prime.postrefine #refines all images&lt;br /&gt;
prime.merge #merges all refined results for an mtz file&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can choose to run these commands independently (ideally in the above order) using the same phil file. See [https://commons.wikimedia.org/wiki/File:Prime_flowcharts.tif &amp;quot;PRIME flowchart&amp;quot;]. This will give you the freedom to change something (e.g. set of parameters to refine, resolution cut-off, etc.) at different stages of the post-refinement and merging. See running prime in manual mode for more detail.&lt;br /&gt;
&lt;br /&gt;
Step-by-step guidelines to post-refine and merge XFEL diffraction images. For more detail and citation, see &lt;br /&gt;
&amp;quot;Enabling X-ray Free Electron Laser Crystallography for Challenging Biological Systems from a Limited Number of Crystals&amp;quot;&lt;br /&gt;
[http://elifesciences.org/content/4/e05421 &amp;quot;DOI: http://dx.doi.org/10.7554/eLife.05421&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
== Prime is gui-ed == &lt;br /&gt;
Thanks to Dr. Lyubimov, PRIME is also available as a Graphic User Interface program. Try it by running&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Click to see [https://commons.wikimedia.org/wiki/File:PRIME_main.png &amp;quot;PRIME main gui&amp;quot;] and [https://commons.wikimedia.org/wiki/File:PRIME_advanced_options.png &amp;quot;Advanced options&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
== Getting started == &lt;br /&gt;
&#039;&#039;&#039;Generating input phil file&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
Like most programs developed under &#039;&#039;cctbx&#039;&#039; framework, &#039;&#039;prime&#039;&#039; reads in input .phil file, which stores all the parameters needed to run post-refinement and merging steps. To generate the template .phil file, do the dry run by calling&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ prime.run&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
An example of the template .phil file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
data = None&lt;br /&gt;
run_no = None&lt;br /&gt;
title = None&lt;br /&gt;
scale {&lt;br /&gt;
  d_min = 0.1&lt;br /&gt;
  d_max = 99&lt;br /&gt;
  sigma_min = 1.5&lt;br /&gt;
}&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can save the content of the output to any file name - in this tutorial, let&#039;s save it to thermolysin.phil.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;First look at your phil file&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
To run prime, set the required parameters to match with your experiments (you can leave other parameters with their default values - or just delete them from you .phil file). The most interesting parameters are shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
data = /path/to/your/integarion/result/pickle_files&lt;br /&gt;
run_no = 001&lt;br /&gt;
title = First trial for thermolysin&lt;br /&gt;
scale {&lt;br /&gt;
  d_min = 2.1&lt;br /&gt;
  d_max = 45&lt;br /&gt;
  sigma_min = 1.5&lt;br /&gt;
}&lt;br /&gt;
postref {&lt;br /&gt;
  scale {&lt;br /&gt;
    d_min = 2.1&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
  }&lt;br /&gt;
  crystal_orientation {&lt;br /&gt;
    flag_on = True&lt;br /&gt;
    d_min = 2.1&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
  }&lt;br /&gt;
  reflecting_range {&lt;br /&gt;
    flag_on = True&lt;br /&gt;
    d_min = 2.1&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
  }&lt;br /&gt;
  unit_cell {&lt;br /&gt;
    flag_on = True&lt;br /&gt;
    d_min = 2.1&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
    uc_tolerance = 3&lt;br /&gt;
  }&lt;br /&gt;
  allparams {&lt;br /&gt;
    flag_on = False&lt;br /&gt;
    d_min = 2.1&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
    uc_tolerance = 3&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
merge {&lt;br /&gt;
  d_min = 2.1&lt;br /&gt;
  d_max = 45&lt;br /&gt;
  sigma_min = 1.5&lt;br /&gt;
  partiality_min = 0.1&lt;br /&gt;
  uc_tolerance = 3&lt;br /&gt;
}&lt;br /&gt;
target_unit_cell = 93.99,93.99,130.87,90,90,120&lt;br /&gt;
target_space_group = P 61 2 2&lt;br /&gt;
pixel_size_mm = 0.102&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You should pay attention to d_min and d_max for the refinement and merging parameters. If you use IOTA to integrate the images, IOTA will output .phil file for prime that has the optimal resolution range. If not, a few trial-and-error runs may be required to get the best resolution range for your dataset. Use merging statistics output by prime and check the values of CC1/2 and I/sigI to find out your optimal resolution range.&lt;br /&gt;
&lt;br /&gt;
Cell parameters (target_unit_cell and target_space_group) are required to run prime. Target cell parameter is used to remove some outlier images by controlling uc_tolerance parameter (the default value of tolerate range is 3% different). Space group parameter is used in removing outliers and merging with the given symmetry.&lt;br /&gt;
&lt;br /&gt;
Don&#039;t forget also to change your pixel size in millimeters. Check what your detector is and note down its pixel size. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Running post-refinement in automatic mode&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
Once you have the input .phil file, you can run &#039;&#039;prime&#039;&#039; by calling&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.run thermolysin.phil&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;Prime&#039;&#039; will post-refine and merge for reflection sets using three (default value) macrocycles. At the end of the run, you can obtain merging statistics in the last cycle - all other cycle statistics are also available in log.txt.&lt;br /&gt;
&lt;br /&gt;
An example of merging statistics:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Summary for 001/postref_cycle_1_merge.mtz&lt;br /&gt;
Bin Resolution Range     Completeness      &amp;lt;N_obs&amp;gt;  |Rsplit  CC1/2  N_ind |CCanom   N_ind| &amp;lt;I/sigI&amp;gt;   &amp;lt;I&amp;gt;&lt;br /&gt;
-------------------------------------------------------------------------------------------------------------&lt;br /&gt;
02    5.70 -    4.52 100.0   1055 /   1055   65.89   16.02   89.15   1055    0.00      0    20.17    2101.97&lt;br /&gt;
03    4.52 -    3.95 100.0   1032 /   1032   61.53   14.48   92.03   1032    0.00      0    20.39    2529.90&lt;br /&gt;
04    3.95 -    3.59 100.0   1016 /   1016   54.15   15.61   90.13   1016    0.00      0    16.69    1971.43&lt;br /&gt;
05    3.59 -    3.33 100.0   1004 /   1004   42.67   17.66   89.23   1004    0.00      0    14.21    1502.14&lt;br /&gt;
06    3.33 -    3.14 100.0   1013 /   1013   32.77   20.40   84.26   1013    0.00      0    11.76    1077.60&lt;br /&gt;
07    3.14 -    2.98 100.0    995 /    995   27.36   23.00   78.72    995    0.00      0    11.58     935.37&lt;br /&gt;
08    2.98 -    2.85 100.0   1006 /   1006   23.57   22.63   82.26   1006    0.00      0    10.56     722.62&lt;br /&gt;
09    2.85 -    2.74 100.0    986 /    986   16.64   28.51   72.90    985    0.00      0    10.01     591.56&lt;br /&gt;
10    2.74 -    2.65  99.9    989 /    990   12.41   31.35   72.95    987    0.00      0     9.91     515.07&lt;br /&gt;
11    2.65 -    2.56  99.7    979 /    982    9.35   37.14   65.31    970    0.00      0     9.31     438.96&lt;br /&gt;
12    2.56 -    2.49  98.0    979 /    999    6.06   45.98   45.37    930    0.00      0     9.45     390.05&lt;br /&gt;
13    2.49 -    2.42  95.1    931 /    979    4.46   50.68   34.20    834    0.00      0     8.93     334.80&lt;br /&gt;
14    2.42 -    2.37  91.7    896 /    977    3.35   55.66   37.15    729    0.00      0     9.27     320.17&lt;br /&gt;
15    2.37 -    2.31  83.9    829 /    988    2.61   56.92   43.21    600    0.00      0     9.60     296.67&lt;br /&gt;
16    2.31 -    2.26  72.4    702 /    969    1.97   65.81   26.89    386    0.00      0    10.29     284.39&lt;br /&gt;
17    2.26 -    2.22  59.1    582 /    985    1.75   64.72   31.28    275    0.00      0     9.87     284.06&lt;br /&gt;
18    2.22 -    2.18  52.9    513 /    970    1.51   71.27   16.86    188    0.00      0     8.93     215.31&lt;br /&gt;
19    2.18 -    2.14  35.7    349 /    978    1.32   62.26   68.25     90    0.00      0     8.22     199.09&lt;br /&gt;
20    2.14 -    2.10  23.1    227 /    981    1.20   92.14   -9.20     42    0.00      0     8.59     224.44&lt;br /&gt;
-------------------------------------------------------------------------------------------------------------&lt;br /&gt;
        TOTAL         85.9  17224 /  20046   27.11   21.11   92.07  15305    0.00      0    12.87     999.53&lt;br /&gt;
-------------------------------------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
Summary of refinement and merging&lt;br /&gt;
 No. good frames:                  1809&lt;br /&gt;
 No. bad cc frames:                 153&lt;br /&gt;
 No. bad G frames) :                  0&lt;br /&gt;
 No. bad unit cell frames:            5&lt;br /&gt;
 No. bad gamma_e frames:              0&lt;br /&gt;
 No. bad SE:                          0&lt;br /&gt;
 No. observations:               466997&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Solving indexing ambiguity (New) == &lt;br /&gt;
* SOFTWARE UPDATE REQUIRED *&lt;br /&gt;
With the latest version (Aug 31, 2016), you can solve the indexing ambiguity problem directly in prime. The Brehm &amp;amp; Diederichs algorithms (doi:10.1107/S1399004713025431) have been implemented with bootstrap capability to handle large dataset.&lt;br /&gt;
For merohedral twining group, the indexing choices will be determined automatically in prime. Use this default setting in your .phil file,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
indexing_ambiguity {&lt;br /&gt;
  mode = Auto&lt;br /&gt;
  index_basis_in = None&lt;br /&gt;
  assigned_basis = None&lt;br /&gt;
  n_sample_frames = 300&lt;br /&gt;
  n_selected_frames = 100&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
The n_sample_frames parameter indicates no. of images that will be used for the calculation of the scoring function. After that, only n_selected_images will be used in the B&amp;amp;D algorithms. This saves a lot of computing time since only the selected images will be used for the determination of the ambiguity. You can change these two parameters to fit with your experiments. The default values are 300 and 100 (give 300 - use 100).&lt;br /&gt;
&lt;br /&gt;
For pseudo-merohedral twinning, due to different possibilities for the indexing choice, prime doesn&#039;t determine these choices automatically. If you suspect that you may have pseudo twinning (b and c are similar, beta angle is almost 90 degree but not quite), you have an option to force prime to determine the ambiguity according to your choices.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
indexing_ambiguity {&lt;br /&gt;
  mode = Forced&lt;br /&gt;
  index_basis_in = None&lt;br /&gt;
  assigned_basis = -h,l,k&lt;br /&gt;
  assigned_basis = -k, l, h&lt;br /&gt;
  n_sample_frames = 300&lt;br /&gt;
  n_selected_frames = 100&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When you set indexing_ambiguity.mode to Forced, you can assign indexing choices according to your problem. In this example, two more choices (-h, l, k and -k, l, h) were assigned as the indexing choice.&lt;br /&gt;
&lt;br /&gt;
At the end of the run, your solution pickle is saved to your_run_no/index_ambiguity/solution_pickle.pickle. If you don&#039;t want to spend time solving the ambiguity again in the next run, you can reuse this solution pickle by setting these parameters:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
indexing_ambiguity {&lt;br /&gt;
  mode = Auto&lt;br /&gt;
  index_basis_in = your_run_no/index_ambiguity/solution_pickle.pickle&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will bypass the indexing ambiguity module. Prime will use the solution file to perform normal post-refinement and merging.&lt;br /&gt;
&lt;br /&gt;
To use another isomorphous dataset (e.g. from synchrotron experiment), you can specify the mtz file as part of these parameters:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
indexing_ambiguity {&lt;br /&gt;
  mode = Auto&lt;br /&gt;
  index_basis_in = path/to/your/mtz/file.mtz&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Again, you can choose to do Auto or Forced (with a list of assigned_basis parameters) depending on your problem.&lt;br /&gt;
&lt;br /&gt;
== More detail with input parameters ==&lt;br /&gt;
Now that you have your first trial merged data set, you can explore different parameter settings to merge or to obtain the Bijvoet pairs (I+/I-) for your anomalous data set.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Anomalous data:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
target_anomalous_flag = True&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
In the last cycle, prime will output a reflection set with I+ and I-.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Number of micro- and macrocycles&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
n_postref_cycle = 3&lt;br /&gt;
n_postref_sub_cycle = 1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Number of bins for merging statistics&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
n_bins = 20&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Help with input parameters ==&lt;br /&gt;
&lt;br /&gt;
Most input parameters are self-explained. However, you can run -h switch to view help information for each parameter.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.run -h&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Running in manual mode ==&lt;br /&gt;
With the same phil file, you can run prime manually. This gives you more freedom in terms of parameter settings at different stages (generating reference set, post-refining images, and merging) or at different cycle of post-refinement.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example A&#039;&#039;&#039;: I want to generate a reference set then post-refine all the images on the &#039;&#039;&#039;scale factors only&#039;&#039;&#039; for &#039;&#039;&#039;three cycles&#039;&#039;&#039; then refine &#039;&#039;&#039;all parameters&#039;&#039;&#039; in the &#039;&#039;&#039;4th cycle&#039;&#039;&#039;. To do this, you can follow these steps:&lt;br /&gt;
&lt;br /&gt;
To generate a reference set,&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.genref prime.phil&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
To post-refine on scale factors only, modify your .phil file so that all parameters are turned &#039;&#039;off&#039;&#039;.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
scale {&lt;br /&gt;
  d_min = 2.5&lt;br /&gt;
  d_max = 45&lt;br /&gt;
  sigma_min = 1.5&lt;br /&gt;
}&lt;br /&gt;
postref {&lt;br /&gt;
  residual_threshold = 5&lt;br /&gt;
  residual_threshold_xy = 5&lt;br /&gt;
  scale {&lt;br /&gt;
    d_min = 2.5&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
  }&lt;br /&gt;
  crystal_orientation {&lt;br /&gt;
    flag_on = False&lt;br /&gt;
    d_min = 2.5&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
  }&lt;br /&gt;
  reflecting_range {&lt;br /&gt;
    flag_on = False&lt;br /&gt;
    d_min = 2.5&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
  }&lt;br /&gt;
  unit_cell {&lt;br /&gt;
    flag_on = False&lt;br /&gt;
    d_min = 2.5&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
    uc_tolerance = 5&lt;br /&gt;
  }&lt;br /&gt;
  allparams {&lt;br /&gt;
    flag_on = False&lt;br /&gt;
    d_min = 2.5&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
    uc_tolerance = 5&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
...&lt;br /&gt;
n_postref_cycle = 3&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then run,&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.postrefine prime.phil&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
To refine all parameters one more cycle, update your .phil file again (flag_on = True)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
  allparams {&lt;br /&gt;
    flag_on = True&lt;br /&gt;
    d_min = 2.5&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
    uc_tolerance = 5&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
...&lt;br /&gt;
n_postref_cycle = 1&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then run,&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.postrefine prime.phil&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
To obtain the final merged mtz, run&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.merge prime.phil&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Running on multiple nodes ==&lt;br /&gt;
For LCLS users (or other users with LSF bsub), you can use psana (or your) queuing system to parallelize the entire process. For example, if you want to run your job on 100 nodes using psanq, you can specify:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
queue {&lt;br /&gt;
  mode = bsub&lt;br /&gt;
  qname = psanaq&lt;br /&gt;
  n_nodes = 100&lt;br /&gt;
}&lt;br /&gt;
timeout_seconds = 300&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Prime will divide all the images into 100 batches and submit them to different nodes. It will wait until all images in every batches are done before returning to the merging step (or the exit step in the manual mode). You can control timeout_seconds parameter to tell prime how long it should wait for all the image batches to finish. Usually, this timeout parameter is not used (all images should return before 300 seconds) but in case, you need to wait longer or shorter, you can modify this parameter.&lt;/div&gt;</summary>
		<author><name>Mona</name></author>
	</entry>
	<entry>
		<id>http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=Cctbx.prime&amp;diff=1284</id>
		<title>Cctbx.prime</title>
		<link rel="alternate" type="text/html" href="http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=Cctbx.prime&amp;diff=1284"/>
		<updated>2016-08-31T19:45:53Z</updated>

		<summary type="html">&lt;p&gt;Mona: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Prime: &#039;&#039;&#039;p&#039;&#039;&#039;ost-&#039;&#039;&#039;r&#039;&#039;&#039;ef&#039;&#039;&#039;i&#039;&#039;&#039;nement and &#039;&#039;&#039;me&#039;&#039;&#039;rging ==&lt;br /&gt;
With the latest update, prime can be used to process data on multiple nodes (on a queuing system). At the moment, only LSF (bsub) is supported. See documentation below for more information on how to use the queuing system.&lt;br /&gt;
&lt;br /&gt;
This major update replaces prime.postrefine with &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.run &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For auto mode, you can still use prime.run with your parameter phil file like before. For manual mode, the available sub commands in prime are:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.genref #generates a reference set from given integration results&lt;br /&gt;
prime.postrefine #refines all images&lt;br /&gt;
prime.merge #merges all refined results for an mtz file&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can choose to run these commands independently (ideally in the above order) using the same phil file. See [https://commons.wikimedia.org/wiki/File:Prime_flowcharts.tif &amp;quot;PRIME flowchart&amp;quot;]. This will give you the freedom to change something (e.g. set of parameters to refine, resolution cut-off, etc.) at different stages of the post-refinement and merging. See running prime in manual mode for more detail.&lt;br /&gt;
&lt;br /&gt;
Step-by-step guidelines to post-refine and merge XFEL diffraction images. For more detail and citation, see &lt;br /&gt;
&amp;quot;Enabling X-ray Free Electron Laser Crystallography for Challenging Biological Systems from a Limited Number of Crystals&amp;quot;&lt;br /&gt;
[http://elifesciences.org/content/4/e05421 &amp;quot;DOI: http://dx.doi.org/10.7554/eLife.05421&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
== Prime is gui-ed == &lt;br /&gt;
Thanks to Dr. Lyubimov, PRIME is also available as a Graphic User Interface program. Try it by running&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Click to see [https://commons.wikimedia.org/wiki/File:PRIME_main.png &amp;quot;PRIME main gui&amp;quot;] and [https://commons.wikimedia.org/wiki/File:PRIME_advanced_options.png &amp;quot;Advanced options&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
== Getting started == &lt;br /&gt;
&#039;&#039;&#039;Generating input phil file&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
Like most programs developed under &#039;&#039;cctbx&#039;&#039; framework, &#039;&#039;prime&#039;&#039; reads in input .phil file, which stores all the parameters needed to run post-refinement and merging steps. To generate the template .phil file, do the dry run by calling&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ prime.run&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
An example of the template .phil file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
data = None&lt;br /&gt;
run_no = None&lt;br /&gt;
title = None&lt;br /&gt;
scale {&lt;br /&gt;
  d_min = 0.1&lt;br /&gt;
  d_max = 99&lt;br /&gt;
  sigma_min = 1.5&lt;br /&gt;
}&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can save the content of the output to any file name - in this tutorial, let&#039;s save it to thermolysin.phil.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;First look at your phil file&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
To run prime, set the required parameters to match with your experiments (you can leave other parameters with their default values - or just delete them from you .phil file). The most interesting parameters are shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
data = /path/to/your/integarion/result/pickle_files&lt;br /&gt;
run_no = 001&lt;br /&gt;
title = First trial for thermolysin&lt;br /&gt;
scale {&lt;br /&gt;
  d_min = 2.1&lt;br /&gt;
  d_max = 45&lt;br /&gt;
  sigma_min = 1.5&lt;br /&gt;
}&lt;br /&gt;
postref {&lt;br /&gt;
  scale {&lt;br /&gt;
    d_min = 2.1&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
  }&lt;br /&gt;
  crystal_orientation {&lt;br /&gt;
    flag_on = True&lt;br /&gt;
    d_min = 2.1&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
  }&lt;br /&gt;
  reflecting_range {&lt;br /&gt;
    flag_on = True&lt;br /&gt;
    d_min = 2.1&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
  }&lt;br /&gt;
  unit_cell {&lt;br /&gt;
    flag_on = True&lt;br /&gt;
    d_min = 2.1&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
    uc_tolerance = 3&lt;br /&gt;
  }&lt;br /&gt;
  allparams {&lt;br /&gt;
    flag_on = False&lt;br /&gt;
    d_min = 2.1&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
    uc_tolerance = 3&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
merge {&lt;br /&gt;
  d_min = 2.1&lt;br /&gt;
  d_max = 45&lt;br /&gt;
  sigma_min = 1.5&lt;br /&gt;
  partiality_min = 0.1&lt;br /&gt;
  uc_tolerance = 3&lt;br /&gt;
}&lt;br /&gt;
target_unit_cell = 93.99,93.99,130.87,90,90,120&lt;br /&gt;
target_space_group = P 61 2 2&lt;br /&gt;
pixel_size_mm = 0.102&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You should pay attention to d_min and d_max for the refinement and merging parameters. If you use IOTA to integrate the images, IOTA will output .phil file for prime that has the optimal resolution range. If not, a few trial-and-error runs may be required to get the best resolution range for your dataset. Use merging statistics output by prime and check the values of CC1/2 and I/sigI to find out your optimal resolution range.&lt;br /&gt;
&lt;br /&gt;
Cell parameters (target_unit_cell and target_space_group) are required to run prime. Target cell parameter is used to remove some outlier images by controlling uc_tolerance parameter (the default value of tolerate range is 3% different). Space group parameter is used in removing outliers and merging with the given symmetry.&lt;br /&gt;
&lt;br /&gt;
Don&#039;t forget also to change your pixel size in millimeters. Check what your detector is and note down its pixel size. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Running post-refinement in automatic mode&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
Once you have the input .phil file, you can run &#039;&#039;prime&#039;&#039; by calling&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.run thermolysin.phil&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;Prime&#039;&#039; will post-refine and merge for reflection sets using three (default value) macrocycles. At the end of the run, you can obtain merging statistics in the last cycle - all other cycle statistics are also available in log.txt.&lt;br /&gt;
&lt;br /&gt;
An example of merging statistics:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Summary for 001/postref_cycle_1_merge.mtz&lt;br /&gt;
Bin Resolution Range     Completeness      &amp;lt;N_obs&amp;gt;  |Rsplit  CC1/2  N_ind |CCanom   N_ind| &amp;lt;I/sigI&amp;gt;   &amp;lt;I&amp;gt;&lt;br /&gt;
-------------------------------------------------------------------------------------------------------------&lt;br /&gt;
02    5.70 -    4.52 100.0   1055 /   1055   65.89   16.02   89.15   1055    0.00      0    20.17    2101.97&lt;br /&gt;
03    4.52 -    3.95 100.0   1032 /   1032   61.53   14.48   92.03   1032    0.00      0    20.39    2529.90&lt;br /&gt;
04    3.95 -    3.59 100.0   1016 /   1016   54.15   15.61   90.13   1016    0.00      0    16.69    1971.43&lt;br /&gt;
05    3.59 -    3.33 100.0   1004 /   1004   42.67   17.66   89.23   1004    0.00      0    14.21    1502.14&lt;br /&gt;
06    3.33 -    3.14 100.0   1013 /   1013   32.77   20.40   84.26   1013    0.00      0    11.76    1077.60&lt;br /&gt;
07    3.14 -    2.98 100.0    995 /    995   27.36   23.00   78.72    995    0.00      0    11.58     935.37&lt;br /&gt;
08    2.98 -    2.85 100.0   1006 /   1006   23.57   22.63   82.26   1006    0.00      0    10.56     722.62&lt;br /&gt;
09    2.85 -    2.74 100.0    986 /    986   16.64   28.51   72.90    985    0.00      0    10.01     591.56&lt;br /&gt;
10    2.74 -    2.65  99.9    989 /    990   12.41   31.35   72.95    987    0.00      0     9.91     515.07&lt;br /&gt;
11    2.65 -    2.56  99.7    979 /    982    9.35   37.14   65.31    970    0.00      0     9.31     438.96&lt;br /&gt;
12    2.56 -    2.49  98.0    979 /    999    6.06   45.98   45.37    930    0.00      0     9.45     390.05&lt;br /&gt;
13    2.49 -    2.42  95.1    931 /    979    4.46   50.68   34.20    834    0.00      0     8.93     334.80&lt;br /&gt;
14    2.42 -    2.37  91.7    896 /    977    3.35   55.66   37.15    729    0.00      0     9.27     320.17&lt;br /&gt;
15    2.37 -    2.31  83.9    829 /    988    2.61   56.92   43.21    600    0.00      0     9.60     296.67&lt;br /&gt;
16    2.31 -    2.26  72.4    702 /    969    1.97   65.81   26.89    386    0.00      0    10.29     284.39&lt;br /&gt;
17    2.26 -    2.22  59.1    582 /    985    1.75   64.72   31.28    275    0.00      0     9.87     284.06&lt;br /&gt;
18    2.22 -    2.18  52.9    513 /    970    1.51   71.27   16.86    188    0.00      0     8.93     215.31&lt;br /&gt;
19    2.18 -    2.14  35.7    349 /    978    1.32   62.26   68.25     90    0.00      0     8.22     199.09&lt;br /&gt;
20    2.14 -    2.10  23.1    227 /    981    1.20   92.14   -9.20     42    0.00      0     8.59     224.44&lt;br /&gt;
-------------------------------------------------------------------------------------------------------------&lt;br /&gt;
        TOTAL         85.9  17224 /  20046   27.11   21.11   92.07  15305    0.00      0    12.87     999.53&lt;br /&gt;
-------------------------------------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
Summary of refinement and merging&lt;br /&gt;
 No. good frames:                  1809&lt;br /&gt;
 No. bad cc frames:                 153&lt;br /&gt;
 No. bad G frames) :                  0&lt;br /&gt;
 No. bad unit cell frames:            5&lt;br /&gt;
 No. bad gamma_e frames:              0&lt;br /&gt;
 No. bad SE:                          0&lt;br /&gt;
 No. observations:               466997&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Solving indexing ambiguity (New) == &lt;br /&gt;
With the latest version (Aug 31, 2016), you can now solve indexing ambiguity directly in prime. The Brehm &amp;amp; Diederichs algorhtms (doi:10.1107/S1399004713025431) have been implemented with boostrap capability to handle large dataset.&lt;br /&gt;
For merohedral twining group, the indexing choices will be determined automatically in prime. Use this default settings in your .phil input parameter file,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
indexing_ambiguity {&lt;br /&gt;
  mode = Auto&lt;br /&gt;
  index_basis_in = None&lt;br /&gt;
  assigned_basis = None&lt;br /&gt;
  n_sample_frames = 300&lt;br /&gt;
  n_selected_frames = 100&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
The n_sample_frames parameter indicates no. of images that will be used for the calculation of the scoring function. After that, only n_selected_images will be used in the B&amp;amp;D algorithms. This saves a lot of computing time since only the good images will be used for the determination of the ambiguity. You can change these two parameters to fit with your experiments. The default values are 300 and 100.&lt;br /&gt;
&lt;br /&gt;
For pseudo-merohedral twinning, due to different possibilities for the indexing choice, prime doesn&#039;t determine these choices automatically. If you suspect that you may have pseudo twinning (b and c are similar, beta angle is almost 90 degree but not quite), you have an option to force prime to determine the ambiguity according to your choices.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== More detail with input parameters ==&lt;br /&gt;
Now that you have your first trial merged data set, you can explore different parameter settings to merge or to obtain the Bijvoet pairs (I+/I-) for your anomalous data set.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Anomalous data:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
target_anomalous_flag = True&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
In the last cycle, prime will output a reflection set with I+ and I-.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Number of micro- and macrocycles&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
n_postref_cycle = 3&lt;br /&gt;
n_postref_sub_cycle = 1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Number of bins for merging statistics&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
n_bins = 20&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Help with input parameters ==&lt;br /&gt;
&lt;br /&gt;
Most input parameters are self-explained. However, you can run -h switch to view help information for each parameter.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.run -h&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Running in manual mode ==&lt;br /&gt;
With the same phil file, you can run prime manually. This gives you more freedom in terms of parameter settings at different stages (generating reference set, post-refining images, and merging) or at different cycle of post-refinement.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example A&#039;&#039;&#039;: I want to generate a reference set then post-refine all the images on the &#039;&#039;&#039;scale factors only&#039;&#039;&#039; for &#039;&#039;&#039;three cycles&#039;&#039;&#039; then refine &#039;&#039;&#039;all parameters&#039;&#039;&#039; in the &#039;&#039;&#039;4th cycle&#039;&#039;&#039;. To do this, you can follow these steps:&lt;br /&gt;
&lt;br /&gt;
To generate a reference set,&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.genref prime.phil&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
To post-refine on scale factors only, modify your .phil file so that all parameters are turned &#039;&#039;off&#039;&#039;.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
scale {&lt;br /&gt;
  d_min = 2.5&lt;br /&gt;
  d_max = 45&lt;br /&gt;
  sigma_min = 1.5&lt;br /&gt;
}&lt;br /&gt;
postref {&lt;br /&gt;
  residual_threshold = 5&lt;br /&gt;
  residual_threshold_xy = 5&lt;br /&gt;
  scale {&lt;br /&gt;
    d_min = 2.5&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
  }&lt;br /&gt;
  crystal_orientation {&lt;br /&gt;
    flag_on = False&lt;br /&gt;
    d_min = 2.5&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
  }&lt;br /&gt;
  reflecting_range {&lt;br /&gt;
    flag_on = False&lt;br /&gt;
    d_min = 2.5&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
  }&lt;br /&gt;
  unit_cell {&lt;br /&gt;
    flag_on = False&lt;br /&gt;
    d_min = 2.5&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
    uc_tolerance = 5&lt;br /&gt;
  }&lt;br /&gt;
  allparams {&lt;br /&gt;
    flag_on = False&lt;br /&gt;
    d_min = 2.5&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
    uc_tolerance = 5&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
...&lt;br /&gt;
n_postref_cycle = 3&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then run,&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.postrefine prime.phil&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
To refine all parameters one more cycle, update your .phil file again (flag_on = True)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
  allparams {&lt;br /&gt;
    flag_on = True&lt;br /&gt;
    d_min = 2.5&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
    uc_tolerance = 5&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
...&lt;br /&gt;
n_postref_cycle = 1&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then run,&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.postrefine prime.phil&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
To obtain the final merged mtz, run&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.merge prime.phil&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Running on multiple nodes ==&lt;br /&gt;
For LCLS users (or other users with LSF bsub), you can use psana (or your) queuing system to parallelize the entire process. For example, if you want to run your job on 100 nodes using psanq, you can specify:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
queue {&lt;br /&gt;
  mode = bsub&lt;br /&gt;
  qname = psanaq&lt;br /&gt;
  n_nodes = 100&lt;br /&gt;
}&lt;br /&gt;
timeout_seconds = 300&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Prime will divide all the images into 100 batches and submit them to different nodes. It will wait until all images in every batches are done before returning to the merging step (or the exit step in the manual mode). You can control timeout_seconds parameter to tell prime how long it should wait for all the image batches to finish. Usually, this timeout parameter is not used (all images should return before 300 seconds) but in case, you need to wait longer or shorter, you can modify this parameter.&lt;/div&gt;</summary>
		<author><name>Mona</name></author>
	</entry>
	<entry>
		<id>http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=Cctbx.prime&amp;diff=1283</id>
		<title>Cctbx.prime</title>
		<link rel="alternate" type="text/html" href="http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=Cctbx.prime&amp;diff=1283"/>
		<updated>2016-08-31T19:31:00Z</updated>

		<summary type="html">&lt;p&gt;Mona: /* Prime is gui-ed (new!) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Prime: &#039;&#039;&#039;p&#039;&#039;&#039;ost-&#039;&#039;&#039;r&#039;&#039;&#039;ef&#039;&#039;&#039;i&#039;&#039;&#039;nement and &#039;&#039;&#039;me&#039;&#039;&#039;rging ==&lt;br /&gt;
With the latest update, prime can be used to process data on multiple nodes (on a queuing system). At the moment, only LSF (bsub) is supported. See documentation below for more information on how to use the queuing system.&lt;br /&gt;
&lt;br /&gt;
This major update replaces prime.postrefine with &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.run &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For auto mode, you can still use prime.run with your parameter phil file like before. For manual mode, the available sub commands in prime are:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.genref #generates a reference set from given integration results&lt;br /&gt;
prime.postrefine #refines all images&lt;br /&gt;
prime.merge #merges all refined results for an mtz file&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can choose to run these commands independently (ideally in the above order) using the same phil file. See [https://commons.wikimedia.org/wiki/File:Prime_flowcharts.tif &amp;quot;PRIME flowchart&amp;quot;]. This will give you the freedom to change something (e.g. set of parameters to refine, resolution cut-off, etc.) at different stages of the post-refinement and merging. See running prime in manual mode for more detail.&lt;br /&gt;
&lt;br /&gt;
Step-by-step guidelines to post-refine and merge XFEL diffraction images. For more detail and citation, see &lt;br /&gt;
&amp;quot;Enabling X-ray Free Electron Laser Crystallography for Challenging Biological Systems from a Limited Number of Crystals&amp;quot;&lt;br /&gt;
[http://elifesciences.org/content/4/e05421 &amp;quot;DOI: http://dx.doi.org/10.7554/eLife.05421&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
== Prime is gui-ed == &lt;br /&gt;
Thanks to Dr. Lyubimov, PRIME is also available as a Graphic User Interface program. Try it by running&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Click to see [https://commons.wikimedia.org/wiki/File:PRIME_main.png &amp;quot;PRIME main gui&amp;quot;] and [https://commons.wikimedia.org/wiki/File:PRIME_advanced_options.png &amp;quot;Advanced options&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
== Getting started == &lt;br /&gt;
&#039;&#039;&#039;Generating input phil file&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
Like most programs developed under &#039;&#039;cctbx&#039;&#039; framework, &#039;&#039;prime&#039;&#039; reads in input .phil file, which stores all the parameters needed to run post-refinement and merging steps. To generate the template .phil file, do the dry run by calling&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ prime.run&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
An example of the template .phil file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
data = None&lt;br /&gt;
run_no = None&lt;br /&gt;
title = None&lt;br /&gt;
scale {&lt;br /&gt;
  d_min = 0.1&lt;br /&gt;
  d_max = 99&lt;br /&gt;
  sigma_min = 1.5&lt;br /&gt;
}&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can save the content of the output to any file name - in this tutorial, let&#039;s save it to thermolysin.phil.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;First look at your phil file&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
To run prime, set the required parameters to match with your experiments (you can leave other parameters with their default values - or just delete them from you .phil file). The most interesting parameters are shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
data = /path/to/your/integarion/result/pickle_files&lt;br /&gt;
run_no = 001&lt;br /&gt;
title = First trial for thermolysin&lt;br /&gt;
scale {&lt;br /&gt;
  d_min = 2.1&lt;br /&gt;
  d_max = 45&lt;br /&gt;
  sigma_min = 1.5&lt;br /&gt;
}&lt;br /&gt;
postref {&lt;br /&gt;
  scale {&lt;br /&gt;
    d_min = 2.1&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
  }&lt;br /&gt;
  crystal_orientation {&lt;br /&gt;
    flag_on = True&lt;br /&gt;
    d_min = 2.1&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
  }&lt;br /&gt;
  reflecting_range {&lt;br /&gt;
    flag_on = True&lt;br /&gt;
    d_min = 2.1&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
  }&lt;br /&gt;
  unit_cell {&lt;br /&gt;
    flag_on = True&lt;br /&gt;
    d_min = 2.1&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
    uc_tolerance = 3&lt;br /&gt;
  }&lt;br /&gt;
  allparams {&lt;br /&gt;
    flag_on = False&lt;br /&gt;
    d_min = 2.1&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
    uc_tolerance = 3&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
merge {&lt;br /&gt;
  d_min = 2.1&lt;br /&gt;
  d_max = 45&lt;br /&gt;
  sigma_min = 1.5&lt;br /&gt;
  partiality_min = 0.1&lt;br /&gt;
  uc_tolerance = 3&lt;br /&gt;
}&lt;br /&gt;
target_unit_cell = 93.99,93.99,130.87,90,90,120&lt;br /&gt;
target_space_group = P 61 2 2&lt;br /&gt;
pixel_size_mm = 0.102&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You should pay attention to d_min and d_max for the refinement and merging parameters. If you use IOTA to integrate the images, IOTA will output .phil file for prime that has the optimal resolution range. If not, a few trial-and-error runs may be required to get the best resolution range for your dataset. Use merging statistics output by prime and check the values of CC1/2 and I/sigI to find out your optimal resolution range.&lt;br /&gt;
&lt;br /&gt;
Cell parameters (target_unit_cell and target_space_group) are required to run prime. Target cell parameter is used to remove some outlier images by controlling uc_tolerance parameter (the default value of tolerate range is 3% different). Space group parameter is used in removing outliers and merging with the given symmetry.&lt;br /&gt;
&lt;br /&gt;
Don&#039;t forget also to change your pixel size in millimeters. Check what your detector is and note down its pixel size. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Running post-refinement in automatic mode&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
Once you have the input .phil file, you can run &#039;&#039;prime&#039;&#039; by calling&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.run thermolysin.phil&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;Prime&#039;&#039; will post-refine and merge for reflection sets using three (default value) macrocycles. At the end of the run, you can obtain merging statistics in the last cycle - all other cycle statistics are also available in log.txt.&lt;br /&gt;
&lt;br /&gt;
An example of merging statistics:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Summary for 001/postref_cycle_1_merge.mtz&lt;br /&gt;
Bin Resolution Range     Completeness      &amp;lt;N_obs&amp;gt;  |Rsplit  CC1/2  N_ind |CCanom   N_ind| &amp;lt;I/sigI&amp;gt;   &amp;lt;I&amp;gt;&lt;br /&gt;
-------------------------------------------------------------------------------------------------------------&lt;br /&gt;
02    5.70 -    4.52 100.0   1055 /   1055   65.89   16.02   89.15   1055    0.00      0    20.17    2101.97&lt;br /&gt;
03    4.52 -    3.95 100.0   1032 /   1032   61.53   14.48   92.03   1032    0.00      0    20.39    2529.90&lt;br /&gt;
04    3.95 -    3.59 100.0   1016 /   1016   54.15   15.61   90.13   1016    0.00      0    16.69    1971.43&lt;br /&gt;
05    3.59 -    3.33 100.0   1004 /   1004   42.67   17.66   89.23   1004    0.00      0    14.21    1502.14&lt;br /&gt;
06    3.33 -    3.14 100.0   1013 /   1013   32.77   20.40   84.26   1013    0.00      0    11.76    1077.60&lt;br /&gt;
07    3.14 -    2.98 100.0    995 /    995   27.36   23.00   78.72    995    0.00      0    11.58     935.37&lt;br /&gt;
08    2.98 -    2.85 100.0   1006 /   1006   23.57   22.63   82.26   1006    0.00      0    10.56     722.62&lt;br /&gt;
09    2.85 -    2.74 100.0    986 /    986   16.64   28.51   72.90    985    0.00      0    10.01     591.56&lt;br /&gt;
10    2.74 -    2.65  99.9    989 /    990   12.41   31.35   72.95    987    0.00      0     9.91     515.07&lt;br /&gt;
11    2.65 -    2.56  99.7    979 /    982    9.35   37.14   65.31    970    0.00      0     9.31     438.96&lt;br /&gt;
12    2.56 -    2.49  98.0    979 /    999    6.06   45.98   45.37    930    0.00      0     9.45     390.05&lt;br /&gt;
13    2.49 -    2.42  95.1    931 /    979    4.46   50.68   34.20    834    0.00      0     8.93     334.80&lt;br /&gt;
14    2.42 -    2.37  91.7    896 /    977    3.35   55.66   37.15    729    0.00      0     9.27     320.17&lt;br /&gt;
15    2.37 -    2.31  83.9    829 /    988    2.61   56.92   43.21    600    0.00      0     9.60     296.67&lt;br /&gt;
16    2.31 -    2.26  72.4    702 /    969    1.97   65.81   26.89    386    0.00      0    10.29     284.39&lt;br /&gt;
17    2.26 -    2.22  59.1    582 /    985    1.75   64.72   31.28    275    0.00      0     9.87     284.06&lt;br /&gt;
18    2.22 -    2.18  52.9    513 /    970    1.51   71.27   16.86    188    0.00      0     8.93     215.31&lt;br /&gt;
19    2.18 -    2.14  35.7    349 /    978    1.32   62.26   68.25     90    0.00      0     8.22     199.09&lt;br /&gt;
20    2.14 -    2.10  23.1    227 /    981    1.20   92.14   -9.20     42    0.00      0     8.59     224.44&lt;br /&gt;
-------------------------------------------------------------------------------------------------------------&lt;br /&gt;
        TOTAL         85.9  17224 /  20046   27.11   21.11   92.07  15305    0.00      0    12.87     999.53&lt;br /&gt;
-------------------------------------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
Summary of refinement and merging&lt;br /&gt;
 No. good frames:                  1809&lt;br /&gt;
 No. bad cc frames:                 153&lt;br /&gt;
 No. bad G frames) :                  0&lt;br /&gt;
 No. bad unit cell frames:            5&lt;br /&gt;
 No. bad gamma_e frames:              0&lt;br /&gt;
 No. bad SE:                          0&lt;br /&gt;
 No. observations:               466997&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== More detail with input parameters ==&lt;br /&gt;
Now that you have your first trial merged data set, you can explore different parameter settings to merge or to obtain the Bijvoet pairs (I+/I-) for your anomalous data set.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Anomalous data:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
target_anomalous_flag = True&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
In the last cycle, prime will output a reflection set with I+ and I-.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Indexing ambiguity&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For space groups with indexing ambiguity, use the solutions from cctbx.xfel (see Tutorial for resolving indexing ambiguity) to merge the data set.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
indexing_ambiguity {&lt;br /&gt;
  flag_on = True&lt;br /&gt;
  index_basis_in = /path/to/solution/pickle_file.pickle&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Number of micro- and macrocycles&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
n_postref_cycle = 3&lt;br /&gt;
n_postref_sub_cycle = 3&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Number of bins for merging statistics&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
n_bins = 20&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Help with input parameters ==&lt;br /&gt;
&lt;br /&gt;
Most input parameters are self-explained. However, you can run -h switch to view help information for each parameter.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.run -h&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Running in manual mode ==&lt;br /&gt;
With the same phil file, you can run prime manually. This gives you more freedom in terms of parameter settings at different stages (generating reference set, post-refining images, and merging) or at different cycle of post-refinement.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example A&#039;&#039;&#039;: I want to generate a reference set then post-refine all the images on the &#039;&#039;&#039;scale factors only&#039;&#039;&#039; for &#039;&#039;&#039;three cycles&#039;&#039;&#039; then refine &#039;&#039;&#039;all parameters&#039;&#039;&#039; in the &#039;&#039;&#039;4th cycle&#039;&#039;&#039;. To do this, you can follow these steps:&lt;br /&gt;
&lt;br /&gt;
To generate a reference set,&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.genref prime.phil&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
To post-refine on scale factors only, modify your .phil file so that all parameters are turned &#039;&#039;off&#039;&#039;.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
scale {&lt;br /&gt;
  d_min = 2.5&lt;br /&gt;
  d_max = 45&lt;br /&gt;
  sigma_min = 1.5&lt;br /&gt;
}&lt;br /&gt;
postref {&lt;br /&gt;
  residual_threshold = 5&lt;br /&gt;
  residual_threshold_xy = 5&lt;br /&gt;
  scale {&lt;br /&gt;
    d_min = 2.5&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
  }&lt;br /&gt;
  crystal_orientation {&lt;br /&gt;
    flag_on = False&lt;br /&gt;
    d_min = 2.5&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
  }&lt;br /&gt;
  reflecting_range {&lt;br /&gt;
    flag_on = False&lt;br /&gt;
    d_min = 2.5&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
  }&lt;br /&gt;
  unit_cell {&lt;br /&gt;
    flag_on = False&lt;br /&gt;
    d_min = 2.5&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
    uc_tolerance = 5&lt;br /&gt;
  }&lt;br /&gt;
  allparams {&lt;br /&gt;
    flag_on = False&lt;br /&gt;
    d_min = 2.5&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
    uc_tolerance = 5&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
...&lt;br /&gt;
n_postref_cycle = 3&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then run,&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.postrefine prime.phil&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
To refine all parameters one more cycle, update your .phil file again (flag_on = True)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
  allparams {&lt;br /&gt;
    flag_on = True&lt;br /&gt;
    d_min = 2.5&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
    uc_tolerance = 5&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
...&lt;br /&gt;
n_postref_cycle = 1&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then run,&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.postrefine prime.phil&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
To obtain the final merged mtz, run&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.merge prime.phil&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Running on multiple nodes ==&lt;br /&gt;
For LCLS users (or other users with LSF bsub), you can use psana (or your) queuing system to parallelize the entire process. For example, if you want to run your job on 100 nodes using psanq, you can specify:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
queue {&lt;br /&gt;
  mode = bsub&lt;br /&gt;
  qname = psanaq&lt;br /&gt;
  n_nodes = 100&lt;br /&gt;
}&lt;br /&gt;
timeout_seconds = 300&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Prime will divide all the images into 100 batches and submit them to different nodes. It will wait until all images in every batches are done before returning to the merging step (or the exit step in the manual mode). You can control timeout_seconds parameter to tell prime how long it should wait for all the image batches to finish. Usually, this timeout parameter is not used (all images should return before 300 seconds) but in case, you need to wait longer or shorter, you can modify this parameter.&lt;/div&gt;</summary>
		<author><name>Mona</name></author>
	</entry>
	<entry>
		<id>http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=Cctbx.prime&amp;diff=1239</id>
		<title>Cctbx.prime</title>
		<link rel="alternate" type="text/html" href="http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=Cctbx.prime&amp;diff=1239"/>
		<updated>2016-08-02T01:06:12Z</updated>

		<summary type="html">&lt;p&gt;Mona: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Prime: &#039;&#039;&#039;p&#039;&#039;&#039;ost-&#039;&#039;&#039;r&#039;&#039;&#039;ef&#039;&#039;&#039;i&#039;&#039;&#039;nement and &#039;&#039;&#039;me&#039;&#039;&#039;rging ==&lt;br /&gt;
With the latest update, prime can be used to process data on multiple nodes (on a queuing system). At the moment, only LSF (bsub) is supported. See documentation below for more information on how to use the queuing system.&lt;br /&gt;
&lt;br /&gt;
This major update replaces prime.postrefine with &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.run &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For auto mode, you can still use prime.run with your parameter phil file like before. For manual mode, the available sub commands in prime are:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.genref #generates a reference set from given integration results&lt;br /&gt;
prime.postrefine #refines all images&lt;br /&gt;
prime.merge #merges all refined results for an mtz file&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can choose to run these commands independently (ideally in the above order) using the same phil file. See [https://commons.wikimedia.org/wiki/File:Prime_flowcharts.tif &amp;quot;PRIME flowchart&amp;quot;]. This will give you the freedom to change something (e.g. set of parameters to refine, resolution cut-off, etc.) at different stages of the post-refinement and merging. See running prime in manual mode for more detail.&lt;br /&gt;
&lt;br /&gt;
Step-by-step guidelines to post-refine and merge XFEL diffraction images. For more detail and citation, see &lt;br /&gt;
&amp;quot;Enabling X-ray Free Electron Laser Crystallography for Challenging Biological Systems from a Limited Number of Crystals&amp;quot;&lt;br /&gt;
[http://elifesciences.org/content/4/e05421 &amp;quot;DOI: http://dx.doi.org/10.7554/eLife.05421&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
== Prime is gui-ed (new!)== &lt;br /&gt;
Thanks to Dr. Lyubimov, PRIME is also available as a Graphic User Interface program. Try it by running&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Click to see [https://commons.wikimedia.org/wiki/File:PRIME_main.png &amp;quot;PRIME main gui&amp;quot;] and [https://commons.wikimedia.org/wiki/File:PRIME_advanced_options.png &amp;quot;Advanced options&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
== Getting started == &lt;br /&gt;
&#039;&#039;&#039;Generating input phil file&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
Like most programs developed under &#039;&#039;cctbx&#039;&#039; framework, &#039;&#039;prime&#039;&#039; reads in input .phil file, which stores all the parameters needed to run post-refinement and merging steps. To generate the template .phil file, do the dry run by calling&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ prime.run&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
An example of the template .phil file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
data = None&lt;br /&gt;
run_no = None&lt;br /&gt;
title = None&lt;br /&gt;
scale {&lt;br /&gt;
  d_min = 0.1&lt;br /&gt;
  d_max = 99&lt;br /&gt;
  sigma_min = 1.5&lt;br /&gt;
}&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can save the content of the output to any file name - in this tutorial, let&#039;s save it to thermolysin.phil.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;First look at your phil file&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
To run prime, set the required parameters to match with your experiments (you can leave other parameters with their default values - or just delete them from you .phil file). The most interesting parameters are shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
data = /path/to/your/integarion/result/pickle_files&lt;br /&gt;
run_no = 001&lt;br /&gt;
title = First trial for thermolysin&lt;br /&gt;
scale {&lt;br /&gt;
  d_min = 2.1&lt;br /&gt;
  d_max = 45&lt;br /&gt;
  sigma_min = 1.5&lt;br /&gt;
}&lt;br /&gt;
postref {&lt;br /&gt;
  scale {&lt;br /&gt;
    d_min = 2.1&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
  }&lt;br /&gt;
  crystal_orientation {&lt;br /&gt;
    flag_on = True&lt;br /&gt;
    d_min = 2.1&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
  }&lt;br /&gt;
  reflecting_range {&lt;br /&gt;
    flag_on = True&lt;br /&gt;
    d_min = 2.1&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
  }&lt;br /&gt;
  unit_cell {&lt;br /&gt;
    flag_on = True&lt;br /&gt;
    d_min = 2.1&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
    uc_tolerance = 3&lt;br /&gt;
  }&lt;br /&gt;
  allparams {&lt;br /&gt;
    flag_on = False&lt;br /&gt;
    d_min = 2.1&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
    uc_tolerance = 3&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
merge {&lt;br /&gt;
  d_min = 2.1&lt;br /&gt;
  d_max = 45&lt;br /&gt;
  sigma_min = 1.5&lt;br /&gt;
  partiality_min = 0.1&lt;br /&gt;
  uc_tolerance = 3&lt;br /&gt;
}&lt;br /&gt;
target_unit_cell = 93.99,93.99,130.87,90,90,120&lt;br /&gt;
target_space_group = P 61 2 2&lt;br /&gt;
pixel_size_mm = 0.102&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You should pay attention to d_min and d_max for the refinement and merging parameters. If you use IOTA to integrate the images, IOTA will output .phil file for prime that has the optimal resolution range. If not, a few trial-and-error runs may be required to get the best resolution range for your dataset. Use merging statistics output by prime and check the values of CC1/2 and I/sigI to find out your optimal resolution range.&lt;br /&gt;
&lt;br /&gt;
Cell parameters (target_unit_cell and target_space_group) are required to run prime. Target cell parameter is used to remove some outlier images by controlling uc_tolerance parameter (the default value of tolerate range is 3% different). Space group parameter is used in removing outliers and merging with the given symmetry.&lt;br /&gt;
&lt;br /&gt;
Don&#039;t forget also to change your pixel size in millimeters. Check what your detector is and note down its pixel size. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Running post-refinement in automatic mode&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
Once you have the input .phil file, you can run &#039;&#039;prime&#039;&#039; by calling&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.run thermolysin.phil&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;Prime&#039;&#039; will post-refine and merge for reflection sets using three (default value) macrocycles. At the end of the run, you can obtain merging statistics in the last cycle - all other cycle statistics are also available in log.txt.&lt;br /&gt;
&lt;br /&gt;
An example of merging statistics:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Summary for 001/postref_cycle_1_merge.mtz&lt;br /&gt;
Bin Resolution Range     Completeness      &amp;lt;N_obs&amp;gt;  |Rsplit  CC1/2  N_ind |CCanom   N_ind| &amp;lt;I/sigI&amp;gt;   &amp;lt;I&amp;gt;&lt;br /&gt;
-------------------------------------------------------------------------------------------------------------&lt;br /&gt;
02    5.70 -    4.52 100.0   1055 /   1055   65.89   16.02   89.15   1055    0.00      0    20.17    2101.97&lt;br /&gt;
03    4.52 -    3.95 100.0   1032 /   1032   61.53   14.48   92.03   1032    0.00      0    20.39    2529.90&lt;br /&gt;
04    3.95 -    3.59 100.0   1016 /   1016   54.15   15.61   90.13   1016    0.00      0    16.69    1971.43&lt;br /&gt;
05    3.59 -    3.33 100.0   1004 /   1004   42.67   17.66   89.23   1004    0.00      0    14.21    1502.14&lt;br /&gt;
06    3.33 -    3.14 100.0   1013 /   1013   32.77   20.40   84.26   1013    0.00      0    11.76    1077.60&lt;br /&gt;
07    3.14 -    2.98 100.0    995 /    995   27.36   23.00   78.72    995    0.00      0    11.58     935.37&lt;br /&gt;
08    2.98 -    2.85 100.0   1006 /   1006   23.57   22.63   82.26   1006    0.00      0    10.56     722.62&lt;br /&gt;
09    2.85 -    2.74 100.0    986 /    986   16.64   28.51   72.90    985    0.00      0    10.01     591.56&lt;br /&gt;
10    2.74 -    2.65  99.9    989 /    990   12.41   31.35   72.95    987    0.00      0     9.91     515.07&lt;br /&gt;
11    2.65 -    2.56  99.7    979 /    982    9.35   37.14   65.31    970    0.00      0     9.31     438.96&lt;br /&gt;
12    2.56 -    2.49  98.0    979 /    999    6.06   45.98   45.37    930    0.00      0     9.45     390.05&lt;br /&gt;
13    2.49 -    2.42  95.1    931 /    979    4.46   50.68   34.20    834    0.00      0     8.93     334.80&lt;br /&gt;
14    2.42 -    2.37  91.7    896 /    977    3.35   55.66   37.15    729    0.00      0     9.27     320.17&lt;br /&gt;
15    2.37 -    2.31  83.9    829 /    988    2.61   56.92   43.21    600    0.00      0     9.60     296.67&lt;br /&gt;
16    2.31 -    2.26  72.4    702 /    969    1.97   65.81   26.89    386    0.00      0    10.29     284.39&lt;br /&gt;
17    2.26 -    2.22  59.1    582 /    985    1.75   64.72   31.28    275    0.00      0     9.87     284.06&lt;br /&gt;
18    2.22 -    2.18  52.9    513 /    970    1.51   71.27   16.86    188    0.00      0     8.93     215.31&lt;br /&gt;
19    2.18 -    2.14  35.7    349 /    978    1.32   62.26   68.25     90    0.00      0     8.22     199.09&lt;br /&gt;
20    2.14 -    2.10  23.1    227 /    981    1.20   92.14   -9.20     42    0.00      0     8.59     224.44&lt;br /&gt;
-------------------------------------------------------------------------------------------------------------&lt;br /&gt;
        TOTAL         85.9  17224 /  20046   27.11   21.11   92.07  15305    0.00      0    12.87     999.53&lt;br /&gt;
-------------------------------------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
Summary of refinement and merging&lt;br /&gt;
 No. good frames:                  1809&lt;br /&gt;
 No. bad cc frames:                 153&lt;br /&gt;
 No. bad G frames) :                  0&lt;br /&gt;
 No. bad unit cell frames:            5&lt;br /&gt;
 No. bad gamma_e frames:              0&lt;br /&gt;
 No. bad SE:                          0&lt;br /&gt;
 No. observations:               466997&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== More detail with input parameters ==&lt;br /&gt;
Now that you have your first trial merged data set, you can explore different parameter settings to merge or to obtain the Bijvoet pairs (I+/I-) for your anomalous data set.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Anomalous data:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
target_anomalous_flag = True&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
In the last cycle, prime will output a reflection set with I+ and I-.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Indexing ambiguity&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For space groups with indexing ambiguity, use the solutions from cctbx.xfel (see Tutorial for resolving indexing ambiguity) to merge the data set.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
indexing_ambiguity {&lt;br /&gt;
  flag_on = True&lt;br /&gt;
  index_basis_in = /path/to/solution/pickle_file.pickle&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Number of micro- and macrocycles&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
n_postref_cycle = 3&lt;br /&gt;
n_postref_sub_cycle = 3&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Number of bins for merging statistics&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
n_bins = 20&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Help with input parameters ==&lt;br /&gt;
&lt;br /&gt;
Most input parameters are self-explained. However, you can run -h switch to view help information for each parameter.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.run -h&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Running in manual mode ==&lt;br /&gt;
With the same phil file, you can run prime manually. This gives you more freedom in terms of parameter settings at different stages (generating reference set, post-refining images, and merging) or at different cycle of post-refinement.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example A&#039;&#039;&#039;: I want to generate a reference set then post-refine all the images on the &#039;&#039;&#039;scale factors only&#039;&#039;&#039; for &#039;&#039;&#039;three cycles&#039;&#039;&#039; then refine &#039;&#039;&#039;all parameters&#039;&#039;&#039; in the &#039;&#039;&#039;4th cycle&#039;&#039;&#039;. To do this, you can follow these steps:&lt;br /&gt;
&lt;br /&gt;
To generate a reference set,&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.genref prime.phil&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
To post-refine on scale factors only, modify your .phil file so that all parameters are turned &#039;&#039;off&#039;&#039;.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
scale {&lt;br /&gt;
  d_min = 2.5&lt;br /&gt;
  d_max = 45&lt;br /&gt;
  sigma_min = 1.5&lt;br /&gt;
}&lt;br /&gt;
postref {&lt;br /&gt;
  residual_threshold = 5&lt;br /&gt;
  residual_threshold_xy = 5&lt;br /&gt;
  scale {&lt;br /&gt;
    d_min = 2.5&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
  }&lt;br /&gt;
  crystal_orientation {&lt;br /&gt;
    flag_on = False&lt;br /&gt;
    d_min = 2.5&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
  }&lt;br /&gt;
  reflecting_range {&lt;br /&gt;
    flag_on = False&lt;br /&gt;
    d_min = 2.5&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
  }&lt;br /&gt;
  unit_cell {&lt;br /&gt;
    flag_on = False&lt;br /&gt;
    d_min = 2.5&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
    uc_tolerance = 5&lt;br /&gt;
  }&lt;br /&gt;
  allparams {&lt;br /&gt;
    flag_on = False&lt;br /&gt;
    d_min = 2.5&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
    uc_tolerance = 5&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
...&lt;br /&gt;
n_postref_cycle = 3&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then run,&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.postrefine prime.phil&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
To refine all parameters one more cycle, update your .phil file again (flag_on = True)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
  allparams {&lt;br /&gt;
    flag_on = True&lt;br /&gt;
    d_min = 2.5&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
    uc_tolerance = 5&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
...&lt;br /&gt;
n_postref_cycle = 1&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then run,&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.postrefine prime.phil&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
To obtain the final merged mtz, run&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.merge prime.phil&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Running on multiple nodes ==&lt;br /&gt;
For LCLS users (or other users with LSF bsub), you can use psana (or your) queuing system to parallelize the entire process. For example, if you want to run your job on 100 nodes using psanq, you can specify:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
queue {&lt;br /&gt;
  mode = bsub&lt;br /&gt;
  qname = psanaq&lt;br /&gt;
  n_nodes = 100&lt;br /&gt;
}&lt;br /&gt;
timeout_seconds = 300&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Prime will divide all the images into 100 batches and submit them to different nodes. It will wait until all images in every batches are done before returning to the merging step (or the exit step in the manual mode). You can control timeout_seconds parameter to tell prime how long it should wait for all the image batches to finish. Usually, this timeout parameter is not used (all images should return before 300 seconds) but in case, you need to wait longer or shorter, you can modify this parameter.&lt;/div&gt;</summary>
		<author><name>Mona</name></author>
	</entry>
	<entry>
		<id>http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=Cctbx.prime&amp;diff=1238</id>
		<title>Cctbx.prime</title>
		<link rel="alternate" type="text/html" href="http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=Cctbx.prime&amp;diff=1238"/>
		<updated>2016-08-02T01:05:46Z</updated>

		<summary type="html">&lt;p&gt;Mona: /* Prime: post-refinement and merging */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Prime: &#039;&#039;&#039;p&#039;&#039;&#039;ost-&#039;&#039;&#039;r&#039;&#039;&#039;ef&#039;&#039;&#039;i&#039;&#039;&#039;nement and &#039;&#039;&#039;me&#039;&#039;&#039;rging ==&lt;br /&gt;
With the latest update, prime can be used to process data on multiple nodes (on a queuing system). At the moment, only LSF (bsub) is supported. See documentation below for more information how to use the queuing system.&lt;br /&gt;
&lt;br /&gt;
This major update replaces prime.postrefine with &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.run &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For auto mode, you can still use prime.run with your parameter phil file like before. For manual mode, the available sub commands in prime are:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.genref #generates a reference set from given integration results&lt;br /&gt;
prime.postrefine #refines all images&lt;br /&gt;
prime.merge #merges all refined results for an mtz file&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can choose to run these commands independently (ideally in the above order) using the same phil file. See [https://commons.wikimedia.org/wiki/File:Prime_flowcharts.tif &amp;quot;PRIME flowchart&amp;quot;]. This will give you the freedom to change something (e.g. set of parameters to refine, resolution cut-off, etc.) at different stages of the post-refinement and merging. See running prime in manual mode for more detail.&lt;br /&gt;
&lt;br /&gt;
Step-by-step guidelines to post-refine and merge XFEL diffraction images. For more detail and citation, see &lt;br /&gt;
&amp;quot;Enabling X-ray Free Electron Laser Crystallography for Challenging Biological Systems from a Limited Number of Crystals&amp;quot;&lt;br /&gt;
[http://elifesciences.org/content/4/e05421 &amp;quot;DOI: http://dx.doi.org/10.7554/eLife.05421&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
== Prime is gui-ed (new!)== &lt;br /&gt;
Thanks to Dr. Lyubimov, PRIME is also available as a Graphic User Interface program. Try it by running&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Click to see [https://commons.wikimedia.org/wiki/File:PRIME_main.png &amp;quot;PRIME main gui&amp;quot;] and [https://commons.wikimedia.org/wiki/File:PRIME_advanced_options.png &amp;quot;Advanced options&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
== Getting started == &lt;br /&gt;
&#039;&#039;&#039;Generating input phil file&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
Like most programs developed under &#039;&#039;cctbx&#039;&#039; framework, &#039;&#039;prime&#039;&#039; reads in input .phil file, which stores all the parameters needed to run post-refinement and merging steps. To generate the template .phil file, do the dry run by calling&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ prime.run&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
An example of the template .phil file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
data = None&lt;br /&gt;
run_no = None&lt;br /&gt;
title = None&lt;br /&gt;
scale {&lt;br /&gt;
  d_min = 0.1&lt;br /&gt;
  d_max = 99&lt;br /&gt;
  sigma_min = 1.5&lt;br /&gt;
}&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can save the content of the output to any file name - in this tutorial, let&#039;s save it to thermolysin.phil.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;First look at your phil file&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
To run prime, set the required parameters to match with your experiments (you can leave other parameters with their default values - or just delete them from you .phil file). The most interesting parameters are shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
data = /path/to/your/integarion/result/pickle_files&lt;br /&gt;
run_no = 001&lt;br /&gt;
title = First trial for thermolysin&lt;br /&gt;
scale {&lt;br /&gt;
  d_min = 2.1&lt;br /&gt;
  d_max = 45&lt;br /&gt;
  sigma_min = 1.5&lt;br /&gt;
}&lt;br /&gt;
postref {&lt;br /&gt;
  scale {&lt;br /&gt;
    d_min = 2.1&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
  }&lt;br /&gt;
  crystal_orientation {&lt;br /&gt;
    flag_on = True&lt;br /&gt;
    d_min = 2.1&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
  }&lt;br /&gt;
  reflecting_range {&lt;br /&gt;
    flag_on = True&lt;br /&gt;
    d_min = 2.1&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
  }&lt;br /&gt;
  unit_cell {&lt;br /&gt;
    flag_on = True&lt;br /&gt;
    d_min = 2.1&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
    uc_tolerance = 3&lt;br /&gt;
  }&lt;br /&gt;
  allparams {&lt;br /&gt;
    flag_on = False&lt;br /&gt;
    d_min = 2.1&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
    uc_tolerance = 3&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
merge {&lt;br /&gt;
  d_min = 2.1&lt;br /&gt;
  d_max = 45&lt;br /&gt;
  sigma_min = 1.5&lt;br /&gt;
  partiality_min = 0.1&lt;br /&gt;
  uc_tolerance = 3&lt;br /&gt;
}&lt;br /&gt;
target_unit_cell = 93.99,93.99,130.87,90,90,120&lt;br /&gt;
target_space_group = P 61 2 2&lt;br /&gt;
pixel_size_mm = 0.102&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You should pay attention to d_min and d_max for the refinement and merging parameters. If you use IOTA to integrate the images, IOTA will output .phil file for prime that has the optimal resolution range. If not, a few trial-and-error runs may be required to get the best resolution range for your dataset. Use merging statistics output by prime and check the values of CC1/2 and I/sigI to find out your optimal resolution range.&lt;br /&gt;
&lt;br /&gt;
Cell parameters (target_unit_cell and target_space_group) are required to run prime. Target cell parameter is used to remove some outlier images by controlling uc_tolerance parameter (the default value of tolerate range is 3% different). Space group parameter is used in removing outliers and merging with the given symmetry.&lt;br /&gt;
&lt;br /&gt;
Don&#039;t forget also to change your pixel size in millimeters. Check what your detector is and note down its pixel size. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Running post-refinement in automatic mode&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
Once you have the input .phil file, you can run &#039;&#039;prime&#039;&#039; by calling&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.run thermolysin.phil&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;Prime&#039;&#039; will post-refine and merge for reflection sets using three (default value) macrocycles. At the end of the run, you can obtain merging statistics in the last cycle - all other cycle statistics are also available in log.txt.&lt;br /&gt;
&lt;br /&gt;
An example of merging statistics:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Summary for 001/postref_cycle_1_merge.mtz&lt;br /&gt;
Bin Resolution Range     Completeness      &amp;lt;N_obs&amp;gt;  |Rsplit  CC1/2  N_ind |CCanom   N_ind| &amp;lt;I/sigI&amp;gt;   &amp;lt;I&amp;gt;&lt;br /&gt;
-------------------------------------------------------------------------------------------------------------&lt;br /&gt;
02    5.70 -    4.52 100.0   1055 /   1055   65.89   16.02   89.15   1055    0.00      0    20.17    2101.97&lt;br /&gt;
03    4.52 -    3.95 100.0   1032 /   1032   61.53   14.48   92.03   1032    0.00      0    20.39    2529.90&lt;br /&gt;
04    3.95 -    3.59 100.0   1016 /   1016   54.15   15.61   90.13   1016    0.00      0    16.69    1971.43&lt;br /&gt;
05    3.59 -    3.33 100.0   1004 /   1004   42.67   17.66   89.23   1004    0.00      0    14.21    1502.14&lt;br /&gt;
06    3.33 -    3.14 100.0   1013 /   1013   32.77   20.40   84.26   1013    0.00      0    11.76    1077.60&lt;br /&gt;
07    3.14 -    2.98 100.0    995 /    995   27.36   23.00   78.72    995    0.00      0    11.58     935.37&lt;br /&gt;
08    2.98 -    2.85 100.0   1006 /   1006   23.57   22.63   82.26   1006    0.00      0    10.56     722.62&lt;br /&gt;
09    2.85 -    2.74 100.0    986 /    986   16.64   28.51   72.90    985    0.00      0    10.01     591.56&lt;br /&gt;
10    2.74 -    2.65  99.9    989 /    990   12.41   31.35   72.95    987    0.00      0     9.91     515.07&lt;br /&gt;
11    2.65 -    2.56  99.7    979 /    982    9.35   37.14   65.31    970    0.00      0     9.31     438.96&lt;br /&gt;
12    2.56 -    2.49  98.0    979 /    999    6.06   45.98   45.37    930    0.00      0     9.45     390.05&lt;br /&gt;
13    2.49 -    2.42  95.1    931 /    979    4.46   50.68   34.20    834    0.00      0     8.93     334.80&lt;br /&gt;
14    2.42 -    2.37  91.7    896 /    977    3.35   55.66   37.15    729    0.00      0     9.27     320.17&lt;br /&gt;
15    2.37 -    2.31  83.9    829 /    988    2.61   56.92   43.21    600    0.00      0     9.60     296.67&lt;br /&gt;
16    2.31 -    2.26  72.4    702 /    969    1.97   65.81   26.89    386    0.00      0    10.29     284.39&lt;br /&gt;
17    2.26 -    2.22  59.1    582 /    985    1.75   64.72   31.28    275    0.00      0     9.87     284.06&lt;br /&gt;
18    2.22 -    2.18  52.9    513 /    970    1.51   71.27   16.86    188    0.00      0     8.93     215.31&lt;br /&gt;
19    2.18 -    2.14  35.7    349 /    978    1.32   62.26   68.25     90    0.00      0     8.22     199.09&lt;br /&gt;
20    2.14 -    2.10  23.1    227 /    981    1.20   92.14   -9.20     42    0.00      0     8.59     224.44&lt;br /&gt;
-------------------------------------------------------------------------------------------------------------&lt;br /&gt;
        TOTAL         85.9  17224 /  20046   27.11   21.11   92.07  15305    0.00      0    12.87     999.53&lt;br /&gt;
-------------------------------------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
Summary of refinement and merging&lt;br /&gt;
 No. good frames:                  1809&lt;br /&gt;
 No. bad cc frames:                 153&lt;br /&gt;
 No. bad G frames) :                  0&lt;br /&gt;
 No. bad unit cell frames:            5&lt;br /&gt;
 No. bad gamma_e frames:              0&lt;br /&gt;
 No. bad SE:                          0&lt;br /&gt;
 No. observations:               466997&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== More detail with input parameters ==&lt;br /&gt;
Now that you have your first trial merged data set, you can explore different parameter settings to merge or to obtain the Bijvoet pairs (I+/I-) for your anomalous data set.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Anomalous data:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
target_anomalous_flag = True&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
In the last cycle, prime will output a reflection set with I+ and I-.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Indexing ambiguity&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For space groups with indexing ambiguity, use the solutions from cctbx.xfel (see Tutorial for resolving indexing ambiguity) to merge the data set.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
indexing_ambiguity {&lt;br /&gt;
  flag_on = True&lt;br /&gt;
  index_basis_in = /path/to/solution/pickle_file.pickle&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Number of micro- and macrocycles&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
n_postref_cycle = 3&lt;br /&gt;
n_postref_sub_cycle = 3&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Number of bins for merging statistics&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
n_bins = 20&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Help with input parameters ==&lt;br /&gt;
&lt;br /&gt;
Most input parameters are self-explained. However, you can run -h switch to view help information for each parameter.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.run -h&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Running in manual mode ==&lt;br /&gt;
With the same phil file, you can run prime manually. This gives you more freedom in terms of parameter settings at different stages (generating reference set, post-refining images, and merging) or at different cycle of post-refinement.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example A&#039;&#039;&#039;: I want to generate a reference set then post-refine all the images on the &#039;&#039;&#039;scale factors only&#039;&#039;&#039; for &#039;&#039;&#039;three cycles&#039;&#039;&#039; then refine &#039;&#039;&#039;all parameters&#039;&#039;&#039; in the &#039;&#039;&#039;4th cycle&#039;&#039;&#039;. To do this, you can follow these steps:&lt;br /&gt;
&lt;br /&gt;
To generate a reference set,&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.genref prime.phil&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
To post-refine on scale factors only, modify your .phil file so that all parameters are turned &#039;&#039;off&#039;&#039;.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
scale {&lt;br /&gt;
  d_min = 2.5&lt;br /&gt;
  d_max = 45&lt;br /&gt;
  sigma_min = 1.5&lt;br /&gt;
}&lt;br /&gt;
postref {&lt;br /&gt;
  residual_threshold = 5&lt;br /&gt;
  residual_threshold_xy = 5&lt;br /&gt;
  scale {&lt;br /&gt;
    d_min = 2.5&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
  }&lt;br /&gt;
  crystal_orientation {&lt;br /&gt;
    flag_on = False&lt;br /&gt;
    d_min = 2.5&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
  }&lt;br /&gt;
  reflecting_range {&lt;br /&gt;
    flag_on = False&lt;br /&gt;
    d_min = 2.5&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
  }&lt;br /&gt;
  unit_cell {&lt;br /&gt;
    flag_on = False&lt;br /&gt;
    d_min = 2.5&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
    uc_tolerance = 5&lt;br /&gt;
  }&lt;br /&gt;
  allparams {&lt;br /&gt;
    flag_on = False&lt;br /&gt;
    d_min = 2.5&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
    uc_tolerance = 5&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
...&lt;br /&gt;
n_postref_cycle = 3&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then run,&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.postrefine prime.phil&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
To refine all parameters one more cycle, update your .phil file again (flag_on = True)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
  allparams {&lt;br /&gt;
    flag_on = True&lt;br /&gt;
    d_min = 2.5&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
    uc_tolerance = 5&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
...&lt;br /&gt;
n_postref_cycle = 1&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then run,&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.postrefine prime.phil&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
To obtain the final merged mtz, run&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.merge prime.phil&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Running on multiple nodes ==&lt;br /&gt;
For LCLS users (or other users with LSF bsub), you can use psana (or your) queuing system to parallelize the entire process. For example, if you want to run your job on 100 nodes using psanq, you can specify:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
queue {&lt;br /&gt;
  mode = bsub&lt;br /&gt;
  qname = psanaq&lt;br /&gt;
  n_nodes = 100&lt;br /&gt;
}&lt;br /&gt;
timeout_seconds = 300&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Prime will divide all the images into 100 batches and submit them to different nodes. It will wait until all images in every batches are done before returning to the merging step (or the exit step in the manual mode). You can control timeout_seconds parameter to tell prime how long it should wait for all the image batches to finish. Usually, this timeout parameter is not used (all images should return before 300 seconds) but in case, you need to wait longer or shorter, you can modify this parameter.&lt;/div&gt;</summary>
		<author><name>Mona</name></author>
	</entry>
	<entry>
		<id>http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=Cctbx.prime&amp;diff=1237</id>
		<title>Cctbx.prime</title>
		<link rel="alternate" type="text/html" href="http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=Cctbx.prime&amp;diff=1237"/>
		<updated>2016-08-02T00:34:15Z</updated>

		<summary type="html">&lt;p&gt;Mona: /* Prime: post-refinement and merging */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Prime: &#039;&#039;&#039;p&#039;&#039;&#039;ost-&#039;&#039;&#039;r&#039;&#039;&#039;ef&#039;&#039;&#039;i&#039;&#039;&#039;nement and &#039;&#039;&#039;me&#039;&#039;&#039;rging ==&lt;br /&gt;
With the latest update, prime can be used to process data on multiple nodes (on queuing system). At the moment, only LSF (bsub) is supported. See documentation below for more information how to use the queuing system.&lt;br /&gt;
&lt;br /&gt;
This major update replaces prime.postrefine with &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.run &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For auto mode, you can still use prime.run with your parameter phil file like before. For manual mode, the available sub commands in prime are:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.genref #generates a reference set from given integration results&lt;br /&gt;
prime.postrefine #refines all images&lt;br /&gt;
prime.merge #merges all refined results for an mtz file&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can choose to run these commands independently (ideally in the above order) using the same phil file. See [https://commons.wikimedia.org/wiki/File:Prime_flowcharts.tif &amp;quot;PRIME flowchart&amp;quot;]. This will give you the freedom to change something (e.g. set of parameters to refine, resolution cut-off, etc.) at different stages of the post-refinement and merging. See running prime in manual mode for more detail.&lt;br /&gt;
&lt;br /&gt;
Step-by-step guidelines to post-refine and merge XFEL diffraction images. For more detail and citation, see &lt;br /&gt;
&amp;quot;Enabling X-ray Free Electron Laser Crystallography for Challenging Biological Systems from a Limited Number of Crystals&amp;quot;&lt;br /&gt;
[http://elifesciences.org/content/4/e05421 &amp;quot;DOI: http://dx.doi.org/10.7554/eLife.05421&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
== Prime is gui-ed (new!)== &lt;br /&gt;
Thanks to Dr. Lyubimov, PRIME is also available as a Graphic User Interface program. Try it by running&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Click to see [https://commons.wikimedia.org/wiki/File:PRIME_main.png &amp;quot;PRIME main gui&amp;quot;] and [https://commons.wikimedia.org/wiki/File:PRIME_advanced_options.png &amp;quot;Advanced options&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
== Getting started == &lt;br /&gt;
&#039;&#039;&#039;Generating input phil file&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
Like most programs developed under &#039;&#039;cctbx&#039;&#039; framework, &#039;&#039;prime&#039;&#039; reads in input .phil file, which stores all the parameters needed to run post-refinement and merging steps. To generate the template .phil file, do the dry run by calling&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ prime.run&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
An example of the template .phil file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
data = None&lt;br /&gt;
run_no = None&lt;br /&gt;
title = None&lt;br /&gt;
scale {&lt;br /&gt;
  d_min = 0.1&lt;br /&gt;
  d_max = 99&lt;br /&gt;
  sigma_min = 1.5&lt;br /&gt;
}&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can save the content of the output to any file name - in this tutorial, let&#039;s save it to thermolysin.phil.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;First look at your phil file&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
To run prime, set the required parameters to match with your experiments (you can leave other parameters with their default values - or just delete them from you .phil file). The most interesting parameters are shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
data = /path/to/your/integarion/result/pickle_files&lt;br /&gt;
run_no = 001&lt;br /&gt;
title = First trial for thermolysin&lt;br /&gt;
scale {&lt;br /&gt;
  d_min = 2.1&lt;br /&gt;
  d_max = 45&lt;br /&gt;
  sigma_min = 1.5&lt;br /&gt;
}&lt;br /&gt;
postref {&lt;br /&gt;
  scale {&lt;br /&gt;
    d_min = 2.1&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
  }&lt;br /&gt;
  crystal_orientation {&lt;br /&gt;
    flag_on = True&lt;br /&gt;
    d_min = 2.1&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
  }&lt;br /&gt;
  reflecting_range {&lt;br /&gt;
    flag_on = True&lt;br /&gt;
    d_min = 2.1&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
  }&lt;br /&gt;
  unit_cell {&lt;br /&gt;
    flag_on = True&lt;br /&gt;
    d_min = 2.1&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
    uc_tolerance = 3&lt;br /&gt;
  }&lt;br /&gt;
  allparams {&lt;br /&gt;
    flag_on = False&lt;br /&gt;
    d_min = 2.1&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
    uc_tolerance = 3&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
merge {&lt;br /&gt;
  d_min = 2.1&lt;br /&gt;
  d_max = 45&lt;br /&gt;
  sigma_min = 1.5&lt;br /&gt;
  partiality_min = 0.1&lt;br /&gt;
  uc_tolerance = 3&lt;br /&gt;
}&lt;br /&gt;
target_unit_cell = 93.99,93.99,130.87,90,90,120&lt;br /&gt;
target_space_group = P 61 2 2&lt;br /&gt;
pixel_size_mm = 0.102&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You should pay attention to d_min and d_max for the refinement and merging parameters. If you use IOTA to integrate the images, IOTA will output .phil file for prime that has the optimal resolution range. If not, a few trial-and-error runs may be required to get the best resolution range for your dataset. Use merging statistics output by prime and check the values of CC1/2 and I/sigI to find out your optimal resolution range.&lt;br /&gt;
&lt;br /&gt;
Cell parameters (target_unit_cell and target_space_group) are required to run prime. Target cell parameter is used to remove some outlier images by controlling uc_tolerance parameter (the default value of tolerate range is 3% different). Space group parameter is used in removing outliers and merging with the given symmetry.&lt;br /&gt;
&lt;br /&gt;
Don&#039;t forget also to change your pixel size in millimeters. Check what your detector is and note down its pixel size. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Running post-refinement in automatic mode&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
Once you have the input .phil file, you can run &#039;&#039;prime&#039;&#039; by calling&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.run thermolysin.phil&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;Prime&#039;&#039; will post-refine and merge for reflection sets using three (default value) macrocycles. At the end of the run, you can obtain merging statistics in the last cycle - all other cycle statistics are also available in log.txt.&lt;br /&gt;
&lt;br /&gt;
An example of merging statistics:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Summary for 001/postref_cycle_1_merge.mtz&lt;br /&gt;
Bin Resolution Range     Completeness      &amp;lt;N_obs&amp;gt;  |Rsplit  CC1/2  N_ind |CCanom   N_ind| &amp;lt;I/sigI&amp;gt;   &amp;lt;I&amp;gt;&lt;br /&gt;
-------------------------------------------------------------------------------------------------------------&lt;br /&gt;
02    5.70 -    4.52 100.0   1055 /   1055   65.89   16.02   89.15   1055    0.00      0    20.17    2101.97&lt;br /&gt;
03    4.52 -    3.95 100.0   1032 /   1032   61.53   14.48   92.03   1032    0.00      0    20.39    2529.90&lt;br /&gt;
04    3.95 -    3.59 100.0   1016 /   1016   54.15   15.61   90.13   1016    0.00      0    16.69    1971.43&lt;br /&gt;
05    3.59 -    3.33 100.0   1004 /   1004   42.67   17.66   89.23   1004    0.00      0    14.21    1502.14&lt;br /&gt;
06    3.33 -    3.14 100.0   1013 /   1013   32.77   20.40   84.26   1013    0.00      0    11.76    1077.60&lt;br /&gt;
07    3.14 -    2.98 100.0    995 /    995   27.36   23.00   78.72    995    0.00      0    11.58     935.37&lt;br /&gt;
08    2.98 -    2.85 100.0   1006 /   1006   23.57   22.63   82.26   1006    0.00      0    10.56     722.62&lt;br /&gt;
09    2.85 -    2.74 100.0    986 /    986   16.64   28.51   72.90    985    0.00      0    10.01     591.56&lt;br /&gt;
10    2.74 -    2.65  99.9    989 /    990   12.41   31.35   72.95    987    0.00      0     9.91     515.07&lt;br /&gt;
11    2.65 -    2.56  99.7    979 /    982    9.35   37.14   65.31    970    0.00      0     9.31     438.96&lt;br /&gt;
12    2.56 -    2.49  98.0    979 /    999    6.06   45.98   45.37    930    0.00      0     9.45     390.05&lt;br /&gt;
13    2.49 -    2.42  95.1    931 /    979    4.46   50.68   34.20    834    0.00      0     8.93     334.80&lt;br /&gt;
14    2.42 -    2.37  91.7    896 /    977    3.35   55.66   37.15    729    0.00      0     9.27     320.17&lt;br /&gt;
15    2.37 -    2.31  83.9    829 /    988    2.61   56.92   43.21    600    0.00      0     9.60     296.67&lt;br /&gt;
16    2.31 -    2.26  72.4    702 /    969    1.97   65.81   26.89    386    0.00      0    10.29     284.39&lt;br /&gt;
17    2.26 -    2.22  59.1    582 /    985    1.75   64.72   31.28    275    0.00      0     9.87     284.06&lt;br /&gt;
18    2.22 -    2.18  52.9    513 /    970    1.51   71.27   16.86    188    0.00      0     8.93     215.31&lt;br /&gt;
19    2.18 -    2.14  35.7    349 /    978    1.32   62.26   68.25     90    0.00      0     8.22     199.09&lt;br /&gt;
20    2.14 -    2.10  23.1    227 /    981    1.20   92.14   -9.20     42    0.00      0     8.59     224.44&lt;br /&gt;
-------------------------------------------------------------------------------------------------------------&lt;br /&gt;
        TOTAL         85.9  17224 /  20046   27.11   21.11   92.07  15305    0.00      0    12.87     999.53&lt;br /&gt;
-------------------------------------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
Summary of refinement and merging&lt;br /&gt;
 No. good frames:                  1809&lt;br /&gt;
 No. bad cc frames:                 153&lt;br /&gt;
 No. bad G frames) :                  0&lt;br /&gt;
 No. bad unit cell frames:            5&lt;br /&gt;
 No. bad gamma_e frames:              0&lt;br /&gt;
 No. bad SE:                          0&lt;br /&gt;
 No. observations:               466997&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== More detail with input parameters ==&lt;br /&gt;
Now that you have your first trial merged data set, you can explore different parameter settings to merge or to obtain the Bijvoet pairs (I+/I-) for your anomalous data set.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Anomalous data:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
target_anomalous_flag = True&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
In the last cycle, prime will output a reflection set with I+ and I-.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Indexing ambiguity&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For space groups with indexing ambiguity, use the solutions from cctbx.xfel (see Tutorial for resolving indexing ambiguity) to merge the data set.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
indexing_ambiguity {&lt;br /&gt;
  flag_on = True&lt;br /&gt;
  index_basis_in = /path/to/solution/pickle_file.pickle&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Number of micro- and macrocycles&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
n_postref_cycle = 3&lt;br /&gt;
n_postref_sub_cycle = 3&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Number of bins for merging statistics&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
n_bins = 20&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Help with input parameters ==&lt;br /&gt;
&lt;br /&gt;
Most input parameters are self-explained. However, you can run -h switch to view help information for each parameter.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.run -h&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Running in manual mode ==&lt;br /&gt;
With the same phil file, you can run prime manually. This gives you more freedom in terms of parameter settings at different stages (generating reference set, post-refining images, and merging) or at different cycle of post-refinement.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example A&#039;&#039;&#039;: I want to generate a reference set then post-refine all the images on the &#039;&#039;&#039;scale factors only&#039;&#039;&#039; for &#039;&#039;&#039;three cycles&#039;&#039;&#039; then refine &#039;&#039;&#039;all parameters&#039;&#039;&#039; in the &#039;&#039;&#039;4th cycle&#039;&#039;&#039;. To do this, you can follow these steps:&lt;br /&gt;
&lt;br /&gt;
To generate a reference set,&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.genref prime.phil&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
To post-refine on scale factors only, modify your .phil file so that all parameters are turned &#039;&#039;off&#039;&#039;.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
scale {&lt;br /&gt;
  d_min = 2.5&lt;br /&gt;
  d_max = 45&lt;br /&gt;
  sigma_min = 1.5&lt;br /&gt;
}&lt;br /&gt;
postref {&lt;br /&gt;
  residual_threshold = 5&lt;br /&gt;
  residual_threshold_xy = 5&lt;br /&gt;
  scale {&lt;br /&gt;
    d_min = 2.5&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
  }&lt;br /&gt;
  crystal_orientation {&lt;br /&gt;
    flag_on = False&lt;br /&gt;
    d_min = 2.5&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
  }&lt;br /&gt;
  reflecting_range {&lt;br /&gt;
    flag_on = False&lt;br /&gt;
    d_min = 2.5&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
  }&lt;br /&gt;
  unit_cell {&lt;br /&gt;
    flag_on = False&lt;br /&gt;
    d_min = 2.5&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
    uc_tolerance = 5&lt;br /&gt;
  }&lt;br /&gt;
  allparams {&lt;br /&gt;
    flag_on = False&lt;br /&gt;
    d_min = 2.5&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
    uc_tolerance = 5&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
...&lt;br /&gt;
n_postref_cycle = 3&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then run,&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.postrefine prime.phil&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
To refine all parameters one more cycle, update your .phil file again (flag_on = True)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
  allparams {&lt;br /&gt;
    flag_on = True&lt;br /&gt;
    d_min = 2.5&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
    uc_tolerance = 5&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
...&lt;br /&gt;
n_postref_cycle = 1&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then run,&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.postrefine prime.phil&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
To obtain the final merged mtz, run&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.merge prime.phil&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Running on multiple nodes ==&lt;br /&gt;
For LCLS users (or other users with LSF bsub), you can use psana (or your) queuing system to parallelize the entire process. For example, if you want to run your job on 100 nodes using psanq, you can specify:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
queue {&lt;br /&gt;
  mode = bsub&lt;br /&gt;
  qname = psanaq&lt;br /&gt;
  n_nodes = 100&lt;br /&gt;
}&lt;br /&gt;
timeout_seconds = 300&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Prime will divide all the images into 100 batches and submit them to different nodes. It will wait until all images in every batches are done before returning to the merging step (or the exit step in the manual mode). You can control timeout_seconds parameter to tell prime how long it should wait for all the image batches to finish. Usually, this timeout parameter is not used (all images should return before 300 seconds) but in case, you need to wait longer or shorter, you can modify this parameter.&lt;/div&gt;</summary>
		<author><name>Mona</name></author>
	</entry>
	<entry>
		<id>http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=Cctbx.prime&amp;diff=1236</id>
		<title>Cctbx.prime</title>
		<link rel="alternate" type="text/html" href="http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=Cctbx.prime&amp;diff=1236"/>
		<updated>2016-08-02T00:30:25Z</updated>

		<summary type="html">&lt;p&gt;Mona: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Prime: &#039;&#039;&#039;p&#039;&#039;&#039;ost-&#039;&#039;&#039;r&#039;&#039;&#039;ef&#039;&#039;&#039;i&#039;&#039;&#039;nement and &#039;&#039;&#039;me&#039;&#039;&#039;rging ==&lt;br /&gt;
With the latest update, prime can be used to process data on multiple nodes (on queuing system). At the moment, only LSF (bsub) is supported. See documentation below for more information how to use the queuing system.&lt;br /&gt;
&lt;br /&gt;
This major update replaces prime.postrefine with &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.run &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For auto mode, you can still use prime.run with your parameter phil file like before. For manual mode, the available sub commands in prime are:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.genref #generates a reference set from given integration results&lt;br /&gt;
prime.postrefine #refines all images&lt;br /&gt;
prime.merge #merges all refined results for an mtz file&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can choose to run these commands independently (ideally in the above order) using the same phil file. See [https://commons.wikimedia.org/wiki/File:Prime_flowcharts.tif &amp;quot;PRIME flowchart&amp;quot;]. This will you a freedom to change something (e.g. set of parameters to refine, resolution cut-off, etc.) at different stages of the post-refinement and merging. See running prime in manual mode for more detail.&lt;br /&gt;
&lt;br /&gt;
Step-by-step guidelines to post-refine and merge XFEL diffraction images. For more detail and citation, see &lt;br /&gt;
&amp;quot;Enabling X-ray Free Electron Laser Crystallography for Challenging Biological Systems from a Limited Number of Crystals&amp;quot;&lt;br /&gt;
[http://elifesciences.org/content/4/e05421 &amp;quot;DOI: http://dx.doi.org/10.7554/eLife.05421&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
== Prime is gui-ed (new!)== &lt;br /&gt;
Thanks to Dr. Lyubimov, PRIME is also available as a Graphic User Interface program. Try it by running&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Click to see [https://commons.wikimedia.org/wiki/File:PRIME_main.png &amp;quot;PRIME main gui&amp;quot;] and [https://commons.wikimedia.org/wiki/File:PRIME_advanced_options.png &amp;quot;Advanced options&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
== Getting started == &lt;br /&gt;
&#039;&#039;&#039;Generating input phil file&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
Like most programs developed under &#039;&#039;cctbx&#039;&#039; framework, &#039;&#039;prime&#039;&#039; reads in input .phil file, which stores all the parameters needed to run post-refinement and merging steps. To generate the template .phil file, do the dry run by calling&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ prime.run&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
An example of the template .phil file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
data = None&lt;br /&gt;
run_no = None&lt;br /&gt;
title = None&lt;br /&gt;
scale {&lt;br /&gt;
  d_min = 0.1&lt;br /&gt;
  d_max = 99&lt;br /&gt;
  sigma_min = 1.5&lt;br /&gt;
}&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can save the content of the output to any file name - in this tutorial, let&#039;s save it to thermolysin.phil.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;First look at your phil file&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
To run prime, set the required parameters to match with your experiments (you can leave other parameters with their default values - or just delete them from you .phil file). The most interesting parameters are shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
data = /path/to/your/integarion/result/pickle_files&lt;br /&gt;
run_no = 001&lt;br /&gt;
title = First trial for thermolysin&lt;br /&gt;
scale {&lt;br /&gt;
  d_min = 2.1&lt;br /&gt;
  d_max = 45&lt;br /&gt;
  sigma_min = 1.5&lt;br /&gt;
}&lt;br /&gt;
postref {&lt;br /&gt;
  scale {&lt;br /&gt;
    d_min = 2.1&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
  }&lt;br /&gt;
  crystal_orientation {&lt;br /&gt;
    flag_on = True&lt;br /&gt;
    d_min = 2.1&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
  }&lt;br /&gt;
  reflecting_range {&lt;br /&gt;
    flag_on = True&lt;br /&gt;
    d_min = 2.1&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
  }&lt;br /&gt;
  unit_cell {&lt;br /&gt;
    flag_on = True&lt;br /&gt;
    d_min = 2.1&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
    uc_tolerance = 3&lt;br /&gt;
  }&lt;br /&gt;
  allparams {&lt;br /&gt;
    flag_on = False&lt;br /&gt;
    d_min = 2.1&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
    uc_tolerance = 3&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
merge {&lt;br /&gt;
  d_min = 2.1&lt;br /&gt;
  d_max = 45&lt;br /&gt;
  sigma_min = 1.5&lt;br /&gt;
  partiality_min = 0.1&lt;br /&gt;
  uc_tolerance = 3&lt;br /&gt;
}&lt;br /&gt;
target_unit_cell = 93.99,93.99,130.87,90,90,120&lt;br /&gt;
target_space_group = P 61 2 2&lt;br /&gt;
pixel_size_mm = 0.102&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You should pay attention to d_min and d_max for the refinement and merging parameters. If you use IOTA to integrate the images, IOTA will output .phil file for prime that has the optimal resolution range. If not, a few trial-and-error runs may be required to get the best resolution range for your dataset. Use merging statistics output by prime and check the values of CC1/2 and I/sigI to find out your optimal resolution range.&lt;br /&gt;
&lt;br /&gt;
Cell parameters (target_unit_cell and target_space_group) are required to run prime. Target cell parameter is used to remove some outlier images by controlling uc_tolerance parameter (the default value of tolerate range is 3% different). Space group parameter is used in removing outliers and merging with the given symmetry.&lt;br /&gt;
&lt;br /&gt;
Don&#039;t forget also to change your pixel size in millimeters. Check what your detector is and note down its pixel size. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Running post-refinement in automatic mode&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
Once you have the input .phil file, you can run &#039;&#039;prime&#039;&#039; by calling&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.run thermolysin.phil&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;Prime&#039;&#039; will post-refine and merge for reflection sets using three (default value) macrocycles. At the end of the run, you can obtain merging statistics in the last cycle - all other cycle statistics are also available in log.txt.&lt;br /&gt;
&lt;br /&gt;
An example of merging statistics:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Summary for 001/postref_cycle_1_merge.mtz&lt;br /&gt;
Bin Resolution Range     Completeness      &amp;lt;N_obs&amp;gt;  |Rsplit  CC1/2  N_ind |CCanom   N_ind| &amp;lt;I/sigI&amp;gt;   &amp;lt;I&amp;gt;&lt;br /&gt;
-------------------------------------------------------------------------------------------------------------&lt;br /&gt;
02    5.70 -    4.52 100.0   1055 /   1055   65.89   16.02   89.15   1055    0.00      0    20.17    2101.97&lt;br /&gt;
03    4.52 -    3.95 100.0   1032 /   1032   61.53   14.48   92.03   1032    0.00      0    20.39    2529.90&lt;br /&gt;
04    3.95 -    3.59 100.0   1016 /   1016   54.15   15.61   90.13   1016    0.00      0    16.69    1971.43&lt;br /&gt;
05    3.59 -    3.33 100.0   1004 /   1004   42.67   17.66   89.23   1004    0.00      0    14.21    1502.14&lt;br /&gt;
06    3.33 -    3.14 100.0   1013 /   1013   32.77   20.40   84.26   1013    0.00      0    11.76    1077.60&lt;br /&gt;
07    3.14 -    2.98 100.0    995 /    995   27.36   23.00   78.72    995    0.00      0    11.58     935.37&lt;br /&gt;
08    2.98 -    2.85 100.0   1006 /   1006   23.57   22.63   82.26   1006    0.00      0    10.56     722.62&lt;br /&gt;
09    2.85 -    2.74 100.0    986 /    986   16.64   28.51   72.90    985    0.00      0    10.01     591.56&lt;br /&gt;
10    2.74 -    2.65  99.9    989 /    990   12.41   31.35   72.95    987    0.00      0     9.91     515.07&lt;br /&gt;
11    2.65 -    2.56  99.7    979 /    982    9.35   37.14   65.31    970    0.00      0     9.31     438.96&lt;br /&gt;
12    2.56 -    2.49  98.0    979 /    999    6.06   45.98   45.37    930    0.00      0     9.45     390.05&lt;br /&gt;
13    2.49 -    2.42  95.1    931 /    979    4.46   50.68   34.20    834    0.00      0     8.93     334.80&lt;br /&gt;
14    2.42 -    2.37  91.7    896 /    977    3.35   55.66   37.15    729    0.00      0     9.27     320.17&lt;br /&gt;
15    2.37 -    2.31  83.9    829 /    988    2.61   56.92   43.21    600    0.00      0     9.60     296.67&lt;br /&gt;
16    2.31 -    2.26  72.4    702 /    969    1.97   65.81   26.89    386    0.00      0    10.29     284.39&lt;br /&gt;
17    2.26 -    2.22  59.1    582 /    985    1.75   64.72   31.28    275    0.00      0     9.87     284.06&lt;br /&gt;
18    2.22 -    2.18  52.9    513 /    970    1.51   71.27   16.86    188    0.00      0     8.93     215.31&lt;br /&gt;
19    2.18 -    2.14  35.7    349 /    978    1.32   62.26   68.25     90    0.00      0     8.22     199.09&lt;br /&gt;
20    2.14 -    2.10  23.1    227 /    981    1.20   92.14   -9.20     42    0.00      0     8.59     224.44&lt;br /&gt;
-------------------------------------------------------------------------------------------------------------&lt;br /&gt;
        TOTAL         85.9  17224 /  20046   27.11   21.11   92.07  15305    0.00      0    12.87     999.53&lt;br /&gt;
-------------------------------------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
Summary of refinement and merging&lt;br /&gt;
 No. good frames:                  1809&lt;br /&gt;
 No. bad cc frames:                 153&lt;br /&gt;
 No. bad G frames) :                  0&lt;br /&gt;
 No. bad unit cell frames:            5&lt;br /&gt;
 No. bad gamma_e frames:              0&lt;br /&gt;
 No. bad SE:                          0&lt;br /&gt;
 No. observations:               466997&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== More detail with input parameters ==&lt;br /&gt;
Now that you have your first trial merged data set, you can explore different parameter settings to merge or to obtain the Bijvoet pairs (I+/I-) for your anomalous data set.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Anomalous data:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
target_anomalous_flag = True&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
In the last cycle, prime will output a reflection set with I+ and I-.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Indexing ambiguity&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For space groups with indexing ambiguity, use the solutions from cctbx.xfel (see Tutorial for resolving indexing ambiguity) to merge the data set.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
indexing_ambiguity {&lt;br /&gt;
  flag_on = True&lt;br /&gt;
  index_basis_in = /path/to/solution/pickle_file.pickle&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Number of micro- and macrocycles&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
n_postref_cycle = 3&lt;br /&gt;
n_postref_sub_cycle = 3&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Number of bins for merging statistics&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
n_bins = 20&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Help with input parameters ==&lt;br /&gt;
&lt;br /&gt;
Most input parameters are self-explained. However, you can run -h switch to view help information for each parameter.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.run -h&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Running in manual mode ==&lt;br /&gt;
With the same phil file, you can run prime manually. This gives you more freedom in terms of parameter settings at different stages (generating reference set, post-refining images, and merging) or at different cycle of post-refinement.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example A&#039;&#039;&#039;: I want to generate a reference set then post-refine all the images on the &#039;&#039;&#039;scale factors only&#039;&#039;&#039; for &#039;&#039;&#039;three cycles&#039;&#039;&#039; then refine &#039;&#039;&#039;all parameters&#039;&#039;&#039; in the &#039;&#039;&#039;4th cycle&#039;&#039;&#039;. To do this, you can follow these steps:&lt;br /&gt;
&lt;br /&gt;
To generate a reference set,&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.genref prime.phil&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
To post-refine on scale factors only, modify your .phil file so that all parameters are turned &#039;&#039;off&#039;&#039;.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
scale {&lt;br /&gt;
  d_min = 2.5&lt;br /&gt;
  d_max = 45&lt;br /&gt;
  sigma_min = 1.5&lt;br /&gt;
}&lt;br /&gt;
postref {&lt;br /&gt;
  residual_threshold = 5&lt;br /&gt;
  residual_threshold_xy = 5&lt;br /&gt;
  scale {&lt;br /&gt;
    d_min = 2.5&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
  }&lt;br /&gt;
  crystal_orientation {&lt;br /&gt;
    flag_on = False&lt;br /&gt;
    d_min = 2.5&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
  }&lt;br /&gt;
  reflecting_range {&lt;br /&gt;
    flag_on = False&lt;br /&gt;
    d_min = 2.5&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
  }&lt;br /&gt;
  unit_cell {&lt;br /&gt;
    flag_on = False&lt;br /&gt;
    d_min = 2.5&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
    uc_tolerance = 5&lt;br /&gt;
  }&lt;br /&gt;
  allparams {&lt;br /&gt;
    flag_on = False&lt;br /&gt;
    d_min = 2.5&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
    uc_tolerance = 5&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
...&lt;br /&gt;
n_postref_cycle = 3&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then run,&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.postrefine prime.phil&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
To refine all parameters one more cycle, update your .phil file again (flag_on = True)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
  allparams {&lt;br /&gt;
    flag_on = True&lt;br /&gt;
    d_min = 2.5&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
    uc_tolerance = 5&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
...&lt;br /&gt;
n_postref_cycle = 1&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then run,&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.postrefine prime.phil&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
To obtain the final merged mtz, run&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.merge prime.phil&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Running on multiple nodes ==&lt;br /&gt;
For LCLS users (or other users with LSF bsub), you can use psana (or your) queuing system to parallelize the entire process. For example, if you want to run your job on 100 nodes using psanq, you can specify:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
queue {&lt;br /&gt;
  mode = bsub&lt;br /&gt;
  qname = psanaq&lt;br /&gt;
  n_nodes = 100&lt;br /&gt;
}&lt;br /&gt;
timeout_seconds = 300&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Prime will divide all the images into 100 batches and submit them to different nodes. It will wait until all images in every batches are done before returning to the merging step (or the exit step in the manual mode). You can control timeout_seconds parameter to tell prime how long it should wait for all the image batches to finish. Usually, this timeout parameter is not used (all images should return before 300 seconds) but in case, you need to wait longer or shorter, you can modify this parameter.&lt;/div&gt;</summary>
		<author><name>Mona</name></author>
	</entry>
	<entry>
		<id>http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=Cctbx.prime&amp;diff=1235</id>
		<title>Cctbx.prime</title>
		<link rel="alternate" type="text/html" href="http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=Cctbx.prime&amp;diff=1235"/>
		<updated>2016-08-02T00:17:56Z</updated>

		<summary type="html">&lt;p&gt;Mona: /* Running in manual mode */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Prime: &#039;&#039;&#039;p&#039;&#039;&#039;ost-&#039;&#039;&#039;r&#039;&#039;&#039;ef&#039;&#039;&#039;i&#039;&#039;&#039;nement and &#039;&#039;&#039;me&#039;&#039;&#039;rging ==&lt;br /&gt;
With the latest update, prime can be used to process data on multiple nodes (on queuing system). At the moment, only LSF (bsub) is supported. See documentation below for more information how to use the queuing system.&lt;br /&gt;
&lt;br /&gt;
This major update replaces prime.postrefine with &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.run &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For auto mode, you can still use prime.run with your parameter phil file like before. For manual mode, the available sub commands in prime are:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.genref #generates a reference set from given integration results&lt;br /&gt;
prime.postrefine #refines all images&lt;br /&gt;
prime.merge #merges all refined results for an mtz file&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can choose to run these commands independently (ideally in the above order) using the same phil file. See [https://commons.wikimedia.org/wiki/File:Prime_flowcharts.tif &amp;quot;PRIME flowchart&amp;quot;]. This will you a freedom to change something (e.g. set of parameters to refine, resolution cut-off, etc.) at different stages of the post-refinement and merging. See running prime in manual mode for more detail.&lt;br /&gt;
&lt;br /&gt;
Step-by-step guidelines to post-refine and merge XFEL diffraction images. For more detail and citation, see &lt;br /&gt;
&amp;quot;Enabling X-ray Free Electron Laser Crystallography for Challenging Biological Systems from a Limited Number of Crystals&amp;quot;&lt;br /&gt;
[http://elifesciences.org/content/4/e05421 &amp;quot;DOI: http://dx.doi.org/10.7554/eLife.05421&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
== Prime is gui-ed (new!)== &lt;br /&gt;
Thanks to Dr. Lyubimov, PRIME is also available as a Graphic User Interface program. Try it by running&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Click to see [https://commons.wikimedia.org/wiki/File:PRIME_main.png &amp;quot;PRIME main gui&amp;quot;] and [https://commons.wikimedia.org/wiki/File:PRIME_advanced_options.png &amp;quot;Advanced options&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
== Getting started == &lt;br /&gt;
&#039;&#039;&#039;Generating input phil file&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
Like most programs developed under &#039;&#039;cctbx&#039;&#039; framework, &#039;&#039;prime&#039;&#039; reads in input .phil file, which stores all the parameters needed to run post-refinement and merging steps. To generate the template .phil file, do the dry run by calling&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ prime.run&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
An example of the template .phil file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
data = None&lt;br /&gt;
run_no = None&lt;br /&gt;
title = None&lt;br /&gt;
scale {&lt;br /&gt;
  d_min = 0.1&lt;br /&gt;
  d_max = 99&lt;br /&gt;
  sigma_min = 1.5&lt;br /&gt;
}&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can save the content of the output to any file name - in this tutorial, let&#039;s save it to thermolysin.phil.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;First look at your phil file&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
To run prime, set the required parameters to match with your experiments (you can leave other parameters with their default values - or just delete them from you .phil file). The most interesting parameters are shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
data = /path/to/your/integarion/result/pickle_files&lt;br /&gt;
run_no = 001&lt;br /&gt;
title = First trial for thermolysin&lt;br /&gt;
scale {&lt;br /&gt;
  d_min = 2.1&lt;br /&gt;
  d_max = 45&lt;br /&gt;
  sigma_min = 1.5&lt;br /&gt;
}&lt;br /&gt;
postref {&lt;br /&gt;
  scale {&lt;br /&gt;
    d_min = 2.1&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
  }&lt;br /&gt;
  crystal_orientation {&lt;br /&gt;
    flag_on = True&lt;br /&gt;
    d_min = 2.1&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
  }&lt;br /&gt;
  reflecting_range {&lt;br /&gt;
    flag_on = True&lt;br /&gt;
    d_min = 2.1&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
  }&lt;br /&gt;
  unit_cell {&lt;br /&gt;
    flag_on = True&lt;br /&gt;
    d_min = 2.1&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
    uc_tolerance = 3&lt;br /&gt;
  }&lt;br /&gt;
  allparams {&lt;br /&gt;
    flag_on = False&lt;br /&gt;
    d_min = 2.1&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
    uc_tolerance = 3&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
merge {&lt;br /&gt;
  d_min = 2.1&lt;br /&gt;
  d_max = 45&lt;br /&gt;
  sigma_min = 1.5&lt;br /&gt;
  partiality_min = 0.1&lt;br /&gt;
  uc_tolerance = 3&lt;br /&gt;
}&lt;br /&gt;
target_unit_cell = 93.99,93.99,130.87,90,90,120&lt;br /&gt;
target_space_group = P 61 2 2&lt;br /&gt;
pixel_size_mm = 0.102&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You should pay attention to d_min and d_max for the refinement and merging parameters. If you use IOTA to integrate the images, IOTA will output .phil file for prime that has the optimal resolution range. If not, a few trial-and-error runs may be required to get the best resolution range for your dataset. Use merging statistics output by prime and check the values of CC1/2 and I/sigI to find out your optimal resolution range.&lt;br /&gt;
&lt;br /&gt;
Cell parameters (target_unit_cell and target_space_group) are required to run prime. Target cell parameter is used to remove some outlier images by controlling uc_tolerance parameter (the default value of tolerate range is 3% different). Space group parameter is used in removing outliers and merging with the given symmetry.&lt;br /&gt;
&lt;br /&gt;
Don&#039;t forget also to change your pixel size in millimeters. Check what your detector is and note down its pixel size. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Running post-refinement in automatic mode&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
Once you have the input .phil file, you can run &#039;&#039;prime&#039;&#039; by calling&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.run thermolysin.phil&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;Prime&#039;&#039; will post-refine and merge for reflection sets using three (default value) macrocycles. At the end of the run, you can obtain merging statistics in the last cycle - all other cycle statistics are also available in log.txt.&lt;br /&gt;
&lt;br /&gt;
An example of merging statistics:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Summary for 001/postref_cycle_1_merge.mtz&lt;br /&gt;
Bin Resolution Range     Completeness      &amp;lt;N_obs&amp;gt;  |Rsplit  CC1/2  N_ind |CCanom   N_ind| &amp;lt;I/sigI&amp;gt;   &amp;lt;I&amp;gt;&lt;br /&gt;
-------------------------------------------------------------------------------------------------------------&lt;br /&gt;
02    5.70 -    4.52 100.0   1055 /   1055   65.89   16.02   89.15   1055    0.00      0    20.17    2101.97&lt;br /&gt;
03    4.52 -    3.95 100.0   1032 /   1032   61.53   14.48   92.03   1032    0.00      0    20.39    2529.90&lt;br /&gt;
04    3.95 -    3.59 100.0   1016 /   1016   54.15   15.61   90.13   1016    0.00      0    16.69    1971.43&lt;br /&gt;
05    3.59 -    3.33 100.0   1004 /   1004   42.67   17.66   89.23   1004    0.00      0    14.21    1502.14&lt;br /&gt;
06    3.33 -    3.14 100.0   1013 /   1013   32.77   20.40   84.26   1013    0.00      0    11.76    1077.60&lt;br /&gt;
07    3.14 -    2.98 100.0    995 /    995   27.36   23.00   78.72    995    0.00      0    11.58     935.37&lt;br /&gt;
08    2.98 -    2.85 100.0   1006 /   1006   23.57   22.63   82.26   1006    0.00      0    10.56     722.62&lt;br /&gt;
09    2.85 -    2.74 100.0    986 /    986   16.64   28.51   72.90    985    0.00      0    10.01     591.56&lt;br /&gt;
10    2.74 -    2.65  99.9    989 /    990   12.41   31.35   72.95    987    0.00      0     9.91     515.07&lt;br /&gt;
11    2.65 -    2.56  99.7    979 /    982    9.35   37.14   65.31    970    0.00      0     9.31     438.96&lt;br /&gt;
12    2.56 -    2.49  98.0    979 /    999    6.06   45.98   45.37    930    0.00      0     9.45     390.05&lt;br /&gt;
13    2.49 -    2.42  95.1    931 /    979    4.46   50.68   34.20    834    0.00      0     8.93     334.80&lt;br /&gt;
14    2.42 -    2.37  91.7    896 /    977    3.35   55.66   37.15    729    0.00      0     9.27     320.17&lt;br /&gt;
15    2.37 -    2.31  83.9    829 /    988    2.61   56.92   43.21    600    0.00      0     9.60     296.67&lt;br /&gt;
16    2.31 -    2.26  72.4    702 /    969    1.97   65.81   26.89    386    0.00      0    10.29     284.39&lt;br /&gt;
17    2.26 -    2.22  59.1    582 /    985    1.75   64.72   31.28    275    0.00      0     9.87     284.06&lt;br /&gt;
18    2.22 -    2.18  52.9    513 /    970    1.51   71.27   16.86    188    0.00      0     8.93     215.31&lt;br /&gt;
19    2.18 -    2.14  35.7    349 /    978    1.32   62.26   68.25     90    0.00      0     8.22     199.09&lt;br /&gt;
20    2.14 -    2.10  23.1    227 /    981    1.20   92.14   -9.20     42    0.00      0     8.59     224.44&lt;br /&gt;
-------------------------------------------------------------------------------------------------------------&lt;br /&gt;
        TOTAL         85.9  17224 /  20046   27.11   21.11   92.07  15305    0.00      0    12.87     999.53&lt;br /&gt;
-------------------------------------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
Summary of refinement and merging&lt;br /&gt;
 No. good frames:                  1809&lt;br /&gt;
 No. bad cc frames:                 153&lt;br /&gt;
 No. bad G frames) :                  0&lt;br /&gt;
 No. bad unit cell frames:            5&lt;br /&gt;
 No. bad gamma_e frames:              0&lt;br /&gt;
 No. bad SE:                          0&lt;br /&gt;
 No. observations:               466997&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== More detail with input parameters ==&lt;br /&gt;
Now that you have your first trial merged data set, you can explore different parameter settings to merge or to obtain the Bijvoet pairs (I+/I-) for your anomalous data set.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Anomalous data:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
target_anomalous_flag = True&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
In the last cycle, prime will output a reflection set with I+ and I-.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Indexing ambiguity&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For space groups with indexing ambiguity, use the solutions from cctbx.xfel (see Tutorial for resolving indexing ambiguity) to merge the data set.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
indexing_ambiguity {&lt;br /&gt;
  flag_on = True&lt;br /&gt;
  index_basis_in = /path/to/solution/pickle_file.pickle&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Number of micro- and macrocycles&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
n_postref_cycle = 3&lt;br /&gt;
n_postref_sub_cycle = 3&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Number of bins for merging statistics&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
n_bins = 20&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Help with input parameters ==&lt;br /&gt;
&lt;br /&gt;
Most input parameters are self-explained. However, you can run -h switch to view help information for each parameter.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.run -h&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Running in manual mode ==&lt;br /&gt;
With the same phil file, you can run prime manually. This gives you more freedom in terms of parameter settings at different stages (generating reference set, post-refining images, and merging) or at different cycle of post-refinement.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example A&#039;&#039;&#039;: I want to generate a reference set then post-refine all the images on the &#039;&#039;&#039;scale factors only&#039;&#039;&#039; for &#039;&#039;&#039;three cycles&#039;&#039;&#039; then refine &#039;&#039;&#039;all parameters&#039;&#039;&#039; in the &#039;&#039;&#039;4th cycle&#039;&#039;&#039;. To do this, you can follow these steps:&lt;br /&gt;
&lt;br /&gt;
To generate a reference set,&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.genref prime.phil&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
To post-refine on scale factors only, modify your .phil file so that all parameters are turned &#039;&#039;off&#039;&#039;.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
scale {&lt;br /&gt;
  d_min = 2.5&lt;br /&gt;
  d_max = 45&lt;br /&gt;
  sigma_min = 1.5&lt;br /&gt;
}&lt;br /&gt;
postref {&lt;br /&gt;
  residual_threshold = 5&lt;br /&gt;
  residual_threshold_xy = 5&lt;br /&gt;
  scale {&lt;br /&gt;
    d_min = 2.5&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
  }&lt;br /&gt;
  crystal_orientation {&lt;br /&gt;
    flag_on = False&lt;br /&gt;
    d_min = 2.5&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
  }&lt;br /&gt;
  reflecting_range {&lt;br /&gt;
    flag_on = False&lt;br /&gt;
    d_min = 2.5&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
  }&lt;br /&gt;
  unit_cell {&lt;br /&gt;
    flag_on = False&lt;br /&gt;
    d_min = 2.5&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
    uc_tolerance = 5&lt;br /&gt;
  }&lt;br /&gt;
  allparams {&lt;br /&gt;
    flag_on = False&lt;br /&gt;
    d_min = 2.5&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
    uc_tolerance = 5&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
...&lt;br /&gt;
n_postref_cycle = 3&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then run,&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.postrefine prime.phil&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
To refine all parameters one more cycle, update your .phil file again (flag_on = True)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
  allparams {&lt;br /&gt;
    flag_on = True&lt;br /&gt;
    d_min = 2.5&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
    uc_tolerance = 5&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
...&lt;br /&gt;
n_postref_cycle = 1&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then run,&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.postrefine prime.phil&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
To obtain the final merged mtz, run&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.merge prime.phil&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mona</name></author>
	</entry>
	<entry>
		<id>http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=Cctbx.prime&amp;diff=1234</id>
		<title>Cctbx.prime</title>
		<link rel="alternate" type="text/html" href="http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=Cctbx.prime&amp;diff=1234"/>
		<updated>2016-08-02T00:16:42Z</updated>

		<summary type="html">&lt;p&gt;Mona: /* Running in manual mode */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Prime: &#039;&#039;&#039;p&#039;&#039;&#039;ost-&#039;&#039;&#039;r&#039;&#039;&#039;ef&#039;&#039;&#039;i&#039;&#039;&#039;nement and &#039;&#039;&#039;me&#039;&#039;&#039;rging ==&lt;br /&gt;
With the latest update, prime can be used to process data on multiple nodes (on queuing system). At the moment, only LSF (bsub) is supported. See documentation below for more information how to use the queuing system.&lt;br /&gt;
&lt;br /&gt;
This major update replaces prime.postrefine with &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.run &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For auto mode, you can still use prime.run with your parameter phil file like before. For manual mode, the available sub commands in prime are:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.genref #generates a reference set from given integration results&lt;br /&gt;
prime.postrefine #refines all images&lt;br /&gt;
prime.merge #merges all refined results for an mtz file&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can choose to run these commands independently (ideally in the above order) using the same phil file. See [https://commons.wikimedia.org/wiki/File:Prime_flowcharts.tif &amp;quot;PRIME flowchart&amp;quot;]. This will you a freedom to change something (e.g. set of parameters to refine, resolution cut-off, etc.) at different stages of the post-refinement and merging. See running prime in manual mode for more detail.&lt;br /&gt;
&lt;br /&gt;
Step-by-step guidelines to post-refine and merge XFEL diffraction images. For more detail and citation, see &lt;br /&gt;
&amp;quot;Enabling X-ray Free Electron Laser Crystallography for Challenging Biological Systems from a Limited Number of Crystals&amp;quot;&lt;br /&gt;
[http://elifesciences.org/content/4/e05421 &amp;quot;DOI: http://dx.doi.org/10.7554/eLife.05421&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
== Prime is gui-ed (new!)== &lt;br /&gt;
Thanks to Dr. Lyubimov, PRIME is also available as a Graphic User Interface program. Try it by running&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Click to see [https://commons.wikimedia.org/wiki/File:PRIME_main.png &amp;quot;PRIME main gui&amp;quot;] and [https://commons.wikimedia.org/wiki/File:PRIME_advanced_options.png &amp;quot;Advanced options&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
== Getting started == &lt;br /&gt;
&#039;&#039;&#039;Generating input phil file&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
Like most programs developed under &#039;&#039;cctbx&#039;&#039; framework, &#039;&#039;prime&#039;&#039; reads in input .phil file, which stores all the parameters needed to run post-refinement and merging steps. To generate the template .phil file, do the dry run by calling&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ prime.run&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
An example of the template .phil file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
data = None&lt;br /&gt;
run_no = None&lt;br /&gt;
title = None&lt;br /&gt;
scale {&lt;br /&gt;
  d_min = 0.1&lt;br /&gt;
  d_max = 99&lt;br /&gt;
  sigma_min = 1.5&lt;br /&gt;
}&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can save the content of the output to any file name - in this tutorial, let&#039;s save it to thermolysin.phil.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;First look at your phil file&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
To run prime, set the required parameters to match with your experiments (you can leave other parameters with their default values - or just delete them from you .phil file). The most interesting parameters are shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
data = /path/to/your/integarion/result/pickle_files&lt;br /&gt;
run_no = 001&lt;br /&gt;
title = First trial for thermolysin&lt;br /&gt;
scale {&lt;br /&gt;
  d_min = 2.1&lt;br /&gt;
  d_max = 45&lt;br /&gt;
  sigma_min = 1.5&lt;br /&gt;
}&lt;br /&gt;
postref {&lt;br /&gt;
  scale {&lt;br /&gt;
    d_min = 2.1&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
  }&lt;br /&gt;
  crystal_orientation {&lt;br /&gt;
    flag_on = True&lt;br /&gt;
    d_min = 2.1&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
  }&lt;br /&gt;
  reflecting_range {&lt;br /&gt;
    flag_on = True&lt;br /&gt;
    d_min = 2.1&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
  }&lt;br /&gt;
  unit_cell {&lt;br /&gt;
    flag_on = True&lt;br /&gt;
    d_min = 2.1&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
    uc_tolerance = 3&lt;br /&gt;
  }&lt;br /&gt;
  allparams {&lt;br /&gt;
    flag_on = False&lt;br /&gt;
    d_min = 2.1&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
    uc_tolerance = 3&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
merge {&lt;br /&gt;
  d_min = 2.1&lt;br /&gt;
  d_max = 45&lt;br /&gt;
  sigma_min = 1.5&lt;br /&gt;
  partiality_min = 0.1&lt;br /&gt;
  uc_tolerance = 3&lt;br /&gt;
}&lt;br /&gt;
target_unit_cell = 93.99,93.99,130.87,90,90,120&lt;br /&gt;
target_space_group = P 61 2 2&lt;br /&gt;
pixel_size_mm = 0.102&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You should pay attention to d_min and d_max for the refinement and merging parameters. If you use IOTA to integrate the images, IOTA will output .phil file for prime that has the optimal resolution range. If not, a few trial-and-error runs may be required to get the best resolution range for your dataset. Use merging statistics output by prime and check the values of CC1/2 and I/sigI to find out your optimal resolution range.&lt;br /&gt;
&lt;br /&gt;
Cell parameters (target_unit_cell and target_space_group) are required to run prime. Target cell parameter is used to remove some outlier images by controlling uc_tolerance parameter (the default value of tolerate range is 3% different). Space group parameter is used in removing outliers and merging with the given symmetry.&lt;br /&gt;
&lt;br /&gt;
Don&#039;t forget also to change your pixel size in millimeters. Check what your detector is and note down its pixel size. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Running post-refinement in automatic mode&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
Once you have the input .phil file, you can run &#039;&#039;prime&#039;&#039; by calling&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.run thermolysin.phil&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;Prime&#039;&#039; will post-refine and merge for reflection sets using three (default value) macrocycles. At the end of the run, you can obtain merging statistics in the last cycle - all other cycle statistics are also available in log.txt.&lt;br /&gt;
&lt;br /&gt;
An example of merging statistics:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Summary for 001/postref_cycle_1_merge.mtz&lt;br /&gt;
Bin Resolution Range     Completeness      &amp;lt;N_obs&amp;gt;  |Rsplit  CC1/2  N_ind |CCanom   N_ind| &amp;lt;I/sigI&amp;gt;   &amp;lt;I&amp;gt;&lt;br /&gt;
-------------------------------------------------------------------------------------------------------------&lt;br /&gt;
02    5.70 -    4.52 100.0   1055 /   1055   65.89   16.02   89.15   1055    0.00      0    20.17    2101.97&lt;br /&gt;
03    4.52 -    3.95 100.0   1032 /   1032   61.53   14.48   92.03   1032    0.00      0    20.39    2529.90&lt;br /&gt;
04    3.95 -    3.59 100.0   1016 /   1016   54.15   15.61   90.13   1016    0.00      0    16.69    1971.43&lt;br /&gt;
05    3.59 -    3.33 100.0   1004 /   1004   42.67   17.66   89.23   1004    0.00      0    14.21    1502.14&lt;br /&gt;
06    3.33 -    3.14 100.0   1013 /   1013   32.77   20.40   84.26   1013    0.00      0    11.76    1077.60&lt;br /&gt;
07    3.14 -    2.98 100.0    995 /    995   27.36   23.00   78.72    995    0.00      0    11.58     935.37&lt;br /&gt;
08    2.98 -    2.85 100.0   1006 /   1006   23.57   22.63   82.26   1006    0.00      0    10.56     722.62&lt;br /&gt;
09    2.85 -    2.74 100.0    986 /    986   16.64   28.51   72.90    985    0.00      0    10.01     591.56&lt;br /&gt;
10    2.74 -    2.65  99.9    989 /    990   12.41   31.35   72.95    987    0.00      0     9.91     515.07&lt;br /&gt;
11    2.65 -    2.56  99.7    979 /    982    9.35   37.14   65.31    970    0.00      0     9.31     438.96&lt;br /&gt;
12    2.56 -    2.49  98.0    979 /    999    6.06   45.98   45.37    930    0.00      0     9.45     390.05&lt;br /&gt;
13    2.49 -    2.42  95.1    931 /    979    4.46   50.68   34.20    834    0.00      0     8.93     334.80&lt;br /&gt;
14    2.42 -    2.37  91.7    896 /    977    3.35   55.66   37.15    729    0.00      0     9.27     320.17&lt;br /&gt;
15    2.37 -    2.31  83.9    829 /    988    2.61   56.92   43.21    600    0.00      0     9.60     296.67&lt;br /&gt;
16    2.31 -    2.26  72.4    702 /    969    1.97   65.81   26.89    386    0.00      0    10.29     284.39&lt;br /&gt;
17    2.26 -    2.22  59.1    582 /    985    1.75   64.72   31.28    275    0.00      0     9.87     284.06&lt;br /&gt;
18    2.22 -    2.18  52.9    513 /    970    1.51   71.27   16.86    188    0.00      0     8.93     215.31&lt;br /&gt;
19    2.18 -    2.14  35.7    349 /    978    1.32   62.26   68.25     90    0.00      0     8.22     199.09&lt;br /&gt;
20    2.14 -    2.10  23.1    227 /    981    1.20   92.14   -9.20     42    0.00      0     8.59     224.44&lt;br /&gt;
-------------------------------------------------------------------------------------------------------------&lt;br /&gt;
        TOTAL         85.9  17224 /  20046   27.11   21.11   92.07  15305    0.00      0    12.87     999.53&lt;br /&gt;
-------------------------------------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
Summary of refinement and merging&lt;br /&gt;
 No. good frames:                  1809&lt;br /&gt;
 No. bad cc frames:                 153&lt;br /&gt;
 No. bad G frames) :                  0&lt;br /&gt;
 No. bad unit cell frames:            5&lt;br /&gt;
 No. bad gamma_e frames:              0&lt;br /&gt;
 No. bad SE:                          0&lt;br /&gt;
 No. observations:               466997&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== More detail with input parameters ==&lt;br /&gt;
Now that you have your first trial merged data set, you can explore different parameter settings to merge or to obtain the Bijvoet pairs (I+/I-) for your anomalous data set.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Anomalous data:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
target_anomalous_flag = True&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
In the last cycle, prime will output a reflection set with I+ and I-.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Indexing ambiguity&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For space groups with indexing ambiguity, use the solutions from cctbx.xfel (see Tutorial for resolving indexing ambiguity) to merge the data set.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
indexing_ambiguity {&lt;br /&gt;
  flag_on = True&lt;br /&gt;
  index_basis_in = /path/to/solution/pickle_file.pickle&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Number of micro- and macrocycles&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
n_postref_cycle = 3&lt;br /&gt;
n_postref_sub_cycle = 3&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Number of bins for merging statistics&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
n_bins = 20&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Help with input parameters ==&lt;br /&gt;
&lt;br /&gt;
Most input parameters are self-explained. However, you can run -h switch to view help information for each parameter.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.run -h&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Running in manual mode ==&lt;br /&gt;
With the same phil file, you can run prime manually. This gives you more freedom in terms of parameter settings at different stages (generating reference set, post-refining images, and merging) or at different cycle of post-refinement.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example A&#039;&#039;&#039;: I want to generate a reference set then post-refine all the images on the &#039;&#039;&#039;scale factors only&#039;&#039;&#039; for &#039;&#039;&#039;three cycles&#039;&#039;&#039; then refine &#039;&#039;&#039;all parameters&#039;&#039;&#039; in the &#039;&#039;&#039;4th cycle&#039;&#039;&#039;. To do this, you can follow these steps:&lt;br /&gt;
&lt;br /&gt;
To generate a reference set,&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.genref prime.phil&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
To post-refine on scale factors only, modify your .phil file so that all parameters are turned &#039;&#039;off&#039;&#039;.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
scale {&lt;br /&gt;
  d_min = 2.5&lt;br /&gt;
  d_max = 45&lt;br /&gt;
  sigma_min = 1.5&lt;br /&gt;
}&lt;br /&gt;
postref {&lt;br /&gt;
  residual_threshold = 5&lt;br /&gt;
  residual_threshold_xy = 5&lt;br /&gt;
  scale {&lt;br /&gt;
    d_min = 2.5&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
  }&lt;br /&gt;
  crystal_orientation {&lt;br /&gt;
    flag_on = False&lt;br /&gt;
    d_min = 2.5&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
  }&lt;br /&gt;
  reflecting_range {&lt;br /&gt;
    flag_on = False&lt;br /&gt;
    d_min = 2.5&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
  }&lt;br /&gt;
  unit_cell {&lt;br /&gt;
    flag_on = False&lt;br /&gt;
    d_min = 2.5&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
    uc_tolerance = 5&lt;br /&gt;
  }&lt;br /&gt;
  allparams {&lt;br /&gt;
    flag_on = False&lt;br /&gt;
    d_min = 2.5&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
    uc_tolerance = 5&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
...&lt;br /&gt;
n_postref_cycle = 3&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then run,&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.postrefine prime.phil&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
To refine all parameters one more cycle, update your .phil file again&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
  allparams {&lt;br /&gt;
    flag_on = &#039;&#039;&#039;True&#039;&#039;&#039;&lt;br /&gt;
    d_min = 2.5&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
    uc_tolerance = 5&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
...&lt;br /&gt;
n_postref_cycle = 1&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then run,&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.postrefine prime.phil&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
To obtain the final merged mtz, run&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.merge prime.phil&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mona</name></author>
	</entry>
	<entry>
		<id>http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=Cctbx.prime&amp;diff=1233</id>
		<title>Cctbx.prime</title>
		<link rel="alternate" type="text/html" href="http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=Cctbx.prime&amp;diff=1233"/>
		<updated>2016-08-02T00:16:08Z</updated>

		<summary type="html">&lt;p&gt;Mona: /* Running in manual mode */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Prime: &#039;&#039;&#039;p&#039;&#039;&#039;ost-&#039;&#039;&#039;r&#039;&#039;&#039;ef&#039;&#039;&#039;i&#039;&#039;&#039;nement and &#039;&#039;&#039;me&#039;&#039;&#039;rging ==&lt;br /&gt;
With the latest update, prime can be used to process data on multiple nodes (on queuing system). At the moment, only LSF (bsub) is supported. See documentation below for more information how to use the queuing system.&lt;br /&gt;
&lt;br /&gt;
This major update replaces prime.postrefine with &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.run &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For auto mode, you can still use prime.run with your parameter phil file like before. For manual mode, the available sub commands in prime are:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.genref #generates a reference set from given integration results&lt;br /&gt;
prime.postrefine #refines all images&lt;br /&gt;
prime.merge #merges all refined results for an mtz file&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can choose to run these commands independently (ideally in the above order) using the same phil file. See [https://commons.wikimedia.org/wiki/File:Prime_flowcharts.tif &amp;quot;PRIME flowchart&amp;quot;]. This will you a freedom to change something (e.g. set of parameters to refine, resolution cut-off, etc.) at different stages of the post-refinement and merging. See running prime in manual mode for more detail.&lt;br /&gt;
&lt;br /&gt;
Step-by-step guidelines to post-refine and merge XFEL diffraction images. For more detail and citation, see &lt;br /&gt;
&amp;quot;Enabling X-ray Free Electron Laser Crystallography for Challenging Biological Systems from a Limited Number of Crystals&amp;quot;&lt;br /&gt;
[http://elifesciences.org/content/4/e05421 &amp;quot;DOI: http://dx.doi.org/10.7554/eLife.05421&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
== Prime is gui-ed (new!)== &lt;br /&gt;
Thanks to Dr. Lyubimov, PRIME is also available as a Graphic User Interface program. Try it by running&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Click to see [https://commons.wikimedia.org/wiki/File:PRIME_main.png &amp;quot;PRIME main gui&amp;quot;] and [https://commons.wikimedia.org/wiki/File:PRIME_advanced_options.png &amp;quot;Advanced options&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
== Getting started == &lt;br /&gt;
&#039;&#039;&#039;Generating input phil file&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
Like most programs developed under &#039;&#039;cctbx&#039;&#039; framework, &#039;&#039;prime&#039;&#039; reads in input .phil file, which stores all the parameters needed to run post-refinement and merging steps. To generate the template .phil file, do the dry run by calling&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ prime.run&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
An example of the template .phil file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
data = None&lt;br /&gt;
run_no = None&lt;br /&gt;
title = None&lt;br /&gt;
scale {&lt;br /&gt;
  d_min = 0.1&lt;br /&gt;
  d_max = 99&lt;br /&gt;
  sigma_min = 1.5&lt;br /&gt;
}&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can save the content of the output to any file name - in this tutorial, let&#039;s save it to thermolysin.phil.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;First look at your phil file&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
To run prime, set the required parameters to match with your experiments (you can leave other parameters with their default values - or just delete them from you .phil file). The most interesting parameters are shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
data = /path/to/your/integarion/result/pickle_files&lt;br /&gt;
run_no = 001&lt;br /&gt;
title = First trial for thermolysin&lt;br /&gt;
scale {&lt;br /&gt;
  d_min = 2.1&lt;br /&gt;
  d_max = 45&lt;br /&gt;
  sigma_min = 1.5&lt;br /&gt;
}&lt;br /&gt;
postref {&lt;br /&gt;
  scale {&lt;br /&gt;
    d_min = 2.1&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
  }&lt;br /&gt;
  crystal_orientation {&lt;br /&gt;
    flag_on = True&lt;br /&gt;
    d_min = 2.1&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
  }&lt;br /&gt;
  reflecting_range {&lt;br /&gt;
    flag_on = True&lt;br /&gt;
    d_min = 2.1&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
  }&lt;br /&gt;
  unit_cell {&lt;br /&gt;
    flag_on = True&lt;br /&gt;
    d_min = 2.1&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
    uc_tolerance = 3&lt;br /&gt;
  }&lt;br /&gt;
  allparams {&lt;br /&gt;
    flag_on = False&lt;br /&gt;
    d_min = 2.1&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
    uc_tolerance = 3&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
merge {&lt;br /&gt;
  d_min = 2.1&lt;br /&gt;
  d_max = 45&lt;br /&gt;
  sigma_min = 1.5&lt;br /&gt;
  partiality_min = 0.1&lt;br /&gt;
  uc_tolerance = 3&lt;br /&gt;
}&lt;br /&gt;
target_unit_cell = 93.99,93.99,130.87,90,90,120&lt;br /&gt;
target_space_group = P 61 2 2&lt;br /&gt;
pixel_size_mm = 0.102&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You should pay attention to d_min and d_max for the refinement and merging parameters. If you use IOTA to integrate the images, IOTA will output .phil file for prime that has the optimal resolution range. If not, a few trial-and-error runs may be required to get the best resolution range for your dataset. Use merging statistics output by prime and check the values of CC1/2 and I/sigI to find out your optimal resolution range.&lt;br /&gt;
&lt;br /&gt;
Cell parameters (target_unit_cell and target_space_group) are required to run prime. Target cell parameter is used to remove some outlier images by controlling uc_tolerance parameter (the default value of tolerate range is 3% different). Space group parameter is used in removing outliers and merging with the given symmetry.&lt;br /&gt;
&lt;br /&gt;
Don&#039;t forget also to change your pixel size in millimeters. Check what your detector is and note down its pixel size. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Running post-refinement in automatic mode&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
Once you have the input .phil file, you can run &#039;&#039;prime&#039;&#039; by calling&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.run thermolysin.phil&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;Prime&#039;&#039; will post-refine and merge for reflection sets using three (default value) macrocycles. At the end of the run, you can obtain merging statistics in the last cycle - all other cycle statistics are also available in log.txt.&lt;br /&gt;
&lt;br /&gt;
An example of merging statistics:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Summary for 001/postref_cycle_1_merge.mtz&lt;br /&gt;
Bin Resolution Range     Completeness      &amp;lt;N_obs&amp;gt;  |Rsplit  CC1/2  N_ind |CCanom   N_ind| &amp;lt;I/sigI&amp;gt;   &amp;lt;I&amp;gt;&lt;br /&gt;
-------------------------------------------------------------------------------------------------------------&lt;br /&gt;
02    5.70 -    4.52 100.0   1055 /   1055   65.89   16.02   89.15   1055    0.00      0    20.17    2101.97&lt;br /&gt;
03    4.52 -    3.95 100.0   1032 /   1032   61.53   14.48   92.03   1032    0.00      0    20.39    2529.90&lt;br /&gt;
04    3.95 -    3.59 100.0   1016 /   1016   54.15   15.61   90.13   1016    0.00      0    16.69    1971.43&lt;br /&gt;
05    3.59 -    3.33 100.0   1004 /   1004   42.67   17.66   89.23   1004    0.00      0    14.21    1502.14&lt;br /&gt;
06    3.33 -    3.14 100.0   1013 /   1013   32.77   20.40   84.26   1013    0.00      0    11.76    1077.60&lt;br /&gt;
07    3.14 -    2.98 100.0    995 /    995   27.36   23.00   78.72    995    0.00      0    11.58     935.37&lt;br /&gt;
08    2.98 -    2.85 100.0   1006 /   1006   23.57   22.63   82.26   1006    0.00      0    10.56     722.62&lt;br /&gt;
09    2.85 -    2.74 100.0    986 /    986   16.64   28.51   72.90    985    0.00      0    10.01     591.56&lt;br /&gt;
10    2.74 -    2.65  99.9    989 /    990   12.41   31.35   72.95    987    0.00      0     9.91     515.07&lt;br /&gt;
11    2.65 -    2.56  99.7    979 /    982    9.35   37.14   65.31    970    0.00      0     9.31     438.96&lt;br /&gt;
12    2.56 -    2.49  98.0    979 /    999    6.06   45.98   45.37    930    0.00      0     9.45     390.05&lt;br /&gt;
13    2.49 -    2.42  95.1    931 /    979    4.46   50.68   34.20    834    0.00      0     8.93     334.80&lt;br /&gt;
14    2.42 -    2.37  91.7    896 /    977    3.35   55.66   37.15    729    0.00      0     9.27     320.17&lt;br /&gt;
15    2.37 -    2.31  83.9    829 /    988    2.61   56.92   43.21    600    0.00      0     9.60     296.67&lt;br /&gt;
16    2.31 -    2.26  72.4    702 /    969    1.97   65.81   26.89    386    0.00      0    10.29     284.39&lt;br /&gt;
17    2.26 -    2.22  59.1    582 /    985    1.75   64.72   31.28    275    0.00      0     9.87     284.06&lt;br /&gt;
18    2.22 -    2.18  52.9    513 /    970    1.51   71.27   16.86    188    0.00      0     8.93     215.31&lt;br /&gt;
19    2.18 -    2.14  35.7    349 /    978    1.32   62.26   68.25     90    0.00      0     8.22     199.09&lt;br /&gt;
20    2.14 -    2.10  23.1    227 /    981    1.20   92.14   -9.20     42    0.00      0     8.59     224.44&lt;br /&gt;
-------------------------------------------------------------------------------------------------------------&lt;br /&gt;
        TOTAL         85.9  17224 /  20046   27.11   21.11   92.07  15305    0.00      0    12.87     999.53&lt;br /&gt;
-------------------------------------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
Summary of refinement and merging&lt;br /&gt;
 No. good frames:                  1809&lt;br /&gt;
 No. bad cc frames:                 153&lt;br /&gt;
 No. bad G frames) :                  0&lt;br /&gt;
 No. bad unit cell frames:            5&lt;br /&gt;
 No. bad gamma_e frames:              0&lt;br /&gt;
 No. bad SE:                          0&lt;br /&gt;
 No. observations:               466997&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== More detail with input parameters ==&lt;br /&gt;
Now that you have your first trial merged data set, you can explore different parameter settings to merge or to obtain the Bijvoet pairs (I+/I-) for your anomalous data set.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Anomalous data:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
target_anomalous_flag = True&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
In the last cycle, prime will output a reflection set with I+ and I-.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Indexing ambiguity&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For space groups with indexing ambiguity, use the solutions from cctbx.xfel (see Tutorial for resolving indexing ambiguity) to merge the data set.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
indexing_ambiguity {&lt;br /&gt;
  flag_on = True&lt;br /&gt;
  index_basis_in = /path/to/solution/pickle_file.pickle&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Number of micro- and macrocycles&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
n_postref_cycle = 3&lt;br /&gt;
n_postref_sub_cycle = 3&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Number of bins for merging statistics&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
n_bins = 20&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Help with input parameters ==&lt;br /&gt;
&lt;br /&gt;
Most input parameters are self-explained. However, you can run -h switch to view help information for each parameter.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.run -h&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Running in manual mode ==&lt;br /&gt;
With the same phil file, you can run prime manually. This gives you more freedom in terms of parameter settings at different stages (generating reference set, post-refining images, and merging) or at different cycle of post-refinement.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example A&#039;&#039;&#039;: I want to generate a reference set then post-refine all the images on the &#039;&#039;&#039;scale factors only&#039;&#039;&#039; for &#039;&#039;&#039;three cycles&#039;&#039;&#039; then refine all parameters in the 4th cycle. To do this, you can follow these steps:&lt;br /&gt;
&lt;br /&gt;
To generate a reference set,&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.genref prime.phil&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
To post-refine on scale factors only, modify your .phil file so that all parameters are turned &#039;&#039;off&#039;&#039;.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
scale {&lt;br /&gt;
  d_min = 2.5&lt;br /&gt;
  d_max = 45&lt;br /&gt;
  sigma_min = 1.5&lt;br /&gt;
}&lt;br /&gt;
postref {&lt;br /&gt;
  residual_threshold = 5&lt;br /&gt;
  residual_threshold_xy = 5&lt;br /&gt;
  scale {&lt;br /&gt;
    d_min = 2.5&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
  }&lt;br /&gt;
  crystal_orientation {&lt;br /&gt;
    flag_on = False&lt;br /&gt;
    d_min = 2.5&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
  }&lt;br /&gt;
  reflecting_range {&lt;br /&gt;
    flag_on = False&lt;br /&gt;
    d_min = 2.5&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
  }&lt;br /&gt;
  unit_cell {&lt;br /&gt;
    flag_on = False&lt;br /&gt;
    d_min = 2.5&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
    uc_tolerance = 5&lt;br /&gt;
  }&lt;br /&gt;
  allparams {&lt;br /&gt;
    flag_on = False&lt;br /&gt;
    d_min = 2.5&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
    uc_tolerance = 5&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
...&lt;br /&gt;
n_postref_cycle = 3&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then run,&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.postrefine prime.phil&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
To refine all parameters one more cycle, update your .phil file again&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
  allparams {&lt;br /&gt;
    flag_on = &#039;&#039;&#039;True&#039;&#039;&#039;&lt;br /&gt;
    d_min = 2.5&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
    uc_tolerance = 5&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
...&lt;br /&gt;
n_postref_cycle = 1&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then run,&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.postrefine prime.phil&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
To obtain the final merged mtz, run&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.merge prime.phil&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mona</name></author>
	</entry>
	<entry>
		<id>http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=Cctbx.prime&amp;diff=1232</id>
		<title>Cctbx.prime</title>
		<link rel="alternate" type="text/html" href="http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=Cctbx.prime&amp;diff=1232"/>
		<updated>2016-08-02T00:15:23Z</updated>

		<summary type="html">&lt;p&gt;Mona: /* Running in manual mode */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Prime: &#039;&#039;&#039;p&#039;&#039;&#039;ost-&#039;&#039;&#039;r&#039;&#039;&#039;ef&#039;&#039;&#039;i&#039;&#039;&#039;nement and &#039;&#039;&#039;me&#039;&#039;&#039;rging ==&lt;br /&gt;
With the latest update, prime can be used to process data on multiple nodes (on queuing system). At the moment, only LSF (bsub) is supported. See documentation below for more information how to use the queuing system.&lt;br /&gt;
&lt;br /&gt;
This major update replaces prime.postrefine with &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.run &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For auto mode, you can still use prime.run with your parameter phil file like before. For manual mode, the available sub commands in prime are:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.genref #generates a reference set from given integration results&lt;br /&gt;
prime.postrefine #refines all images&lt;br /&gt;
prime.merge #merges all refined results for an mtz file&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can choose to run these commands independently (ideally in the above order) using the same phil file. See [https://commons.wikimedia.org/wiki/File:Prime_flowcharts.tif &amp;quot;PRIME flowchart&amp;quot;]. This will you a freedom to change something (e.g. set of parameters to refine, resolution cut-off, etc.) at different stages of the post-refinement and merging. See running prime in manual mode for more detail.&lt;br /&gt;
&lt;br /&gt;
Step-by-step guidelines to post-refine and merge XFEL diffraction images. For more detail and citation, see &lt;br /&gt;
&amp;quot;Enabling X-ray Free Electron Laser Crystallography for Challenging Biological Systems from a Limited Number of Crystals&amp;quot;&lt;br /&gt;
[http://elifesciences.org/content/4/e05421 &amp;quot;DOI: http://dx.doi.org/10.7554/eLife.05421&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
== Prime is gui-ed (new!)== &lt;br /&gt;
Thanks to Dr. Lyubimov, PRIME is also available as a Graphic User Interface program. Try it by running&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Click to see [https://commons.wikimedia.org/wiki/File:PRIME_main.png &amp;quot;PRIME main gui&amp;quot;] and [https://commons.wikimedia.org/wiki/File:PRIME_advanced_options.png &amp;quot;Advanced options&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
== Getting started == &lt;br /&gt;
&#039;&#039;&#039;Generating input phil file&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
Like most programs developed under &#039;&#039;cctbx&#039;&#039; framework, &#039;&#039;prime&#039;&#039; reads in input .phil file, which stores all the parameters needed to run post-refinement and merging steps. To generate the template .phil file, do the dry run by calling&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ prime.run&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
An example of the template .phil file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
data = None&lt;br /&gt;
run_no = None&lt;br /&gt;
title = None&lt;br /&gt;
scale {&lt;br /&gt;
  d_min = 0.1&lt;br /&gt;
  d_max = 99&lt;br /&gt;
  sigma_min = 1.5&lt;br /&gt;
}&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can save the content of the output to any file name - in this tutorial, let&#039;s save it to thermolysin.phil.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;First look at your phil file&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
To run prime, set the required parameters to match with your experiments (you can leave other parameters with their default values - or just delete them from you .phil file). The most interesting parameters are shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
data = /path/to/your/integarion/result/pickle_files&lt;br /&gt;
run_no = 001&lt;br /&gt;
title = First trial for thermolysin&lt;br /&gt;
scale {&lt;br /&gt;
  d_min = 2.1&lt;br /&gt;
  d_max = 45&lt;br /&gt;
  sigma_min = 1.5&lt;br /&gt;
}&lt;br /&gt;
postref {&lt;br /&gt;
  scale {&lt;br /&gt;
    d_min = 2.1&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
  }&lt;br /&gt;
  crystal_orientation {&lt;br /&gt;
    flag_on = True&lt;br /&gt;
    d_min = 2.1&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
  }&lt;br /&gt;
  reflecting_range {&lt;br /&gt;
    flag_on = True&lt;br /&gt;
    d_min = 2.1&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
  }&lt;br /&gt;
  unit_cell {&lt;br /&gt;
    flag_on = True&lt;br /&gt;
    d_min = 2.1&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
    uc_tolerance = 3&lt;br /&gt;
  }&lt;br /&gt;
  allparams {&lt;br /&gt;
    flag_on = False&lt;br /&gt;
    d_min = 2.1&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
    uc_tolerance = 3&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
merge {&lt;br /&gt;
  d_min = 2.1&lt;br /&gt;
  d_max = 45&lt;br /&gt;
  sigma_min = 1.5&lt;br /&gt;
  partiality_min = 0.1&lt;br /&gt;
  uc_tolerance = 3&lt;br /&gt;
}&lt;br /&gt;
target_unit_cell = 93.99,93.99,130.87,90,90,120&lt;br /&gt;
target_space_group = P 61 2 2&lt;br /&gt;
pixel_size_mm = 0.102&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You should pay attention to d_min and d_max for the refinement and merging parameters. If you use IOTA to integrate the images, IOTA will output .phil file for prime that has the optimal resolution range. If not, a few trial-and-error runs may be required to get the best resolution range for your dataset. Use merging statistics output by prime and check the values of CC1/2 and I/sigI to find out your optimal resolution range.&lt;br /&gt;
&lt;br /&gt;
Cell parameters (target_unit_cell and target_space_group) are required to run prime. Target cell parameter is used to remove some outlier images by controlling uc_tolerance parameter (the default value of tolerate range is 3% different). Space group parameter is used in removing outliers and merging with the given symmetry.&lt;br /&gt;
&lt;br /&gt;
Don&#039;t forget also to change your pixel size in millimeters. Check what your detector is and note down its pixel size. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Running post-refinement in automatic mode&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
Once you have the input .phil file, you can run &#039;&#039;prime&#039;&#039; by calling&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.run thermolysin.phil&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;Prime&#039;&#039; will post-refine and merge for reflection sets using three (default value) macrocycles. At the end of the run, you can obtain merging statistics in the last cycle - all other cycle statistics are also available in log.txt.&lt;br /&gt;
&lt;br /&gt;
An example of merging statistics:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Summary for 001/postref_cycle_1_merge.mtz&lt;br /&gt;
Bin Resolution Range     Completeness      &amp;lt;N_obs&amp;gt;  |Rsplit  CC1/2  N_ind |CCanom   N_ind| &amp;lt;I/sigI&amp;gt;   &amp;lt;I&amp;gt;&lt;br /&gt;
-------------------------------------------------------------------------------------------------------------&lt;br /&gt;
02    5.70 -    4.52 100.0   1055 /   1055   65.89   16.02   89.15   1055    0.00      0    20.17    2101.97&lt;br /&gt;
03    4.52 -    3.95 100.0   1032 /   1032   61.53   14.48   92.03   1032    0.00      0    20.39    2529.90&lt;br /&gt;
04    3.95 -    3.59 100.0   1016 /   1016   54.15   15.61   90.13   1016    0.00      0    16.69    1971.43&lt;br /&gt;
05    3.59 -    3.33 100.0   1004 /   1004   42.67   17.66   89.23   1004    0.00      0    14.21    1502.14&lt;br /&gt;
06    3.33 -    3.14 100.0   1013 /   1013   32.77   20.40   84.26   1013    0.00      0    11.76    1077.60&lt;br /&gt;
07    3.14 -    2.98 100.0    995 /    995   27.36   23.00   78.72    995    0.00      0    11.58     935.37&lt;br /&gt;
08    2.98 -    2.85 100.0   1006 /   1006   23.57   22.63   82.26   1006    0.00      0    10.56     722.62&lt;br /&gt;
09    2.85 -    2.74 100.0    986 /    986   16.64   28.51   72.90    985    0.00      0    10.01     591.56&lt;br /&gt;
10    2.74 -    2.65  99.9    989 /    990   12.41   31.35   72.95    987    0.00      0     9.91     515.07&lt;br /&gt;
11    2.65 -    2.56  99.7    979 /    982    9.35   37.14   65.31    970    0.00      0     9.31     438.96&lt;br /&gt;
12    2.56 -    2.49  98.0    979 /    999    6.06   45.98   45.37    930    0.00      0     9.45     390.05&lt;br /&gt;
13    2.49 -    2.42  95.1    931 /    979    4.46   50.68   34.20    834    0.00      0     8.93     334.80&lt;br /&gt;
14    2.42 -    2.37  91.7    896 /    977    3.35   55.66   37.15    729    0.00      0     9.27     320.17&lt;br /&gt;
15    2.37 -    2.31  83.9    829 /    988    2.61   56.92   43.21    600    0.00      0     9.60     296.67&lt;br /&gt;
16    2.31 -    2.26  72.4    702 /    969    1.97   65.81   26.89    386    0.00      0    10.29     284.39&lt;br /&gt;
17    2.26 -    2.22  59.1    582 /    985    1.75   64.72   31.28    275    0.00      0     9.87     284.06&lt;br /&gt;
18    2.22 -    2.18  52.9    513 /    970    1.51   71.27   16.86    188    0.00      0     8.93     215.31&lt;br /&gt;
19    2.18 -    2.14  35.7    349 /    978    1.32   62.26   68.25     90    0.00      0     8.22     199.09&lt;br /&gt;
20    2.14 -    2.10  23.1    227 /    981    1.20   92.14   -9.20     42    0.00      0     8.59     224.44&lt;br /&gt;
-------------------------------------------------------------------------------------------------------------&lt;br /&gt;
        TOTAL         85.9  17224 /  20046   27.11   21.11   92.07  15305    0.00      0    12.87     999.53&lt;br /&gt;
-------------------------------------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
Summary of refinement and merging&lt;br /&gt;
 No. good frames:                  1809&lt;br /&gt;
 No. bad cc frames:                 153&lt;br /&gt;
 No. bad G frames) :                  0&lt;br /&gt;
 No. bad unit cell frames:            5&lt;br /&gt;
 No. bad gamma_e frames:              0&lt;br /&gt;
 No. bad SE:                          0&lt;br /&gt;
 No. observations:               466997&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== More detail with input parameters ==&lt;br /&gt;
Now that you have your first trial merged data set, you can explore different parameter settings to merge or to obtain the Bijvoet pairs (I+/I-) for your anomalous data set.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Anomalous data:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
target_anomalous_flag = True&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
In the last cycle, prime will output a reflection set with I+ and I-.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Indexing ambiguity&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For space groups with indexing ambiguity, use the solutions from cctbx.xfel (see Tutorial for resolving indexing ambiguity) to merge the data set.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
indexing_ambiguity {&lt;br /&gt;
  flag_on = True&lt;br /&gt;
  index_basis_in = /path/to/solution/pickle_file.pickle&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Number of micro- and macrocycles&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
n_postref_cycle = 3&lt;br /&gt;
n_postref_sub_cycle = 3&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Number of bins for merging statistics&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
n_bins = 20&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Help with input parameters ==&lt;br /&gt;
&lt;br /&gt;
Most input parameters are self-explained. However, you can run -h switch to view help information for each parameter.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.run -h&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Running in manual mode ==&lt;br /&gt;
With the same phil file, you can run prime manually. This gives you more freedom in terms of parameter settings at different stages (generating reference set, post-refining images, and merging) or at different cycle of post-refinement.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example A&#039;&#039;&#039;: I want to generate a reference set then post-refine all the images on the &#039;&#039;&#039;scale factors only&#039;&#039;&#039; for &#039;&#039;&#039;three cycles&#039;&#039;&#039; then refine all parameters in the 4th cycle. You&#039;d run&lt;br /&gt;
&lt;br /&gt;
To generate a reference set,&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.genref prime.phil&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
To post-refine on scale factors only, modify your .phil file so that all parameters are turned &#039;&#039;off&#039;&#039;.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
scale {&lt;br /&gt;
  d_min = 2.5&lt;br /&gt;
  d_max = 45&lt;br /&gt;
  sigma_min = 1.5&lt;br /&gt;
}&lt;br /&gt;
postref {&lt;br /&gt;
  residual_threshold = 5&lt;br /&gt;
  residual_threshold_xy = 5&lt;br /&gt;
  scale {&lt;br /&gt;
    d_min = 2.5&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
  }&lt;br /&gt;
  crystal_orientation {&lt;br /&gt;
    flag_on = False&lt;br /&gt;
    d_min = 2.5&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
  }&lt;br /&gt;
  reflecting_range {&lt;br /&gt;
    flag_on = False&lt;br /&gt;
    d_min = 2.5&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
  }&lt;br /&gt;
  unit_cell {&lt;br /&gt;
    flag_on = False&lt;br /&gt;
    d_min = 2.5&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
    uc_tolerance = 5&lt;br /&gt;
  }&lt;br /&gt;
  allparams {&lt;br /&gt;
    flag_on = False&lt;br /&gt;
    d_min = 2.5&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
    uc_tolerance = 5&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
...&lt;br /&gt;
n_postref_cycle = 3&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then run,&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.postrefine prime.phil&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
To refine all parameters one more cycle, update your .phil file again&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
  allparams {&lt;br /&gt;
    flag_on = &#039;&#039;&#039;True&#039;&#039;&#039;&lt;br /&gt;
    d_min = 2.5&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
    uc_tolerance = 5&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
...&lt;br /&gt;
n_postref_cycle = 1&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then run,&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.postrefine prime.phil&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
To obtain the final merged mtz, run&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.merge prime.phil&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mona</name></author>
	</entry>
	<entry>
		<id>http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=Cctbx.prime&amp;diff=1231</id>
		<title>Cctbx.prime</title>
		<link rel="alternate" type="text/html" href="http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=Cctbx.prime&amp;diff=1231"/>
		<updated>2016-08-02T00:14:38Z</updated>

		<summary type="html">&lt;p&gt;Mona: /* Running in manual mode */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Prime: &#039;&#039;&#039;p&#039;&#039;&#039;ost-&#039;&#039;&#039;r&#039;&#039;&#039;ef&#039;&#039;&#039;i&#039;&#039;&#039;nement and &#039;&#039;&#039;me&#039;&#039;&#039;rging ==&lt;br /&gt;
With the latest update, prime can be used to process data on multiple nodes (on queuing system). At the moment, only LSF (bsub) is supported. See documentation below for more information how to use the queuing system.&lt;br /&gt;
&lt;br /&gt;
This major update replaces prime.postrefine with &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.run &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For auto mode, you can still use prime.run with your parameter phil file like before. For manual mode, the available sub commands in prime are:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.genref #generates a reference set from given integration results&lt;br /&gt;
prime.postrefine #refines all images&lt;br /&gt;
prime.merge #merges all refined results for an mtz file&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can choose to run these commands independently (ideally in the above order) using the same phil file. See [https://commons.wikimedia.org/wiki/File:Prime_flowcharts.tif &amp;quot;PRIME flowchart&amp;quot;]. This will you a freedom to change something (e.g. set of parameters to refine, resolution cut-off, etc.) at different stages of the post-refinement and merging. See running prime in manual mode for more detail.&lt;br /&gt;
&lt;br /&gt;
Step-by-step guidelines to post-refine and merge XFEL diffraction images. For more detail and citation, see &lt;br /&gt;
&amp;quot;Enabling X-ray Free Electron Laser Crystallography for Challenging Biological Systems from a Limited Number of Crystals&amp;quot;&lt;br /&gt;
[http://elifesciences.org/content/4/e05421 &amp;quot;DOI: http://dx.doi.org/10.7554/eLife.05421&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
== Prime is gui-ed (new!)== &lt;br /&gt;
Thanks to Dr. Lyubimov, PRIME is also available as a Graphic User Interface program. Try it by running&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Click to see [https://commons.wikimedia.org/wiki/File:PRIME_main.png &amp;quot;PRIME main gui&amp;quot;] and [https://commons.wikimedia.org/wiki/File:PRIME_advanced_options.png &amp;quot;Advanced options&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
== Getting started == &lt;br /&gt;
&#039;&#039;&#039;Generating input phil file&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
Like most programs developed under &#039;&#039;cctbx&#039;&#039; framework, &#039;&#039;prime&#039;&#039; reads in input .phil file, which stores all the parameters needed to run post-refinement and merging steps. To generate the template .phil file, do the dry run by calling&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ prime.run&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
An example of the template .phil file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
data = None&lt;br /&gt;
run_no = None&lt;br /&gt;
title = None&lt;br /&gt;
scale {&lt;br /&gt;
  d_min = 0.1&lt;br /&gt;
  d_max = 99&lt;br /&gt;
  sigma_min = 1.5&lt;br /&gt;
}&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can save the content of the output to any file name - in this tutorial, let&#039;s save it to thermolysin.phil.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;First look at your phil file&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
To run prime, set the required parameters to match with your experiments (you can leave other parameters with their default values - or just delete them from you .phil file). The most interesting parameters are shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
data = /path/to/your/integarion/result/pickle_files&lt;br /&gt;
run_no = 001&lt;br /&gt;
title = First trial for thermolysin&lt;br /&gt;
scale {&lt;br /&gt;
  d_min = 2.1&lt;br /&gt;
  d_max = 45&lt;br /&gt;
  sigma_min = 1.5&lt;br /&gt;
}&lt;br /&gt;
postref {&lt;br /&gt;
  scale {&lt;br /&gt;
    d_min = 2.1&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
  }&lt;br /&gt;
  crystal_orientation {&lt;br /&gt;
    flag_on = True&lt;br /&gt;
    d_min = 2.1&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
  }&lt;br /&gt;
  reflecting_range {&lt;br /&gt;
    flag_on = True&lt;br /&gt;
    d_min = 2.1&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
  }&lt;br /&gt;
  unit_cell {&lt;br /&gt;
    flag_on = True&lt;br /&gt;
    d_min = 2.1&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
    uc_tolerance = 3&lt;br /&gt;
  }&lt;br /&gt;
  allparams {&lt;br /&gt;
    flag_on = False&lt;br /&gt;
    d_min = 2.1&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
    uc_tolerance = 3&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
merge {&lt;br /&gt;
  d_min = 2.1&lt;br /&gt;
  d_max = 45&lt;br /&gt;
  sigma_min = 1.5&lt;br /&gt;
  partiality_min = 0.1&lt;br /&gt;
  uc_tolerance = 3&lt;br /&gt;
}&lt;br /&gt;
target_unit_cell = 93.99,93.99,130.87,90,90,120&lt;br /&gt;
target_space_group = P 61 2 2&lt;br /&gt;
pixel_size_mm = 0.102&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You should pay attention to d_min and d_max for the refinement and merging parameters. If you use IOTA to integrate the images, IOTA will output .phil file for prime that has the optimal resolution range. If not, a few trial-and-error runs may be required to get the best resolution range for your dataset. Use merging statistics output by prime and check the values of CC1/2 and I/sigI to find out your optimal resolution range.&lt;br /&gt;
&lt;br /&gt;
Cell parameters (target_unit_cell and target_space_group) are required to run prime. Target cell parameter is used to remove some outlier images by controlling uc_tolerance parameter (the default value of tolerate range is 3% different). Space group parameter is used in removing outliers and merging with the given symmetry.&lt;br /&gt;
&lt;br /&gt;
Don&#039;t forget also to change your pixel size in millimeters. Check what your detector is and note down its pixel size. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Running post-refinement in automatic mode&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
Once you have the input .phil file, you can run &#039;&#039;prime&#039;&#039; by calling&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.run thermolysin.phil&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;Prime&#039;&#039; will post-refine and merge for reflection sets using three (default value) macrocycles. At the end of the run, you can obtain merging statistics in the last cycle - all other cycle statistics are also available in log.txt.&lt;br /&gt;
&lt;br /&gt;
An example of merging statistics:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Summary for 001/postref_cycle_1_merge.mtz&lt;br /&gt;
Bin Resolution Range     Completeness      &amp;lt;N_obs&amp;gt;  |Rsplit  CC1/2  N_ind |CCanom   N_ind| &amp;lt;I/sigI&amp;gt;   &amp;lt;I&amp;gt;&lt;br /&gt;
-------------------------------------------------------------------------------------------------------------&lt;br /&gt;
02    5.70 -    4.52 100.0   1055 /   1055   65.89   16.02   89.15   1055    0.00      0    20.17    2101.97&lt;br /&gt;
03    4.52 -    3.95 100.0   1032 /   1032   61.53   14.48   92.03   1032    0.00      0    20.39    2529.90&lt;br /&gt;
04    3.95 -    3.59 100.0   1016 /   1016   54.15   15.61   90.13   1016    0.00      0    16.69    1971.43&lt;br /&gt;
05    3.59 -    3.33 100.0   1004 /   1004   42.67   17.66   89.23   1004    0.00      0    14.21    1502.14&lt;br /&gt;
06    3.33 -    3.14 100.0   1013 /   1013   32.77   20.40   84.26   1013    0.00      0    11.76    1077.60&lt;br /&gt;
07    3.14 -    2.98 100.0    995 /    995   27.36   23.00   78.72    995    0.00      0    11.58     935.37&lt;br /&gt;
08    2.98 -    2.85 100.0   1006 /   1006   23.57   22.63   82.26   1006    0.00      0    10.56     722.62&lt;br /&gt;
09    2.85 -    2.74 100.0    986 /    986   16.64   28.51   72.90    985    0.00      0    10.01     591.56&lt;br /&gt;
10    2.74 -    2.65  99.9    989 /    990   12.41   31.35   72.95    987    0.00      0     9.91     515.07&lt;br /&gt;
11    2.65 -    2.56  99.7    979 /    982    9.35   37.14   65.31    970    0.00      0     9.31     438.96&lt;br /&gt;
12    2.56 -    2.49  98.0    979 /    999    6.06   45.98   45.37    930    0.00      0     9.45     390.05&lt;br /&gt;
13    2.49 -    2.42  95.1    931 /    979    4.46   50.68   34.20    834    0.00      0     8.93     334.80&lt;br /&gt;
14    2.42 -    2.37  91.7    896 /    977    3.35   55.66   37.15    729    0.00      0     9.27     320.17&lt;br /&gt;
15    2.37 -    2.31  83.9    829 /    988    2.61   56.92   43.21    600    0.00      0     9.60     296.67&lt;br /&gt;
16    2.31 -    2.26  72.4    702 /    969    1.97   65.81   26.89    386    0.00      0    10.29     284.39&lt;br /&gt;
17    2.26 -    2.22  59.1    582 /    985    1.75   64.72   31.28    275    0.00      0     9.87     284.06&lt;br /&gt;
18    2.22 -    2.18  52.9    513 /    970    1.51   71.27   16.86    188    0.00      0     8.93     215.31&lt;br /&gt;
19    2.18 -    2.14  35.7    349 /    978    1.32   62.26   68.25     90    0.00      0     8.22     199.09&lt;br /&gt;
20    2.14 -    2.10  23.1    227 /    981    1.20   92.14   -9.20     42    0.00      0     8.59     224.44&lt;br /&gt;
-------------------------------------------------------------------------------------------------------------&lt;br /&gt;
        TOTAL         85.9  17224 /  20046   27.11   21.11   92.07  15305    0.00      0    12.87     999.53&lt;br /&gt;
-------------------------------------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
Summary of refinement and merging&lt;br /&gt;
 No. good frames:                  1809&lt;br /&gt;
 No. bad cc frames:                 153&lt;br /&gt;
 No. bad G frames) :                  0&lt;br /&gt;
 No. bad unit cell frames:            5&lt;br /&gt;
 No. bad gamma_e frames:              0&lt;br /&gt;
 No. bad SE:                          0&lt;br /&gt;
 No. observations:               466997&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== More detail with input parameters ==&lt;br /&gt;
Now that you have your first trial merged data set, you can explore different parameter settings to merge or to obtain the Bijvoet pairs (I+/I-) for your anomalous data set.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Anomalous data:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
target_anomalous_flag = True&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
In the last cycle, prime will output a reflection set with I+ and I-.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Indexing ambiguity&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For space groups with indexing ambiguity, use the solutions from cctbx.xfel (see Tutorial for resolving indexing ambiguity) to merge the data set.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
indexing_ambiguity {&lt;br /&gt;
  flag_on = True&lt;br /&gt;
  index_basis_in = /path/to/solution/pickle_file.pickle&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Number of micro- and macrocycles&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
n_postref_cycle = 3&lt;br /&gt;
n_postref_sub_cycle = 3&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Number of bins for merging statistics&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
n_bins = 20&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Help with input parameters ==&lt;br /&gt;
&lt;br /&gt;
Most input parameters are self-explained. However, you can run -h switch to view help information for each parameter.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.run -h&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Running in manual mode ==&lt;br /&gt;
With the same phil file, you can run prime manually. This gives you more freedom in terms of parameter settings at different stages (generating reference set, post-refining images, and merging) or at different cycle of post-refinement.&lt;br /&gt;
&lt;br /&gt;
Example A: I want to generate a reference set then post-refine all the images on the &#039;&#039;&#039;scale factors only&#039;&#039;&#039; for &#039;&#039;&#039;three cycles&#039;&#039;&#039; then refine all parameters in the 4th cycle. You&#039;d run&lt;br /&gt;
&lt;br /&gt;
To generate a reference set,&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.genref prime.phil&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
To post-refine on scale factors only, modify your .phil file so that all parameters are turned &#039;&#039;off&#039;&#039;.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
scale {&lt;br /&gt;
  d_min = 2.5&lt;br /&gt;
  d_max = 45&lt;br /&gt;
  sigma_min = 1.5&lt;br /&gt;
}&lt;br /&gt;
postref {&lt;br /&gt;
  residual_threshold = 5&lt;br /&gt;
  residual_threshold_xy = 5&lt;br /&gt;
  scale {&lt;br /&gt;
    d_min = 2.5&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
  }&lt;br /&gt;
  crystal_orientation {&lt;br /&gt;
    flag_on = False&lt;br /&gt;
    d_min = 2.5&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
  }&lt;br /&gt;
  reflecting_range {&lt;br /&gt;
    flag_on = False&lt;br /&gt;
    d_min = 2.5&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
  }&lt;br /&gt;
  unit_cell {&lt;br /&gt;
    flag_on = False&lt;br /&gt;
    d_min = 2.5&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
    uc_tolerance = 5&lt;br /&gt;
  }&lt;br /&gt;
  allparams {&lt;br /&gt;
    flag_on = False&lt;br /&gt;
    d_min = 2.5&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
    uc_tolerance = 5&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
...&lt;br /&gt;
n_postref_cycle = 3&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then run,&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.postrefine prime.phil&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
To refine all parameters one more cycle, update your .phil file again&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
  allparams {&lt;br /&gt;
    flag_on = &#039;&#039;&#039;True&#039;&#039;&#039;&lt;br /&gt;
    d_min = 2.5&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
    uc_tolerance = 5&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
...&lt;br /&gt;
n_postref_cycle = 1&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then run,&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.postrefine prime.phil&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
To obtain the final merged mtz, run&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.merge prime.phil&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mona</name></author>
	</entry>
	<entry>
		<id>http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=Cctbx.prime&amp;diff=1230</id>
		<title>Cctbx.prime</title>
		<link rel="alternate" type="text/html" href="http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=Cctbx.prime&amp;diff=1230"/>
		<updated>2016-08-02T00:13:39Z</updated>

		<summary type="html">&lt;p&gt;Mona: /* Running in manual mode */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Prime: &#039;&#039;&#039;p&#039;&#039;&#039;ost-&#039;&#039;&#039;r&#039;&#039;&#039;ef&#039;&#039;&#039;i&#039;&#039;&#039;nement and &#039;&#039;&#039;me&#039;&#039;&#039;rging ==&lt;br /&gt;
With the latest update, prime can be used to process data on multiple nodes (on queuing system). At the moment, only LSF (bsub) is supported. See documentation below for more information how to use the queuing system.&lt;br /&gt;
&lt;br /&gt;
This major update replaces prime.postrefine with &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.run &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For auto mode, you can still use prime.run with your parameter phil file like before. For manual mode, the available sub commands in prime are:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.genref #generates a reference set from given integration results&lt;br /&gt;
prime.postrefine #refines all images&lt;br /&gt;
prime.merge #merges all refined results for an mtz file&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can choose to run these commands independently (ideally in the above order) using the same phil file. See [https://commons.wikimedia.org/wiki/File:Prime_flowcharts.tif &amp;quot;PRIME flowchart&amp;quot;]. This will you a freedom to change something (e.g. set of parameters to refine, resolution cut-off, etc.) at different stages of the post-refinement and merging. See running prime in manual mode for more detail.&lt;br /&gt;
&lt;br /&gt;
Step-by-step guidelines to post-refine and merge XFEL diffraction images. For more detail and citation, see &lt;br /&gt;
&amp;quot;Enabling X-ray Free Electron Laser Crystallography for Challenging Biological Systems from a Limited Number of Crystals&amp;quot;&lt;br /&gt;
[http://elifesciences.org/content/4/e05421 &amp;quot;DOI: http://dx.doi.org/10.7554/eLife.05421&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
== Prime is gui-ed (new!)== &lt;br /&gt;
Thanks to Dr. Lyubimov, PRIME is also available as a Graphic User Interface program. Try it by running&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Click to see [https://commons.wikimedia.org/wiki/File:PRIME_main.png &amp;quot;PRIME main gui&amp;quot;] and [https://commons.wikimedia.org/wiki/File:PRIME_advanced_options.png &amp;quot;Advanced options&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
== Getting started == &lt;br /&gt;
&#039;&#039;&#039;Generating input phil file&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
Like most programs developed under &#039;&#039;cctbx&#039;&#039; framework, &#039;&#039;prime&#039;&#039; reads in input .phil file, which stores all the parameters needed to run post-refinement and merging steps. To generate the template .phil file, do the dry run by calling&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ prime.run&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
An example of the template .phil file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
data = None&lt;br /&gt;
run_no = None&lt;br /&gt;
title = None&lt;br /&gt;
scale {&lt;br /&gt;
  d_min = 0.1&lt;br /&gt;
  d_max = 99&lt;br /&gt;
  sigma_min = 1.5&lt;br /&gt;
}&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can save the content of the output to any file name - in this tutorial, let&#039;s save it to thermolysin.phil.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;First look at your phil file&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
To run prime, set the required parameters to match with your experiments (you can leave other parameters with their default values - or just delete them from you .phil file). The most interesting parameters are shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
data = /path/to/your/integarion/result/pickle_files&lt;br /&gt;
run_no = 001&lt;br /&gt;
title = First trial for thermolysin&lt;br /&gt;
scale {&lt;br /&gt;
  d_min = 2.1&lt;br /&gt;
  d_max = 45&lt;br /&gt;
  sigma_min = 1.5&lt;br /&gt;
}&lt;br /&gt;
postref {&lt;br /&gt;
  scale {&lt;br /&gt;
    d_min = 2.1&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
  }&lt;br /&gt;
  crystal_orientation {&lt;br /&gt;
    flag_on = True&lt;br /&gt;
    d_min = 2.1&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
  }&lt;br /&gt;
  reflecting_range {&lt;br /&gt;
    flag_on = True&lt;br /&gt;
    d_min = 2.1&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
  }&lt;br /&gt;
  unit_cell {&lt;br /&gt;
    flag_on = True&lt;br /&gt;
    d_min = 2.1&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
    uc_tolerance = 3&lt;br /&gt;
  }&lt;br /&gt;
  allparams {&lt;br /&gt;
    flag_on = False&lt;br /&gt;
    d_min = 2.1&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
    uc_tolerance = 3&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
merge {&lt;br /&gt;
  d_min = 2.1&lt;br /&gt;
  d_max = 45&lt;br /&gt;
  sigma_min = 1.5&lt;br /&gt;
  partiality_min = 0.1&lt;br /&gt;
  uc_tolerance = 3&lt;br /&gt;
}&lt;br /&gt;
target_unit_cell = 93.99,93.99,130.87,90,90,120&lt;br /&gt;
target_space_group = P 61 2 2&lt;br /&gt;
pixel_size_mm = 0.102&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You should pay attention to d_min and d_max for the refinement and merging parameters. If you use IOTA to integrate the images, IOTA will output .phil file for prime that has the optimal resolution range. If not, a few trial-and-error runs may be required to get the best resolution range for your dataset. Use merging statistics output by prime and check the values of CC1/2 and I/sigI to find out your optimal resolution range.&lt;br /&gt;
&lt;br /&gt;
Cell parameters (target_unit_cell and target_space_group) are required to run prime. Target cell parameter is used to remove some outlier images by controlling uc_tolerance parameter (the default value of tolerate range is 3% different). Space group parameter is used in removing outliers and merging with the given symmetry.&lt;br /&gt;
&lt;br /&gt;
Don&#039;t forget also to change your pixel size in millimeters. Check what your detector is and note down its pixel size. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Running post-refinement in automatic mode&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
Once you have the input .phil file, you can run &#039;&#039;prime&#039;&#039; by calling&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.run thermolysin.phil&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;Prime&#039;&#039; will post-refine and merge for reflection sets using three (default value) macrocycles. At the end of the run, you can obtain merging statistics in the last cycle - all other cycle statistics are also available in log.txt.&lt;br /&gt;
&lt;br /&gt;
An example of merging statistics:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Summary for 001/postref_cycle_1_merge.mtz&lt;br /&gt;
Bin Resolution Range     Completeness      &amp;lt;N_obs&amp;gt;  |Rsplit  CC1/2  N_ind |CCanom   N_ind| &amp;lt;I/sigI&amp;gt;   &amp;lt;I&amp;gt;&lt;br /&gt;
-------------------------------------------------------------------------------------------------------------&lt;br /&gt;
02    5.70 -    4.52 100.0   1055 /   1055   65.89   16.02   89.15   1055    0.00      0    20.17    2101.97&lt;br /&gt;
03    4.52 -    3.95 100.0   1032 /   1032   61.53   14.48   92.03   1032    0.00      0    20.39    2529.90&lt;br /&gt;
04    3.95 -    3.59 100.0   1016 /   1016   54.15   15.61   90.13   1016    0.00      0    16.69    1971.43&lt;br /&gt;
05    3.59 -    3.33 100.0   1004 /   1004   42.67   17.66   89.23   1004    0.00      0    14.21    1502.14&lt;br /&gt;
06    3.33 -    3.14 100.0   1013 /   1013   32.77   20.40   84.26   1013    0.00      0    11.76    1077.60&lt;br /&gt;
07    3.14 -    2.98 100.0    995 /    995   27.36   23.00   78.72    995    0.00      0    11.58     935.37&lt;br /&gt;
08    2.98 -    2.85 100.0   1006 /   1006   23.57   22.63   82.26   1006    0.00      0    10.56     722.62&lt;br /&gt;
09    2.85 -    2.74 100.0    986 /    986   16.64   28.51   72.90    985    0.00      0    10.01     591.56&lt;br /&gt;
10    2.74 -    2.65  99.9    989 /    990   12.41   31.35   72.95    987    0.00      0     9.91     515.07&lt;br /&gt;
11    2.65 -    2.56  99.7    979 /    982    9.35   37.14   65.31    970    0.00      0     9.31     438.96&lt;br /&gt;
12    2.56 -    2.49  98.0    979 /    999    6.06   45.98   45.37    930    0.00      0     9.45     390.05&lt;br /&gt;
13    2.49 -    2.42  95.1    931 /    979    4.46   50.68   34.20    834    0.00      0     8.93     334.80&lt;br /&gt;
14    2.42 -    2.37  91.7    896 /    977    3.35   55.66   37.15    729    0.00      0     9.27     320.17&lt;br /&gt;
15    2.37 -    2.31  83.9    829 /    988    2.61   56.92   43.21    600    0.00      0     9.60     296.67&lt;br /&gt;
16    2.31 -    2.26  72.4    702 /    969    1.97   65.81   26.89    386    0.00      0    10.29     284.39&lt;br /&gt;
17    2.26 -    2.22  59.1    582 /    985    1.75   64.72   31.28    275    0.00      0     9.87     284.06&lt;br /&gt;
18    2.22 -    2.18  52.9    513 /    970    1.51   71.27   16.86    188    0.00      0     8.93     215.31&lt;br /&gt;
19    2.18 -    2.14  35.7    349 /    978    1.32   62.26   68.25     90    0.00      0     8.22     199.09&lt;br /&gt;
20    2.14 -    2.10  23.1    227 /    981    1.20   92.14   -9.20     42    0.00      0     8.59     224.44&lt;br /&gt;
-------------------------------------------------------------------------------------------------------------&lt;br /&gt;
        TOTAL         85.9  17224 /  20046   27.11   21.11   92.07  15305    0.00      0    12.87     999.53&lt;br /&gt;
-------------------------------------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
Summary of refinement and merging&lt;br /&gt;
 No. good frames:                  1809&lt;br /&gt;
 No. bad cc frames:                 153&lt;br /&gt;
 No. bad G frames) :                  0&lt;br /&gt;
 No. bad unit cell frames:            5&lt;br /&gt;
 No. bad gamma_e frames:              0&lt;br /&gt;
 No. bad SE:                          0&lt;br /&gt;
 No. observations:               466997&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== More detail with input parameters ==&lt;br /&gt;
Now that you have your first trial merged data set, you can explore different parameter settings to merge or to obtain the Bijvoet pairs (I+/I-) for your anomalous data set.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Anomalous data:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
target_anomalous_flag = True&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
In the last cycle, prime will output a reflection set with I+ and I-.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Indexing ambiguity&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For space groups with indexing ambiguity, use the solutions from cctbx.xfel (see Tutorial for resolving indexing ambiguity) to merge the data set.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
indexing_ambiguity {&lt;br /&gt;
  flag_on = True&lt;br /&gt;
  index_basis_in = /path/to/solution/pickle_file.pickle&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Number of micro- and macrocycles&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
n_postref_cycle = 3&lt;br /&gt;
n_postref_sub_cycle = 3&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Number of bins for merging statistics&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
n_bins = 20&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Help with input parameters ==&lt;br /&gt;
&lt;br /&gt;
Most input parameters are self-explained. However, you can run -h switch to view help information for each parameter.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.run -h&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Running in manual mode ==&lt;br /&gt;
With the same phil file, you can run prime manually. This gives you more freedom in terms of parameter settings at different stages (generating reference set, post-refining images, and merging) or at different cycle of post-refinement.&lt;br /&gt;
&lt;br /&gt;
Example A: I want to generate a reference set then post-refine all the images on the &#039;&#039;&#039;scale factors only&#039;&#039;&#039; for &#039;&#039;&#039;three cycles&#039;&#039;&#039; then refine all parameters in the 4th cycle. You&#039;d run&lt;br /&gt;
&lt;br /&gt;
To generate a reference set,&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.genref prime.phil&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
To post-refine on scale factors only, modify your .phil file so that all parameters are turned &#039;&#039;off&#039;&#039;.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
scale {&lt;br /&gt;
  d_min = 2.5&lt;br /&gt;
  d_max = 45&lt;br /&gt;
  sigma_min = 1.5&lt;br /&gt;
}&lt;br /&gt;
postref {&lt;br /&gt;
  residual_threshold = 5&lt;br /&gt;
  residual_threshold_xy = 5&lt;br /&gt;
  scale {&lt;br /&gt;
    d_min = 2.5&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
  }&lt;br /&gt;
  crystal_orientation {&lt;br /&gt;
    flag_on = &#039;&#039;&#039;False&#039;&#039;&#039;&lt;br /&gt;
    d_min = 2.5&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
  }&lt;br /&gt;
  reflecting_range {&lt;br /&gt;
    flag_on = &#039;&#039;&#039;False&#039;&#039;&#039;&lt;br /&gt;
    d_min = 2.5&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
  }&lt;br /&gt;
  unit_cell {&lt;br /&gt;
    flag_on = &#039;&#039;&#039;False&#039;&#039;&#039;&lt;br /&gt;
    d_min = 2.5&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
    uc_tolerance = 5&lt;br /&gt;
  }&lt;br /&gt;
  allparams {&lt;br /&gt;
    flag_on = &#039;&#039;&#039;False&#039;&#039;&#039;&lt;br /&gt;
    d_min = 2.5&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
    uc_tolerance = 5&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
...&lt;br /&gt;
n_postref_cycle = 3&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then run,&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.postrefine prime.phil&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
To refine all parameters one more cycle, update your .phil file again&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
  allparams {&lt;br /&gt;
    flag_on = &#039;&#039;&#039;True&#039;&#039;&#039;&lt;br /&gt;
    d_min = 2.5&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
    uc_tolerance = 5&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
...&lt;br /&gt;
n_postref_cycle = 1&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then run,&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.postrefine prime.phil&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
To obtain the final merged mtz, run&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.merge prime.phil&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mona</name></author>
	</entry>
	<entry>
		<id>http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=Cctbx.prime&amp;diff=1229</id>
		<title>Cctbx.prime</title>
		<link rel="alternate" type="text/html" href="http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=Cctbx.prime&amp;diff=1229"/>
		<updated>2016-08-02T00:10:02Z</updated>

		<summary type="html">&lt;p&gt;Mona: /* Running in manual mode */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Prime: &#039;&#039;&#039;p&#039;&#039;&#039;ost-&#039;&#039;&#039;r&#039;&#039;&#039;ef&#039;&#039;&#039;i&#039;&#039;&#039;nement and &#039;&#039;&#039;me&#039;&#039;&#039;rging ==&lt;br /&gt;
With the latest update, prime can be used to process data on multiple nodes (on queuing system). At the moment, only LSF (bsub) is supported. See documentation below for more information how to use the queuing system.&lt;br /&gt;
&lt;br /&gt;
This major update replaces prime.postrefine with &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.run &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For auto mode, you can still use prime.run with your parameter phil file like before. For manual mode, the available sub commands in prime are:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.genref #generates a reference set from given integration results&lt;br /&gt;
prime.postrefine #refines all images&lt;br /&gt;
prime.merge #merges all refined results for an mtz file&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can choose to run these commands independently (ideally in the above order) using the same phil file. See [https://commons.wikimedia.org/wiki/File:Prime_flowcharts.tif &amp;quot;PRIME flowchart&amp;quot;]. This will you a freedom to change something (e.g. set of parameters to refine, resolution cut-off, etc.) at different stages of the post-refinement and merging. See running prime in manual mode for more detail.&lt;br /&gt;
&lt;br /&gt;
Step-by-step guidelines to post-refine and merge XFEL diffraction images. For more detail and citation, see &lt;br /&gt;
&amp;quot;Enabling X-ray Free Electron Laser Crystallography for Challenging Biological Systems from a Limited Number of Crystals&amp;quot;&lt;br /&gt;
[http://elifesciences.org/content/4/e05421 &amp;quot;DOI: http://dx.doi.org/10.7554/eLife.05421&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
== Prime is gui-ed (new!)== &lt;br /&gt;
Thanks to Dr. Lyubimov, PRIME is also available as a Graphic User Interface program. Try it by running&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Click to see [https://commons.wikimedia.org/wiki/File:PRIME_main.png &amp;quot;PRIME main gui&amp;quot;] and [https://commons.wikimedia.org/wiki/File:PRIME_advanced_options.png &amp;quot;Advanced options&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
== Getting started == &lt;br /&gt;
&#039;&#039;&#039;Generating input phil file&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
Like most programs developed under &#039;&#039;cctbx&#039;&#039; framework, &#039;&#039;prime&#039;&#039; reads in input .phil file, which stores all the parameters needed to run post-refinement and merging steps. To generate the template .phil file, do the dry run by calling&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ prime.run&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
An example of the template .phil file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
data = None&lt;br /&gt;
run_no = None&lt;br /&gt;
title = None&lt;br /&gt;
scale {&lt;br /&gt;
  d_min = 0.1&lt;br /&gt;
  d_max = 99&lt;br /&gt;
  sigma_min = 1.5&lt;br /&gt;
}&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can save the content of the output to any file name - in this tutorial, let&#039;s save it to thermolysin.phil.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;First look at your phil file&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
To run prime, set the required parameters to match with your experiments (you can leave other parameters with their default values - or just delete them from you .phil file). The most interesting parameters are shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
data = /path/to/your/integarion/result/pickle_files&lt;br /&gt;
run_no = 001&lt;br /&gt;
title = First trial for thermolysin&lt;br /&gt;
scale {&lt;br /&gt;
  d_min = 2.1&lt;br /&gt;
  d_max = 45&lt;br /&gt;
  sigma_min = 1.5&lt;br /&gt;
}&lt;br /&gt;
postref {&lt;br /&gt;
  scale {&lt;br /&gt;
    d_min = 2.1&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
  }&lt;br /&gt;
  crystal_orientation {&lt;br /&gt;
    flag_on = True&lt;br /&gt;
    d_min = 2.1&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
  }&lt;br /&gt;
  reflecting_range {&lt;br /&gt;
    flag_on = True&lt;br /&gt;
    d_min = 2.1&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
  }&lt;br /&gt;
  unit_cell {&lt;br /&gt;
    flag_on = True&lt;br /&gt;
    d_min = 2.1&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
    uc_tolerance = 3&lt;br /&gt;
  }&lt;br /&gt;
  allparams {&lt;br /&gt;
    flag_on = False&lt;br /&gt;
    d_min = 2.1&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
    uc_tolerance = 3&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
merge {&lt;br /&gt;
  d_min = 2.1&lt;br /&gt;
  d_max = 45&lt;br /&gt;
  sigma_min = 1.5&lt;br /&gt;
  partiality_min = 0.1&lt;br /&gt;
  uc_tolerance = 3&lt;br /&gt;
}&lt;br /&gt;
target_unit_cell = 93.99,93.99,130.87,90,90,120&lt;br /&gt;
target_space_group = P 61 2 2&lt;br /&gt;
pixel_size_mm = 0.102&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You should pay attention to d_min and d_max for the refinement and merging parameters. If you use IOTA to integrate the images, IOTA will output .phil file for prime that has the optimal resolution range. If not, a few trial-and-error runs may be required to get the best resolution range for your dataset. Use merging statistics output by prime and check the values of CC1/2 and I/sigI to find out your optimal resolution range.&lt;br /&gt;
&lt;br /&gt;
Cell parameters (target_unit_cell and target_space_group) are required to run prime. Target cell parameter is used to remove some outlier images by controlling uc_tolerance parameter (the default value of tolerate range is 3% different). Space group parameter is used in removing outliers and merging with the given symmetry.&lt;br /&gt;
&lt;br /&gt;
Don&#039;t forget also to change your pixel size in millimeters. Check what your detector is and note down its pixel size. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Running post-refinement in automatic mode&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
Once you have the input .phil file, you can run &#039;&#039;prime&#039;&#039; by calling&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.run thermolysin.phil&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;Prime&#039;&#039; will post-refine and merge for reflection sets using three (default value) macrocycles. At the end of the run, you can obtain merging statistics in the last cycle - all other cycle statistics are also available in log.txt.&lt;br /&gt;
&lt;br /&gt;
An example of merging statistics:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Summary for 001/postref_cycle_1_merge.mtz&lt;br /&gt;
Bin Resolution Range     Completeness      &amp;lt;N_obs&amp;gt;  |Rsplit  CC1/2  N_ind |CCanom   N_ind| &amp;lt;I/sigI&amp;gt;   &amp;lt;I&amp;gt;&lt;br /&gt;
-------------------------------------------------------------------------------------------------------------&lt;br /&gt;
02    5.70 -    4.52 100.0   1055 /   1055   65.89   16.02   89.15   1055    0.00      0    20.17    2101.97&lt;br /&gt;
03    4.52 -    3.95 100.0   1032 /   1032   61.53   14.48   92.03   1032    0.00      0    20.39    2529.90&lt;br /&gt;
04    3.95 -    3.59 100.0   1016 /   1016   54.15   15.61   90.13   1016    0.00      0    16.69    1971.43&lt;br /&gt;
05    3.59 -    3.33 100.0   1004 /   1004   42.67   17.66   89.23   1004    0.00      0    14.21    1502.14&lt;br /&gt;
06    3.33 -    3.14 100.0   1013 /   1013   32.77   20.40   84.26   1013    0.00      0    11.76    1077.60&lt;br /&gt;
07    3.14 -    2.98 100.0    995 /    995   27.36   23.00   78.72    995    0.00      0    11.58     935.37&lt;br /&gt;
08    2.98 -    2.85 100.0   1006 /   1006   23.57   22.63   82.26   1006    0.00      0    10.56     722.62&lt;br /&gt;
09    2.85 -    2.74 100.0    986 /    986   16.64   28.51   72.90    985    0.00      0    10.01     591.56&lt;br /&gt;
10    2.74 -    2.65  99.9    989 /    990   12.41   31.35   72.95    987    0.00      0     9.91     515.07&lt;br /&gt;
11    2.65 -    2.56  99.7    979 /    982    9.35   37.14   65.31    970    0.00      0     9.31     438.96&lt;br /&gt;
12    2.56 -    2.49  98.0    979 /    999    6.06   45.98   45.37    930    0.00      0     9.45     390.05&lt;br /&gt;
13    2.49 -    2.42  95.1    931 /    979    4.46   50.68   34.20    834    0.00      0     8.93     334.80&lt;br /&gt;
14    2.42 -    2.37  91.7    896 /    977    3.35   55.66   37.15    729    0.00      0     9.27     320.17&lt;br /&gt;
15    2.37 -    2.31  83.9    829 /    988    2.61   56.92   43.21    600    0.00      0     9.60     296.67&lt;br /&gt;
16    2.31 -    2.26  72.4    702 /    969    1.97   65.81   26.89    386    0.00      0    10.29     284.39&lt;br /&gt;
17    2.26 -    2.22  59.1    582 /    985    1.75   64.72   31.28    275    0.00      0     9.87     284.06&lt;br /&gt;
18    2.22 -    2.18  52.9    513 /    970    1.51   71.27   16.86    188    0.00      0     8.93     215.31&lt;br /&gt;
19    2.18 -    2.14  35.7    349 /    978    1.32   62.26   68.25     90    0.00      0     8.22     199.09&lt;br /&gt;
20    2.14 -    2.10  23.1    227 /    981    1.20   92.14   -9.20     42    0.00      0     8.59     224.44&lt;br /&gt;
-------------------------------------------------------------------------------------------------------------&lt;br /&gt;
        TOTAL         85.9  17224 /  20046   27.11   21.11   92.07  15305    0.00      0    12.87     999.53&lt;br /&gt;
-------------------------------------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
Summary of refinement and merging&lt;br /&gt;
 No. good frames:                  1809&lt;br /&gt;
 No. bad cc frames:                 153&lt;br /&gt;
 No. bad G frames) :                  0&lt;br /&gt;
 No. bad unit cell frames:            5&lt;br /&gt;
 No. bad gamma_e frames:              0&lt;br /&gt;
 No. bad SE:                          0&lt;br /&gt;
 No. observations:               466997&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== More detail with input parameters ==&lt;br /&gt;
Now that you have your first trial merged data set, you can explore different parameter settings to merge or to obtain the Bijvoet pairs (I+/I-) for your anomalous data set.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Anomalous data:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
target_anomalous_flag = True&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
In the last cycle, prime will output a reflection set with I+ and I-.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Indexing ambiguity&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For space groups with indexing ambiguity, use the solutions from cctbx.xfel (see Tutorial for resolving indexing ambiguity) to merge the data set.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
indexing_ambiguity {&lt;br /&gt;
  flag_on = True&lt;br /&gt;
  index_basis_in = /path/to/solution/pickle_file.pickle&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Number of micro- and macrocycles&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
n_postref_cycle = 3&lt;br /&gt;
n_postref_sub_cycle = 3&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Number of bins for merging statistics&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
n_bins = 20&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Help with input parameters ==&lt;br /&gt;
&lt;br /&gt;
Most input parameters are self-explained. However, you can run -h switch to view help information for each parameter.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.run -h&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Running in manual mode ==&lt;br /&gt;
With the same phil file, you can run prime manually. This gives you more freedom in terms of parameter settings at different stages (generating reference set, post-refining images, and merging) or at different cycle of post-refinement.&lt;br /&gt;
&lt;br /&gt;
Example A: I want to generate a reference set the post-refine all the images on the scale factors only for three cycles then refine all parameters in the 4th cycle. You&#039;d run&lt;br /&gt;
&lt;br /&gt;
For generating a reference set,&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.genref prime.phil&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
For post-refinement on scale factors only, modify your .phil file so that all parameters are turned &#039;&#039;off&#039;&#039;.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
scale {&lt;br /&gt;
  d_min = 2.5&lt;br /&gt;
  d_max = 45&lt;br /&gt;
  sigma_min = 1.5&lt;br /&gt;
}&lt;br /&gt;
postref {&lt;br /&gt;
  residual_threshold = 5&lt;br /&gt;
  residual_threshold_xy = 5&lt;br /&gt;
  scale {&lt;br /&gt;
    d_min = 2.5&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
  }&lt;br /&gt;
  crystal_orientation {&lt;br /&gt;
    flag_on = &#039;&#039;&#039;False&#039;&#039;&#039;&lt;br /&gt;
    d_min = 2.5&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
  }&lt;br /&gt;
  reflecting_range {&lt;br /&gt;
    flag_on = &#039;&#039;&#039;False&#039;&#039;&#039;&lt;br /&gt;
    d_min = 2.5&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
  }&lt;br /&gt;
  unit_cell {&lt;br /&gt;
    flag_on = &#039;&#039;&#039;False&#039;&#039;&#039;&lt;br /&gt;
    d_min = 2.5&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
    uc_tolerance = 5&lt;br /&gt;
  }&lt;br /&gt;
  allparams {&lt;br /&gt;
    flag_on = &#039;&#039;&#039;False&#039;&#039;&#039;&lt;br /&gt;
    d_min = 2.5&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
    uc_tolerance = 5&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
...&lt;br /&gt;
n_postref_cycle = 3&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mona</name></author>
	</entry>
	<entry>
		<id>http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=Cctbx.prime&amp;diff=1228</id>
		<title>Cctbx.prime</title>
		<link rel="alternate" type="text/html" href="http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=Cctbx.prime&amp;diff=1228"/>
		<updated>2016-08-02T00:09:27Z</updated>

		<summary type="html">&lt;p&gt;Mona: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Prime: &#039;&#039;&#039;p&#039;&#039;&#039;ost-&#039;&#039;&#039;r&#039;&#039;&#039;ef&#039;&#039;&#039;i&#039;&#039;&#039;nement and &#039;&#039;&#039;me&#039;&#039;&#039;rging ==&lt;br /&gt;
With the latest update, prime can be used to process data on multiple nodes (on queuing system). At the moment, only LSF (bsub) is supported. See documentation below for more information how to use the queuing system.&lt;br /&gt;
&lt;br /&gt;
This major update replaces prime.postrefine with &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.run &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For auto mode, you can still use prime.run with your parameter phil file like before. For manual mode, the available sub commands in prime are:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.genref #generates a reference set from given integration results&lt;br /&gt;
prime.postrefine #refines all images&lt;br /&gt;
prime.merge #merges all refined results for an mtz file&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can choose to run these commands independently (ideally in the above order) using the same phil file. See [https://commons.wikimedia.org/wiki/File:Prime_flowcharts.tif &amp;quot;PRIME flowchart&amp;quot;]. This will you a freedom to change something (e.g. set of parameters to refine, resolution cut-off, etc.) at different stages of the post-refinement and merging. See running prime in manual mode for more detail.&lt;br /&gt;
&lt;br /&gt;
Step-by-step guidelines to post-refine and merge XFEL diffraction images. For more detail and citation, see &lt;br /&gt;
&amp;quot;Enabling X-ray Free Electron Laser Crystallography for Challenging Biological Systems from a Limited Number of Crystals&amp;quot;&lt;br /&gt;
[http://elifesciences.org/content/4/e05421 &amp;quot;DOI: http://dx.doi.org/10.7554/eLife.05421&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
== Prime is gui-ed (new!)== &lt;br /&gt;
Thanks to Dr. Lyubimov, PRIME is also available as a Graphic User Interface program. Try it by running&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Click to see [https://commons.wikimedia.org/wiki/File:PRIME_main.png &amp;quot;PRIME main gui&amp;quot;] and [https://commons.wikimedia.org/wiki/File:PRIME_advanced_options.png &amp;quot;Advanced options&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
== Getting started == &lt;br /&gt;
&#039;&#039;&#039;Generating input phil file&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
Like most programs developed under &#039;&#039;cctbx&#039;&#039; framework, &#039;&#039;prime&#039;&#039; reads in input .phil file, which stores all the parameters needed to run post-refinement and merging steps. To generate the template .phil file, do the dry run by calling&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ prime.run&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
An example of the template .phil file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
data = None&lt;br /&gt;
run_no = None&lt;br /&gt;
title = None&lt;br /&gt;
scale {&lt;br /&gt;
  d_min = 0.1&lt;br /&gt;
  d_max = 99&lt;br /&gt;
  sigma_min = 1.5&lt;br /&gt;
}&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can save the content of the output to any file name - in this tutorial, let&#039;s save it to thermolysin.phil.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;First look at your phil file&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
To run prime, set the required parameters to match with your experiments (you can leave other parameters with their default values - or just delete them from you .phil file). The most interesting parameters are shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
data = /path/to/your/integarion/result/pickle_files&lt;br /&gt;
run_no = 001&lt;br /&gt;
title = First trial for thermolysin&lt;br /&gt;
scale {&lt;br /&gt;
  d_min = 2.1&lt;br /&gt;
  d_max = 45&lt;br /&gt;
  sigma_min = 1.5&lt;br /&gt;
}&lt;br /&gt;
postref {&lt;br /&gt;
  scale {&lt;br /&gt;
    d_min = 2.1&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
  }&lt;br /&gt;
  crystal_orientation {&lt;br /&gt;
    flag_on = True&lt;br /&gt;
    d_min = 2.1&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
  }&lt;br /&gt;
  reflecting_range {&lt;br /&gt;
    flag_on = True&lt;br /&gt;
    d_min = 2.1&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
  }&lt;br /&gt;
  unit_cell {&lt;br /&gt;
    flag_on = True&lt;br /&gt;
    d_min = 2.1&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
    uc_tolerance = 3&lt;br /&gt;
  }&lt;br /&gt;
  allparams {&lt;br /&gt;
    flag_on = False&lt;br /&gt;
    d_min = 2.1&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
    uc_tolerance = 3&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
merge {&lt;br /&gt;
  d_min = 2.1&lt;br /&gt;
  d_max = 45&lt;br /&gt;
  sigma_min = 1.5&lt;br /&gt;
  partiality_min = 0.1&lt;br /&gt;
  uc_tolerance = 3&lt;br /&gt;
}&lt;br /&gt;
target_unit_cell = 93.99,93.99,130.87,90,90,120&lt;br /&gt;
target_space_group = P 61 2 2&lt;br /&gt;
pixel_size_mm = 0.102&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You should pay attention to d_min and d_max for the refinement and merging parameters. If you use IOTA to integrate the images, IOTA will output .phil file for prime that has the optimal resolution range. If not, a few trial-and-error runs may be required to get the best resolution range for your dataset. Use merging statistics output by prime and check the values of CC1/2 and I/sigI to find out your optimal resolution range.&lt;br /&gt;
&lt;br /&gt;
Cell parameters (target_unit_cell and target_space_group) are required to run prime. Target cell parameter is used to remove some outlier images by controlling uc_tolerance parameter (the default value of tolerate range is 3% different). Space group parameter is used in removing outliers and merging with the given symmetry.&lt;br /&gt;
&lt;br /&gt;
Don&#039;t forget also to change your pixel size in millimeters. Check what your detector is and note down its pixel size. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Running post-refinement in automatic mode&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
Once you have the input .phil file, you can run &#039;&#039;prime&#039;&#039; by calling&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.run thermolysin.phil&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;Prime&#039;&#039; will post-refine and merge for reflection sets using three (default value) macrocycles. At the end of the run, you can obtain merging statistics in the last cycle - all other cycle statistics are also available in log.txt.&lt;br /&gt;
&lt;br /&gt;
An example of merging statistics:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Summary for 001/postref_cycle_1_merge.mtz&lt;br /&gt;
Bin Resolution Range     Completeness      &amp;lt;N_obs&amp;gt;  |Rsplit  CC1/2  N_ind |CCanom   N_ind| &amp;lt;I/sigI&amp;gt;   &amp;lt;I&amp;gt;&lt;br /&gt;
-------------------------------------------------------------------------------------------------------------&lt;br /&gt;
02    5.70 -    4.52 100.0   1055 /   1055   65.89   16.02   89.15   1055    0.00      0    20.17    2101.97&lt;br /&gt;
03    4.52 -    3.95 100.0   1032 /   1032   61.53   14.48   92.03   1032    0.00      0    20.39    2529.90&lt;br /&gt;
04    3.95 -    3.59 100.0   1016 /   1016   54.15   15.61   90.13   1016    0.00      0    16.69    1971.43&lt;br /&gt;
05    3.59 -    3.33 100.0   1004 /   1004   42.67   17.66   89.23   1004    0.00      0    14.21    1502.14&lt;br /&gt;
06    3.33 -    3.14 100.0   1013 /   1013   32.77   20.40   84.26   1013    0.00      0    11.76    1077.60&lt;br /&gt;
07    3.14 -    2.98 100.0    995 /    995   27.36   23.00   78.72    995    0.00      0    11.58     935.37&lt;br /&gt;
08    2.98 -    2.85 100.0   1006 /   1006   23.57   22.63   82.26   1006    0.00      0    10.56     722.62&lt;br /&gt;
09    2.85 -    2.74 100.0    986 /    986   16.64   28.51   72.90    985    0.00      0    10.01     591.56&lt;br /&gt;
10    2.74 -    2.65  99.9    989 /    990   12.41   31.35   72.95    987    0.00      0     9.91     515.07&lt;br /&gt;
11    2.65 -    2.56  99.7    979 /    982    9.35   37.14   65.31    970    0.00      0     9.31     438.96&lt;br /&gt;
12    2.56 -    2.49  98.0    979 /    999    6.06   45.98   45.37    930    0.00      0     9.45     390.05&lt;br /&gt;
13    2.49 -    2.42  95.1    931 /    979    4.46   50.68   34.20    834    0.00      0     8.93     334.80&lt;br /&gt;
14    2.42 -    2.37  91.7    896 /    977    3.35   55.66   37.15    729    0.00      0     9.27     320.17&lt;br /&gt;
15    2.37 -    2.31  83.9    829 /    988    2.61   56.92   43.21    600    0.00      0     9.60     296.67&lt;br /&gt;
16    2.31 -    2.26  72.4    702 /    969    1.97   65.81   26.89    386    0.00      0    10.29     284.39&lt;br /&gt;
17    2.26 -    2.22  59.1    582 /    985    1.75   64.72   31.28    275    0.00      0     9.87     284.06&lt;br /&gt;
18    2.22 -    2.18  52.9    513 /    970    1.51   71.27   16.86    188    0.00      0     8.93     215.31&lt;br /&gt;
19    2.18 -    2.14  35.7    349 /    978    1.32   62.26   68.25     90    0.00      0     8.22     199.09&lt;br /&gt;
20    2.14 -    2.10  23.1    227 /    981    1.20   92.14   -9.20     42    0.00      0     8.59     224.44&lt;br /&gt;
-------------------------------------------------------------------------------------------------------------&lt;br /&gt;
        TOTAL         85.9  17224 /  20046   27.11   21.11   92.07  15305    0.00      0    12.87     999.53&lt;br /&gt;
-------------------------------------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
Summary of refinement and merging&lt;br /&gt;
 No. good frames:                  1809&lt;br /&gt;
 No. bad cc frames:                 153&lt;br /&gt;
 No. bad G frames) :                  0&lt;br /&gt;
 No. bad unit cell frames:            5&lt;br /&gt;
 No. bad gamma_e frames:              0&lt;br /&gt;
 No. bad SE:                          0&lt;br /&gt;
 No. observations:               466997&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== More detail with input parameters ==&lt;br /&gt;
Now that you have your first trial merged data set, you can explore different parameter settings to merge or to obtain the Bijvoet pairs (I+/I-) for your anomalous data set.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Anomalous data:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
target_anomalous_flag = True&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
In the last cycle, prime will output a reflection set with I+ and I-.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Indexing ambiguity&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For space groups with indexing ambiguity, use the solutions from cctbx.xfel (see Tutorial for resolving indexing ambiguity) to merge the data set.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
indexing_ambiguity {&lt;br /&gt;
  flag_on = True&lt;br /&gt;
  index_basis_in = /path/to/solution/pickle_file.pickle&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Number of micro- and macrocycles&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
n_postref_cycle = 3&lt;br /&gt;
n_postref_sub_cycle = 3&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Number of bins for merging statistics&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
n_bins = 20&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Help with input parameters ==&lt;br /&gt;
&lt;br /&gt;
Most input parameters are self-explained. However, you can run -h switch to view help information for each parameter.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.run -h&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Running in manual mode ==&lt;br /&gt;
With the same phil file, you can run prime manually. This gives you more freedom in terms of parameter settings at different stages (generating reference set, post-refining images, and merging) or at different cycle of post-refinement.&lt;br /&gt;
&lt;br /&gt;
Example A: I want to generate a reference set the post-refine all the images on the scale factors only for three cycles then refine all parameters in the 4th cycle. You&#039;d run&lt;br /&gt;
&lt;br /&gt;
For generating a reference set,&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prime.genref prime.phil&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
For post-refinement on scale factors only, modify your .phil file so that all parameters are turned &#039;&#039;off&#039;&#039;.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
scale {&lt;br /&gt;
  d_min = 2.5&lt;br /&gt;
  d_max = 45&lt;br /&gt;
  sigma_min = 1.5&lt;br /&gt;
}&lt;br /&gt;
postref {&lt;br /&gt;
  residual_threshold = 5&lt;br /&gt;
  residual_threshold_xy = 5&lt;br /&gt;
  scale {&lt;br /&gt;
    d_min = 2.5&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
  }&lt;br /&gt;
  crystal_orientation {&lt;br /&gt;
    flag_on = &#039;&#039;&#039;False&#039;&#039;&#039;&lt;br /&gt;
    d_min = 2.5&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
  }&lt;br /&gt;
  reflecting_range {&lt;br /&gt;
    flag_on = &#039;&#039;&#039;False&#039;&#039;&#039;&lt;br /&gt;
    d_min = 2.5&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
  }&lt;br /&gt;
  unit_cell {&lt;br /&gt;
    flag_on = &#039;&#039;&#039;False&#039;&#039;&#039;&lt;br /&gt;
    d_min = 2.5&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
    uc_tolerance = 5&lt;br /&gt;
  }&lt;br /&gt;
  allparams {&lt;br /&gt;
    flag_on = &#039;&#039;&#039;False&#039;&#039;&#039;&lt;br /&gt;
    d_min = 2.5&lt;br /&gt;
    d_max = 45&lt;br /&gt;
    sigma_min = 1.5&lt;br /&gt;
    partiality_min = 0.1&lt;br /&gt;
    uc_tolerance = 5&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
...&lt;br /&gt;
n_postref_cycle = 3&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mona</name></author>
	</entry>
</feed>