1 #ifndef __MOVE_SET_H 2 #define __MOVE_SET_H 3 4 #include <stdio.h> 5 6 /* used data structure*/ 7 typedef struct _struct_en{ 8 int energy; /* energy in 10kcal/mol*/ 9 short *structure; /* structure in energy_of_move format*/ 10 } struct_en; 11 12 /* prints structure*/ 13 void print_stren(FILE *out, struct_en *str); 14 void print_str(FILE *out, short *str); 15 16 /* copying functions*/ 17 void copy_arr(short *dest, short *src); /*just copy*/ 18 short *allocopy(short *src); /*copy and make space*/ 19 20 enum MOVE_TYPE {GRADIENT, FIRST, ADAPTIVE}; 21 22 /* walking methods (verbose_lvl 0-2, shifts = use shift moves? noLP = no lone pairs? (not compatible with shifts)) 23 input: seq - sequence 24 ptable - structure encoded with make_pair_table() from pair_mat.h 25 s, s1 - sequence encoded with encode_sequence from pair_mat.h 26 methods: deepest - lowest energy structure is used 27 first - first found lower energy structure is used 28 rand - random lower energy structure is used 29 returns local minima structure in ptable and its energy in 10kcal/mol as output */ 30 31 int move_gradient( char *seq, 32 short *ptable, 33 short *s, 34 short *s1, 35 int verbosity_level, 36 int shifts, 37 int noLP); 38 int move_first( char *seq, 39 short *ptable, 40 short *s, 41 short *s1, 42 int verbosity_level, 43 int shifts, 44 int noLP); 45 int move_adaptive( char *seq, 46 short *ptable, 47 short *s, 48 short *s1, 49 int verbosity_level); 50 51 /* standardized method that encapsulates above "_pt" methods 52 input: seq - sequence 53 struc - structure in dot-bracket notation 54 type - type of move selection according to MOVE_TYPE enum 55 return: energy of LM 56 structure of LM in struc in bracket-dot notation 57 */ 58 int move_standard(char *seq, 59 char *struc, 60 enum MOVE_TYPE type, 61 int verbosity_level, 62 int shifts, 63 int noLP); 64 65 66 /* browse_neighbours and perform funct function on each of them (used mainly for user specified flooding) 67 input: seq - sequence 68 ptable - structure encoded with make_pair_table() from pair_mat.h 69 s, s1 - sequence encoded with encode_sequence from pair_mat.h 70 funct - function (structure from neighbourhood, structure from input) toperform on every structure in neigbourhood (if the function returns non-zero, the iteration through neighbourhood stops.) 71 returns energy of the structure funct sets as second argument*/ 72 int browse_neighs_pt( char *seq, 73 short *ptable, 74 short *s, 75 short *s1, 76 int verbosity_level, 77 int shifts, 78 int noLP, 79 int (*funct) (struct_en*, struct_en*)); 80 81 int browse_neighs( char *seq, 82 char *struc, 83 int verbosity_level, 84 int shifts, 85 int noLP, 86 int (*funct) (struct_en*, struct_en*)); 87 88 /* switches OFF (and ON) degeneracy handling, ON by default 89 input: degeneracy - 0 for degeneracy handling OFF, 1 for ON 90 returns void */ 91 92 void degeneracy_handling(int degeneracy); 93 94 #endif 95 96 97 98