{
'G',
'T'}, {
'G',
'C'}, {
'A',
'T'}, {
'?',
'?'}
82 const char* seq2,
size_tlen2)
103 switch(splice_type) {
110eInvalidSpliceTypeIndex,
123 const Uint2kMaskDnr0 (0x0010);
124 const Uint2kMaskDnr1 (0x0020);
125 const Uint2kMaskDnr2 (0x0040);
126 const Uint2kMaskDnr3 (0x0080);
128 const Uint2kMaskAcc0 (0x0100);
129 const Uint2kMaskAcc1 (0x0200);
130 const Uint2kMaskAcc2 (0x0400);
131 const Uint2kMaskAcc3 (0x0800);
133 const Uint2kMask_ZeroJump (0x1000);
158 const TScorecds_penalty_extra (-1);
159 const size_tibs (12);
163 const size_tN1 (
data->m_len1 + 1);
164 const size_tN2 (
data->m_len2 + 1);
175vector<TScore> stl_rowV (N2), stl_rowF (N2);
176 TScore* rowV (&stl_rowV.front());
177 TScore* rowF (&stl_rowF.front());
188 const boolbFreeGapLeft1 (
data->m_esf_L1 &&
data->m_offset1 == 0);
189 const boolbFreeGapRight1 (
data->m_esf_R1 &&
192 const boolbFreeGapLeft2 (
data->m_esf_L2 &&
data->m_offset2 == 0);
193 const boolbFreeGapRight2 (
data->m_esf_R2 &&
196 const boolsw_left (bFreeGapLeft1 && bFreeGapLeft2);
197 const boolsw_right (bFreeGapRight1 && bFreeGapRight2);
201 TScorewg1 (wgleft1), ws1 (wsleft1);
211 size_ti_global_max (N1 - 1), j_global_max (N2 - 1);
234jAllDonors[
st] = &stl_jAllDonors[
st*N2];
235vAllDonors[
st] = &stl_vAllDonors[
st*N2];
247vector<Uint1> stl_splices (N2);
251 for(k = 0; k < N2; ++k) {
253rowV[k] = rowF[k] = kInfMinus;
257 const Uint2v1 ((seq2[k-1] << 8) | seq2[k]);
258 if(v1 == g_nwspl_acceptor_16[0]) c |= eAcc0;
259 if(v1 == g_nwspl_acceptor_16[1]) c |= eAcc1;
260 if(v1 == g_nwspl_acceptor_16[2]) c |= eAcc2;
264 const Uint2v1 ((seq2[k+1] << 8) | seq2[k+2]);
265 if(v1 == g_nwspl_donor_16[0]) c |= eDnr0;
266 if(v1 == g_nwspl_donor_16[1]) c |= eDnr1;
267 if(v1 == g_nwspl_donor_16[2]) c |= eDnr2;
279 if(cds_start < cds_stop) {
280cds_start -=
data->m_offset1;
281cds_stop -=
data->m_offset1;
284 for(
size_t i(0), j(0);
i< N1; ++
i, j = 0) {
286V =
i> 0? (V0 += wsleft2) : 0;
288backtrace_matrix[k++] =
kMaskFc;
289 Uint1ci (
i> 0? seq1[
i]:
'N');
291 if(ci ==
'N') ci =
'z';
293jTail[0] = jTail[1] = jTail[2] = jTail[3]
294= jHead[0] = jHead[1] = jHead[2] = jHead[3] = 0;
295vBestDonor[0] = vBestDonor[1] = vBestDonor[2] = vBestDonor[3] = kInfMinus;
296jBestDonor[0] = jBestDonor[1] = jBestDonor[2] = jBestDonor[3] = 0;
303 #define NWSPL_DETECTDONOR(st_idx) \ 304 if(splices[j] & eDnr##st_idx ) \ 306 const size_t tl (jTail[st_idx]++); \ 307 jAllDonors[st_idx][tl] = j; \ 308 vAllDonors[st_idx][tl] = V; \ 319 const size_ttl (jTail[g_topidx]++);
320jAllDonors[g_topidx][tl] = j;
321vAllDonors[g_topidx][tl] = V_max = V;
323 if(cds_start <=
i&&
i< cds_stop) {
325 if(
i!= 0 || ! bFreeGapLeft1) {
326ws1 += cds_penalty_extra;
328 if(j != 0 || ! bFreeGapLeft2) {
329ws2 += cds_penalty_extra;
333 if(
i== N1 - 1 && bFreeGapRight1) {
337 for(j = 1; j < N2; ++j, ++k) {
340 G= pV[j] + sm[ci][(
unsignedchar)seq2[j]];
354 if(j == N2 - 1 && bFreeGapRight2) {
397 #define NW_NDON_EVAL(st_idx) \ 399 const size_t jt (jTail[st_idx]); \ 400 const size_t jh (jHead[st_idx]); \ 401 if (jt > jh && j - jAllDonors[st_idx][jh] >= m_IntronMinSize) { \ 402 const TScore x (static_cast<TScore>((jAllDonors[st_idx][jh] - \ 403 jBestDonor[st_idx]) >> ibs)); \ 404 if (vAllDonors[st_idx][jh] + x > vBestDonor[st_idx]) { \ 405 vBestDonor[st_idx] = vAllDonors[st_idx][jh]; \ 406 jBestDonor[st_idx] = jAllDonors[st_idx][jh]; \ 422 #define NW_SIG_EVAL(st_idx) \ 423 if(splices[j] & eAcc##st_idx) { \ 424 const size_t ilen (j - jBestDonor[st_idx]); \ 425 vAcc = vBestDonor[st_idx] + m_Wi[st_idx] - static_cast<TScore>(ilen >> ibs); \ 428 acceptor = kMaskAcc##st_idx; \ 429 backtrace_matrix[k - ilen] |= kMaskDnr##st_idx; \ 439vAcc = vBestDonor[g_topidx] +
m_Wi[g_topidx];
442acceptor = kMaskAcc3;
443 const size_tilen (j - jBestDonor[g_topidx]);
444backtrace_matrix[k - ilen] |= kMaskDnr3;
447 if(sw_left && V < 0) {
448tracer |= kMask_ZeroJump;
452 if(sw_right && V > global_max) {
463 #define NW_DON_EVAL(st_idx) \ 464 if(splices[j] & eDnr##st_idx ) { \ 465 const size_t ilen (j - jBestDonor[st_idx]); \ 466 const TScore x (static_cast<TScore>(ilen >> ibs)); \ 467 if(V + x > vBestDonor[st_idx]) { \ 468 const size_t tl_ (jTail[st_idx]++); \ 469 jAllDonors[st_idx][tl_] = j; \ 470 vAllDonors[st_idx][tl_] = V; \ 482 const size_ttl (jTail[g_topidx]++);
483jAllDonors[g_topidx][tl] = j;
484vAllDonors[g_topidx][tl] = V_max = V;
487backtrace_matrix[k] = tracer;
521 size_ti_global_max,
size_tj_global_max)
523 const size_tN1 (
data->m_len1 + 1);
524 const size_tN2 (
data->m_len2 + 1);
526 data->m_transcript.clear();
527 data->m_transcript.reserve(N1 + N2);
529 size_tk (i_global_max * N2 + j_global_max);
530 size_ti1 (
data->m_offset1 + i_global_max - 1);
531 size_ti2 (
data->m_offset2 + j_global_max - 1);
533 const size_tdim_slack_ins (N2 - 1 - j_global_max);
534 data->m_transcript.insert(
data->m_transcript.end(),
538 const size_tdim_slack_del (N1 - 1 - i_global_max);
539 data->m_transcript.insert(
data->m_transcript.end(),
544 Uint2Key (backtrace_matrix[k]);
545 if(Key & kMask_ZeroJump) {
547 const size_tdim_ins (i2 -
data->m_offset2 + 1);
548 data->m_transcript.insert(
data->m_transcript.end(),
552 const size_tdim_del (i1 -
data->m_offset1 + 1);
553 data->m_transcript.insert(
data->m_transcript.end(),
561 size_tintron_length (1);
562 const Uint2donor ((Key & 0x0F00) >> 4);
565Key = backtrace_matrix[--k];
572 if(k == 0)
continue;
583 while(k > 0 && (Key &
kMaskEc)) {
585Key = backtrace_matrix[k--];
595 while(k > 0 && (Key &
kMaskFc)) {
597Key = backtrace_matrix[k];
608 size_tstart1,
size_tstart2)
const 621 const size_tdim (transcript.size());
625 const char* p1 (
m_Seq1+ start1);
626 const char* p2 (
m_Seq2+ start2);
643 switch(transcript[
i]) {
651state1 = 1; state2 = 0; score +=
m_Wg;
655state1 = 0; state2 = 0;
659state1 = 0; state2 = 1; score +=
m_Wg;
666 for(;
i< dim; ++
i) {
682 unsigned charc1 = *p1;
683 unsigned charc2 = *p2;
692 if(state1 != 1) score +=
m_Wg;
693state1 = 1; state2 = 0;
700 if(state2 != 1) score +=
m_Wg;
701state1 = 0; state2 = 1;
716 if( (*p2 == g_nwspl_donor[i_][0] &&
717*(p2 + 1) == g_nwspl_donor[i_][1]) || i_ == g_topidx) {
725state1 = 2; state2 = 0;
737 for(
Int8i_ = dim - 1; i_ >= 0; --i_) {
738 if(transcript[i_] ==
eTS_Insert) ++
g;
else break;
747 for(
Int8i_ = dim - 1; i_ >= 0; --i_) {
748 if(transcript[i_] ==
eTS_Delete) ++
g;
else break;
757 for(
size_ti_ = 0; i_ < dim; ++i_) {
758 if(transcript[i_] ==
eTS_Insert) ++
g;
else break;
767 for(
size_ti_ = 0; i_ < dim; ++i_) {
768 if(transcript[i_] ==
eTS_Delete) ++
g;
else break;
virtual ETranscriptSymbol x_GetDiagTS(size_t i1, size_t i2) const
SNCBIFullScoreMatrix m_ScoreMatrix
FProgressCallback m_prg_callback
vector< ETranscriptSymbol > TTranscript
virtual TScore x_Align(CNWAligner::SAlignInOut *data)
const size_t splice_type_count_16
virtual TScore ScoreFromTranscript(const TTranscript &transcript, size_t start1=kMax_UInt, size_t start2=kMax_UInt) const
TScore m_Wi[splice_type_count_16]
static TScore GetDefaultWi(unsigned char splice_type)
void x_DoBackTrace(const Uint2 *backtrace_matrix, CNWAligner::SAlignInOut *data, size_t i_global_max, size_t j_global_max)
#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
uint16_t Uint2
2-byte (16-bit) unsigned integer
int64_t Int8
8-byte (64-bit) signed integer
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
const unsigned char kMaskFc
const unsigned char kMaskEc
const unsigned char kMaskE
const unsigned char kMaskD
#define NW_NDON_EVAL(st_idx)
#define NW_SIG_EVAL(st_idx)
#define NW_DON_EVAL(st_idx)
#define NWSPL_DETECTDONOR(st_idx)
#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[]
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