#
#     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$
# ======================================================================
# prelyscar.tcl --
#
# CCP4Interface 
#
# =======================================================================

#---------------------------------------------------------------------
proc prelyscar_setup { typedefVar arrayname } {
#---------------------------------------------------------------------
  upvar #0 $typedefVar typedef
  upvar #0 $arrayname array

  set prior { 0.5 0.05 0.009 0.0001 }
  DefineMenu _prior_list $prior

  return 1
}

# procedure to draw task window
#---------------------------------------------------------------------
proc prelyscar_task_window { arrayname } {
#---------------------------------------------------------------------
  global configure
  upvar #0 $arrayname array

  if { [CreateTaskWindow $arrayname  \
        "Prediction of carboxylation of lysine residues" "Prelyscar" \
               {} ] == 0 } return

  SetProgramHelpFile "prelyscar"

  set array(INITIALISED) 0

#=PROTOCOL==============================================================

  OpenFolder protocol 

  #CreateTitleLine line TITLE

  CreateLine line \
    message "Enter job title (use only alphanumeric, spaces, brackets and underscores)" \
    help  title \
    label "Job title" \
    widget TITLE  -width 65 \
      -command "check_title_line $arrayname TITLE"
 
  set link_target [FileJoin [GetEnvPath CCP4] html prelyscar_ccp4.html]
  set urlbrowser [button $line.urlbrowser \
          -text "PreLysCar User Guide" \
          -command "open_url $link_target -remote"]

  $urlbrowser configure -font $configure(FONT_SMALL)
  pack $urlbrowser -side left  

#=FILES================================================================ 

  OpenFolder file

  CreateLine line \
	  label "Run prelyscar to predict carboxylation of lysine residues" \
	  -italic

  CreateInputFileLine line \
        "Enter name of input coordinate file" \
        "PDB file" \
        XYZIN DIR_XYZIN 

  CreateLine line \
      message "Enter the chain to be used from the PDB file" \
      help chainid \
      label "Chain identifier" \
      widget CHAINID -width 3 \
      label "Chain A will be used by default" -italic

  CreateLine line \
      message "Prior value:" \
      help priorlist \
      label "Prior probability value:" \
      widget PRIORLIST 

}

#--------------------------------------------------------------
proc prelyscar_run { arrayname } {
#--------------------------------------------------------------
  global system
  return 1
}
