<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://viper.lbl.gov:8080/cctbx.xfel/index.php?action=history&amp;feed=atom&amp;title=Advanced_Merging</id>
	<title>Advanced Merging - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://viper.lbl.gov:8080/cctbx.xfel/index.php?action=history&amp;feed=atom&amp;title=Advanced_Merging"/>
	<link rel="alternate" type="text/html" href="http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=Advanced_Merging&amp;action=history"/>
	<updated>2026-05-30T08:07:15Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.39.15</generator>
	<entry>
		<id>http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=Advanced_Merging&amp;diff=961&amp;oldid=prev</id>
		<title>Aaron: /* Use case 2: New structure */</title>
		<link rel="alternate" type="text/html" href="http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=Advanced_Merging&amp;diff=961&amp;oldid=prev"/>
		<updated>2015-08-07T17:02:43Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Use case 2: New structure&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 17:02, 7 August 2015&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l72&quot;&gt;Line 72:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 72:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;set_average_unit_cell=True \&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;set_average_unit_cell=True \&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;rescale_with_average_cell=True \&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;rescale_with_average_cell=True \&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;pixel_size = 0.11 \&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;output.prefix=${tag}”&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;output.prefix=${tag}”&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Aaron</name></author>
	</entry>
	<entry>
		<id>http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=Advanced_Merging&amp;diff=960&amp;oldid=prev</id>
		<title>Aaron: /* Use case 1: Isomorphous replacement */</title>
		<link rel="alternate" type="text/html" href="http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=Advanced_Merging&amp;diff=960&amp;oldid=prev"/>
		<updated>2015-08-07T17:02:22Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Use case 1: Isomorphous replacement&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Here we describe two use cases for merging: one where an isomorphous structure is already known, and the other with a new structure.  In the examples below, note the use of the same command line parameters for the MERGE and XMERGE steps, allowing the command script to be formed in a condensed non-redundant fashion.  Not all of the parameters are actually used by both steps. Used only by merge:  nproc. Used only by xmerge:  scaling.*&lt;br /&gt;
&lt;br /&gt;
== Use case 1: Isomorphous replacement ==&lt;br /&gt;
In this case, the new XFEL data are scaled to a known isomorphous reference, either a synchrotron-solved structure or a previous XFEL structure:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ vi psII_merge.csh&lt;br /&gt;
#!/bin/csh -f&lt;br /&gt;
set trial=${1}&lt;br /&gt;
&lt;br /&gt;
set runs = 127,130,132,134,135,140,141,142,144,145,146,148,151,152,157,162,163&lt;br /&gt;
set datastring = \&lt;br /&gt;
`python -c &amp;quot;print &amp;#039; &amp;#039;.join([&amp;#039;data=/my_result_directory/L785/r%04d/${trial}/integration&amp;#039;%i for i in [${runs}]])&amp;quot;`&lt;br /&gt;
set tag = L785_2flash_${trial}&lt;br /&gt;
&lt;br /&gt;
set effective_params = &amp;quot;d_min=4.7 \&lt;br /&gt;
output.n_bins=20 \&lt;br /&gt;
${datastring} \&lt;br /&gt;
model=/my_work/3bz1_3bz2_core.pdb \&lt;br /&gt;
nproc=16 \&lt;br /&gt;
merge_anomalous=True \&lt;br /&gt;
plot_single_index_histograms=False \&lt;br /&gt;
raw_data.sdfac_auto=True \&lt;br /&gt;
mysql.runtag=${tag} \&lt;br /&gt;
mysql.passwd=terp888 \&lt;br /&gt;
mysql.user=nick \&lt;br /&gt;
mysql.database=xfelnks \&lt;br /&gt;
scaling.mtz_file=./3bz1-sf.mtz \&lt;br /&gt;
scaling.show_plots=False \&lt;br /&gt;
scaling.algorithm=mark0 \&lt;br /&gt;
scaling.log_cutoff=9. \&lt;br /&gt;
set_average_unit_cell=True \&lt;br /&gt;
rescale_with_average_cell=True \&lt;br /&gt;
pixel_size = 0.11 \&lt;br /&gt;
output.prefix=${tag}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
cxi.merge ${effective_params}&lt;br /&gt;
cxi.xmerge ${effective_params}&lt;br /&gt;
&lt;br /&gt;
$./psII_merge.csh 009 # merge the data from trial 009&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Use case 2: New structure ==&lt;br /&gt;
This is a completely unknown structure with no isomorphous reference:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ vi bt_allmerge.csh&lt;br /&gt;
#!/bin/csh -f&lt;br /&gt;
&lt;br /&gt;
set trial=${1}&lt;br /&gt;
set datadir = /my_work_area/LCLS/cxis9913&lt;br /&gt;
set runs = 62,63,64,65,66,67,68,69,70&lt;br /&gt;
set datastring = `python -c &amp;quot;print &amp;#039; &amp;#039;.join([&amp;#039;data=${datadir}/r%04d/${trial}/integration&amp;#039;%i for i in [${runs}]])&amp;quot;`&lt;br /&gt;
set tag = last_BT_${trial}&lt;br /&gt;
&lt;br /&gt;
set effective_params = “d_min=3.0 \&lt;br /&gt;
output.n_bins=13 \&lt;br /&gt;
${datastring} \&lt;br /&gt;
target_unit_cell=81.8,94.0,123.0,90,90,90 \&lt;br /&gt;
target_space_group=P212121 \&lt;br /&gt;
nproc=16 \&lt;br /&gt;
merge_anomalous=True \&lt;br /&gt;
plot_single_index_histograms=False \&lt;br /&gt;
raw_data.sdfac_auto=True \&lt;br /&gt;
mysql.runtag=${tag} \&lt;br /&gt;
mysql.passwd=terp888 \&lt;br /&gt;
mysql.user=nick \&lt;br /&gt;
mysql.database=xfelnks \&lt;br /&gt;
scaling.mtz_file=&amp;quot;fake_fake.mtz&amp;quot; \&lt;br /&gt;
scaling.show_plots=True \&lt;br /&gt;
scaling.algorithm=mark1 \&lt;br /&gt;
scaling.log_cutoff=3. \&lt;br /&gt;
scaling.mtz_column_F=f-obs \&lt;br /&gt;
set_average_unit_cell=True \&lt;br /&gt;
rescale_with_average_cell=True \&lt;br /&gt;
output.prefix=${tag}”&lt;br /&gt;
&lt;br /&gt;
cxi.merge ${effective_params}&lt;br /&gt;
cxi.xmerge ${effective_params}&lt;br /&gt;
&lt;br /&gt;
$ ./bt_allmerge.csh 001&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== The two cases contrasted ==&lt;br /&gt;
Note the following differences in the command lines for the two use cases:&lt;br /&gt;
* &amp;lt;code&amp;gt;model &amp;lt;/code&amp;gt; [pdb file | mtz file] is provided only in case #1 as the scaling reference, not in case #2.  &lt;br /&gt;
* &amp;lt;code&amp;gt;min_corr &amp;lt;/code&amp;gt; is ignored in case #2; images are not discarded for lack of correlation to a reference.  &lt;br /&gt;
* &amp;lt;code&amp;gt;target_unit_cell&amp;lt;/code&amp;gt; is mandatory in case #2; it is used to form the list of reflections in the asymmetric unit.  Not used in case #1.&lt;br /&gt;
* &amp;lt;code&amp;gt;target_space_group&amp;lt;/code&amp;gt; [symbol] is mandatory in case #2 and is carried through to the mtz output.&lt;br /&gt;
* &amp;lt;code&amp;gt;scaling.mtz_file&amp;lt;/code&amp;gt; is supplied in case #2, but here it is a dummy file name, used to output fake structure factor amplitudes for dummy scaling [Do not supply the name of an existing file].  In case #1 it is the actual file containing reference Iobs to calculate the CC&amp;lt;sub&amp;gt;iso&amp;lt;/sub&amp;gt;.&lt;br /&gt;
* &amp;lt;code&amp;gt;scaling.algorithm&amp;lt;/code&amp;gt; is set to mark1 (no scaling) for case #2; mark0 (isomorphous reference) for case #1.  &lt;br /&gt;
* &amp;lt;code&amp;gt;scaling.mtz_column_F&amp;lt;/code&amp;gt; is set to &amp;quot;f-obs&amp;quot;, the label used by the fake structure factor generator for case #2.  For case #1, set it to whatever label is to be used to look up the Iobs for calculating CC&amp;lt;sub&amp;gt;iso&amp;lt;/sub&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Additional explanation of parameters ==&lt;br /&gt;
&lt;br /&gt;
; model&lt;br /&gt;
:  a PBD file (heavy atoms omitted) to compute Fmodel intensities for frame by frame scaling.&lt;br /&gt;
; nproc&lt;br /&gt;
: the xmerge script is fast and uses 1 core, this parameter has no effect for xmerge, only for merge.&lt;br /&gt;
; scaling.mtz_file&lt;br /&gt;
: isomorphous experimental structure factors for computing the isomorphous correlation-coefficient CC&amp;lt;sub&amp;gt;iso&amp;lt;/sub&amp;gt;; measures data quality only; does not affect scaling.&lt;br /&gt;
; scaling.algorithm&lt;br /&gt;
: mark0: the usual method, rejects some frames based on low correlation with reference PDB model, then scales frame-by-frame with data scaled to the isomorphous reference.&lt;br /&gt;
mark1: no scaling.&lt;br /&gt;
; scaling.log_cutoff&lt;br /&gt;
: For the calculation of correlation coefficients, ignore the weak data (affects only the reported quality measures, not the scaling algorithm).  Cutoff is expressed on a log scale.  The only way to determine a good cutoff is to use scaling.show_plots=True the first time through, and experiment with different values.&lt;/div&gt;</summary>
		<author><name>Aaron</name></author>
	</entry>
</feed>