-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathglix.h
60 lines (46 loc) · 1.26 KB
/
glix.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#define GFFRecord GFFRecord2
const int SEQMAP_BLOCKSIZE = 1024;
const int DEFAULT_HASH_TABLE_SIZE = 17909;
const int DEFAULT_PAD = 0;
struct SEQDATA
{
char *Label;
int Length;
int RoundedLength;
int Offset;
SEQDATA *Next;
};
class GLIX
{
public:
GLIX();
virtual ~GLIX();
void Free();
void Init(int Pad = DEFAULT_PAD, int HashTableSize = DEFAULT_HASH_TABLE_SIZE);
const char *GlobalToSeq(int GlobalPos, int *ptrSeqPos) const;
const char *GlobalToSeqPadded(int GlobalPos, int *ptrSeqPos) const;
int LocalToGlobal(const char *Label, int LocalPos) const;
int LocalToGlobalNoFail(const char *Label, int LocalPos) const;
int FromGFFFile(FILE *f);
int FromGFFSet(const GFFSet &Set);
void Add(const char *Label, int LocalPos);
void Insert(const char *Label, int Offset, int Length);
void MakeGlobalToLocalIndex();
int GetGlobalLength() const;
int GetSeqCount() const;
int GetSeqOffset(const char *Label) const;
int GetSeqLength(const char *Label) const;
void LogMe() const;
private:
SEQDATA *AddToIndex(const char *Label, int Length);
void AssignOffsets();
SEQDATA *SeqIndexLookup(const char *Label) const;
private:
SEQDATA **m_HashTable;
SEQDATA **m_SeqMap;
int m_SeqCount;
int m_HashTableSize;
int m_GlobalLength;
int m_Pad;
};
#undef GFFRecord