modified: makefile
[GalaxyCodeBases.git] / BGI / soap_src / soap_builder / extratools.h
blobf730aa2da5dd266b23f94159ecdbcf111f69ecb3
1 #ifndef _EXTRATOOLS_H_
2 #define _EXTRATOOLS_H_
4 #include <stdio.h>
5 #include <stdlib.h>
6 #include "MiscUtilities.h"
7 #include "MemManager.h"
8 #include "TextConverter.h"
9 #include "Timing.h"
10 #include "BWT.h"
11 #include "HSP.h"
12 #include "Types.h"
13 #include <fcntl.h>
15 typedef struct LOOKUPTABLE_TYPE {
16 unsigned int tableSize;
17 unsigned int * table;
18 }LOOKUPTABLE;
20 typedef struct HASHCELL_TYPE {
21 unsigned int count;
22 unsigned int index;
23 }HASHCELL;
25 typedef struct HASHITEM_TYPE {
26 unsigned int l;
27 unsigned int r;
28 unsigned int occIndex;
29 }HASHITEM;
31 typedef unsigned int OCC;
33 typedef struct HASHTABLE_TYPE {
34 unsigned int prime;
35 unsigned int a;
36 unsigned int b;
37 unsigned int tableSize;
38 HASHCELL * table;
39 HASHITEM * itemList;
40 OCC * occList;
41 }HASHTABLE;
45 BWT * occBwt;
46 HASHTABLE * occHashtable;
47 unsigned int * occCollector;
48 unsigned int occCollected;
50 FILE * textPositionFile;
51 void registerTPFile(FILE * filePtr,unsigned int searchMode);
54 void registerQIndex(unsigned int queryIndex);
55 void registerQSection();
58 void LoadLookupTable(LOOKUPTABLE * lookupTable, const char * fileName, const int tableSize);
59 void FreeLookupTable(LOOKUPTABLE * lookupTable);
60 unsigned int LookupSafe(LOOKUPTABLE lookupTable, BWT * bwt,unsigned long long lKey, unsigned long long rKey,unsigned int *l, unsigned int *r);
61 void LoadHashTable(HASHTABLE * hashTable, const char * fileName);
62 HASHITEM * HashFind(HASHTABLE * hashTable, unsigned int l,unsigned int r);
63 void FreeHashTable(HASHTABLE * hashTable);
64 void RegisterDecoder(BWT * bwt,HASHTABLE * hashTable);
66 //void OCCClean();
67 //void OCCProcess(unsigned int l,unsigned int r);
68 void OCCProcess(unsigned int l,unsigned int r, int chain, unsigned int allele1, unsigned int allele2, HitInfo *hits, unsigned int *numOfHits);
70 //void CleanDecoder();
72 double getTextPositionTime();
73 unsigned int getSARetrieved();
74 unsigned int getHASHRetrieved();
76 #endif /*_EXTRATOOLS_H_*/