-
Notifications
You must be signed in to change notification settings - Fork 285
Expand file tree
/
Copy pathAlignment.h
More file actions
130 lines (92 loc) · 3.25 KB
/
Alignment.h
File metadata and controls
130 lines (92 loc) · 3.25 KB
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
#ifndef ALIGNMENT_H
#define ALIGNMENT_H
#include "IndexReader.h"
#include "DBReader.h"
#include "Parameters.h"
#include "BaseMatrix.h"
#include "Matcher.h"
class Alignment {
public:
Alignment(const std::string &querySeqDB,
const std::string &targetSeqDB,
const std::string &prefDB, const std::string &prefDBIndex,
const std::string &outDB, const std::string &outDBIndex,
const Parameters &par, const bool lcaAlign);
~Alignment();
//Non-MPI
void run();
//MPI function
void run(const unsigned int mpiRank, const unsigned int mpiNumProc);
//Run parallel
void run(const std::string &outDB, const std::string &outDBIndex, const size_t dbFrom, const size_t dbSize, bool merge);
static bool checkCriteria(Matcher::result_t &res, bool isIdentity, double evalThr, double seqIdThr, int alnLenThr, int covMode, float covThr);
static unsigned int initSWMode(unsigned int alignmentMode, float covThr, float seqIdThr);
private:
// sequence coverage threshold
double covThr;
// sequence coverage threshold for canCov function (needed for realignment)
double canCovThr;
// query or query+target coverage mode
const int covMode;
// sets the mode how seq. id will be normalized
const int seqIdMode;
// e value threshold
const double evalThr;
// sequence identity threshold
const double seqIdThr;
// alignment length threshold
const int alnLenThr;
// include id
const bool includeIdentity;
// includes backtrace to alignment
bool addBacktrace;
// realign with different score matrix
bool realign;
float realignCov;
bool sameQTDB;
//to increase/decrease the threshold for finishing the alignment
float scoreBias;
float realignScoreBias;
int realignMaxSeqs;
// keeps state of the SW alignment mode (ALIGNMENT_MODE_SCORE_ONLY, ALIGNMENT_MODE_SCORE_COV or ALIGNMENT_MODE_SCORE_COV_SEQID)
unsigned int swMode;
unsigned int realignSwMode;
unsigned int lcaSwMode;
unsigned int threads;
unsigned int compressed;
const std::string outDB;
const std::string outDBIndex;
size_t maxSeqLen;
int querySeqType;
int targetSeqType;
bool compBiasCorrection;
float compBiasCorrectionScale;
int altAlignment;
int alignmentOutputMode;
const unsigned int maxAccept;
const unsigned int maxReject;
const bool wrappedScoring;
BaseMatrix *m;
// costs to open a gap
int gapOpen;
// costs to extend a gap
int gapExtend;
// correction score weight
float correlationScoreWeight;
// score difference to break alignment
int zdrop;
bool lcaAlign;
// needed for realignment
BaseMatrix *realign_m;
DBReader<KeyType> *qdbr;
IndexReader * qDbrIdx;
DBReader<KeyType> *tdbr;
IndexReader * tDbrIdx;
DBReader<KeyType> *prefdbr;
bool reversePrefilterResult;
static size_t estimateHDDMemoryConsumption(int dbSize, int maxSeqs);
void computeAlternativeAlignment(KeyType queryDbKey, Sequence &dbSeq,
std::vector<Matcher::result_t> &vector, Matcher &matcher,
float covThr, float evalThr, int swMode, int thread_idx);
};
#endif