cawlign 0.0.1
Codon-aware pairwise sequence alignment
Loading...
Searching...
No Matches
scoring.hpp
1#ifndef SCORING_H
2#define SCORING_H
3
4#include <iostream>
5#include "alignment.h"
6#include "argparse.hpp"
7#include "tn93_shared.h"
8
9using namespace std;
10using namespace argparse;
11
12
14 public:
16 const char * _alphabet,
17 const cawlign_fp * _scoring_matrix,
18 const cawlign_fp _open_gap_reference,
19 const cawlign_fp _open_gap_query,
20 const cawlign_fp _extend_gap_reference,
21 const cawlign_fp _extend_gap_query
22 );
23
25 CawalignSimpleScores (void) {D=0;};
26 virtual ~CawalignSimpleScores (void) {};
27
28 StringBuffer alphabet;
29 /*
30 ordered characters that are included in the scoring matrix
31 */
32 unsigned int D;
33 // the number of characters in the string
34
35 long char_map [255];
36 /*
37 for each ASCII character, this will map the character to the corresping entry the scoring matrix
38 all characters NOT in `alphabet` get mapped to index D (the 'not defined' character)
39 */
40
41 VectorFP scoring_matrix;
42 /*
43 A (D+1)x(D+1) scoring matrix where element (i,j) gives the score of matching (or mis-matching)
44 the D-th row/column is for matchign a character NOT in the alphabet
45 While generally symmetric, an asymmetric matrix can also be meaningful if there is some reason to have
46 substitutions in reference/query weigted differently
47 */
48
49 cawlign_fp open_gap_reference,
50 open_gap_query,
51 extend_gap_query,
52 extend_gap_reference;
53
54 char gap_char;
55 /* gap open and extend character*/
56
57 void _init_alphabet (long not_found = -1);
58
59};
60
62 public:
63
65 virtual ~CawalignCodonScores (void) {};
66
67 // compute how many nucleotides are different between the two codons encoded as 0-63 integers
68 static int nucleotide_diff (long, long);
69
70 Vector translation_table;
71 // codon (0-63 index) to single letter amino-acid code translation table
72
73 // partial score tables
74 VectorFP s3x1,
75 s3x2,
76 s3x4,
77 s3x5;
78
79 // the cost of introducing frameshits
80 cawlign_fp frameshift_cost,
81 // the penalty for synonymous substitutions, per nucleotide change
82 synonymous_penalty;
83
84 // ordered amino-acid scoring tables
85 StringBuffer amino_acids;
86
87 int stop_codon_index;
88 int mismatch_index;
89
90
91
92};
93
94
95extern const char kNucleotideAlphabet[];
96extern const cawlign_fp kNucScoring[];
97
98#endif
Definition scoring.hpp:61
static int nucleotide_diff(long, long)
Definition scoring.cpp:114
Definition scoring.hpp:13
void _init_alphabet(long not_found=-1)
Definition scoring.cpp:30
Definition configparser.hpp:32
Definition stringBuffer.h:8
Definition stringBuffer.h:44
Definition stringBuffer.h:67