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/smith__waterman_8c_source.html below:

NCBI C++ ToolKit: src/algo/blast/composition_adjustment/smith_waterman.c Source File

53  const Uint1

* matchSeq,

int

matchSeqLength,

55  int

**matrix,

int

gapOpen,

int

gapExtend,

60  int

bestMatchSeqPos, bestQueryPos;

67  int

prevScoreNoGapMatchSeq;

69  int

prevScoreGapMatchSeq;

72  int

matchSeqPos, queryPos;

75  if

(scoreVector ==

NULL

) {

81

newGapCost = gapOpen + gapExtend;

82  for

(matchSeqPos = 0; matchSeqPos < matchSeqLength; matchSeqPos++) {

83

scoreVector[matchSeqPos].

noGap

= 0;

84

scoreVector[matchSeqPos].

gapExists

= -gapOpen;

86  for

(queryPos = 0; queryPos < queryLength; queryPos++) {

88

matrixRow = matrix[queryPos];

90

matrixRow = matrix[

query

[queryPos]];

92

prevScoreNoGapMatchSeq = 0;

93

prevScoreGapMatchSeq = -(gapOpen);

94  for

(matchSeqPos = 0; matchSeqPos < matchSeqLength; matchSeqPos++) {

97  if

((newScore = newScore - newGapCost) >

98

(prevScoreGapMatchSeq = prevScoreGapMatchSeq - gapExtend))

99

prevScoreGapMatchSeq = newScore;

102  if

((newScore = scoreVector[matchSeqPos].noGap - newGapCost) >

104

scoreVector[matchSeqPos].

gapExists

- gapExtend))

105

continueGapScore = newScore;

109

prevScoreNoGapMatchSeq + matrixRow[matchSeq[matchSeqPos]];

113  if

(newScore < prevScoreGapMatchSeq)

114

newScore = prevScoreGapMatchSeq;

115  if

(newScore < continueGapScore)

116

newScore = continueGapScore;

117

prevScoreNoGapMatchSeq = scoreVector[matchSeqPos].

noGap

;

118

scoreVector[matchSeqPos].

noGap

= newScore;

119

scoreVector[matchSeqPos].

gapExists

= continueGapScore;

120  if

(newScore > bestScore) {

121

bestScore = newScore;

122

bestQueryPos = queryPos;

123

bestMatchSeqPos = matchSeqPos;

130

*matchSeqEnd = bestMatchSeqPos;

131

*queryEnd = bestQueryPos;

146  int

*matchSeqStart,

int

*queryStart,

147  const Uint1

* matchSeq,

int

matchSeqLength,

149  int

**matrix,

int

gapOpen,

int

gapExtend,

150  int

matchSeqEnd,

int

queryEnd,

int

score_in,

151  int

positionSpecific)

155  int

bestMatchSeqPos, bestQueryPos;

161  int

prevScoreNoGapMatchSeq;

163  int

prevScoreGapMatchSeq;

165  int

continueGapScore;

166  int

matchSeqPos, queryPos;

169  if

(scoreVector ==

NULL

) {

175

newGapCost = gapOpen + gapExtend;

176  for

(matchSeqPos = 0; matchSeqPos < matchSeqLength; matchSeqPos++) {

177

scoreVector[matchSeqPos].

noGap

= 0;

178

scoreVector[matchSeqPos].

gapExists

= -(gapOpen);

180  for

(queryPos = queryEnd; queryPos >= 0; queryPos--) {

181  if

(positionSpecific)

182

matrixRow = matrix[queryPos];

184

matrixRow = matrix[

query

[queryPos]];

186

prevScoreNoGapMatchSeq = 0;

187

prevScoreGapMatchSeq = -(gapOpen);

188  for

(matchSeqPos = matchSeqEnd; matchSeqPos >= 0; matchSeqPos--) {

191  if

((newScore = newScore - newGapCost) >

192

(prevScoreGapMatchSeq = prevScoreGapMatchSeq - gapExtend))

193

prevScoreGapMatchSeq = newScore;

196  if

((newScore = scoreVector[matchSeqPos].noGap - newGapCost) >

198

scoreVector[matchSeqPos].

gapExists

- gapExtend))

199

continueGapScore = newScore;

203

prevScoreNoGapMatchSeq + matrixRow[matchSeq[matchSeqPos]];

207  if

(newScore < prevScoreGapMatchSeq)

208

newScore = prevScoreGapMatchSeq;

209  if

(newScore < continueGapScore)

210

newScore = continueGapScore;

211

prevScoreNoGapMatchSeq = scoreVector[matchSeqPos].

noGap

;

212

scoreVector[matchSeqPos].

noGap

= newScore;

213

scoreVector[matchSeqPos].

gapExists

= continueGapScore;

214  if

(newScore > bestScore) {

215

bestScore = newScore;

216

bestQueryPos = queryPos;

217

bestMatchSeqPos = matchSeqPos;

219  if

(bestScore >= score_in)

222  if

(bestScore >= score_in)

228

*matchSeqStart = bestMatchSeqPos;

229

*queryStart = bestQueryPos;

230

*score_out = bestScore;

245  const Uint1

* matchSeq,

int

matchSeqLength,

247  int

**matrix,

int

gapOpen,

int

gapExtend,

248  const int

*numForbidden,

249  int

** forbiddenRanges,

250  int

positionSpecific)

254  int

bestMatchSeqPos, bestQueryPos;

260  int

prevScoreNoGapMatchSeq;

262  int

prevScoreGapMatchSeq;

264  int

continueGapScore;

265  int

matchSeqPos, queryPos;

270  if

(scoreVector ==

NULL

) {

276

newGapCost = gapOpen + gapExtend;

277  for

(matchSeqPos = 0; matchSeqPos < matchSeqLength; matchSeqPos++) {

278

scoreVector[matchSeqPos].

noGap

= 0;

279

scoreVector[matchSeqPos].

gapExists

= -(gapOpen);

281  for

(queryPos = 0; queryPos < queryLength; queryPos++) {

282  if

(positionSpecific)

283

matrixRow = matrix[queryPos];

285

matrixRow = matrix[

query

[queryPos]];

287

prevScoreNoGapMatchSeq = 0;

288

prevScoreGapMatchSeq = -(gapOpen);

289  for

(matchSeqPos = 0; matchSeqPos < matchSeqLength; matchSeqPos++) {

292  if

((newScore = newScore - newGapCost) >

293

(prevScoreGapMatchSeq = prevScoreGapMatchSeq - gapExtend))

294

prevScoreGapMatchSeq = newScore;

297  if

((newScore = scoreVector[matchSeqPos].noGap - newGapCost) >

299

scoreVector[matchSeqPos].

gapExists

- gapExtend))

300

continueGapScore = newScore;

304  for

(

f

= 0;

f

< numForbidden[queryPos];

f

++) {

305  if

((matchSeqPos >= forbiddenRanges[queryPos][2 *

f

]) &&

306

(matchSeqPos <= forbiddenRanges[queryPos][2*

f

+ 1])) {

315

prevScoreNoGapMatchSeq + matrixRow[matchSeq[matchSeqPos]];

319  if

(newScore < prevScoreGapMatchSeq)

320

newScore = prevScoreGapMatchSeq;

321  if

(newScore < continueGapScore)

322

newScore = continueGapScore;

323

prevScoreNoGapMatchSeq = scoreVector[matchSeqPos].

noGap

;

324

scoreVector[matchSeqPos].

noGap

= newScore;

325

scoreVector[matchSeqPos].

gapExists

= continueGapScore;

326  if

(newScore > bestScore) {

327

bestScore = newScore;

328

bestQueryPos = queryPos;

329

bestMatchSeqPos = matchSeqPos;

336

*matchSeqEnd = bestMatchSeqPos;

337

*queryEnd = bestQueryPos;

353  int

*matchSeqStart,

int

*queryStart,

354  const Uint1

* matchSeq,

int

matchSeqLength,

356  int

gapOpen,

int

gapExtend,

int

matchSeqEnd,

357  int

queryEnd,

int

score_in,

358  const int

*numForbidden,

359  int

** forbiddenRanges,

360  int

positionSpecific)

364  int

bestMatchSeqPos, bestQueryPos;

371  int

prevScoreNoGapMatchSeq;

373  int

prevScoreGapMatchSeq;

375  int

continueGapScore;

376  int

matchSeqPos, queryPos;

381  if

(scoreVector ==

NULL

) {

387

newGapCost = gapOpen + gapExtend;

388  for

(matchSeqPos = 0; matchSeqPos < matchSeqLength; matchSeqPos++) {

389

scoreVector[matchSeqPos].

noGap

= 0;

390

scoreVector[matchSeqPos].

gapExists

= -(gapOpen);

392  for

(queryPos = queryEnd; queryPos >= 0; queryPos--) {

393  if

(positionSpecific)

394

matrixRow = matrix[queryPos];

396

matrixRow = matrix[

query

[queryPos]];

398

prevScoreNoGapMatchSeq = 0;

399

prevScoreGapMatchSeq = -(gapOpen);

400  for

(matchSeqPos = matchSeqEnd; matchSeqPos >= 0; matchSeqPos--) {

403  if

((newScore = newScore - newGapCost) >

404

(prevScoreGapMatchSeq = prevScoreGapMatchSeq - gapExtend))

405

prevScoreGapMatchSeq = newScore;

408  if

((newScore = scoreVector[matchSeqPos].noGap - newGapCost) >

410

scoreVector[matchSeqPos].

gapExists

- gapExtend))

411

continueGapScore = newScore;

415  for

(

f

= 0;

f

< numForbidden[queryPos];

f

++) {

416  if

((matchSeqPos >= forbiddenRanges[queryPos][2 *

f

]) &&

417

(matchSeqPos <= forbiddenRanges[queryPos][2*

f

+ 1])) {

426

prevScoreNoGapMatchSeq + matrixRow[matchSeq[matchSeqPos]];

430  if

(newScore < prevScoreGapMatchSeq)

431

newScore = prevScoreGapMatchSeq;

432  if

(newScore < continueGapScore)

433

newScore = continueGapScore;

434

prevScoreNoGapMatchSeq = scoreVector[matchSeqPos].

noGap

;

435

scoreVector[matchSeqPos].

noGap

= newScore;

436

scoreVector[matchSeqPos].

gapExists

= continueGapScore;

437  if

(newScore > bestScore) {

438

bestScore = newScore;

439

bestQueryPos = queryPos;

440

bestMatchSeqPos = matchSeqPos;

442  if

(bestScore >= score_in)

445  if

(bestScore >= score_in)

451

*matchSeqStart = bestMatchSeqPos;

452

*queryStart = bestQueryPos;

453

*score_out = bestScore;

465  for

(

f

= 0;

f

<

self

->capacity;

f

++)

free

(self->ranges[

f

]);

467  free

(self->ranges);

self

->ranges =

NULL

;

468  free

(self->numForbidden);

self

->numForbidden =

NULL

;

478  self

->capacity = capacity;

479  self

->numForbidden =

NULL

;

480  self

->ranges =

NULL

;

481  self

->isEmpty =

TRUE

;

483  self

->numForbidden = (

int

*)

calloc

(capacity,

sizeof

(

int

));

484  if

(self->numForbidden ==

NULL

)

486  self

->ranges = (

int

**)

calloc

(capacity,

sizeof

(

int

*));

487  if

(self->ranges ==

NULL

)

489  for

(

f

= 0;

f

< capacity;

f

++) {

490  self

->numForbidden[

f

] = 0;

491  self

->ranges[

f

] = (

int

*)

malloc

(2 *

sizeof

(

int

));

492  if

(self->ranges[

f

] ==

NULL

)

494  self

->ranges[

f

][0] = 0;

495  self

->ranges[

f

][1] = 0;

508  for

(

f

= 0;

f

<

self

->capacity;

f

++) {

509  self

->numForbidden[

f

] = 0;

511  self

->isEmpty =

TRUE

;

524  for

(

f

= queryStart;

f

< queryEnd;

f

++) {

525  int last

= 2 *

self

->numForbidden[

f

];

528

realloc(self->ranges[

f

], (

last

+ 2) *

sizeof

(

int

));

529  if

(new_ranges ==

NULL

)

531  self

->ranges[

f

] = new_ranges;

533  self

->ranges[

f

][

last

] = matchStart;

534  self

->ranges[

f

][

last

+ 1] = matchEnd;

536  self

->numForbidden[

f

]++;

538  self

->isEmpty =

FALSE

;

547  int

*matchSeqEnd,

int

*queryEnd,

548  const Uint1

* subject_data,

int

subject_length,

549  const Uint1

* query_data,

int

query_length,

553  int

positionSpecific,

556  if

(forbiddenRanges->

isEmpty

) {

558

queryEnd, subject_data,

560

query_data, query_length,

566

queryEnd, subject_data,

569

query_length, matrix,

572

forbiddenRanges->

ranges

,

583  const Uint1

* subject_data,

int

subject_length,

584  const Uint1

* query_data,

591  int

positionSpecific,

594  if

(forbiddenRanges->

isEmpty

) {

596

queryStart, subject_data,

597

subject_length, query_data,

598

matrix, gapOpen, gapExtend,

599

matchSeqEnd, queryEnd,

600

score_in, positionSpecific);

609

matchSeqEnd, queryEnd,

612

forbiddenRanges->

ranges

,

Constants used in compositional score matrix adjustment.

#define COMPO_SCORE_MIN

Minimum score in a matrix.

static DLIST_TYPE *DLIST_NAME() last(DLIST_LIST_TYPE *list)

uint8_t Uint1

1-byte (8-bit) unsigned integer

Type and macro definitions from C toolkit that are not defined in C++ toolkit.

#define TRUE

bool replacment for C indicating true.

#define FALSE

bool replacment for C indicating false.

void Blast_ForbiddenRangesRelease(Blast_ForbiddenRanges *self)

Release the storage associated with the fields of self, but do not delete self.

static int BLspecialSmithWatermanScoreOnly(int *score, int *matchSeqEnd, int *queryEnd, const Uint1 *matchSeq, int matchSeqLength, const Uint1 *query, int queryLength, int **matrix, int gapOpen, int gapExtend, const int *numForbidden, int **forbiddenRanges, int positionSpecific)

Compute the score and right-hand endpoints of the locally optimal Smith-Waterman alignment,...

int Blast_ForbiddenRangesPush(Blast_ForbiddenRanges *self, int queryStart, int queryEnd, int matchStart, int matchEnd)

Add some ranges to self.

int Blast_ForbiddenRangesInitialize(Blast_ForbiddenRanges *self, int capacity)

Initialize a new, empty Blast_ForbiddenRanges.

void Blast_ForbiddenRangesClear(Blast_ForbiddenRanges *self)

Reset self to be empty.

int Blast_SmithWatermanFindStart(int *score_out, int *matchSeqStart, int *queryStart, const Uint1 *subject_data, int subject_length, const Uint1 *query_data, int **matrix, int gapOpen, int gapExtend, int matchSeqEnd, int queryEnd, int score_in, int positionSpecific, const Blast_ForbiddenRanges *forbiddenRanges)

Find the left-hand endpoints of the locally optimal Smith-Waterman alignment given the score and righ...

int Blast_SmithWatermanScoreOnly(int *score, int *matchSeqEnd, int *queryEnd, const Uint1 *subject_data, int subject_length, const Uint1 *query_data, int query_length, int **matrix, int gapOpen, int gapExtend, int positionSpecific, const Blast_ForbiddenRanges *forbiddenRanges)

Compute the score and right-hand endpoints of the locally optimal Smith-Waterman alignment,...

static int BLspecialSmithWatermanFindStart(int *score_out, int *matchSeqStart, int *queryStart, const Uint1 *matchSeq, int matchSeqLength, const Uint1 *query, int **matrix, int gapOpen, int gapExtend, int matchSeqEnd, int queryEnd, int score_in, const int *numForbidden, int **forbiddenRanges, int positionSpecific)

Find the left-hand endpoints of the locally optimal Smith-Waterman alignment, subject to the restrict...

static int BLSmithWatermanFindStart(int *score_out, int *matchSeqStart, int *queryStart, const Uint1 *matchSeq, int matchSeqLength, const Uint1 *query, int **matrix, int gapOpen, int gapExtend, int matchSeqEnd, int queryEnd, int score_in, int positionSpecific)

Find the left-hand endpoints of the locally optimal Smith-Waterman alignment.

struct SwGapInfo SwGapInfo

A structure used internally by the Smith-Waterman algorithm to represent gaps.

static int BLbasicSmithWatermanScoreOnly(int *score, int *matchSeqEnd, int *queryEnd, const Uint1 *matchSeq, int matchSeqLength, const Uint1 *query, int queryLength, int **matrix, int gapOpen, int gapExtend, int positionSpecific)

Compute the score and right-hand endpoints of the locally optimal Smith-Waterman alignment.

Definitions for computing Smith-Waterman alignments.

An instance of Blast_ForbiddenRanges is used by the Smith-Waterman algorithm to represent ranges in t...

int * numForbidden

how many forbidden ranges at each database position

int ** ranges

forbidden ranges for each database position

int isEmpty

True if there are no forbidden ranges.

A structure used internally by the Smith-Waterman algorithm to represent gaps.

int noGap

score if opening a gap

int gapExists

score if continuing a gap

voidp calloc(uInt items, uInt size)


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