1 /* @include ajtaxdata ********************************************************* 2 ** 3 ** AJAX taxonomy data structures 4 ** 5 ** @author Copyright (C) 2010 Peter Rice 6 ** @version $Revision: 1.10 $ 7 ** @modified Oct 5 pmr First version 8 ** @modified $Date: 2012/04/26 17:36:15 $ by $Author: mks $ 9 ** @@ 10 ** 11 ** This library is free software; you can redistribute it and/or 12 ** modify it under the terms of the GNU Lesser General Public 13 ** License as published by the Free Software Foundation; either 14 ** version 2.1 of the License, or (at your option) any later version. 15 ** 16 ** This library is distributed in the hope that it will be useful, 17 ** but WITHOUT ANY WARRANTY; without even the implied warranty of 18 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 19 ** Lesser General Public License for more details. 20 ** 21 ** You should have received a copy of the GNU Lesser General Public 22 ** License along with this library; if not, write to the Free Software 23 ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 24 ** MA 02110-1301, USA. 25 ** 26 ******************************************************************************/ 27 28 #ifndef AJTAXDATA_H 29 #define AJTAXDATA_H 30 31 /* ========================================================================= */ 32 /* ============================= include files ============================= */ 33 /* ========================================================================= */ 34 35 #include "ajdefine.h" 36 #include "ajtextdata.h" 37 38 AJ_BEGIN_DECLS 39 40 41 42 43 /* ========================================================================= */ 44 /* =============================== constants =============================== */ 45 /* ========================================================================= */ 46 47 48 49 50 /* ========================================================================= */ 51 /* ============================== public data ============================== */ 52 /* ========================================================================= */ 53 54 55 56 57 /* @data AjPTax *************************************************************** 58 ** 59 ** Ajax tax object. 60 ** 61 ** Holds the tax itself, plus associated information. 62 ** 63 ** @alias AjSTax 64 ** @alias AjOTax 65 ** 66 ** @attr Id [AjPStr] Taxonomy id 67 ** @attr Db [AjPStr] Database name from input 68 ** @attr Setdb [AjPStr] Database name from command line 69 ** @attr Full [AjPStr] Full name 70 ** @attr Qry [AjPStr] Query for re-reading 71 ** @attr Formatstr [AjPStr] Input format name 72 ** @attr Filename [AjPStr] Original filename 73 ** @attr Rank [AjPStr] Rank in taxomony hierarchy 74 ** @attr Emblcode [AjPStr] EMBL locus name prefix (not unique) 75 ** @attr Comment [AjPStr] Comment 76 ** @attr Name [AjPStr] Standard name 77 ** @attr Namelist [AjPList] Names list 78 ** @attr Citations [AjPList] Citations list 79 ** @attr Lines [AjPStr*] Lines of input data 80 ** @attr Fpos [ajlong] File position 81 ** @attr Format [AjEnum] Input format enum 82 ** @attr Count [ajuint] Number of lines read 83 ** @attr Taxid [ajuint] Taxon node id 84 ** @attr Parent [ajuint] Parent taxid 85 ** @attr Flags [ajuint] Flags: 86 ** if node inherits division from parent 87 ** if node inherits genetic code from parent 88 ** if node inherits mito gencode from parent 89 ** if name is suppressed in GB entry lineage 90 ** if this subtree has no sequence data yet 91 ** @attr Divid [unsigned char] Division id 92 ** @attr Gencode [unsigned char] Genetic code id 93 ** @attr Mitocode [unsigned char] Mitochondrial genetic code id 94 ** @attr Padchar [unsigned char] Padding to alignment boundary 95 ** @@ 96 ******************************************************************************/ 97 98 typedef struct AjSTax 99 { 100 AjPStr Id; 101 AjPStr Db; 102 AjPStr Setdb; 103 AjPStr Full; 104 AjPStr Qry; 105 AjPStr Formatstr; 106 AjPStr Filename; 107 AjPStr Rank; 108 AjPStr Emblcode; 109 AjPStr Comment; 110 AjPStr Name; 111 AjPList Namelist; 112 AjPList Citations; 113 AjPStr *Lines; 114 ajlong Fpos; 115 AjEnum Format; 116 ajuint Count; 117 ajuint Taxid; 118 ajuint Parent; 119 ajuint Flags; 120 unsigned char Divid; 121 unsigned char Gencode; 122 unsigned char Mitocode; 123 unsigned char Padchar; 124 } AjOTax; 125 126 #define AjPTax AjOTax* 127 128 129 130 131 /* @data AjPTaxin ************************************************************* 132 ** 133 ** Ajax tax input object. 134 ** 135 ** Holds the input specification and information needed to read 136 ** the tax and possible further entries 137 ** 138 ** @alias AjSTaxin 139 ** @alias AjOTaxin 140 ** 141 ** @attr Input [AjPTextin] General text input object 142 ** @attr TaxData [void*] Format data for reuse, e.g. multiple term input 143 ** (unused in current code) 144 ** @@ 145 ******************************************************************************/ 146 147 typedef struct AjSTaxin 148 { 149 AjPTextin Input; 150 void *TaxData; 151 } AjOTaxin; 152 153 #define AjPTaxin AjOTaxin* 154 155 156 157 158 /* @data AjPTaxall ************************************************************ 159 ** 160 ** Ajax taxon all (stream) object. 161 ** 162 ** Inherits an AjPTax but allows more taxons to be read from the 163 ** same input by also inheriting the AjPTaxin input object. 164 ** 165 ** @alias AjSTaxall 166 ** @alias AjOTaxall 167 ** 168 ** @attr Tax [AjPTax] Current taxon 169 ** @attr Taxin [AjPTaxin] Taxon input for reading next 170 ** @attr Totterms [ajulong] Count of terms so far 171 ** @attr Count [ajuint] Count of terms so far 172 ** @attr Multi [AjBool] True if multiple values are expected 173 ** @attr Returned [AjBool] if true: Taxon object has been returned to a new 174 ** owner and is not to be deleted by the destructor 175 ** @attr Padding [char[4]] Padding to alignment boundary 176 ** @@ 177 ******************************************************************************/ 178 179 typedef struct AjSTaxall 180 { 181 AjPTax Tax; 182 AjPTaxin Taxin; 183 ajulong Totterms; 184 ajuint Count; 185 AjBool Multi; 186 AjBool Returned; 187 char Padding[4]; 188 } AjOTaxall; 189 190 #define AjPTaxall AjOTaxall* 191 192 193 194 195 /* @data AjPTaxname *********************************************************** 196 ** 197 ** NCBI taxonomy node name, listed within AjPTax 198 ** 199 ** @alias AjSTaxname 200 ** @alias AjOTaxname 201 ** 202 ** @attr Name [AjPStr] Name of taxon node 203 ** @attr UniqueName [AjPStr] Unique name of taxon node 204 ** @attr NameClass [AjPStr] Synonym, common name, etc. 205 ** 206 ******************************************************************************/ 207 208 typedef struct AjSTaxname 209 { 210 AjPStr Name; 211 AjPStr UniqueName; 212 AjPStr NameClass; 213 } AjOTaxname; 214 215 #define AjPTaxname AjOTaxname* 216 217 218 219 220 /* @data AjPTaxdiv ************************************************************ 221 ** 222 ** NCBI taxonomy division 223 ** 224 ** @alias AjSTaxdiv 225 ** @alias AjOTaxdiv 226 ** 227 ** @attr GbCode [AjPStr] GenBank division code (three characters) 228 ** @attr GbName [AjPStr] GenBank division name 229 ** @attr Comments [AjPStr] Comments 230 ** @attr Divid [ajuint] Taxonomy division id 231 ** @attr Padding [ajuint] Padding to alignment boundary 232 ** 233 ******************************************************************************/ 234 235 typedef struct AjSTaxdiv 236 { 237 AjPStr GbCode; 238 AjPStr GbName; 239 AjPStr Comments; 240 ajuint Divid; 241 ajuint Padding; 242 } AjOTaxdiv; 243 244 #define AjPTaxdiv AjOTaxdiv* 245 246 247 248 249 /* @data AjPTaxcode *********************************************************** 250 ** 251 ** NCBI taxonomy genetic code 252 ** 253 ** @alias AjSTaxcode 254 ** @alias AjOTaxcode 255 ** 256 ** @attr Abbrev [AjPStr] Genetic code name abbreviation 257 ** @attr Name [AjPStr] Genetic code full name 258 ** @attr Trans [AjPStr] Amino acids for each codon 259 ** @attr Starts [AjPStr] Start codons 260 ** @attr Gencode [ajuint] NCBI genetic code id 261 ** @attr Padding [ajuint] Padding to alignment boundary 262 ** 263 ******************************************************************************/ 264 265 typedef struct AjSTaxcode 266 { 267 268 AjPStr Abbrev; 269 AjPStr Name; 270 AjPStr Trans; 271 AjPStr Starts; 272 ajuint Gencode; 273 ajuint Padding; 274 } AjOTaxcode; 275 276 #define AjPTaxcode AjOTaxcode* 277 278 279 280 281 /* @data AjPTaxdel ************************************************************ 282 ** 283 ** NCBI taxonomy deleted node 284 ** 285 ** @alias AjSTaxdel 286 ** @alias AjOTaxdel 287 ** 288 ** @attr Taxid [ajuint] Taxon node id 289 ** 290 ******************************************************************************/ 291 292 typedef struct AjSTaxdel 293 { 294 ajuint Taxid; 295 } AjOTaxdel; 296 297 #define AjPTaxdel AjOTaxdel* 298 299 300 301 302 /* @data AjPTaxmerge ********************************************************** 303 ** 304 ** NCBI taxonomy mergednode 305 ** 306 ** @alias AjSTaxmerge 307 ** @alias AjOTaxmerge 308 ** 309 ** @attr Taxid [ajuint] Oldaxon node id 310 ** @attr Mergeid [ajuint] Merged taxon node id 311 ** 312 ******************************************************************************/ 313 314 typedef struct AjSTaxmerge 315 { 316 ajuint Taxid; 317 ajuint Mergeid; 318 } AjOTaxmerge; 319 320 #define AjPTaxmerge AjOTaxmerge* 321 322 323 324 325 /* @data AjPTaxcit ************************************************************ 326 ** 327 ** NCBI taxonomy citation, listed within AjPTax 328 ** 329 ** @alias AjSTaxcit 330 ** @alias AjOTaxcit 331 ** 332 ** @attr Citid [ajuint] Taxonomy citation id 333 ** @attr Pubmed [ajuint] PubMed id (0 if not found) 334 ** @attr Medline [ajuint] Medline id (0 if not found) 335 ** @attr Refcount [ajuint] Reference count 336 ** @attr Key [AjPStr] Citation key 337 ** @attr Url [AjPStr] Url associated with citation 338 ** @attr Text [AjPStr] Text, usually article name and authors 339 ** 340 ******************************************************************************/ 341 342 typedef struct AjSTaxcit 343 { 344 ajuint Citid; 345 ajuint Pubmed; 346 ajuint Medline; 347 ajuint Refcount; 348 AjPStr Key; 349 AjPStr Url; 350 AjPStr Text; 351 } AjOTaxcit; 352 353 #define AjPTaxcit AjOTaxcit* 354 355 356 357 358 /* @data AjPTaxAccess ********************************************************* 359 ** 360 ** Ajax taxonomy access database reading object. 361 ** 362 ** Holds information needed to read a tax entry from a database. 363 ** Access methods are defined for each known database type. 364 ** 365 ** Tax entries are read from the database using the defined 366 ** database access function, which is usually a static function 367 ** within ajtaxdb.c 368 ** 369 ** This should be a static data object but is needed for the definition 370 ** of AjPTaxin. 371 ** 372 ** @alias AjSTaxAccess 373 ** @alias AjOTaxAccess 374 ** 375 ** @attr Name [const char*] Access method name used in emboss.default 376 ** @attr Access [AjBool function] Access function 377 ** @attr AccessFree [AjBool function] Access cleanup function 378 ** @attr Qlink [const char*] Supported query link operators 379 ** @attr Desc [const char*] Description 380 ** @attr Alias [AjBool] Alias for another name 381 ** @attr Entry [AjBool] Supports retrieval of single entries 382 ** @attr Query [AjBool] Supports retrieval of selected entries 383 ** @attr All [AjBool] Supports retrieval of all entries 384 ** @attr Chunked [AjBool] Supports retrieval of entries in chunks 385 ** @attr Padding [AjBool] Padding to alignment boundary 386 ** @@ 387 ******************************************************************************/ 388 389 typedef struct AjSTaxAccess 390 { 391 const char *Name; 392 AjBool (*Access) (AjPTaxin taxin); 393 AjBool (*AccessFree) (void* qry); 394 const char* Qlink; 395 const char* Desc; 396 AjBool Alias; 397 AjBool Entry; 398 AjBool Query; 399 AjBool All; 400 AjBool Chunked; 401 AjBool Padding; 402 } AjOTaxAccess; 403 404 #define AjPTaxAccess AjOTaxAccess* 405 406 407 408 409 /* ========================================================================= */ 410 /* =========================== public functions ============================ */ 411 /* ========================================================================= */ 412 413 414 415 416 /* 417 ** Prototype definitions 418 */ 419 420 /* 421 ** End of prototype definitions 422 */ 423 424 425 426 427 AJ_END_DECLS 428 429 #endif /* !AJTAXDATA_H */ 430