File: hydro.cpp

package info (click to toggle)
muscle 3.70%2Bfix1-2
  • links: PTS, VCS
  • area: main
  • in suites: lenny, squeeze
  • size: 1,424 kB
  • ctags: 2,116
  • sloc: cpp: 26,897; xml: 230; makefile: 25
file content (42 lines) | stat: -rw-r--r-- 919 bytes parent folder | download | duplicates (12)
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
#include "muscle.h"
#include "profile.h"

extern void TomHydro(ProfPos *Prof, unsigned Length);

// Apply hydrophobicity heuristic to a profile
void Hydro(ProfPos *Prof, unsigned uLength)
	{
	if (ALPHA_Amino != g_Alpha)
		return;

	if (g_bTomHydro)
		{
		TomHydro(Prof, uLength);
		return;
		}

	if (0 == g_uHydrophobicRunLength)
		return;

	if (uLength <= g_uHydrophobicRunLength)
		return;

	unsigned uRunLength = 0;
	unsigned L2 = g_uHydrophobicRunLength/2;
	for (unsigned uColIndex = L2; uColIndex < uLength - L2; ++uColIndex)
		{
		ProfPos &PP = Prof[uColIndex];
		bool bHydro = IsHydrophobic(PP.m_fcCounts);
		if (bHydro)
			{
			++uRunLength;
			if (uRunLength >= g_uHydrophobicRunLength)
				{
				Prof[uColIndex-L2].m_scoreGapOpen *= (SCORE) g_dHydroFactor;
				Prof[uColIndex-L2].m_scoreGapClose *= (SCORE) g_dHydroFactor;
				}
			}
		else
			uRunLength = 0;
		}
	}