1 #ifndef DYNAMITEgeneparameterHEADERFILE 2 #define DYNAMITEgeneparameterHEADERFILE 3 #ifdef _cplusplus 4 extern "C" { 5 #endif 6 #include "geneparser21.h" 7 #include "genefrequency.h" 8 #include "splicesitemodeler.h" 9 #include "complexevalset.h" 10 #include "probability.h" 11 12 #include "genestats.h" 13 #define GeneParameter21LISTLENGTH 32 14 15 16 17 struct Wise2_GeneWiseCodonModel { 18 int dynamite_hard_link; 19 #ifdef PTHREAD 20 pthread_mutex_t dynamite_mutex; 21 #endif 22 double in_donor[64]; 23 double in_acceptor[64]; 24 double in_cds[64]; 25 } ; 26 /* GeneWiseCodonModel defined */ 27 #ifndef DYNAMITE_DEFINED_GeneWiseCodonModel 28 typedef struct Wise2_GeneWiseCodonModel Wise2_GeneWiseCodonModel; 29 #define GeneWiseCodonModel Wise2_GeneWiseCodonModel 30 #define DYNAMITE_DEFINED_GeneWiseCodonModel 31 #endif 32 33 34 /* Object GeneParameter21 35 * 36 * Descrip: No Description 37 * 38 */ 39 struct Wise2_GeneParameter21 { 40 int dynamite_hard_link; 41 #ifdef PTHREAD 42 pthread_mutex_t dynamite_mutex; 43 #endif 44 GeneParser21 * gp; 45 CodonMapper * cm; 46 ComplexSequenceEvalSet * cses; 47 SpliceSiteModel ** ss; /* held only to be free'd when GeneParser21Set is free'd */ 48 int len;/* len for above ss */ 49 int maxlen; /* maxlen for above ss */ 50 RandomCodon * rc; /* needed to soak up the odd-and-sods of genes */ 51 GeneWiseCodonModel * gwcm; 52 CodonTable * ct; 53 boolean modelled_splice; /* so we can alter balance scores. */ 54 GeneModel * gms; 55 } ; 56 /* GeneParameter21 defined */ 57 #ifndef DYNAMITE_DEFINED_GeneParameter21 58 typedef struct Wise2_GeneParameter21 Wise2_GeneParameter21; 59 #define GeneParameter21 Wise2_GeneParameter21 60 #define DYNAMITE_DEFINED_GeneParameter21 61 #endif 62 63 64 65 66 /***************************************************/ 67 /* Callable functions */ 68 /* These are the functions you are expected to use */ 69 /***************************************************/ 70 71 72 73 /* Function: GeneParameter21_from_GeneModel(gm,ct,rnd_loop,cds_loop,rnd_to_model,link_loop,link_to_model,subs_error,indel_error) 74 * 75 * Descrip: This actually makes the GeneParameter21 stuff from the 76 * new statistics 77 * 78 * 79 * Arg: gm [UNKN ] Undocumented argument [GeneModel *] 80 * Arg: ct [UNKN ] Undocumented argument [CodonTable *] 81 * Arg: rnd_loop [UNKN ] Undocumented argument [Probability] 82 * Arg: cds_loop [UNKN ] Undocumented argument [Probability] 83 * Arg: rnd_to_model [UNKN ] Undocumented argument [Probability] 84 * Arg: link_loop [UNKN ] Undocumented argument [Probability] 85 * Arg: link_to_model [UNKN ] Undocumented argument [Probability] 86 * Arg: subs_error [UNKN ] Undocumented argument [Probability] 87 * Arg: indel_error [UNKN ] Undocumented argument [Probability] 88 * 89 * Return [UNKN ] Undocumented return value [GeneParameter21 *] 90 * 91 */ 92 GeneParameter21 * Wise2_GeneParameter21_from_GeneModel(GeneModel * gm,CodonTable * ct,Probability rnd_loop,Probability cds_loop,Probability rnd_to_model,Probability link_loop,Probability link_to_model,Probability subs_error,Probability indel_error); 93 #define GeneParameter21_from_GeneModel Wise2_GeneParameter21_from_GeneModel 94 95 96 /* Function: hard_link_GeneWiseCodonModel(obj) 97 * 98 * Descrip: Bumps up the reference count of the object 99 * Meaning that multiple pointers can 'own' it 100 * 101 * 102 * Arg: obj [UNKN ] Object to be hard linked [GeneWiseCodonModel *] 103 * 104 * Return [UNKN ] Undocumented return value [GeneWiseCodonModel *] 105 * 106 */ 107 GeneWiseCodonModel * Wise2_hard_link_GeneWiseCodonModel(GeneWiseCodonModel * obj); 108 #define hard_link_GeneWiseCodonModel Wise2_hard_link_GeneWiseCodonModel 109 110 111 /* Function: GeneWiseCodonModel_alloc(void) 112 * 113 * Descrip: Allocates structure: assigns defaults if given 114 * 115 * 116 * 117 * Return [UNKN ] Undocumented return value [GeneWiseCodonModel *] 118 * 119 */ 120 GeneWiseCodonModel * Wise2_GeneWiseCodonModel_alloc(void); 121 #define GeneWiseCodonModel_alloc Wise2_GeneWiseCodonModel_alloc 122 123 124 /* Function: free_GeneWiseCodonModel(obj) 125 * 126 * Descrip: Free Function: removes the memory held by obj 127 * Will chain up to owned members and clear all lists 128 * 129 * 130 * Arg: obj [UNKN ] Object that is free'd [GeneWiseCodonModel *] 131 * 132 * Return [UNKN ] Undocumented return value [GeneWiseCodonModel *] 133 * 134 */ 135 GeneWiseCodonModel * Wise2_free_GeneWiseCodonModel(GeneWiseCodonModel * obj); 136 #define free_GeneWiseCodonModel Wise2_free_GeneWiseCodonModel 137 138 139 /* Function: add_GeneParameter21(obj,add) 140 * 141 * Descrip: Adds another object to the list. It will expand the list if necessary 142 * 143 * 144 * Arg: obj [UNKN ] Object which contains the list [GeneParameter21 *] 145 * Arg: add [OWNER] Object to add to the list [SpliceSiteModel *] 146 * 147 * Return [UNKN ] Undocumented return value [boolean] 148 * 149 */ 150 boolean Wise2_add_GeneParameter21(GeneParameter21 * obj,SpliceSiteModel * add); 151 #define add_GeneParameter21 Wise2_add_GeneParameter21 152 153 154 /* Function: flush_GeneParameter21(obj) 155 * 156 * Descrip: Frees the list elements, sets length to 0 157 * If you want to save some elements, use hard_link_xxx 158 * to protect them from being actually destroyed in the free 159 * 160 * 161 * Arg: obj [UNKN ] Object which contains the list [GeneParameter21 *] 162 * 163 * Return [UNKN ] Undocumented return value [int] 164 * 165 */ 166 int Wise2_flush_GeneParameter21(GeneParameter21 * obj); 167 #define flush_GeneParameter21 Wise2_flush_GeneParameter21 168 169 170 /* Function: GeneParameter21_alloc_std(void) 171 * 172 * Descrip: Equivalent to GeneParameter21_alloc_len(GeneParameter21LISTLENGTH) 173 * 174 * 175 * 176 * Return [UNKN ] Undocumented return value [GeneParameter21 *] 177 * 178 */ 179 GeneParameter21 * Wise2_GeneParameter21_alloc_std(void); 180 #define GeneParameter21_alloc_std Wise2_GeneParameter21_alloc_std 181 182 183 /* Function: GeneParameter21_alloc_len(len) 184 * 185 * Descrip: Allocates len length to all lists 186 * 187 * 188 * Arg: len [UNKN ] Length of lists to allocate [int] 189 * 190 * Return [UNKN ] Undocumented return value [GeneParameter21 *] 191 * 192 */ 193 GeneParameter21 * Wise2_GeneParameter21_alloc_len(int len); 194 #define GeneParameter21_alloc_len Wise2_GeneParameter21_alloc_len 195 196 197 /* Function: hard_link_GeneParameter21(obj) 198 * 199 * Descrip: Bumps up the reference count of the object 200 * Meaning that multiple pointers can 'own' it 201 * 202 * 203 * Arg: obj [UNKN ] Object to be hard linked [GeneParameter21 *] 204 * 205 * Return [UNKN ] Undocumented return value [GeneParameter21 *] 206 * 207 */ 208 GeneParameter21 * Wise2_hard_link_GeneParameter21(GeneParameter21 * obj); 209 #define hard_link_GeneParameter21 Wise2_hard_link_GeneParameter21 210 211 212 /* Function: GeneParameter21_alloc(void) 213 * 214 * Descrip: Allocates structure: assigns defaults if given 215 * 216 * 217 * 218 * Return [UNKN ] Undocumented return value [GeneParameter21 *] 219 * 220 */ 221 GeneParameter21 * Wise2_GeneParameter21_alloc(void); 222 #define GeneParameter21_alloc Wise2_GeneParameter21_alloc 223 224 225 /* Function: free_GeneParameter21(obj) 226 * 227 * Descrip: Free Function: removes the memory held by obj 228 * Will chain up to owned members and clear all lists 229 * 230 * 231 * Arg: obj [UNKN ] Object that is free'd [GeneParameter21 *] 232 * 233 * Return [UNKN ] Undocumented return value [GeneParameter21 *] 234 * 235 */ 236 GeneParameter21 * Wise2_free_GeneParameter21(GeneParameter21 * obj); 237 #define free_GeneParameter21 Wise2_free_GeneParameter21 238 239 240 /* Unplaced functions */ 241 /* There has been no indication of the use of these functions */ 242 GeneWiseCodonModel * Wise2_GeneWiseCodonModel_from_GeneFrequencies(double * cds,GeneConsensus * donor,GeneConsensus * acceptor); 243 #define GeneWiseCodonModel_from_GeneFrequencies Wise2_GeneWiseCodonModel_from_GeneFrequencies 244 GeneParameter21 * Wise2_GeneParameter21_from_GeneFrequency21(GeneFrequency21 * gf,CodonTable * ct,RandomModelDNA * rmd,Probability rnd_loop,Probability cds_loop,Probability rnd_to_model,Probability link_loop,Probability link_to_model); 245 #define GeneParameter21_from_GeneFrequency21 Wise2_GeneParameter21_from_GeneFrequency21 246 247 248 /***************************************************/ 249 /* Internal functions */ 250 /* you are not expected to have to call these */ 251 /***************************************************/ 252 void Wise2_swap_GeneParameter21(SpliceSiteModel ** list,int i,int j) ; 253 #define swap_GeneParameter21 Wise2_swap_GeneParameter21 254 void Wise2_qsort_GeneParameter21(SpliceSiteModel ** list,int left,int right,int (*comp)(SpliceSiteModel * ,SpliceSiteModel * )); 255 #define qsort_GeneParameter21 Wise2_qsort_GeneParameter21 256 void Wise2_sort_GeneParameter21(GeneParameter21 * obj,int (*comp)(SpliceSiteModel *, SpliceSiteModel *)); 257 #define sort_GeneParameter21 Wise2_sort_GeneParameter21 258 boolean Wise2_expand_GeneParameter21(GeneParameter21 * obj,int len); 259 #define expand_GeneParameter21 Wise2_expand_GeneParameter21 260 261 #ifdef _cplusplus 262 } 263 #endif 264 265 #endif 266