(
'A',
'A', 0x47);
76 x_Set(
'A',
'G', 0x47);
77 x_Set(
'A',
'T', 0x57);
78 x_Set(
'A',
'C', 0x67);
79 x_Set(
'G',
'A', 0x33);
80 x_Set(
'G',
'G', 0x33);
81 x_Set(
'G',
'T', 0x70);
82 x_Set(
'G',
'C', 0x34);
83 x_Set(
'T',
'A', 0x00);
84 x_Set(
'T',
'G', 0x03);
85 x_Set(
'T',
'T', 0x50);
86 x_Set(
'T',
'C', 0x24);
87 x_Set(
'C',
'A', 0x00);
88 x_Set(
'C',
'G', 0x03);
89 x_Set(
'C',
'T', 0x50);
90 x_Set(
'C',
'C', 0x24);
100 m_Matrix[(
unsignedchar)c1][(
unsigned char)c2] =
val;
113m_Wd1(GetDefaultWd1()),
114m_Wd2(GetDefaultWd2())
122 const char* seq2,
size_tlen2)
124m_Wd1(GetDefaultWd1()),
125m_Wd2(GetDefaultWd2())
135m_Wd1(GetDefaultWd1()),
136m_Wd2(GetDefaultWd2())
146 switch(splice_type) {
152eInvalidSpliceTypeIndex,
165 const Uint1where (len_dif < 0? 0: 1);
166 const size_tshift (
abs(len_dif) / 2);
167 const size_tband (
abs(len_dif) + 2*(
max(
data->m_len1,
data->m_len2)/20 + 1));
175 const TScorecds_penalty_extra = -2e-6;
177 const size_tN1 =
data->m_len1 + 1;
178 const size_tN2 =
data->m_len2 + 1;
180vector<TScore> stl_rowV (N2), stl_rowF (N2);
181 TScore* rowV = &stl_rowV[0];
182 TScore* rowF = &stl_rowF[0];
190 const char* seq1 =
m_Seq1+
data->m_offset1 - 1;
191 const char* seq2 =
m_Seq2+
data->m_offset2 - 1;
195 boolbFreeGapLeft1 =
data->m_esf_L1 &&
data->m_offset1 == 0;
196 boolbFreeGapRight1 =
data->m_esf_R1 &&
199 boolbFreeGapLeft2 =
data->m_esf_L2 &&
data->m_offset1 == 0;
200 boolbFreeGapRight2 =
data->m_esf_R2 &&
205 TScorewg1 = wgleft1, ws1 = wsleft1;
221jAllDonors[
st] = &stl_jAllDonors[
st*N2];
222vAllDonors[
st] = &stl_vAllDonors[
st*N2];
230vector<size_t> stl_del_start(N2);
231 size_t* del_start = &stl_del_start[0];
234 const Uint1* dnr_acc_matrix = g_dnr_acc_matrix.GetMatrix();
239 for(k = 0; k < N2; k++) {
240rowV[k] = rowF[k] = kInfMinus;
246 if(cds_start < cds_stop) {
247cds_start -=
data->m_offset1;
248cds_stop -=
data->m_offset1;
251 size_t i, j = 0, k0;
253 for(
i= 0;
i< N1; ++
i, j = 0) {
255V =
i> 0? (V0 += wsleft2) : 0;
259ci =
i> 0? seq1[
i]:
'N';
262jTail[
st] = jHead[
st] = 0;
263vBestDonor[
st] = kInfMinus;
266 if(
i== N1 - 1 && bFreeGapRight1) {
274 unsigned chard1 = seq2[1], d2 = seq2[2];
275 Uint1dnr_type = 0xF0 & dnr_acc_matrix[(size_t(d1)<<8)|d2];
278jAllDonors[
st][jTail[
st]] = j;
279 if(dnr_type & (0x10 <<
st)) {
280vAllDonors[
st][jTail[
st]] =
285vAllDonors[
st][jTail[
st]] = V +
m_Wd2;
291 if(cds_start <=
i&&
i< cds_stop) {
293 if(
i!= 0 || ! bFreeGapLeft1) {
294ws1 += cds_penalty_extra;
296 if(j != 0 || ! bFreeGapLeft2) {
297ws2 += cds_penalty_extra;
301 for(j = 1; j < N2; ++j, ++k) {
303 G= pV[j] + sm[ci][(
unsignedchar)seq2[j]];
315 if(j == N2 - 1 && bFreeGapRight2) {
351 if(jTail[
st] > jHead[
st]) {
353 if(vAllDonors[
st][jHead[
st]] > vBestDonor[
st]) {
354vBestDonor[
st] = vAllDonors[
st][jHead[
st]];
355jBestDonor[
st] = jAllDonors[
st][jHead[
st]];
364 unsigned charc1 = seq2[j-1], c2 = seq2[j];
365 Uint1acc_mask = 0x0F & dnr_acc_matrix[(size_t(c1)<<8)|c2];
367 if(acc_mask & (0x01 <<
st)) {
376dnr_pos = k0 + jBestDonor[
st];
383dnr_pos = k0 + jBestDonor[
st];
392backtrace_matrix[k] =
static_cast<unsigned int>(
type);
396 unsigned chard1 = seq2[j+1], d2 = seq2[j+2];
397 Uint1dnr_mask = 0xF0 & dnr_acc_matrix[(size_t(d1)<<8)|d2];
399 if( dnr_mask & (0x10 <<
st) ) {
403 if(V > vBestDonor[
st]) {
404jAllDonors[
st][jTail[
st]] = j;
405vAllDonors[
st][jTail[
st]] = V;
410 if(v > vBestDonor[
st]) {
411jAllDonors[
st][jTail[
st]] = j;
412vAllDonors[
st][jTail[
st]] = v;
419 if(v > vBestDonor[
st]) {
420jAllDonors[
st][jTail[
st]] = j;
421vAllDonors[
st][jTail[
st]] = v;
455 const size_tN1 =
data->m_len1 + 1;
456 const size_tN2 =
data->m_len2 + 1;
458 data->m_transcript.clear();
459 data->m_transcript.reserve(N1 + N2);
461 size_tk = N1*N2 - 1;
462 size_ti1 =
data->m_offset1 +
data->m_len1 - 1;
463 size_ti2 =
data->m_offset2 +
data->m_len2 - 1;
465 const Uint4mask_jump = 0x3FFFFFFF;
466 const Uint4mask_type = ~mask_jump;
470 Uint4Key = backtrace_matrix[k];
479 Uint4k2 = (Key & mask_jump);
492 Uint8kdel = k / N2, k2del = k2 / N2;
493 Uint8kmod = k % N2, k2mod = k2 % N2;
498 else if(kmod == k2mod) {
509 for(; k > k2; k -= decr) {
510 data->m_transcript.push_back(ts);
530 size_tstart1,
size_tstart2)
const 544 const size_tdim = transcript.size();
548 const char* p1 =
m_Seq1+ start1;
549 const char* p2 =
m_Seq2+ start2;
556 switch( transcript[0] ) {
564state1 = 1; state2 = 0; score +=
m_Wg;
568state1 = 0; state2 = 0;
572state1 = 0; state2 = 1; score +=
m_Wg;
581 for(
size_t i= 0;
i< dim; ++
i) {
592 unsigned charc1 = *p1;
593 unsigned charc2 = *p2;
602 if(state1 != 1) score +=
m_Wg;
603state1 = 1; state2 = 0;
610 if(state2 != 1) score +=
m_Wg;
611state1 = 0; state2 = 1;
634state1 = 2; state2 = 0;
648 for(
Int8 i= dim - 1;
i>= 0; --
i) {
658 for(
Int8 i= dim - 1;
i>= 0; --
i) {
668 for(
size_t i= 0;
i< dim; ++
i) {
678 for(
size_t i= 0;
i< dim; ++
i) {
const Uint1 * GetMatrix() const
void x_Set(char c1, char c2, Uint1 val)
void SetBand(size_t band)
virtual ETranscriptSymbol x_GetDiagTS(size_t i1, size_t i2) const
SNCBIFullScoreMatrix m_ScoreMatrix
void SetShift(Uint1 where, size_t offset)
virtual TScore x_Align(CNWAligner::SAlignInOut *data)
vector< ETranscriptSymbol > TTranscript
virtual TScore x_Align(CNWAligner::SAlignInOut *data)
TScore m_Wi[splice_type_count_32]
void x_DoBackTrace(const Uint4 *backtrace_matrix, CNWAligner::SAlignInOut *data)
virtual TScore ScoreFromTranscript(const TTranscript &transcript, size_t start1=kMax_UInt, size_t start2=kMax_UInt) const
const size_t splice_type_count_32
static TScore GetDefaultWi(unsigned char splice_type)
#define NCBI_THROW(exception_class, err_code, message)
Generic macro to throw an exception, given the exception class, error code and message string.
uint8_t Uint1
1-byte (8-bit) unsigned integer
uint32_t Uint4
4-byte (32-bit) unsigned integer
int64_t Int8
8-byte (64-bit) signed integer
uint64_t Uint8
8-byte (64-bit) unsigned integer
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
const unsigned char g_nwspl32_acceptor[splice_type_count_32][2]
const unsigned char g_nwspl32_donor[splice_type_count_32][2]
#define NCBI_FSM_DIM
Recommended approach: unpack and index directly.
int TNCBIScore
data types
static SLJIT_INLINE sljit_ins st(sljit_gpr r, sljit_s32 d, sljit_gpr x, sljit_gpr b)
const char g_msg_InconsistentArguments[]
const char g_msg_InvalidTranscriptSymbol[]
const char g_msg_InvalidSpliceTypeIndex[]
const char g_msg_InvalidBacktraceData[]
int g(Seg_Gsm *spe, Seq_Mtf *psm, Thd_Gsm *tdg)
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4