/*------------------------------------------------------------- Copyright (C) 2000 Rolf Backofen, Peter Clote. All Rights Reserved. Permission to use, copy, modify, and distribute this software and its documentation for NON-COMMERCIAL purposes and without fee is hereby granted provided that this copyright notice appears in all copies. THE AUTHOR AND PUBLISHER MAKE NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. THE AUTHORS AND PUBLISHER SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. -------------------------------------------------------------*/ /***************************************************************************** * general.h: general data structures and function definitions for the * * Project "Error optimized genetic code" * * * * author: S.Schoenauer * * creation: 3/17/1997 * *****************************************************************************/ /* global definitions */ #define NUM_ACIDS 20 /* Number of amino acids */ #define NUM_ACIDS_SS 21 /* Number of amino acids plus start and stop codon */ #define STOP 20 /* STOP codon comes after 0..19 in list */ #define ALPHA 2 /* ALPHA,BETA,GAMMA using in monte_carlo() */ #define BETA 5 #define GAMMA 0 /***************************************************************** Choice of constants: Schoenauer's values : 2 min for run 5 500 #define kb 1.3807E-23 Boltzmans constant #define T_hi 1 starting high temperature; set for WAC matrix #define T_lo 1E-10 terminating low temperature; set for WAC matrix Clote's values : 6 min for run 5 500 #define kb 1.0 #define T_hi 10000.0 #define T_lo 1E-40 #define kb 1.0 #define T_hi 100 #define T_lo 1E-45 The following values, I computed using EXCEL, assuming Delta E is at most 1 initially (so T_hi yields 99% prob of change, while T_lo yields less than 0.01 % prob of changing. NOTE: get error (random value of above constants) if don't use decimal or exp notation. *****************************************************************/ #define kb 1.0 /* Boltzmans constant */ #define T_hi 10.0 /* starting high temperature; set for WAC matrix */ #define T_lo 1E-4 /* terminating low temperature; set for WAC matrix */ /* enumeration type of the nucleotide bases */ enum base {A, T, C, G}; /* A genetic code is represented by an array of the 64 codons. For each codon the array contains the number of the encoded amino acid. */ typedef unsigned int gcode[4][4][4]; /* This is a table to convert the number of an amino acid into the three-letter code plus a symbol for the start and the stop codon. The ordering of amino-acid number are aplphabetical */ extern char *num2triple[NUM_ACIDS_SS]; /* consecutive numbering of blocks. */ extern gcode block_code; /* this is the translation of alphabetic ordering of aminoacids (using three letters) to consective block numbering */ extern int alpha_block[NUM_ACIDS_SS]; /* this is the translation of consective block numbering to alphabetic ordering of aminoacids (using three letters) */ extern int block_alpha[NUM_ACIDS_SS]; /* polar requirement for natural code (for the amino-acids in alphabetical ordering */ extern float alpha_PC[NUM_ACIDS]; /* for test: standard code in alphabetical order */ extern gcode std_code; /* This is a table to convert the numeric code into the one-letter code. */ extern unsigned char num2char[NUM_ACIDS_SS]; /* read_matrix() gets a filename and puts the scoring valus from the file into smatrix. It does not check, whether the file really contains a scoring matrix or not. It expects that the scoring matrix is provided as an upper triangle matrix consisting of float values. */ int read_matrix(char *filename, float matrix[NUM_ACIDS][NUM_ACIDS]); struct float4tuple { float whole; float one; float two; float three; }; typedef struct float4tuple Fourtuple; struct float4int1tuple { float whole; float one; float two; float three; int sumnij; }; typedef struct float4int1tuple Fivetuple;