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

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