#
#     Copyright (C) 1999-2004  Liz Potterton, Peter Briggs
#
#     This code is distributed under the terms and conditions of the
#     CCP4 Program Suite Licence Agreement as a CCP4 Library.
#     A copy of the CCP4 licence can be obtained by writing to the
#     CCP4 Secretary, Daresbury Laboratory, Warrington WA4 4AD, UK.
#
#CCP4i_cvs_Id $Id$
#CCP4I VERSION CCP4Interface 0.2
#CCP4I SCRIPT DEF refmac5
#CCP4I DATE  25/06/97 16:05:30
#CCP4I USER lizp
TITLE           _title_text             ""

INPUT_FILES     _list_of_text           "HKLIN XYZIN"
OUTPUT_FILES    _list_of_text           "HKLOUT XYZOUT"

REFINE_TYPE     _refmac_refine_type     REST
RESIDUAL        _refmac_residual        MLKF
MINIMISATION    _refmac_minimisation    CGMAT

EXCLUDE_RESOLUTION      _logical        0
EXCLUDE_RESOLUTION_MIN  _positivereal   ""
EXCLUDE_RESOLUTION_MAX  _positivereal   ""

INPUT_PHASE     _refmac_input_phase     NO
PHASE_SCBLUR    _real                   ""
PHASE_BBLUR     _real                   ""

HKLIN           _MTZ_file               ""
DIR_HKLIN       _default_dirs           ""
HKLOUT          _MTZ_file               ""
DIR_HKLOUT      _default_dirs           ""
TLSIN		_tls_file		""
DIR_TLSIN	_default_dirs		""
TLSOUT		_tls_file		""
DIR_TLSOUT	_default_dirs		""

XYZIN           _pdb_file               ""
XYZOUT          _pdb_file               ""
DIR_XYZIN       _default_dirs           ""
DIR_XYZOUT      _default_dirs           ""

IFMAPNAMES	_logical		0
MAPOUT1		_map_file		""
DIR_MAPOUT1	_default_dirs		TEMPORARY
MAPOUT2         _map_file               ""
DIR_MAPOUT2     _default_dirs           TEMPORARY

IF_MAPOUT       _logical                0
MAPOUT_FORMAT   _map_format             MAP_DEFAULT
EXTEND_MAP      _logical                1
MAP_BORDER              _positivereal           5.0

LABIN           _text           	"FP SIGFP"
F+	        _mtz_label_g        	""
SIGF+         	_mtz_label_l        	""
F-     		_mtz_label_g        	""
SIGF-     	_mtz_label_l        	""
NATOMS          _positiveint            1
ATOM,0          _text                   ""
ATOM_FP,0       _real                   ""
ATOM_FPP,0      _real                   ""
ATOM,1          _text                   ""
ATOM_FP,1       _real                   ""
ATOM_FPP,1      _real                   ""
WAVELENGTH      _positivereal           ""
REF_SUBOCC    _logical                1
  
IP              _mtz_label_j            ""
SIGIP           _mtz_label_sig          ""
FP              _mtz_label_f            ""
SIGFP           _mtz_label_sig          ""
PHIB            _mtz_label_phi          ""
FOMB            _mtz_label_w            ""
HLA             _mtz_label_hl           ""
HLB             _mtz_label_hl           ""
HLC             _mtz_label_hl           ""
HLD             _mtz_label_hl           ""

FC              _mtz_label_out          FC
FWT             _mtz_label_out          FWT
PHIC            _mtz_label_out          PHIC
PHWT            _mtz_label_out          PHWT
DELFWT          _mtz_label_out          DELFWT
PHDELWT         _mtz_label_out          PHDELWT
FOM             _mtz_label_out          FOM
#PHCOMB          _mtz_label_out          PHCOMB
LABOUT          _text           "FC FWT PHIC PHWT DELFWT PHDELWT FOM"
CTYPOUT         _text                   "F Q P Q F P Q"

TITLE                   _text           ""

NCYCLES                 _positiveint    10
EXTERNAL_NCYCLES        _positiveint    5
B_REFINEMENT            _logical        1
B_REFINEMENT_MODE       _refmac_b_refinement    ISOT
IFTLS			_logical	0
IFFIXTLS		_logical	0

TWINREF_TYPE		_twinref_type	"NO"

BLIM                    _logical        0
BLIM_MIN                _positivereal   2.0
BLIM_MAX                _positivereal   200.0

EXCLUDE_FREER           _logical        1
EXCLUDE_FREER_VALUE     _int            0
FREE                    _mtz_label_freer     ""

BULK_SOLVENT_SCALING    _refmac_scaling         SIMPLE
SIMPLE_SCALING_RESOLUTION_MIN  _resolution      ""
SIMPLE_SCALING_RESOLUTION_MAX  _resolution      ""
BULK_SCALING_RESOLUTION_MIN	_resolution	""
BULK_SCALING_RESOLUTION_MAX  _resolution        ""
SCALING_ANISO           _logical                1
SCALING_IF_FIXB         _logical                0
SCALING_FIXB_BBULK      _positivereal           ""
SCALING_EXPE_SIGMA      _logical                1
SCALING_REF_SET         _refmac_ref_set         working
SCALING_APPLY           _refmac_scaling_appl    observed

IF_SOLVENT              _logical                1
SOLVENT_VDWPROB         _positivereal           ""
SOLVENT_IONPROB         _positivereal           ""
SOLVENT_RSHRINK         _positivereal           ""

EXPERIMENTAL_WEIGHTING  _logical                1
AUTO_WEIGHTING          _logical                1
MATRIX_WEIGHT           _positivereal           ""
GRADIENT_WEIGHT         _real                   1.0
SIGMA_WEIGHT            _positivereal           0.5

TLS_NCYCLES		_positiveint		10
IFADDU                  _logical                0

RIGID_NCYCLES           _positiveint            20
NDOMAINS                _positiveint            0
NGROUPS,0               _positiveint            1
CHAIN1,0                _chain_id               ""
RES1,0                  _res_id                 ""
RES2,0                  _res_id                 ""
INITIALISE_RIGID,0    _logical                0
TRANS_ON,0              _logical                0
TRANS_X,0               _real                   ""
TRANS_Y,0               _real                   ""
TRANS_Z,0               _real                   ""
EULER_ON,0              _logical                0
EULER_ALPHA,0           _real                   ""
EULER_BETA,0            _real                   ""
EULER_GAMMA,0           _real                   ""
EXCLUDE_ATOMS,0         _refmac_rigid_exclude   no
# Define first rigid domain
INITIALISE_RIGID,0    _logical                0
TRANS_ON,1              _logical                0
TRANS_X,1               _real                   ""
TRANS_Y,1               _real                   ""
TRANS_Z,1               _real                   ""
EULER_ON,1              _logical                0
EULER_ALPHA,1           _real                   ""
EULER_BETA,1            _real                   ""
EULER_GAMMA,1           _real                   ""
EXCLUDE_ATOMS,1         _refmac_rigid_exclude   no


MAKE_LIBRARY		_lib_file		""
DIR_MAKE_LIBRARY	_default_dirs		""
LIBOUT			_lib_file		""
DIR_LIBOUT		_default_dirs		""
MAKE_HYDROGEN		_refmac_make_hydrogen	ALL
MAKE_HOUT		_logical		0
MAKE_CHECK		_refmac_make_check	NONE
MAKE_PEPTIDE		_logical		0
MAKE_CISPEPTIDE		_logical		1
MAKE_SSBRIDGE		_logical		1
MAKE_SYMMETRY		_logical		1
MAKE_NEWLIGAND		_logical		0
MAKE_REVIEW		_logical		0
MAKE_CONNECTIVITY	_refmac_make_link	NO
MAKE_LINK		_refmac_make_link	NO
MAKE_SUGAR		_refmac_make_link	YES

REVIEW_MAKE_CHECK              _refmac_make_check      ALL
REVIEW_MAKE_PEPTIDE            _logical                1
REVIEW_MAKE_CISPEPTIDE         _logical                1
REVIEW_MAKE_SSBRIDGE           _logical                1
REVIEW_MAKE_SYMMETRY           _logical                1
REVIEW_MAKE_CHAIN              _logical                1
REVIEW_MAKE_NEWLIGAND          _logical                0
REVIEW_MAKE_CONNECTIVITY       _refmac_make_link       YES
REVIEW_MAKE_LINK               _refmac_make_link       YES
REVIEW_MAKE_SUGAR              _refmac_make_link       YES

# Automatic NCS restraints
IFAUTONCS                       _logical                0
AUTONCS_MODE                    _refmac_autoncs     LOCAL

# New NCS restraint parameters
N_NONX              _positiveint            0
N_NONX_CHN_TOTAL,0   _positiveint           0
N_NONX_SPANS_TOTAL,0 _positiveint           0

# RefmacNonX parameters
NONX_CHN_SRC,0        _chain_id_menu          ""
NONX_INIT_SPANS_RES1,0 _residue_id            ""
NONX_INIT_SPANS_RES2,0 _residue_id            ""
NONX_INIT_SPANS_CODE,0 _refmac_nonx_code      4
NONX_CHN_TARG,0       _chain_id_menu          ""
N_NONX_CHN,0        _positiveint            0
N_NONX_SPANS,0      _positiveint            0

# RefmacNonXSpans parameters
NONX_SPANS_RES1,0   _residue_id             ""
NONX_SPANS_RES2,0   _residue_id             ""
NONX_SPANS_CODE,0   _refmac_nonx_code       4

# RefmacNonXChains parameters
NONX_CHN,0          _chain_id_menu          ""

MONI_LEVEL              _refmac_monitor_level   MEDIUM

MONI_TORSION            _positivereal           10.0
MONI_DISTANCE           _positivereal           10.0
MONI_ANGLE              _positivereal           10.0
MONI_PLANE              _positivereal           10.0
MONI_VANDERWAAL         _positivereal            3.0
MONI_CHIRAL             _positivereal           10.0
MONI_BFACTOR            _positivereal           10.0
MONI_BSPHERE            _positivereal           10.0
MONI_RBOND              _positivereal           10.0
MONI_NCSR               _positivereal           10.0

IFSHARP                 _logical                0
IFBSHARP                _logical                0
B_SHARP                 _real			""
IFALSHARP               _logical                0
AL_SHARP                _real			""

# External restraints from Prosmart
PROSMART_AVAIL          _logical                0
IFPROSMART              _logical                0
PROSMART_MODE           _prosmart_mode          NO
USE_PROSMART_KEYFILE    _logical                0
PROSMART_KEYFILE        _txt_file               ""
DIR_PROSMART_KEYFILE    _default_dirs           ""
EXT_XYZIN               _pdb_file               ""
DIR_EXT_XYZIN           _default_dirs           ""

# External restraints keywords (Prosmart or general)
RESTRAINTFILE           _txt_file               ""
DIR_RESTRAINTFILE       _default_dirs           ""
RESTRAINTFILE_CMD       _text                   ""
IFEXTREST_SCALE         _logical                1
EXTREST_SCALE           _real			10.0
IFEXTREST_USEMAIN       _logical                1
IFEXTREST_GMWT          _logical                0
EXTREST_GMWT            _real			0.15
IFEXTREST_DMAX          _logical                1
EXTREST_DMAX            _real			4.2

# Secondary structure restraints
PROSMART_HELIX          _logical                1
PROSMART_STRAND         _logical                0
PROSMART_HBOND          _logical                1
PROSMART_HBONDHELIX3    _logical                1
PROSMART_HBONDHELIX4    _logical                1
PROSMART_HBONDHELIX5    _logical                1
PROSMART_HBONDSHEET     _logical                1

# Begin of definition for External restraints applied to DNA/RNA 
LIBG_AVAIL              _logical                0
IF_LIBG                 _logical                0
LIBG_MODE               _libg_mode              AUTOMATED
USE_LIBG_DICTFILE       _logical                
LIBG_DICTFILE           _txt_file               ""
DIR_LIBG_DICTFILE       _default_dirs           ""
USE_LIBG_KEYFILE        _logical                0
LIBG_KEYFILE            _txt_file               ""
DIR_LIBG_KEYFILE        _default_dirs           ""
# LIBG_EXT_XYZIN          _pdb_file               ""
# DIR_LIBG_EXT_XYZIN      _default_dirs           ""
LIBG_RESTRAINTFILE      _txt_file               ""
DIR_LIBG_RESTRAINTFILE  _default_dirs           ""
LIBG_RESTRAINTFILE_CMD  _text                   ""


LIBG_RESTRTYPE          _libg_restr_type        BP  

# Base pair
IFAUTOBP                _logical                0
N_BP                    _positiveint            0
BP_CHN1,0               _chain_id               ""
BP_CHN1_RES_FROM,0      _res_id                 ""
BP_CHN1_RES_TO,0        _res_id                 ""
BP_CHN2,0               _chain_id               ""
BP_CHN2_RES_FROM,0      _res_id                 ""
BP_CHN2_RES_TO,0        _res_id                 ""
LIBG_ALIGN_MODE,0       _libg_align_mode        ANTIPARA

#Sugar
N_SUG                   _positiveint            0
SUG_CHN,0               _chain_id               ""
SUG_CHN_RES_FROM,0      _res_id                 ""
SUG_CHN_RES_TO,0        _res_id                 ""
LIBG_SUG_LABEL,0        _libg_sug_label         C2ENDO



#end of definitions for DNA/RNA restraints

IFJELLY                 _logical                0
JELLY_SIGMA             _positivereal           0.02

IFDIST                  _logical                0
IFANGL			_logical		0
IFPLAN                  _logical                0
IFCHIR                  _logical                0
IFTMP                   _logical                0
IFNCSR                  _logical                0
IFTORS                  _logical                0
IFVAND                  _logical                0
IFISO                   _logical                0

ANGLE_SCALE	_positivereal		1.0

WDSKAL          _positivereal           1.0
SIGD1           _positivereal           "" 
SIGD2           _positivereal           ""
SIGD3           _positivereal           "" 
SIGD4           _positivereal           "" 
SIGD5           _positivereal           "" 

WPSKAL          _positivereal           1.0
SIGPP           _positivereal           ""
SIGPA           _positivereal           "" 

WCSKAL          _positivereal           1.0
SIGC            _positivereal           "" 

WBSKAL          _positivereal           1.0
SIGB1           _positivereal           "" 
SIGB2           _positivereal           "" 
SIGB3           _positivereal           "" 
SIGB4           _positivereal           "" 
IFBFAC_SET	_logical		0
BFAC_SET	_real			20.0

WSSKAL          _positivereal           1.0
SIGSP1          _positivereal           "" 
SIGSP2          _positivereal           "" 
SIGSP3          _positivereal           "" 
SIGSB1          _positivereal           "" 
SIGSB2          _positivereal           "" 
SIGSB3          _positivereal           "" 

WTSKAL          _positivereal           1.0
SIGT1           _positivereal           "" 
SIGT2           _positivereal           "" 
SIGT3           _positivereal           "" 
SIGT4           _positivereal           "" 

WVSKAL          _positivereal           1.0
WAND_SIGMA_VDW	_positivereal		"" 
WAND_SIGMA_HBOND _positivereal		"" 
WAND_SIGMA_METAL _positivereal		"" 
WAND_SIGMA_TORS _positivereal		"" 
WAND_INCR_TORS _real			"" 
WAND_INCR_ADHB _real			"" 
WAND_INCR_AHHB _real			"" 

SPHERICITY      _real                   5.0
RBOND           _real                   1.0

RUN_COOT_FW             _logical                0
COOT_SIGMA_ADD          _real                  2.0
COOT_SIGMA_REMOVE       _real                  1.0

FDISTANCE               _logical                1

USE_INCLUDEFILE         _logical                0
INCLUDEFILE             _any_file               ""
DIR_INCLUDEFILE         _default_dirs           ""
INCLUDEFILE_CMD         _text                   ""

@ [FileJoin [GetEnvPath CCP4I_TOP] tasks harvest.def]

# Redundant parameters retained for backwards compatibility
WEIGHTING_METHOD        _refmac_weighting       matrix
DAMP                    _logical        0
DAMP_P                  _positivereal   "" 
DAMP_B                  _positivereal   ""

SPACE_GROUP             _space_group    ""
CELL_1                  _cell_length    ""
CELL_2                  _cell_length    ""
CELL_3                  _cell_length    ""
CELL_4                  _cell_angle     ""
CELL_5                  _cell_angle     ""
CELL_6                  _cell_angle     ""

NPARTIALS       _positiveint            0
FPART,0         _mtz_label_f            ""
PHIP,0          _mtz_label_sig          ""
PARTIAL_SCALE,0 _positivereal           1.0

SPLIT_MODE              _refmac_split_mode      BINS
SPLIT_BINS              _positiveint            20
SPLIT_RANGES            _positivereal           0.1

SCALING_NCYCYLES        _positiveint            10
SCALING_IF_BAVERAGE     _logical                0
SCALING_BAVERAGE        _positivereal           ""
SCALING_FIXB_SCBULK     _positivereal           -0.75

MLSC_ON                 _logical                0
MLSC_NCYCLES            _positiveint            10
MLSC_IF_FIXB            _logical                0
MLSC_FIXB_BBULK         _positivereal           100.0
MLSC_FIXB_SCBULK        _positivereal           -0.1

IFHOLD                  _logical                0

PBEL            _positivereal           0.3
BDEL            _positivereal           3.0
QDEL            _positivereal           0.2

MAKE_CHAIN		_logical		0

# Internal parameter
PREVIOUS_REFINE_TYPE	_text		""

# Patch for limited length of pname etc.
HARVEST_LENSTR          _positiveint           10
