annotate gecko/src/structs.h @ 1:35af401890c0 draft

Uploaded
author bitlab
date Thu, 13 Dec 2018 07:59:25 -0500
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1
35af401890c0 Uploaded
bitlab
parents:
diff changeset
1 #ifndef STRUCTS_H
35af401890c0 Uploaded
bitlab
parents:
diff changeset
2 #define STRUCTS_H
35af401890c0 Uploaded
bitlab
parents:
diff changeset
3
35af401890c0 Uploaded
bitlab
parents:
diff changeset
4 #include <inttypes.h>
35af401890c0 Uploaded
bitlab
parents:
diff changeset
5 //Structs required for the dotplot workflow
35af401890c0 Uploaded
bitlab
parents:
diff changeset
6 #define MAXLID 200
35af401890c0 Uploaded
bitlab
parents:
diff changeset
7 #define MAXLS 1000000000
35af401890c0 Uploaded
bitlab
parents:
diff changeset
8 #define READBUF 50000000 //50MB
35af401890c0 Uploaded
bitlab
parents:
diff changeset
9
35af401890c0 Uploaded
bitlab
parents:
diff changeset
10 //Struct for words program
35af401890c0 Uploaded
bitlab
parents:
diff changeset
11 typedef struct {
35af401890c0 Uploaded
bitlab
parents:
diff changeset
12 //Each letter is stored using 2 bits
35af401890c0 Uploaded
bitlab
parents:
diff changeset
13 //We have 4 letters per byte and a
35af401890c0 Uploaded
bitlab
parents:
diff changeset
14 //maximum of 32 in 'b'
35af401890c0 Uploaded
bitlab
parents:
diff changeset
15 unsigned char b[8];
35af401890c0 Uploaded
bitlab
parents:
diff changeset
16 } word;
35af401890c0 Uploaded
bitlab
parents:
diff changeset
17
35af401890c0 Uploaded
bitlab
parents:
diff changeset
18 //Struct for words and sort program
35af401890c0 Uploaded
bitlab
parents:
diff changeset
19 typedef struct {
35af401890c0 Uploaded
bitlab
parents:
diff changeset
20 //Word compressed in binary format
35af401890c0 Uploaded
bitlab
parents:
diff changeset
21 word w;
35af401890c0 Uploaded
bitlab
parents:
diff changeset
22 //Ocurrence position in the sequence
35af401890c0 Uploaded
bitlab
parents:
diff changeset
23 uint64_t pos;
35af401890c0 Uploaded
bitlab
parents:
diff changeset
24 //For multiple sequence files this var
35af401890c0 Uploaded
bitlab
parents:
diff changeset
25 //reflects in what sequence occurs the
35af401890c0 Uploaded
bitlab
parents:
diff changeset
26 //word
35af401890c0 Uploaded
bitlab
parents:
diff changeset
27 uint64_t seq;
35af401890c0 Uploaded
bitlab
parents:
diff changeset
28 } wentry;
35af401890c0 Uploaded
bitlab
parents:
diff changeset
29
35af401890c0 Uploaded
bitlab
parents:
diff changeset
30 //Struct for w2hd program
35af401890c0 Uploaded
bitlab
parents:
diff changeset
31 typedef struct {
35af401890c0 Uploaded
bitlab
parents:
diff changeset
32 //Word compressed in binary format
35af401890c0 Uploaded
bitlab
parents:
diff changeset
33 word w;
35af401890c0 Uploaded
bitlab
parents:
diff changeset
34 //Ocurrence position in the sequence
35af401890c0 Uploaded
bitlab
parents:
diff changeset
35 uint64_t pos;
35af401890c0 Uploaded
bitlab
parents:
diff changeset
36 //Number of ocurrences inside the
35af401890c0 Uploaded
bitlab
parents:
diff changeset
37 //sequence. This is used to know the
35af401890c0 Uploaded
bitlab
parents:
diff changeset
38 //number of locations stored in the
35af401890c0 Uploaded
bitlab
parents:
diff changeset
39 //positions file
35af401890c0 Uploaded
bitlab
parents:
diff changeset
40 uint64_t num;
35af401890c0 Uploaded
bitlab
parents:
diff changeset
41 } hashentry;
35af401890c0 Uploaded
bitlab
parents:
diff changeset
42
35af401890c0 Uploaded
bitlab
parents:
diff changeset
43 //Struct for w2hd program
35af401890c0 Uploaded
bitlab
parents:
diff changeset
44 typedef struct {
35af401890c0 Uploaded
bitlab
parents:
diff changeset
45 //Ocurrence position in the sequence
35af401890c0 Uploaded
bitlab
parents:
diff changeset
46 uint64_t pos;
35af401890c0 Uploaded
bitlab
parents:
diff changeset
47 //For multiple sequence files this var
35af401890c0 Uploaded
bitlab
parents:
diff changeset
48 //reflects in what sequence occurs the
35af401890c0 Uploaded
bitlab
parents:
diff changeset
49 //word
35af401890c0 Uploaded
bitlab
parents:
diff changeset
50 uint64_t seq;
35af401890c0 Uploaded
bitlab
parents:
diff changeset
51 } location;
35af401890c0 Uploaded
bitlab
parents:
diff changeset
52
35af401890c0 Uploaded
bitlab
parents:
diff changeset
53 //Struct for hits, sortHits and filterHits programs
35af401890c0 Uploaded
bitlab
parents:
diff changeset
54 typedef struct {
35af401890c0 Uploaded
bitlab
parents:
diff changeset
55 //Diagonal where the hit is located
35af401890c0 Uploaded
bitlab
parents:
diff changeset
56 //This value is calculated as:
35af401890c0 Uploaded
bitlab
parents:
diff changeset
57 //posX - posY
35af401890c0 Uploaded
bitlab
parents:
diff changeset
58 int64_t diag;
35af401890c0 Uploaded
bitlab
parents:
diff changeset
59 //Ocurrence position in sequence X
35af401890c0 Uploaded
bitlab
parents:
diff changeset
60 uint64_t posX;
35af401890c0 Uploaded
bitlab
parents:
diff changeset
61 //Ocurrence position in sequence Y
35af401890c0 Uploaded
bitlab
parents:
diff changeset
62 uint64_t posY;
35af401890c0 Uploaded
bitlab
parents:
diff changeset
63 //For multiple sequence files this var
35af401890c0 Uploaded
bitlab
parents:
diff changeset
64 //reflects in what sequence of X file
35af401890c0 Uploaded
bitlab
parents:
diff changeset
65 //occurs the word
35af401890c0 Uploaded
bitlab
parents:
diff changeset
66 uint64_t seqX;
35af401890c0 Uploaded
bitlab
parents:
diff changeset
67 //For multiple sequence files this var
35af401890c0 Uploaded
bitlab
parents:
diff changeset
68 //reflects in what sequence of Y file
35af401890c0 Uploaded
bitlab
parents:
diff changeset
69 //occurs the word
35af401890c0 Uploaded
bitlab
parents:
diff changeset
70 uint64_t seqY;
35af401890c0 Uploaded
bitlab
parents:
diff changeset
71 } hit;
35af401890c0 Uploaded
bitlab
parents:
diff changeset
72
35af401890c0 Uploaded
bitlab
parents:
diff changeset
73 //Struct for FragHits, af2png and leeFrag programs
35af401890c0 Uploaded
bitlab
parents:
diff changeset
74 struct FragFile {
35af401890c0 Uploaded
bitlab
parents:
diff changeset
75 //Diagonal where the frag is located
35af401890c0 Uploaded
bitlab
parents:
diff changeset
76 //This value is calculated as:
35af401890c0 Uploaded
bitlab
parents:
diff changeset
77 //posX - posY
35af401890c0 Uploaded
bitlab
parents:
diff changeset
78 int64_t diag;
35af401890c0 Uploaded
bitlab
parents:
diff changeset
79 //Start position in sequence X
35af401890c0 Uploaded
bitlab
parents:
diff changeset
80 uint64_t xStart;
35af401890c0 Uploaded
bitlab
parents:
diff changeset
81 //Start position in Sequence Y
35af401890c0 Uploaded
bitlab
parents:
diff changeset
82 uint64_t yStart;
35af401890c0 Uploaded
bitlab
parents:
diff changeset
83 //End position in Sequence X
35af401890c0 Uploaded
bitlab
parents:
diff changeset
84 uint64_t xEnd;
35af401890c0 Uploaded
bitlab
parents:
diff changeset
85 //End position in Sequence Y
35af401890c0 Uploaded
bitlab
parents:
diff changeset
86 uint64_t yEnd;
35af401890c0 Uploaded
bitlab
parents:
diff changeset
87 //Fragment Length
35af401890c0 Uploaded
bitlab
parents:
diff changeset
88 //For ungaped aligment is:
35af401890c0 Uploaded
bitlab
parents:
diff changeset
89 //xEnd-xStart+1
35af401890c0 Uploaded
bitlab
parents:
diff changeset
90 uint64_t length;
35af401890c0 Uploaded
bitlab
parents:
diff changeset
91 //Number of identities in the
35af401890c0 Uploaded
bitlab
parents:
diff changeset
92 //fragment
35af401890c0 Uploaded
bitlab
parents:
diff changeset
93 uint64_t ident;
35af401890c0 Uploaded
bitlab
parents:
diff changeset
94 //Score of the fragment. This
35af401890c0 Uploaded
bitlab
parents:
diff changeset
95 //depends on the score matrix
35af401890c0 Uploaded
bitlab
parents:
diff changeset
96 //used
35af401890c0 Uploaded
bitlab
parents:
diff changeset
97 uint64_t score;
35af401890c0 Uploaded
bitlab
parents:
diff changeset
98 //Percentage of similarity. This
35af401890c0 Uploaded
bitlab
parents:
diff changeset
99 //is calculated as score/scoreMax
35af401890c0 Uploaded
bitlab
parents:
diff changeset
100 //Where score max is the maximum
35af401890c0 Uploaded
bitlab
parents:
diff changeset
101 //score possible
35af401890c0 Uploaded
bitlab
parents:
diff changeset
102 float similarity;
35af401890c0 Uploaded
bitlab
parents:
diff changeset
103 //sequence number in the 'X' file
35af401890c0 Uploaded
bitlab
parents:
diff changeset
104 uint64_t seqX;
35af401890c0 Uploaded
bitlab
parents:
diff changeset
105 //sequence number in the 'Y' file
35af401890c0 Uploaded
bitlab
parents:
diff changeset
106 uint64_t seqY;
35af401890c0 Uploaded
bitlab
parents:
diff changeset
107 //synteny block id
35af401890c0 Uploaded
bitlab
parents:
diff changeset
108 int64_t block;
35af401890c0 Uploaded
bitlab
parents:
diff changeset
109 //'f' for the forward strain and 'r' for the reverse
35af401890c0 Uploaded
bitlab
parents:
diff changeset
110 char strand;
35af401890c0 Uploaded
bitlab
parents:
diff changeset
111 };
35af401890c0 Uploaded
bitlab
parents:
diff changeset
112
35af401890c0 Uploaded
bitlab
parents:
diff changeset
113 //Struct for leeSeqDB function
35af401890c0 Uploaded
bitlab
parents:
diff changeset
114 struct Sequence{
35af401890c0 Uploaded
bitlab
parents:
diff changeset
115 char ident[MAXLID+1];
35af401890c0 Uploaded
bitlab
parents:
diff changeset
116 char *datos;
35af401890c0 Uploaded
bitlab
parents:
diff changeset
117 };
35af401890c0 Uploaded
bitlab
parents:
diff changeset
118
35af401890c0 Uploaded
bitlab
parents:
diff changeset
119 //Struct for reads index tuple
35af401890c0 Uploaded
bitlab
parents:
diff changeset
120 struct rIndex2 {
35af401890c0 Uploaded
bitlab
parents:
diff changeset
121 char id[MAXLID];
35af401890c0 Uploaded
bitlab
parents:
diff changeset
122 uint64_t rNumber;
35af401890c0 Uploaded
bitlab
parents:
diff changeset
123 uint64_t rLen;
35af401890c0 Uploaded
bitlab
parents:
diff changeset
124 uint64_t rLmasked; //Masked positions
35af401890c0 Uploaded
bitlab
parents:
diff changeset
125 uint64_t nonACGT; //N's
35af401890c0 Uploaded
bitlab
parents:
diff changeset
126 uint64_t pos; //Start position of sequence
35af401890c0 Uploaded
bitlab
parents:
diff changeset
127 uint64_t Lac; //Accumulated length
35af401890c0 Uploaded
bitlab
parents:
diff changeset
128 };
35af401890c0 Uploaded
bitlab
parents:
diff changeset
129
35af401890c0 Uploaded
bitlab
parents:
diff changeset
130 #endif