Dictionary.c geneid v 1.1 source documentation


Description:
This module implements a look-up table or dictionary to simulate associative arrays by using a hash table that binds unique integer keys to gene features such as "First" or "Internal" (combined with the strand "+" or "-"). There is enough room for MAXENTRY different features.
Briefing:
void resetDict(dict* d)
Reset the counter nextFree (assign new key) and NULL pointers in the hash table of sinonimous.
int f(char s[])
Hash function: weighted sum of chars of the input string modulus the length of the hash table to get an integer between 0..MAXENTRY-1.
int setkeyDict(dict* d, char s[])
Assign a new key for the input string if it was not into the hash table. Management of computing hash function and colissions.
int getkeyDict(dict* d, char s[])
Finding a word into the dictionary by computing the hash function and looking up the proper list of nodes in the hash table. NOTFOUND is returned if the word is not found, but the key is returned if it exists.
void showDict(dict* d)
Display the nodes (string,key) stored into the dictionary.
void freeNodes(pnode node)
Set free a list of sinonimous (colissions).
void freeDict(dict* d)
Set recursively free the dictionary hash table of sinonimous.
void setAADict(dict* d, char s[], char aA)
Store the Genetic Code (1 codon : 1 amino acid) in a dictionary.
char getAADict(dict* d, char s[])
Returns the translation of the input codon by using the Genetic Code.




Enrique Blanco Garcia © 2001