| 0 | 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 //50MB | 
|  | 10 #define INITSEQS 3000 //Number of starting sequences (in database) | 
|  | 11 #define POINT 4 | 
|  | 12 | 
|  | 13 #define FIXED_K 12 | 
|  | 14 #define TOTAL_ENTRIES 16777216 | 
|  | 15 | 
|  | 16 #define MAXLID 200 | 
|  | 17 #define ALIGN_LEN 60 //For NW alignment | 
|  | 18 #define MAX_READ_SIZE 20000 //Maximum length of read to have a portion of the table allocated | 
|  | 19 #define MAX_WINDOW_SIZE 500 //Maximum window length to explore NW table | 
|  | 20 //#define POOL_SIZE 2500000000 // by 16 bytes it is 40 GB | 
|  | 21 #define POOL_SIZE 12500000 // 1 GB if 16 bytes | 
|  | 22 #define MAX_MEM_POOLS 256 | 
|  | 23 | 
|  | 24 #define BYTES_IN_MER 4 | 
|  | 25 #define MAX_DECOMP_HASH 10 | 
|  | 26 #define FALSE 0 | 
|  | 27 #define TRUE 1 | 
|  | 28 | 
|  | 29 #define MAX(x, y) (((x) > (y)) ? (x) : (y)) | 
|  | 30 #define MIN(x, y) (((x) <= (y)) ? (x) : (y)) | 
|  | 31 | 
|  | 32 extern uint64_t custom_kmer; | 
|  | 33 extern uint64_t diffuse_z; | 
|  | 34 | 
|  | 35 //Struct for linked list of positions | 
|  | 36 typedef struct linked_list_pos{ | 
|  | 37     uint64_t pos; | 
|  | 38     //uint64_t extended_hash; | 
|  | 39     //unsigned char decomp_hash[MAX_DECOMP_HASH]; // Fits up to MAX_DECOMP_HASH*4 letters = 256 length kmer | 
|  | 40     //uint64_t hits_count; | 
|  | 41     struct linked_list_pos * next; | 
|  | 42 } llpos; | 
|  | 43 | 
|  | 44 | 
|  | 45 // An AVL tree node | 
|  | 46 typedef struct AVL_Node{ | 
|  | 47     uint64_t key; | 
|  | 48     struct AVL_Node * left; | 
|  | 49     struct AVL_Node * right; | 
|  | 50     uint64_t height; | 
|  | 51     uint64_t count; | 
|  | 52     llpos * next; | 
|  | 53 } AVLTree; | 
|  | 54 | 
|  | 55 | 
|  | 56 // Tuple of data | 
|  | 57 typedef struct tuple_hits{ | 
|  | 58     int repetition; | 
|  | 59     int hit_count; | 
|  | 60     uint64_t key; | 
|  | 61     uint64_t pos; | 
|  | 62     uint64_t pos_in_y; | 
|  | 63 } Tuple_hits; | 
|  | 64 | 
|  | 65 typedef struct hash_holder{ | 
|  | 66     uint64_t key; | 
|  | 67     uint64_t pos; | 
|  | 68 } Hash_holder; | 
|  | 69 | 
|  | 70 | 
|  | 71 | 
|  | 72 //Struct for memory pool por lists | 
|  | 73 typedef struct mempool_l{ | 
|  | 74     llpos * base; | 
|  | 75     uint64_t current; | 
|  | 76 } Mempool_l; | 
|  | 77 | 
|  | 78 //Struct for memory pool por AVLtree | 
|  | 79 typedef struct mempool_AVL{ | 
|  | 80     AVLTree * base; | 
|  | 81     uint64_t current; | 
|  | 82 } Mempool_AVL; | 
|  | 83 | 
|  | 84 //Struct for a whole sequence(s) data | 
|  | 85 typedef struct seqinfo{ | 
|  | 86     unsigned char * sequences; | 
|  | 87     uint64_t * start_pos; | 
|  | 88     uint64_t total_len; | 
|  | 89     uint64_t n_seqs; | 
|  | 90 } SeqInfo; | 
|  | 91 | 
|  | 92 //Struct for the alignment of a quick hit | 
|  | 93 typedef struct quickfrag{ | 
|  | 94     uint64_t x_start; | 
|  | 95     uint64_t y_start; | 
|  | 96     uint64_t t_len; | 
|  | 97     long double coverage; | 
|  | 98     long double e_value; | 
|  | 99 } Quickfrag; | 
|  | 100 | 
|  | 101 typedef struct point{ | 
|  | 102     uint64_t x; | 
|  | 103     uint64_t y; | 
|  | 104 } Point; | 
|  | 105 | 
|  | 106 | 
|  | 107 | 
|  | 108 struct cell{ | 
|  | 109     int64_t score; | 
|  | 110     uint64_t xfrom; | 
|  | 111     uint64_t yfrom; | 
|  | 112 }; | 
|  | 113 | 
|  | 114 struct positioned_cell{ | 
|  | 115     int64_t score; | 
|  | 116     uint64_t xpos; | 
|  | 117     uint64_t ypos; | 
|  | 118 }; | 
|  | 119 | 
|  | 120 struct best_cell{ | 
|  | 121     struct positioned_cell c; | 
|  | 122     uint64_t j_prime; | 
|  | 123 }; | 
|  | 124 | 
|  | 125 typedef struct{ | 
|  | 126     uint64_t identities; | 
|  | 127     uint64_t length; | 
|  | 128     uint64_t igaps; | 
|  | 129     uint64_t egaps; | 
|  | 130 } BasicAlignment; | 
|  | 131 | 
|  | 132 typedef struct queue{ | 
|  | 133     uint64_t r1; //reads region | 
|  | 134     uint64_t r2; | 
|  | 135     struct queue * next; | 
|  | 136 } Queue; | 
|  | 137 | 
|  | 138 typedef struct{ | 
|  | 139     Queue * head; | 
|  | 140 } Head; | 
|  | 141 | 
|  | 142 | 
|  | 143 #endif |