#
#############################################################
#
# This file describes the set of experiments for reference spectra hsqc
#
#     hncacb(i-1)
#     cbcaconnh(i)
#     hncacb(i)
#
#############################################################
#
# These are the experiment dependent variables that smartnotebook
# uses in order to properly process the above experiment. Anyone
# interested in defining a new experiment or new spectral view will
# need to be very familiar with this file. The intent is that few users
# will actually want/need to edit this file. The author and maybe a
# few others will develop these configuration files for the users of snb.
#
# Assumptions:
#   All connectivities involve residues i-1 and i.
#   All connectivities use peak ids of a reference experiment.
#
#############################################################


#############################################################
#
# Enter descriptive labels for the processed nmr data and peaklists
# These are used by the snb initialization process.
#
	set mySpectra(nv,fileNum)           3 
    set mySpectra(nv,desc,0)            "Reference"
    set mySpectra(nv,desc,1)            "Hncacb"
    set mySpectra(nv,desc,2)            "Cbcaconnh"

	set mySpectra(xpk,fileNum)          3 
    set mySpectra(xpk,desc,0)           "Reference"
    set mySpectra(xpk,desc,1)           "Hncacb"
    set mySpectra(xpk,desc,2)           "Cbcaconnh"
#
# Try to anticipate the filenames for the above data. If the
# variables below are already defined when this file is sourced,
# then do nothing.
# 
# If a peaklist file below does not exist, remember that snb drops the
# ".xpk" suffix and searches for the corresponding ".tab" file. 
#
    u_set_val mySpectra(nv,defName,0)   hsqc.nv
    u_set_val mySpectra(nv,defName,1)   hncacb.nv
    u_set_val mySpectra(nv,defName,2)   cbcaconnh.nv

    u_set_val mySpectra(xpk,defName,0)  hsqc.xpk
    u_set_val mySpectra(xpk,defName,1)  hncacb.xpk
    u_set_val mySpectra(xpk,defName,2)  cbcaconnh.xpk
#
# This is where we define which columns in the peakpick files have
# shift or intensity values. 
#
    set mySpectra(xpk,fields,0)         "3 10 17" 
    set mySpectra(xpk,fields,1)         "3 10 17 24" 
    set mySpectra(xpk,fields,2)         "3 10 17 24" 
#
# Next we associate variables with the above column numbers. For now,
# we ONLY use this knowledge to help in the processing of folded peaks. 
# My convention is Hn=proton, N=nitrogen, C=carbon, I=intensity.
#
    set mySpectra(xpk,fieldName,0)      "Hn N I"
    set mySpectra(xpk,fieldName,1)      "Hn C N I"
    set mySpectra(xpk,fieldName,2)      "Hn C N I"

#############################################################
#
# Enter the index number of the peaklist file of the reference spectra.
# Even though the software could figure it out, there is less chance for 
# confusion if we just specify it explicitly.
#
    set mySpectra(REF,xpkIx)            0 
#
# Which dimension is Hn (for spectral display along x-axis) 
# Which dimension is  N (for spectral display along y-axis) 
#
	set mySpectra(REF,atomNames)       "hn n"
    set mySpectra(REF,xdim)             0
    set mySpectra(REF,ydim)             1
#
# What are the names of the atoms we wish to assign in the
# peakpick files (use lower case). For each atom name,
# specify the peakpick error tolerance from the peakpick files.
#
    set mySpectra(atoms,names)          "ca cb n hn"
    set mySpectra(atoms,errTol)         "0.50 0.50 0.50 0.03"

#############################################################
# 
# The following section defines what the connection data looks
# like so that smartnotebook can read the connections properly.
#
# There may be other fields but snb only cares about those 
# defined below.
# 
#############################################################
#
#
# What are the number of fields in a connectivity record. 
#
    set mySpectra(connect,FIELDNUM)   24
#
# Next, we specify what the columns in the connections file are.
#
# Reference ID numbers of a connection.
#
    set mySpectra(connect,REF,0)       0
    set mySpectra(connect,REF,1)       1
#
# Connection label marker (rule type) and probability score 
#
    set mySpectra(connect,RULE)        2
    set mySpectra(connect,PROB)        3
#
# These are Peak Id fields for distinguishing connections with the same
# reference Ids. PeakIds for residue i-1 are line 1, peak ids for
# residue i are line 2. The peakids in this experiment are from the
# hncacb peaklist file.
#
    set mySpectra(connect,PKID,0)     "4 5"
    set mySpectra(connect,PKID,1)     "6 7"
#
# The shift values are defined at these columns.
# The atomnames specified here must be defined in our atomlist above
# 
    set mySpectra(connect,ca,0)       16
    set mySpectra(connect,cb,0)       17
    set mySpectra(connect,n,0)        18
    set mySpectra(connect,hn,0)       19
    set mySpectra(connect,ca,1)       20
    set mySpectra(connect,cb,1)       21
    set mySpectra(connect,n,1)        22
    set mySpectra(connect,hn,1)       23
#
#############################################################
#
# Indicate atomnames associated with PKID peaks 
#
    set mySpectra(connect,PKID,atom)  "ca cb"
#
# Distinguish between those columns in the connection file whose
# peak ids refer to residue i-1 and those that refer to residue i.
#
    set mySpectra(connect,RES,0)      "0 4 5 8 9" 
    set mySpectra(connect,RES,1)      "1 6 7" 
#
# Then for the peak Ids defined above, indicate the associated peakpick
# file. Use the index numbers that are defined with our peaklist files. 
#
    set mySpectra(connect,XPK_INDEX,0)   0
    set mySpectra(connect,XPK_INDEX,1)   0 
    set mySpectra(connect,XPK_INDEX,4)   1 
    set mySpectra(connect,XPK_INDEX,5)   1 
    set mySpectra(connect,XPK_INDEX,6)   1 
    set mySpectra(connect,XPK_INDEX,7)   1 
    set mySpectra(connect,XPK_INDEX,8)   2 
    set mySpectra(connect,XPK_INDEX,9)   2 
#
#############################################################
#
# This section provides information which enables the
# user to create a connection.
#
    set mySpectra(connect,ATOMS,TITLE) "ca:  cb:  "
	set mySpectra(connect,ATOMS,0)     "hn ca n"
    set mySpectra(connect,ATOMS,1)     "hn cb n"
#
# This next table helps snb make the proper assignment label for the
# update of peakpick files.
#
# Each atom field is of the form "name:number" where "name" is the
# atom name to write out and "number" is an offset from the current
# residue ID that this peak is being assigned to. The only time the
# offset number is not zero is when you have a spectra that mixes
# shifts from residue i and residue i-1 (eg, cbcaconnh).
#
    set mySpectra(connect,ANAME,0)       "hn:0 n:0" 
    set mySpectra(connect,ANAME,1)       "hn:0 n:0" 
    set mySpectra(connect,ANAME,4)       "hn:0 ca:0 n:0" 
    set mySpectra(connect,ANAME,5)       "hn:0 cb:0 n:0"
    set mySpectra(connect,ANAME,6)       "hn:0 ca:0 n:0" 
    set mySpectra(connect,ANAME,7)       "hn:0 cb:0 n:0" 
    set mySpectra(connect,ANAME,8)       "hn:1 ca:0 n:1" 
    set mySpectra(connect,ANAME,9)       "hn:1 cb:0 n:1" 

#############################################################
# 
# The following section deals with how the spectra is drawn 
# on the screen for displaying connectivities. 
#
#############################################################

#
# Enter the names to give for each spectral window.
#
    set mySpectra(winList)            "hsqc strips"
#
# Define the number of spectra in each spectral window.  If you
# adding/subtracting spectral strips, then this variable needs updating.
#
    set mySpectra(hsqc,spectraNum)    1
    set mySpectra(strips,spectraNum)  3
#
# Correlate the above filename information with each of our spectral windows. 
# Enter the index of mySpectra(xpk,defName) that is correct. 
#
    set mySpectra(hsqc,nv,0)          0 
    set mySpectra(strips,nv,0)        1
    set mySpectra(strips,nv,1)        2
    set mySpectra(strips,nv,2)        1
# 
    set mySpectra(hsqc,xpk,0)         0 
    set mySpectra(strips,xpk,0)       1 
    set mySpectra(strips,xpk,1)       2 
    set mySpectra(strips,xpk,2)       1 

#
# Strips referring to residue i-1 are 0
# Strips referring to residue i   are 1
# Strips referring to residue i+1 are 2
#
    set mySpectra(strips,0,iRes)    0
    set mySpectra(strips,1,iRes)    1
    set mySpectra(strips,2,iRes)    1
#
# Setup those spectra where we want the x-axis to be centered 
# on a specified value. 
#
    set mySpectra(strips,0,x,val)      $mySpectra(connect,hn,0)  
    set mySpectra(strips,1,x,val)      $mySpectra(connect,hn,1)  
    set mySpectra(strips,2,x,val)      $mySpectra(connect,hn,1)  
    set mySpectra(strips,0,x,width)    0.4  
    set mySpectra(strips,1,x,width)    0.4  
    set mySpectra(strips,2,x,width)    0.4  
#
# For your 3D spectral data, tell me what slice to be on.
# My preference is to have the i-1 residue in the first strip. 
#
    set mySpectra(strips,0,z,val)      $mySpectra(connect,n,0)  
    set mySpectra(strips,1,z,val)      $mySpectra(connect,n,1)  
    set mySpectra(strips,2,z,val)      $mySpectra(connect,n,1)  
    set mySpectra(strips,0,z,width)    0
    set mySpectra(strips,1,z,width)    0
    set mySpectra(strips,2,z,width)    0


#############################################################
#
# Define the two sets of crosshairs
#
# The parameters to specify are:
#     spectral window, strip, cursor set, nmrview cursor number, and axis.
#

# First set
    set mySpectra(hsqc,0,0,1,x)         $mySpectra(connect,hn,0)
    set mySpectra(hsqc,0,0,1,y)         $mySpectra(connect,n,0)
    set mySpectra(hsqc,0,0,2,x)         $mySpectra(connect,hn,1)
    set mySpectra(hsqc,0,0,2,y)         $mySpectra(connect,n,1)
    set mySpectra(strips,0,0,1,x)       $mySpectra(connect,hn,0)
    set mySpectra(strips,0,0,1,y)       $mySpectra(connect,cb,0)
    set mySpectra(strips,2,0,2,x)       $mySpectra(connect,hn,1)
    set mySpectra(strips,2,0,2,y)       $mySpectra(connect,ca,0)

# Second set
    set mySpectra(hsqc,0,1,1,x)         $mySpectra(connect,hn,0)
    set mySpectra(hsqc,0,1,1,y)         $mySpectra(connect,n,0)
    set mySpectra(hsqc,0,1,2,x)         $mySpectra(connect,hn,1)
    set mySpectra(hsqc,0,1,2,y)         $mySpectra(connect,n,1)
    set mySpectra(strips,0,1,1,x)       $mySpectra(connect,hn,0)
    set mySpectra(strips,0,1,1,y)       $mySpectra(connect,cb,1)
    set mySpectra(strips,2,1,2,x)       $mySpectra(connect,hn,1)
    set mySpectra(strips,2,1,2,y)       $mySpectra(connect,ca,1)