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

NCBI C++ ToolKit: src/app/cn3d/conservation_colorer.cpp Source File

61  static bool

unpacked =

false

;

72

alignment(parent), nColumns(0), basicColorsCurrent(

false

), fitColorsCurrent(

false

)

80  ERRORMSG

(

"ConservationColorer::AddBlock : block is not from the associated alignment"

);

97  TRACEMSG

(

"calculating basic conservation colors"

);

101

ColumnProfile::iterator p, pe, p2;

102  int row

, profileColumn;

105  typedef

vector < int > IntVector;

108  int

minVariety=0, maxVariety=0, minWeightedVariety=0, maxWeightedVariety=0;

110  typedef

vector < float > FloatVector;

111

FloatVector informationContents(

nColumns

, 0.0f);

112  float

totalInformationContent = 0.0f;

114

BlockMap::const_iterator

b

, be =

blocks

.end();

115  for

(

b

=

blocks

.begin();

b

!=be; ++

b

) {

117  for

(

unsigned int

blockColumn=0; blockColumn<

b

->first->width; ++blockColumn) {

118

profileColumn =

b

->second[blockColumn];

125  if

((p=profile.find(ch)) != profile.end())

133  if

(profile.size() == 1 && profile.begin()->first !=

'X'

)

139  int

& variety = varieties[profileColumn];

140

variety = profile.size();

141  if

(profile.find(

'X'

) != profile.end())

142

variety += profile[

'X'

] - 1;

143  if

(blockColumn == 0 &&

b

==

blocks

.begin()) {

144

minVariety = maxVariety = variety;

146  if

(variety < minVariety) minVariety = variety;

147  else if

(variety > maxVariety) maxVariety = variety;

151  int

& weightedVariety = weightedVarieties[profileColumn];

152  for

(p=profile.begin(); p!=pe; ++p) {

156  for

(++p2; p2!=pe; ++p2)

160  if

(blockColumn == 0 &&

b

==

blocks

.begin()) {

161

minWeightedVariety = maxWeightedVariety = weightedVariety;

163  if

(weightedVariety < minWeightedVariety) minWeightedVariety = weightedVariety;

164  else if

(weightedVariety > maxWeightedVariety) maxWeightedVariety = weightedVariety;

168  float

&columnInfo = informationContents[profileColumn];

169  for

(p=profile.begin(); p!=pe; ++p) {

170  static const float

ln2 =

log

(2.0f), threshhold = 0.0001f;

172  if

(expFreq > threshhold) {

173  float

obsFreq = 1.0f * p->second /

nRows

,

174

freqRatio = obsFreq / expFreq;

175  if

(freqRatio > threshhold) {

176

residueScore = obsFreq * ((float)

log

(freqRatio)) / ln2;

177

columnInfo += residueScore;

181

totalInformationContent += columnInfo;

185  INFOMSG

(

"Total information content of aligned blocks: "

<< totalInformationContent <<

" bits"

);

193  for

(profileColumn=0; profileColumn<

nColumns

; ++profileColumn) {

196  if

(maxVariety == minVariety)

199

scale = 1.0 - 1.0 * (varieties[profileColumn] - minVariety) / (maxVariety - minVariety);

203  if

(maxWeightedVariety == minWeightedVariety)

206

scale = 1.0 * (weightedVarieties[profileColumn] - minWeightedVariety) /

207

(maxWeightedVariety - minWeightedVariety);

211  static const float

minInform = 0.10f, maxInform = 6.24f;

212

scale = (informationContents[profileColumn] - minInform) / (maxInform - minInform);

213  if

(scale < 0.0) scale = 0.0;

214  else if

(scale > 1.0) scale = 1.0;

229  TRACEMSG

(

"calculating fit conservation colors"

);

233

ColumnProfile::iterator p, pe;

234  int row

, profileColumn;

237

vector < CharIntMap > fitScores(

nColumns

);

238  int

minFit=0, maxFit=0;

240  typedef

vector < float > FloatVector;

242

BlockRowScores blockFitScores, blockZFitScores, blockRowFitScores;

243  float

minBlockFit=0.0f, maxBlockFit=0.0f, minBlockZFit=0.0f, maxBlockZFit=0.0f, minBlockRowFit=0.0f, maxBlockRowFit=0.0f;

245

BlockMap::const_iterator

b

, be =

blocks

.end();

246  for

(

b

=

blocks

.begin();

b

!=be; ++

b

) {

247

blockFitScores[

b

->first].resize(

nRows

, 0.0f);

249  for

(

unsigned int

blockColumn=0; blockColumn<

b

->first->width; ++blockColumn) {

250

profileColumn =

b

->second[blockColumn];

255  for

(p=profile.begin(); p!=pe; ++p) {

256  int

& fit = fitScores[profileColumn][p->first];

259  b

->first->GetRangeOfRow(0)->from + blockColumn);

260  if

(blockColumn == 0 &&

b

==

blocks

.begin() && p == profile.begin()) {

261

minFit = maxFit = fit;

263  if

(fit < minFit) minFit = fit;

264  else if

(fit > maxFit) maxFit = fit;

271

blockFitScores[

b

->first][

row

] += fitScores[profileColumn][ch];

276  float

average = 0.0f;

278  float

& score = blockFitScores[

b

->first][

row

];

279

score /=

b

->first->width;

282

minBlockFit = maxBlockFit = score;

284  if

(score < minBlockFit) minBlockFit = score;

285  else if

(score > maxBlockFit) maxBlockFit = score;

295

stdDev += (blockFitScores[

b

->first][

row

] - average) *

296

(blockFitScores[

b

->first][

row

] - average);

298

stdDev = sqrt(stdDev);

299  if

(stdDev > 1e-10) {

301

blockZFitScores[

b

->first].resize(

nRows

);

303

blockZFitScores[

b

->first][

row

] = (blockFitScores[

b

->first][

row

] - average) / stdDev;

309  if

(

blocks

.size() >= 2) {

310  for

(

b

=

blocks

.begin();

b

!=be; ++

b

)

315  float

average = 0.0f;

316  for

(

b

=

blocks

.begin();

b

!=be; ++

b

)

317

average += blockFitScores[

b

->first][

row

];

318

average /=

blocks

.size();

320  for

(

b

=

blocks

.begin();

b

!=be; ++

b

)

321

stdDev += (blockFitScores[

b

->first][

row

] - average) *

322

(blockFitScores[

b

->first][

row

] - average);

323

stdDev /=

blocks

.size() - 1;

324

stdDev = sqrt(stdDev);

325  if

(stdDev > 1e-10) {

326  for

(

b

=

blocks

.begin();

b

!=be; ++

b

)

327

blockRowFitScores[

b

->first][

row

] = (blockFitScores[

b

->first][

row

] - average) / stdDev;

335  for

(profileColumn=0; profileColumn<

nColumns

; ++profileColumn) {

337

CharIntMap::const_iterator c, ce = fitScores[profileColumn].end();

338  for

(c=fitScores[profileColumn].begin(); c!=ce; ++c) {

339  if

(maxFit == minFit)

342

scale = 1.0 * (c->second - minFit) / (maxFit - minFit);

349  for

(

b

=

blocks

.begin();

b

!=be; ++

b

) {

352  if

(maxBlockFit == minBlockFit)

355

scale = 1.0 * (blockFitScores[

b

->first][

row

] - minBlockFit) / (maxBlockFit - minBlockFit);

362  for

(

b

=

blocks

.begin();

b

!=be; ++

b

) {

364  if

(blockZFitScores.find(

b

->first) != blockZFitScores.end()) {

366  float

zScore = blockZFitScores[

b

->first][

row

];

368

minBlockZFit = maxBlockZFit = zScore;

370  if

(zScore < minBlockZFit) minBlockZFit = zScore;

371  else if

(zScore > maxBlockZFit) maxBlockZFit = zScore;

375  if

(maxBlockZFit == minBlockZFit)

378

scale = 1.0 * (blockZFitScores[

b

->first][

row

] - minBlockZFit) /

379

(maxBlockZFit - minBlockZFit);

387  for

(

b

=

blocks

.begin();

b

!=be; ++

b

)

389  if

(

blocks

.size() >= 2) {

391  if

(blockRowFitScores.begin()->second[

row

] !=

kMin_Float

) {

392  for

(

b

=

blocks

.begin();

b

!=be; ++

b

) {

393  float

zScore = blockRowFitScores[

b

->first][

row

];

395

minBlockRowFit = maxBlockRowFit = zScore;

397  if

(zScore < minBlockRowFit) minBlockRowFit = zScore;

398  else if

(zScore > maxBlockRowFit) maxBlockRowFit = zScore;

401  for

(

b

=

blocks

.begin();

b

!=be; ++

b

) {

402  if

(maxBlockRowFit == minBlockRowFit)

405

scale = 1.0 * (blockRowFitScores[

b

->first][

row

] - minBlockRowFit) /

406

(maxBlockRowFit - minBlockRowFit);

418  int

*profileIndex,

char

*residue)

const 420

BlockMap::const_iterator

b

=

blocks

.find(block);

421

*profileIndex =

b

->second[blockColumn];

const BLAST_Matrix * GetPSSM(void) const

unsigned int NRows(void) const

bool IsFrom(const BlockMultipleAlignment *alignment) const

const Vector & Get(eColor which) const

void AddBlock(const UngappedAlignedBlock *block)

ColumnColors informationContentColors

ConservationColorer(const BlockMultipleAlignment *parent)

BlockFitColors blockRowFitColors

void GetProfileIndexAndResidue(const UngappedAlignedBlock *block, int blockColumn, int row, int *profileIndex, char *residue) const

ColumnColors weightedVarietyColors

ColumnColors varietyColors

AlignmentProfile alignmentProfile

std::map< char, int > ColumnProfile

BlockFitColors blockZFitColors

void CalculateFitConservationColors(void)

void CalculateBasicConservationColors(void)

std::vector< bool > identities

const BlockMultipleAlignment * alignment

BlockFitColors blockFitColors

const Colors * GlobalColors(void)

char ScreenResidueCharacter(char ch)

int GetBLOSUM62Score(char a, char b)

Include a standard set of the NCBI C++ Toolkit most basic headers.

#define END_SCOPE(ns)

End the previously defined scope.

#define BEGIN_SCOPE(ns)

Define a new scope.

unsigned int

A callback function used to compare two keys in a database.

const TYPE & Get(const CNamedParameterList *param)

const SNCBIPackedScoreMatrix NCBISM_Blosum62

void NCBISM_Unpack(const SNCBIPackedScoreMatrix *psm, SNCBIFullScoreMatrix *fsm)

Expand a packed score matrix into an unpacked one, which callers can proceed to index directly by sta...

#define row(bind, expected)

double GetStandardProbability(char ch)

unsigned char LookupNCBIStdaaNumberFromCharacter(char r)

char LookupCharacterFromNCBIStdaaNumber(unsigned char n)


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