-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathHSP.h
278 lines (186 loc) · 4.88 KB
/
HSP.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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
#ifndef __HSP_H__
#define __HSP_H__
#include "SNP.h"
#include "definitions.h"
#include <pthread.h>
#define MAX_SEQ_NAME_LENGTH 256
typedef struct occRec
{
unsigned int readID;
unsigned int ambPosition;
unsigned char strand;
unsigned char source;
char score;
} occRec;
typedef struct AlgnResult
{
occRec *occ_list;
unsigned int occTotalNum;
unsigned int availableSize;
} AlgnResult;
typedef struct AlgnResultArrays
{
AlgnResult **algnArrays;
unsigned int numArrays;
} AlgnResultArrays;
#define CIGAR_MATCHMISMATCH 'M'
#define CIGAR_INSERT 'I'
#define CIGAR_DELETE 'D'
#define CIGAR_SOFT_CLIP 'S'
typedef struct RecalQ
{
unsigned int mismatch[Q_SCORE_ARRAY_SIZE];
unsigned int nucleotides[Q_SCORE_ARRAY_SIZE];
} RecalQ;
#define NUM_BUCKETS 65536
#pragma pack(1)
typedef struct PairEndAlignmentInfo
{
unsigned int read_id;
unsigned int pos;
unsigned short diff;
unsigned char mapq;
unsigned char avgBaseQuality;
} PEEntry;
#pragma pack()
#pragma pack(1)
typedef struct SingleEndAlignmentInfo
{
unsigned int read_id;
unsigned int pos;
unsigned char mapq;
unsigned char avgBaseQuality;
} SEEntry;
#pragma pack()
#include "SimpleMemoryPool.h"
#include "readIndex.h"
#define GRID_SAMPLING_FACTOR_2_POWER 18
typedef struct SeqActualOffset
{
unsigned int startPos;
unsigned int endPos;
} SeqActualOffset;
typedef struct Ambiguity
{
unsigned int startPos;
unsigned int rightOfEndPos;
int symbol;
} Ambiguity;
typedef struct CIResult
{
char *cigarString;
unsigned int hitPos;
int strand;
unsigned int readID;
int DPScore;
char *altPattern;
} CIResult;
typedef struct HSP
{
int numOfSeq;
int numOfAmbiguity;
unsigned int dnaLength;
unsigned int minSeqLength;
unsigned int *packedDNA;
Annotation *annotation;
SeqOffset *seqOffset;
Ambiguity *ambiguity;
unsigned int numOfRemovedSegment;
unsigned int numOfGridEntry;
unsigned int *ambiguityMap;
Translate *translate;
SeqActualOffset *seqActualOffset;
AlgnResultArrays *algnResultArrays;
char isFastq;
int dpMatchScore;
int dpMisMatchScore;
int alignmentType;
int readType;
int peMaxOutputPerRead;
int *x0_array;
int *x1_array;
int *mismatch_array;
int minMAPQ;
int maxMAPQ;
int bwaLikeScore;
int g_log_n[256];
char *readGroup;
char *sampleName;
char *readGrpOption;
int maxLenReadName;
int ProceedDPForTooManyHits;
int singleDPcutoffThreshold;
void *bwt;
void *soap3AnsArray;
unsigned int *sa_start;
unsigned int *occ_start;
unsigned int *sa_num;
unsigned int *occ_num;
void *readsIDForSingleDP;
void *allHits;
char snpFlag;
VcSetting *vcSetting;
SnpBundle snpBundle;
LongSoftClipPositionArray *longSoftClipArray;
LongSoftClipPositionArray *dupLongSoftClipArray;
LongSoftClipCounter *longSoftClipCounter;
unsigned int mapqThreshold;
unsigned int longSoftClipThreshold;
unsigned int longIndelThreshold;
unsigned int mBestLongIndelThreshold;
unsigned int mBestLongIndelSupport;
unsigned int mBestShortIndelThreshold;
unsigned int mBestShortIndelSupport;
unsigned int windowGapFactor;
unsigned char *nonDupIDs;
unsigned int maxBucketFiles;
unsigned int *readsOffsetMap;
FILE **dedupOutputFiles;
FILE *dedupOutputDPFile;
FILE *dedupOutputUnpairFile;
int isBalsaOutputBam;
unsigned int accumReadNum;
char scoreRecalStage;
RecalQ *recalQ;
unsigned char **scoreMap;
unsigned char currLane;
unsigned int numAlignment[MAX_NUM_CPU_THREADS + 2];
FILE *snpOverflowFilePtr[MAX_NUM_CPU_THREADS];
FILE *snpOverflowFileDpPtr;
FILE *snpOverflowFileUnpairPtr;
FILE *snpDscFilePtr[MAX_NUM_CPU_THREADS];
FILE *snpDscFileDpPtr;
FILE *snpDscFileUnpairPtr;
FILE *snpDscDedupFilePtr[MAX_NUM_CPU_THREADS];
FILE *snpDscDedupFileDpPtr;
FILE *snpDscDedupFileUnpairPtr;
FILE *snpDscIncFilePtr;
FILE *snpDscDecFilePtr;
RA_Window *ra_window;
unsigned int *window_id_map;
unsigned int window_id_map_size;
unsigned int *insert_high;
unsigned int *insert_low;
RA_AlignmentInfo *ra_alignmentInfo;
unsigned int ra_alignmentInfo_size;
SC_DP_AlignmentInfo *sc_dp_alignmentInfo;
unsigned int sc_dp_alignmentInfo_size;
RA_DP_AlignmentInfo *ra_dp_alignmentInfo;
unsigned int ra_dp_alignmentInfo_size;
PEEntry *peResult;
unsigned int pe_size;
SEEntry *seResult;
unsigned int se_size;
unsigned int *bucketSize;
unsigned int bucketWidth;
PrimerHash *primerHash;
CIResult *ciResult;
int curNumOfCiResult;
} HSP;
#define MAX_SEQ_NAME_LENGTH 256
static const char dnaChar[16] = {'A', 'C', 'G', 'T', 'M', 'R', 'S', 'V', 'W', 'Y', 'H', 'K', 'D', 'B', 'N', 'L'};
void HSPFree(HSP *hsp, const unsigned int trailerBufferInWord, char isShareIndex);
void getChrAndPos(unsigned int *occAmbiguityMap, Translate *occTranslate,
unsigned long long ambPos,
unsigned long long *tp, unsigned short *chr_id);
#endif