MCPcopy Create free account
hub / github.com/BirolLab/abyss / newDefaultScoreMatrix

Function newDefaultScoreMatrix

Align/dialign.cpp:25–49  ·  view source on GitHub ↗

Return a DNA score matrix. */

Source from the content-addressed store, hash-verified

23
24/** Return a DNA score matrix. */
25static scr_matrix* newDefaultScoreMatrix()
26{
27 string s("ACGT?#$");
28 struct scr_matrix* p = (scr_matrix*)calloc(1, sizeof *smatrix);
29 p->length = s.size();
30 p->num2char = (int*)calloc(256, sizeof(int));
31 p->char2num = (int*)calloc(256, sizeof(int));
32 for (unsigned i = 0; i < s.size(); ++i) {
33 unsigned c = s[i];
34 p->num2char[i] = c;
35 p->char2num[c] = i;
36 }
37
38 p->data = (int*)calloc(s.size() * s.size(), sizeof(int));
39 unsigned n = s.size() - 3; // ignore ?#$
40 // Set the diagonal to 1.
41 for (unsigned i = 0; i < n; i++)
42 p->data[s.size() * i + i] = 1;
43 p->max_score = 1;
44 p->avg_sim_score = para->PROT_SIM_SCORE_THRESHOLD;
45 p->dist = (int*)calloc(2, sizeof(int));
46 p->dist[0] = n * n - n;
47 p->dist[1] = n;
48 return p;
49}
50
51/** Return a probability distribution for diagonal lengths
52 * for a DNA score matrix.

Callers 1

initDialignFunction · 0.85

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected