| 1 | # @Author: Tristan Croll
|
|---|
| 2 | # @Date: 09-Apr-2018
|
|---|
| 3 | # @Email: tic20@cam.ac.uk
|
|---|
| 4 | # @Last modified by: Tristan Croll
|
|---|
| 5 | # @Last modified time: 18-Apr-2018
|
|---|
| 6 | # @License: Creative Commons BY-NC-SA 3.0, https://creativecommons.org/licenses/by-nc-sa/3.0/.
|
|---|
| 7 | # @Copyright: Copyright 2017-2018 Tristan Croll
|
|---|
| 8 |
|
|---|
| 9 |
|
|---|
| 10 |
|
|---|
| 11 | from .main import *
|
|---|
| 12 | # General objects
|
|---|
| 13 | from .clipper_python import (
|
|---|
| 14 | Cell,
|
|---|
| 15 | Cell_descr,
|
|---|
| 16 | CCP4MTZfile,
|
|---|
| 17 | CIFfile,
|
|---|
| 18 | Coord_frac,
|
|---|
| 19 | Coord_grid,
|
|---|
| 20 | Coord_orth,
|
|---|
| 21 | Grid,
|
|---|
| 22 | Grid_range,
|
|---|
| 23 | Grid_sampling,
|
|---|
| 24 | HKL_info,
|
|---|
| 25 | Map_stats,
|
|---|
| 26 | Resolution,
|
|---|
| 27 | RTop_frac,
|
|---|
| 28 | RTop_orth,
|
|---|
| 29 | Spacegroup,
|
|---|
| 30 | Spgr_descr,
|
|---|
| 31 | Symop,
|
|---|
| 32 | # Symops,
|
|---|
| 33 | Unit_Cell,
|
|---|
| 34 | Util,
|
|---|
| 35 | Xmap_float as Xmap,
|
|---|
| 36 | )
|
|---|
| 37 |
|
|---|
| 38 |
|
|---|
| 39 | # Singular forms of HKL data
|
|---|
| 40 | from .clipper_python import Flag, Flag_bool
|
|---|
| 41 | from .clipper_python.data32 import (
|
|---|
| 42 | ABCD_float as ABCD,
|
|---|
| 43 | E_sigE_float as E_sigE,
|
|---|
| 44 | F_phi_float as F_phi,
|
|---|
| 45 | F_sigF_float as F_sigF,
|
|---|
| 46 | F_sigF_ano_float as F_sigF_ano,
|
|---|
| 47 | I_sigI_float as I_sigI,
|
|---|
| 48 | Phi_fom_float as Phi_fom,
|
|---|
| 49 | )
|
|---|
| 50 |
|
|---|
| 51 | # Array forms of HKL data
|
|---|
| 52 | from .clipper_python import HKL_data_Flag, HKL_data_Flag_bool
|
|---|
| 53 | from .clipper_python.data32 import (
|
|---|
| 54 | HKL_data_ABCD_float as HKL_data_F_ABCD,
|
|---|
| 55 | HKL_data_E_sigE_float as HKL_data_E_sigE,
|
|---|
| 56 | HKL_data_F_phi_float as HKL_data_F_phi,
|
|---|
| 57 | HKL_data_F_sigF_float as HKL_data_F_sigF,
|
|---|
| 58 | HKL_data_F_sigF_ano_float as HKL_data_F_sigF_ano,
|
|---|
| 59 | HKL_data_I_sigI_float as HKL_data_I_sigI,
|
|---|
| 60 | HKL_data_Phi_fom_float as HKL_data_Phi_fom,
|
|---|
| 61 | )
|
|---|
| 62 |
|
|---|
| 63 | from .clipper_mtz import ReflectionDataContainer
|
|---|
| 64 |
|
|---|
| 65 | from chimerax.core.toolshed import BundleAPI
|
|---|
| 66 | class _ClipperBundle(BundleAPI):
|
|---|
| 67 | from chimerax.core.commands import FloatArg
|
|---|
| 68 | from chimerax.atomic import StructureArg
|
|---|
| 69 | @staticmethod
|
|---|
| 70 | def initialize(session, bundle_info):
|
|---|
| 71 | from chimerax.clipper import cmd
|
|---|
| 72 | # cmd.register_mtz_file_format(session)
|
|---|
| 73 |
|
|---|
| 74 | @staticmethod
|
|---|
| 75 | def register_command(command_name, logger):
|
|---|
| 76 | # 'register_command' is lazily called when the command is referenced
|
|---|
| 77 | from chimerax.clipper import cmd
|
|---|
| 78 | if command_name == 'cxclipper':
|
|---|
| 79 | cmd.register_clipper_cmd(logger)
|
|---|
| 80 |
|
|---|
| 81 | @staticmethod
|
|---|
| 82 | def open_file(session, path, format_name, structure_model=None,
|
|---|
| 83 | over_sampling=1.5):
|
|---|
| 84 | if structure_model is None:
|
|---|
| 85 | from chimerax.core.errors import UserError
|
|---|
| 86 | raise UserError('Must specify a structure model to associate with crystallographic data')
|
|---|
| 87 | if format_name == 'mtz':
|
|---|
| 88 | from .cmd import open_mtz
|
|---|
| 89 | return open_mtz(session, path, structure_model=structure_model,
|
|---|
| 90 | over_sampling=over_sampling)
|
|---|
| 91 |
|
|---|
| 92 | bundle_api = _ClipperBundle()
|
|---|