File: posgap.cpp

package info (click to toggle)
muscle 3.60-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 1,384 kB
  • ctags: 2,079
  • sloc: cpp: 26,452; xml: 185; makefile: 101
file content (141 lines) | stat: -rw-r--r-- 2,653 bytes parent folder | download
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
#include "muscle.h"

// Pascaralle and Argos gap factors
// after Table 1 in Thompson et. al. ClustalW NAR paper.
static double PAFFacs[20] =
	{
	1.13,		// A
	1.13,		// C
	0.96,		// D
	1.31,		// E
	1.20,		// F
	0.61,		// G
	1.00,		// H
	1.32,		// I
	0.96,		// K
	1.21,		// L
	1.29,		// M
	0.62,		// N
	0.74,		// P
	1.07,		// Q
	0.72,		// R
	0.76,		// S
	0.89,		// T
	1.25,		// V
	1.00,		// Y
	1.23,		// W
	};

// (Not used: does not appear to work well).
SCORE PAFactor(const FCOUNT fcCounts[])
	{
	if (ALPHA_Amino != g_Alpha)
		Quit("PAFFactor: requires amino acid sequence");

	FCOUNT fLetterCount = 0;
	double dSum = 0;
	for (unsigned uLetter = 0; uLetter < 20; ++uLetter)
		{
		const FCOUNT fCount = fcCounts[uLetter];
		dSum += fCount*PAFFacs[uLetter];
		fLetterCount += fCount;
		}
	if (0 == fLetterCount)
		return 0.5;
	return (SCORE) (dSum/fLetterCount);
	}

static bool Hydrophilic[20] =
	{
	false,		// A
	false,		// C
	true,		// D
	true,		// E
	false,		// F
	true,		// G
	false,		// H
	false,		// I
	true,		// K
	false,		// L
	false,		// M
	true,		// N
	true,		// P
	true,		// Q
	true,		// R
	true,		// S
	false,		// T
	false,		// V
	false,		// Y
	false,		// W
	};

bool IsHydrophilic(const FCOUNT fcCounts[])
	{
	if (ALPHA_Amino != g_Alpha)
		Quit("IsHydrophilic: requires amino acid sequence");

	for (unsigned uLetter = 0; uLetter < 20; ++uLetter)
		if (fcCounts[uLetter] > 0 && !Hydrophilic[uLetter])
			return false;
	return true;
	}

bool IsHydrophilic(const unsigned uCounts[])
	{
	if (ALPHA_Amino != g_Alpha)
		Quit("IsHydrophilic: requires amino acid sequence");

	for (unsigned uLetter = 0; uLetter < 20; ++uLetter)
		if (uCounts[uLetter] > 0 && !Hydrophilic[uLetter])
			return false;
	return true;
	}

// LIVCATMFYWHK
// Venn		Pascaralla	B&T		Me
// L		y			y		y
// I		y			y		y
// V		y			y		y
// C		y			n
// A		y			y		y
// T		N			n
// M		y			y		y
// F		y			y		y
// Y		n			n
// W		y			n
// H		n			n
// K		n			n
static bool Hydrophobic[20] =
	{
	true,		// A
	true,		// C
	false,		// D
	false,		// E
	true,		// F
	false,		// G
	true,		// H
	true,		// I
	false,		// K
	true,		// L
	true,		// M
	false,		// N
	false,		// P
	false,		// Q
	false,		// R
	false,		// S
	true,		// T
	true,		// V
	true,		// Y
	true,		// W
	};

bool IsHydrophobic(const FCOUNT fcCounts[])
	{
	if (ALPHA_Amino != g_Alpha)
		Quit("IsHydrophobic: requires amino acid sequence");

	for (unsigned uLetter = 0; uLetter < 20; ++uLetter)
		if (fcCounts[uLetter] > 0.0 && !Hydrophobic[uLetter])
			return false;
	return true;
	}