<div dir="ltr">Thank Nathaniel.  I am still confused.  Do you intend me to copy and paste the script that you included to a file called score.py.  When I did that I got the following error message<div><br></div><div>Syntax error: expected &quot;=&quot;, found &quot;__future__&quot; (file &quot;score.py&quot;, line 1)</div>
<div>Sorry: score.py is not a valid parameter file.</div><div><br></div><div>What are the inputs?  I would think that at a minimum I would have to input a pdb file, mtz file, fasta file, and an estimate for the rmsd.</div>
<div><br></div><div>Thanks again,</div><div><br></div><div>Jouko</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Jul 11, 2014 at 6:03 PM, Nathaniel Echols <span dir="ltr">&lt;<a href="mailto:nechols@lbl.gov" target="_blank">nechols@lbl.gov</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="">On Fri, Jul 11, 2014 at 2:48 PM, Jouko Virtanen <span dir="ltr">&lt;<a href="mailto:jouko@umich.edu" target="_blank">jouko@umich.edu</a>&gt;</span> wrote:<br>
</div><div class="gmail_extra"><div class="gmail_quote"><div class="">

<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div style="font-family:arial,sans-serif;font-size:13px">


I would like to calculate the maximum-likelihood score given an input structure and an mtz file.  How can I do that?  Thanks in advance.</div></div></blockquote><div><br></div></div><div>Do you just want the ML target function value, i.e. what phenix.refine prints out at regular intervals?  In that case, you can use the script appended below (run with phenix.python score.py), which is derived from $PHENIX/cctbx_project/mmtbx/examples/simple_command_line_cc.py.</div>


<div><br></div><div>from __future__ import division</div><div>import mmtbx.command_line</div><div>import sys</div><div><br></div><div>def master_phil () :</div><div>  return mmtbx.command_line.generic_simple_input_phil()</div>


<div><br></div><div>def run (args, out=sys.stdout) :</div><div>  cmdline = mmtbx.command_line.load_model_and_data(<br></div><div>    update_f_part1_for=&quot;map&quot;,</div><div>    args=args,</div><div>    master_phil=master_phil(),</div>


<div>    out=out,</div><div>    process_pdb_file=False,</div><div>    create_fmodel=True)</div><div>  fmodel = cmdline.fmodel<br></div><div>  tf = fmodel.target_functor(compute_gradients=False)</div><div>  score = tf_r.target_work()</div>


<div>  print score</div><div><br></div><div>if (__name__ == &quot;__main__&quot;) :</div><div>  run(sys.argv[1:])</div></div></div></div>
</blockquote></div><br></div>