/* amino.c 
 *
 * this file contains three-literal amino acids 
 * abbreviations and their uniliteral equivalents
 * -------------------------------------------------
 */

#include "main.h"

AMINO_ABREV amk_symbols[20] = { 
{"ALA", 'A'} /* alanine */,    {"ARG", 'R'} /* arginine */,
{"ASN", 'N'} /* asparagine */,  {"ASP", 'D'} /* aspartic acid */,
{"CYS", 'C'} /* cysteine */,   {"GLU", 'E'} /* glutamic acid */,
{"GLN", 'Q'} /* glutamine */,  {"GLY", 'G'} /* glycine */,
{"HIS", 'H'} /* histidine */,  {"ILE", 'I'} /* isoleucine */,
{"LEU", 'L'} /* leucine */,    {"LYS", 'K'} /* lysine */,
{"MET", 'M'} /* methionine */, {"PHE", 'F'} /* phenylalanine */,
{"PRO", 'P'} /* proline*/,     {"SER", 'S'} /* serine */,
{"THR", 'T'} /* threonine */,  {"TRP", 'W'} /* tryptophan */,
{"TYR", 'Y'} /* tyrosine*/,    {"VAL", 'V'} /* valine */
};

/* ------------------------------------------------------------------------- */
/* for the given name of amino acid, the function returns 
   its uniliteral abbreviation or '-' (if given name was not found)          */
char vratJednopismenouZkratku (char nazev[4]) {
/* ------------------------------------------------------------------------- */
  int i = 0;
  char r = '-';

  nazev[3]='\0';
  while ((i<20)&&(r=='-')) {
    if (strcmp(amk_symbols[i].znacka_residua,nazev)==0) {r=amk_symbols[i].uniliteral; break;}
    i++;
  }
  return r;
}


