A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://www.ncbi.nlm.nih.gov/IEB/ToolBox/CPP_DOC/doxyhtml/mm__aligner_8cpp_source.html below:

NCBI C++ ToolKit: src/algo/align/nw/mm_aligner.cpp Source File

48  const char

* seq2,

size_t

len2,

50

:

CNWAligner

(seq1, len1, seq2, len2, scoremat)

88

list<ETranscriptSymbol>::const_iterator ii =

m_TransList

.begin();

92  for

(

size_t

k = 1; k <= nsize; ++k)

114

list<ETranscriptSymbol>::iterator translist_pos,

115  bool

left_top,

bool

right_bottom )

122  const Int8

dimI = submatr.

i2

- submatr.

i1

+ 1;

123  const Int8

dimJ = submatr.

j2

- submatr.

j1

+ 1;

124  if

(dimI < 1 || dimJ < 1)

return

;

126  bool

top_level = submatr.

i1

== 0 && submatr.

j1

== 0 &&

130  if

(dimI < 3 || dimJ < 3) {

132

list<ETranscriptSymbol> lts;

134  if

(top_level)

m_score

= score;

139  const size_t

I = submatr.

i1

+ dimI / 2;

140  const size_t

dim = dimJ + 1;

144

vector<TScore> vEtop (dim), vFtop (dim), vGtop (dim);

145

vector<unsigned char> trace_top (dim);

148

vector<TScore> vEbtm (dim), vFbtm (dim), vGbtm (dim);

149

vector<unsigned char> trace_btm (dim);

153

&vEtop, &vFtop, &vGtop,

154

&trace_top, left_top );

156  x_RunBtm

(rbtm, vEbtm, vFbtm, vGbtm, trace_btm, right_bottom);

160  x_RunTop

(rtop, vEtop, vFtop, vGtop, trace_top, left_top);

161  x_RunBtm

(rbtm, vEbtm, vFbtm, vGbtm, trace_btm, right_bottom);

169  size_t

trans_pos = 0;

172

trans_pos, trans_type );

177  if

(trans_type ==

eII

) {

178  unsigned char

mask_top =

kMaskE

;

179  if

(trace_top[trans_pos] &

kMaskEc

)

181

trace_top[trans_pos] = mask_top;

184  if

(trans_type ==

eDD

) {

185

trace_top[trans_pos] = (trace_top[trans_pos] &

kMaskFc

)?

kMaskFc

: 0;

186

trace_btm[trans_pos] =

kMaskFc

;

190

vector<unsigned char>::const_iterator trace_it_top =

191

trace_top.begin() + trans_pos;

192

list<ETranscriptSymbol> subpath_left;

193  size_t

steps_left =

x_ExtendSubpath

(trace_it_top,

false

, subpath_left);

195

vector<unsigned char>::const_iterator trace_it_btm =

196

trace_btm.begin() + trans_pos;

197

list<ETranscriptSymbol> subpath_right;

198  size_t

steps_right =

x_ExtendSubpath

(trace_it_btm,

true

, subpath_right);

202  Int8

nc0 = trans_pos - steps_left;

205  "Assertion: LT underflow"

);

207  bool

bLeft = nc0 == 0;

208  bool

bTop = I == submatr.

i1

;

209  if

(bLeft && !bTop) {

210  Int8

jump = I - submatr.

i1

;

211

subpath_left.insert(subpath_left.begin(), jump,

eTS_Delete

);

213  if

(!bLeft && bTop) {

214

subpath_left.insert(subpath_left.begin(), nc0,

eTS_Insert

);

222  Int8

nc1 = trans_pos + steps_right;

225  "Assertion: RB overflow"

);

227  bool

bRight = nc1 == dimJ;

228  bool

bBottom = I == submatr.

i2

- 1;

229  if

(bRight && !bBottom) {

230  Int8

jump = submatr.

i2

- I - 1;

231

subpath_right.insert(subpath_right.end(), jump,

eTS_Delete

);

233  if

(!bRight && bBottom) {

234  Int8

jump = dimJ - nc1;

235

subpath_right.insert(subpath_right.end(), jump,

eTS_Insert

);

237  if

(bRight || bBottom) {

243  bool

rb = subpath_left.front() ==

eTS_Delete

;

247

subpath_left.splice( subpath_left.end(), subpath_right );

249

list<ETranscriptSymbol>::iterator ti0, ti1;

254  m_TransList

.splice( translist_pos, subpath_left );

263  size_t

left_bnd = submatr.

j1

+ trans_pos - steps_left - 1;

264  if

(left_bnd >= submatr.

j1

) {

265

rlt.

i1

= submatr.

i1

;

266

rlt.

j1

= submatr.

j1

;

272  "Assertion: Left boundary out of range"

);

279  size_t

right_bnd = submatr.

j1

+ trans_pos + steps_right;

280  if

(right_bnd <= submatr.

j2

) {

283

rrb.

i2

= submatr.

i2

;

284

rrb.

j2

= submatr.

j2

;

288  "Assertion: Right boundary out of range"

);

292  if

(!bNoLT && !bNoRB) {

329  const

vector<TScore>& vEtop,

const

vector<TScore>& vFtop,

330  const

vector<TScore>& vGtop,

const

vector<TScore>& vEbtm,

331  const

vector<TScore>& vFbtm,

const

vector<TScore>& vGbtm,

335  const size_t

dim = vEtop.size();

342  for

(

size_t i

= 0;

i

< dim ; ++

i

) {

343

trans_alts [0] = vEtop[

i

] + vEbtm[

i

] -

m_Wg

;

344

trans_alts [1] = vFtop[

i

] + vEbtm[

i

];

345

trans_alts [2] = vGtop[

i

] + vEbtm[

i

];

346

trans_alts [3] = vEtop[

i

] + vFbtm[

i

];

347  TScore

wg = ((bFreeGapLeft2 &&

i

== 0) || ( bFreeGapRight2 &&

i

== dim -1) )?

349

trans_alts [4] = vFtop[

i

] + vFbtm[

i

] - wg;

350

trans_alts [5] = vGtop[

i

] + vFbtm[

i

];

351

trans_alts [6] = vEtop[

i

] + vGbtm[

i

];

352

trans_alts [7] = vFtop[

i

] + vGbtm[

i

];

353

trans_alts [8] = vGtop[

i

] + vGbtm[

i

];

355  for

(

size_t

k = 0; k < 9; ++k) {

356  if

(trans_alts[k] > score) {

357

score = trans_alts[k];

369

vector<unsigned char>::const_iterator trace_it,

371

list<ETranscriptSymbol>& subpath )

const 374  size_t

step_counter = 0;

377  unsigned char

Key = *trace_it;

393  else if

((Key &

kMaskE

) == 0) {

399  "Assertion: incorrect backtrace symbol " 400  "(right expansion)"

);

406  unsigned char

Key = *trace_it;

422  else if

((Key &

kMaskE

) == 0) {

428  "Assertion: incorrect backtrace symbol " 429  "(left expansion)"

);

443

vector<TScore>& vE, vector<TScore>& vF, vector<TScore>& vG,

444

vector<unsigned char>&

trace

,

bool lt

)

const 450  const size_t

dim1 = rect.

i2

- rect.

i1

+ 1;

451  const size_t

dim2 = rect.

j2

- rect.

j1

+ 1;

452  const size_t

N1 = dim1 + 1;

453  const size_t

N2 = dim2 + 1;

455

vector<TScore> stl_rowV (N2), stl_rowF (N2);

456  TScore

* rowV = &stl_rowV [0];

457  TScore

* rowF = &stl_rowF [0];

461  const char

* seq1 =

m_Seq1

- 1 + rect.

i1

;

462  const char

* seq2 =

m_Seq2

- 1 + rect.

j1

;

466  bool

bFreeGapLeft1 =

m_esf_L1

&& rect.

i1

== 0;

467  bool

bFreeGapLeft2 =

m_esf_L2

&& rect.

j1

== 0;

471  const size_t

prg_rep_rate = 100;

472  const size_t

prg_rep_increment = prg_rep_rate*N2;

481  for

(j = 1; j < N2; ++j) {

482

rowV[j] = pV[j] + ws;

489

wg = bFreeGapLeft2? 0:

m_Wg

;

490

ws = bFreeGapLeft2? 0:

m_Ws

;

496  for

(

i

= 1;

i

< N1 - 1; ++

i

) {

500  unsigned char

ci = seq1[

i

];

504  for

(j = 1; j < N2; ++j) {

506  G

= pV[j] + sm[ci][(

unsigned

char)seq2[j]];

515  if

(j == N2 - 1 && bFreeGapRight2)

524

V = (

E

>= rowF[j])? (

E

>=

G

?

E

:

G

): (rowF[j] >=

G

? rowF[j]:

G

);

542

vG[0] = vE[0] =

E

= kInfMinus;

543

vF[0] = V = V0 += ws;

545  unsigned char

ci = seq1[

i

];

549  unsigned char

tracer;

550  for

(j = 1; j < N2; ++j) {

552

vG[j] =

G

= pV[j] + sm[ci][(

unsigned

char)seq2[j]];

566  if

(j == N2 - 1 && bFreeGapRight2) {

613

vector<TScore>& vE, vector<TScore>& vF, vector<TScore>& vG,

614

vector<unsigned char>&

trace

,

bool

rb)

const 620  const size_t

dim1 = rect.

i2

- rect.

i1

+ 1;

621  const size_t

dim2 = rect.

j2

- rect.

j1

+ 1;

622  const size_t

N1 = dim1 + 1;

623  const size_t

N2 = dim2 + 1;

625

vector<TScore> stl_rowV (N2), stl_rowF (N2);

626  TScore

* rowV = &stl_rowV [0];

627  TScore

* rowF = &stl_rowF [0];

631  const char

* seq1 =

m_Seq1

+ rect.

i1

;

632  const char

* seq2 =

m_Seq2

+ rect.

j1

;

638  bool

bFreeGapLeft2 =

m_esf_L2

&& rect.

j1

== 0;

642  const size_t

prg_rep_rate = 100;

643  const size_t

prg_rep_increment = prg_rep_rate*N2;

652  for

(j = N2 - 2; j >= 0; --j) {

653

rowV[j] = pV[j] + ws;

660

wg = bFreeGapRight2? 0:

m_Wg

;

661

ws = bFreeGapRight2? 0:

m_Ws

;

667  for

(

i

= N1 - 2;

i

> 0; --

i

) {

671  unsigned char

ci = seq1[

i

];

675  for

(j = N2 - 2; j >= 0; --j) {

677  G

= pV[j] + sm[ci][(

unsigned

char)seq2[j]];

686  if

(j == 0 && bFreeGapLeft2) {

696

V = (

E

>= rowF[j])? (

E

>=

G

?

E

:

G

): (rowF[j] >=

G

? rowF[j]:

G

);

714

vF[N2-1] = V = V0 += ws;

715

vG[N2-1] = vE[N2-1] =

E

= kInfMinus;

717  unsigned char

ci = seq1[

i

];

721  unsigned char

tracer;

722  for

(j = N2 - 2; j >= 0; --j) {

724

vG[j] =

G

= pV[j] + sm[ci][(

unsigned

char)seq2[j]];

738  if

(j == 0 && bFreeGapLeft2) {

785  bool

left_top,

bool

right_bottom,

786

list<ETranscriptSymbol>& subpath)

792  const size_t

N1 = rect.

i2

- rect.

i1

+ 2;

793  const size_t

N2 = rect.

j2

- rect.

j1

+ 2;

795

vector<TScore> stl_rowV (N2), stl_rowF (N2);

796  TScore

* rowV = &stl_rowV [0];

797  TScore

* rowF = &stl_rowF [0];

800

vector<unsigned char> stl_bm (N1*N2);

801  unsigned char

* backtrace = &stl_bm[0];

805  const char

* seq1 =

m_Seq1

+ rect.

i1

- 1;

806  const char

* seq2 =

m_Seq2

+ rect.

j1

- 1;

810  bool

bFreeGapLeft1 =

m_esf_L1

&& rect.

i1

== 0;

812  bool

bFreeGapLeft2 =

m_esf_L2

&& rect.

j1

== 0;

823  for

(k = 1; k < N2; k++) {

824

rowV[k] = pV[k] + wsleft1;

835  TScore

V0 = left_top? 0: wgleft2;

837  unsigned char

tracer;

840  for

(

i

= 1;

i

< N1; ++

i

) {

845  unsigned char

ci = seq1[

i

];

847  if

(

i

== N1 - 1 && bFreeGapRight1) {

853  for

(j = 1; j < N2; ++j, ++k) {

855  G

= pV[j] + sm[ci][(

unsigned

char)seq2[j]];

868  if

(j == N2 - 1 && bFreeGapRight2) {

871

n0 = rowV[j] + ((right_bottom && j == N2 - 1)? 0: wg2);

898

backtrace[k] = tracer;

910  unsigned char

Key = backtrace[k];

917  while

(k > 0 && (Key &

kMaskEc

)) {

919

Key = backtrace[k--];

925  while

(k > 0 && (Key &

kMaskFc

)) {

TScore x_FindBestJ(const vector< TScore > &vEtop, const vector< TScore > &vFtop, const vector< TScore > &vGtop, const vector< TScore > &vEbtm, const vector< TScore > &vFbtm, const vector< TScore > &vGbtm, size_t &pos, ETransitionType &trans_type) const

friend class CThreadRunOnTop

void x_DoSubmatrix(const SCoordRect &submatr, list< ETranscriptSymbol >::iterator translist_pos, bool left_top, bool right_bottom)

list< ETranscriptSymbol > m_TransList

void x_RunBtm(const SCoordRect &rect, vector< TScore > &vE, vector< TScore > &vF, vector< TScore > &vG, vector< unsigned char > &trace, bool rb) const

TScore x_RunTerm(const SCoordRect &rect, bool left_top, bool right_bottom, list< ETranscriptSymbol > &subpath)

size_t x_ExtendSubpath(vector< unsigned char >::const_iterator trace_it, bool direction, list< ETranscriptSymbol > &subpath) const

void x_RunTop(const SCoordRect &rect, vector< TScore > &vE, vector< TScore > &vF, vector< TScore > &vG, vector< unsigned char > &trace, bool lt) const

virtual bool x_CheckMemoryLimit()

SNCBIFullScoreMatrix m_ScoreMatrix

FProgressCallback m_prg_callback

#define NCBI_THROW(exception_class, err_code, message)

Generic macro to throw an exception, given the exception class, error code and message string.

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.

bool Run(TRunMode flags=fRunDefault)

Run the thread.

void Join(void **exit_data=0)

Wait for the thread termination.

const unsigned char kMaskFc

const unsigned char kMaskEc

const unsigned char kMaskE

const unsigned char kMaskD

DEFINE_STATIC_FAST_MUTEX(masterlist_mutex)

bool MM_RequestNewThread(const size_t max_threads)

Multi-threading – mutexes; rw-locks; semaphore.

#define NCBI_FSM_DIM

Recommended approach: unpack and index directly.

int TNCBIScore

data types


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