comparison IMSAME/src/structs.h @ 0:762009a91895 draft

Uploaded
author bitlab
date Sat, 15 Dec 2018 18:04:10 -0500
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:762009a91895
1 #ifndef STRUCTS_H
2 #define STRUCTS_H
3
4 #include <inttypes.h>
5
6 //Structs required for the dotplot workflow
7 #define MAXLID 200
8 //#define READBUF 2000000000 //2 GB
9 #define READBUF 500000000 //500MB
10 #define INITSEQS 3000 //Number of starting sequences (in database)
11 #define POINT 4
12
13 #define FIXED_K 12
14
15 #define MAXLID 200
16 #define ALIGN_LEN 60 //For NW alignment
17 #define MAX_READ_SIZE 10000 //Maximum length of read to have a portion of the table allocated
18 #define MAX_WINDOW_SIZE 1000 //Maximum window length to explore NW table
19 //#define POOL_SIZE 2500000000 // by 16 bytes it is 40 GB
20 #define POOL_SIZE 12500000 // 1 GB if 16 bytes
21 #define MAX_MEM_POOLS 128
22 #define FIXED_LOADING_THREADS 4
23
24 #define FALSE 0
25 #define TRUE 1
26
27 extern uint64_t custom_kmer;
28
29 typedef char _vector_char __attribute__ ((vector_size (32*sizeof(char))));
30
31 //Struct for linked list of positions
32 typedef struct linked_list_pos{
33 uint64_t pos;
34 uint64_t s_id;
35 //uint64_t extended_hash;
36 struct linked_list_pos * next;
37 } llpos;
38
39 typedef struct AVL_Node{
40 uint64_t key;
41 struct AVL_Node * left;
42 struct AVL_Node * right;
43 uint64_t height;
44 uint64_t count;
45 llpos * next;
46 } AVLTree;
47
48 //Struct for memory pool por lists
49 typedef struct mempool_l{
50 llpos * base;
51 uint64_t current;
52 } Mempool_l;
53
54 //Struct for memory pool por AVLtree
55 typedef struct mempool_AVL{
56 AVLTree * base;
57 uint64_t current;
58 } Mempool_AVL;
59
60
61 //Struct for a whole sequence(s) data
62 typedef struct seqinfo{
63 unsigned char * sequences;
64 uint64_t * start_pos;
65 uint64_t total_len;
66 uint64_t n_seqs;
67 } SeqInfo;
68
69 //Struct for the alignment of a quick hit
70 typedef struct quickfrag{
71 uint64_t x_start;
72 uint64_t y_start;
73 uint64_t t_len;
74 long double coverage;
75 long double e_value;
76 } Quickfrag;
77
78 typedef struct point{
79 uint64_t x;
80 uint64_t y;
81 } Point;
82
83 typedef struct container{
84 llpos * table[4][4][4][4][4][4][4][4][4][4][4]; // One reduced; A,C,G,T tables in use
85 } Container;
86
87 typedef struct AVLcontainer{
88 AVLTree root[4][4][4][4][4][4][4][4][4][4][4];
89 } AVLContainer;
90
91 typedef struct{
92 char * temp_seq_buffer;
93 SeqInfo * data_database;
94 uint64_t t_len;
95 uint64_t word_size;
96 uint64_t read_from;
97 uint64_t read_to;
98 uint64_t contained_reads;
99 uint64_t base_coordinates;
100 uint64_t n_allocs;
101 char thread_id;
102 AVLContainer * ct;
103 Mempool_l * mp;
104 uint64_t n_pools_used;
105 uint64_t n_pools_used_AVL;
106 Mempool_AVL * mp_AVL;
107 } LoadingDBArgs;
108
109 struct cell{
110 int64_t score;
111 uint64_t xfrom;
112 uint64_t yfrom;
113 };
114
115 struct positioned_cell{
116 int64_t score;
117 uint64_t xpos;
118 uint64_t ypos;
119 };
120
121 struct best_cell{
122 struct positioned_cell c;
123 uint64_t j_prime;
124 };
125
126 typedef struct{
127 uint64_t identities;
128 uint64_t length;
129 uint64_t igaps;
130 uint64_t egaps;
131 } BasicAlignment;
132
133 typedef struct queue{
134 uint64_t r1; //reads region
135 uint64_t r2;
136 struct queue * next;
137 } Queue;
138
139 typedef struct{
140 Queue * head;
141 } Head;
142
143
144 #endif