xia2 / xia2

An expert system for automated reduction of X-ray diffraction data from macromolecular crystals
https://xia2.github.io/
BSD 3-Clause "New" or "Revised" License
18 stars 14 forks source link

Look into using cctbx tools to start replacing POINTLESS in xia2 #126

Closed graeme-winter closed 6 years ago

graeme-winter commented 7 years ago

Can have finer grained control i.e.

[gw56@cs03r-sc-serv-16 integrate]$ dials_scratch.twin_laws INTEGRATE.HKL 
1 possible operators
Le-page delta: 2.612 operator: -x,-z,-y
[gw56@cs03r-sc-serv-16 integrate]$ grep UNIT_CELL INTEGRATE.HKL 
!UNIT_CELL_CONSTANTS=    47.613    47.638    49.571  62.906  73.875  73.583
!UNIT_CELL_A-AXIS=   -16.467   -24.728   -37.207
!UNIT_CELL_B-AXIS=   -47.460     3.941     1.155
!UNIT_CELL_C-AXIS=   -20.651    33.160   -30.517
from iotbx import mtz
import sys

from iotbx.file_reader import any_file
f = any_file(sys.argv[1], force_type='hkl', raise_sorry_if_errors=True)

# find intensity array - if XDS HKL file need to check label
i = [ma for ma in f.file_content.as_miller_arrays() if
      (ma.is_xray_intensity_array() or 'iobs' in ma.info().label_string())]

if not i:
  raise RuntimeError, 'no intensities found'

from mmtbx.scaling.twin_analyses import twin_laws
TL = twin_laws(miller_array=i[0])

print '%d possible operators' % len(TL.operators)
for o in TL.operators:
    print 'Le-page delta: %.3f operator: %s' % (o.delta_le_page, o.operator)

Yes, we are implicitly already using this in Brehm Diederichs etc. but more generally could be very useful.

graeme-winter commented 7 years ago

TODO find faster way of loading in data than making list of miller arrays (which is expensive)

graeme-winter commented 7 years ago

Also example

[gw56@cs04r-sc-com99-07 cd-1]$ cat xia2.error 
Traceback (most recent call last):
  File "/dls/science/users/gw56/svn/cctbx/modules/xia2/command_line/xia2_main.py", line 298, in run
    xinfo = xia2_main()
  File "/dls/science/users/gw56/svn/cctbx/modules/xia2/command_line/xia2_main.py", line 245, in xia2_main
    Chatter.write(xinfo.get_output(), strip=False)
  File "/dls/science/users/gw56/svn/cctbx/modules/xia2/Schema/XProject.py", line 127, in get_output
    result += self._crystals[crystal].get_output()
  File "/dls/science/users/gw56/svn/cctbx/modules/xia2/Schema/XCrystal.py", line 474, in get_output
    reflections_all = self.get_scaled_merged_reflections()
  File "/dls/science/users/gw56/svn/cctbx/modules/xia2/Schema/XCrystal.py", line 867, in get_scaled_merged_reflections
    return self._get_scaler().get_scaled_merged_reflections()
  File "/dls/science/users/gw56/svn/cctbx/modules/xia2/Schema/Interfaces/Scaler.py", line 662, in get_scaled_merged_reflections
    self.scale()
  File "/dls/science/users/gw56/svn/cctbx/modules/xia2/Schema/Interfaces/Scaler.py", line 621, in scale
    self._scale_prepare()
  File "/dls/science/users/gw56/svn/cctbx/modules/xia2/Modules/Scaler/CCP4ScalerA.py", line 753, in _scale_prepare
    ignore_errors=PhilIndex.params.xia2.settings.small_molecule)
  File "/dls/science/users/gw56/svn/cctbx/modules/xia2/Wrappers/CCP4/Pointless.py", line 520, in decide_pointgroup
    raise RuntimeError, 'error finding solution'
RuntimeError: error finding solution

xia2 small_molecule=true /dls/i19-1/data/2016/cm14476-1/20160310_collectionTest/22_chargedensity_0-1s_0-1d

graeme-winter commented 7 years ago

Estimation of useful resolution for point group determination:
--------------------------------------------------------------
Point group correlation statistics are not reliable for very weak data,
so a high resolution cutoff (for this purpose only) is estimated either
 from CC(1/2) using P1 (Friedel) symmetry (limit  0.60), or
 from Mean(I/sigma(I)) (limit   6.00), if there are sufficient data

High-resolution estimate from CC(1/2):      0.81
High-resolution estimate from <I/sig(I)>:   0.81

Complete resolution range kept, data are strong to the edge

$TABLE: Mn(I/sigI) and CC(1/2) [in P1] vs. resolution:
$GRAPHS:Resolution estimate 0.81A:0.0219887|1.51527x0|1:2,4,6,7,9:
 $$
  N  1/d^2    Dmid CC(1/2)   N_CC   CCfit  Mn(I/sigI)      N (I/sigI)/10   $$ $$
  1  0.1713   2.42   0.959     54   0.959       61.11    193       6.111
  2  0.4700   1.46   0.969    240   0.963       29.57    856       2.957
  3  0.7686   1.14   0.958    325   0.966       24.06   1149       2.406
  4  1.0673   0.97   0.966    303   0.969       14.66   1023       1.466
  5  1.3659   0.86   0.977     96   0.973       11.44    301       1.144
$$

Reflection list generated from file: /dls/mx-scratch/gw56/cd-1/DEFAULT/NATIVE/SWEEP8/integrate/dials_integrated_reindex.mtz

Title: from dials.export_mtz

   Space group from HKLIN file : P 2 2 2
   Cell:    8.09   9.16   9.98  90.00  90.00  90.00
   Resolution range in file:      0.95        0.41
 Resolution range used     6.74 to     0.81

**** ERROR ****
All reflection pairs rejected

this is from xia2 using dials => should have been ignored "by magic" :(

stale[bot] commented 7 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in six months if no further activity occurs. Thank you for your contributions.

stale[bot] commented 6 years ago

This issue has now been automatically closed due to lack of activity. If you feel this issue is still relevant you can reopen the ticket at any point.