#ifndef __HelixPDB_H
#define __HelixPDB_H

/*
CLASS
  HelixPDB
  
  This class defines a set of tools to be used when trying to read alpha helix
  secondary structure from the Protein Data Bank file format.
  

KEYWORDS
  PDB, protein, helix, right-handed, left-handed, record, atom, residue, 
  structure, coordinate, field

AUTHORS
  Zipi Fligelamn (zipo@math.tau.ac.il)

  Copyright: SAMBA group, Tel-Aviv Univ. Israel, 1999.

CHANGES LOG
<UL>
<LI> 2.09.01 All PDB indices are shifted, minus one.
</UL>

GOALS
  Class HelixPDB is designed to serve as an encapsulation to reading 
  secondary structure of the alpha helix kind from the PDB file format. 
  Methods are static requiring no object instantiation before their use.

USAGE
  The user is highly recommended not to use this class directly but through
  the Helix or SecondStruct class. Though regarding that a line in the PDB
  record has a length of 80 chars. Acoording to the latest submittion manual 
  the differnt fields and their charechteristic type were defined.
*/
class HelixPDB 
{
public:

  // Group: Definion of the Various Helix Types
  typedef enum { Unknown = 0,
                 RightHandedAlpha=1, ReightHandedOmega=2,
                 RightHandedPi=3, RightHandedGamma=4,
                 RightHanded310=5, LeftHnadedAlpha=6,
                 LeftHandedOmega=7, LeftHandedGamma=8,
                 RibbonHelix =9, Polyproline =10} HelixType;
  
  // Group: HELIX record constants and methods
  const static short serNumField = 7;
  const static short helixIdField = 11;
  const static short initResNameField = 15;
  const static short initChainIdField = 19; 
  const static short initSeqNumField = 21;
  const static short initICodeField = 25;
  const static short endResNameField =27;
  const static short endChainIdField =31;
  const static short endSeqNumField = 33;
  const static short endICodeField = 37;
  const static short helixClassField = 38;
  const static short commentField = 40;
  const static short lengthField =71;
  
  //// Returns whether the record is a helix
  static bool isHelix(const char* const PDBrec);
  
  // GROUP: the Strand and the Sheet infromation and methods
  
  //// Returns the helix number
  static short helixID(const char* const PDBrec);

  //// Enters into res the 3 letter code  of the residue strating the helix 
  static void initResName(const char* const PDBrec, char res[]);
  
  //// Returns the chain Id where the beginning residue resides.
  // if there is no such chain it will return '?' if there is no chain.
  static char initChainID(const char* const PDBrec);
  
  //// Returns the relative sequence number of the starting residue of the 
  // helix. Please Notice! that this residue is relative to the chain 
  // if you read the atoms through the Atom class you might find
  // that atom 25 in chain B has a different numbering there
  static int initSeqNum(const char* const PDBrec);
  
  static char initICode(const char* const PDBrec);
  
  //// Enters into res the 3 letter code  of the residue ending the helix 
  static void endResName(const char* const PDBrec, char res[]);
  
  //// Returns the chain Id where the ending residue resides.
  // if there is no such chain it will return '?' if there is no chain.
  static char endChainID(const char* const PDBrec);
  
  //// Returns the relative sequence number of the ending residue of the 
  // helix. Please Notice! that this residue is relative to the chain 
  // if you read the atoms through the Atom class you might find
  // that atom 25 in chain B has a different numbering there
  static int endSeqNum(const char* const PDBrec);
  
  static char endICode(const char* const PDBrec);
  
  //// Returns the number characteristic to the helix type.
  // this might have mo meaning if you have a very old version of the 
  // pdb file. Please make sure you have downloaded the most recent version
  // that comply with the contents guide version 2.1 from October 1996
  static HelixType helixClass(const char* const PDBrec);
  
  //// returns the number of amino acids that participate in this helix
  static unsigned short length(const char* const PDBrec);
  
private:
  HelixPDB() {}
};


#endif 



