File: ScoreMatrixRow.hh

package info (click to toggle)
last-align 1651-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 14,688 kB
  • sloc: cpp: 44,419; python: 5,217; ansic: 1,938; sh: 710; makefile: 457
file content (32 lines) | stat: -rw-r--r-- 919 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
// Copyright 2010, 2011 Martin C. Frith

// These definitions are for manipulating a score matrix, or a PSSM,
// as a 2-dimensional array.  The hope is that 2D arrays are extremely
// fast.  But arrays are "evil", so this may not be the best way...

#ifndef SCORE_MATRIX_ROW_HH
#define SCORE_MATRIX_ROW_HH

#include <limits.h>

namespace cbrc{

enum { scoreMatrixRowSize = ALPHABET_CAPACITY };

typedef int ScoreMatrixRow[scoreMatrixRowSize];

// Substitution score for delimiter symbols at the ends of sequences.
// It should be highly negative, to terminate alignments immediately,
// but not so negative that it causes overflow errors.

// The delimiter score when using short ints:
const int shortDelimiterScore = SHRT_MIN/2 + SCHAR_MIN;

// We want: short(delimiterScore) = shortDelimiterScore
const int delimiterScore = INT_MIN/2 + (unsigned short)shortDelimiterScore;

enum { INF = -delimiterScore };

}

#endif