File: hydro.cpp

package info (click to toggle)
muscle 3.52-2
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 1,196 kB
  • ctags: 1,763
  • sloc: cpp: 21,335; xml: 185; makefile: 104
file content (37 lines) | stat: -rw-r--r-- 941 bytes parent folder | download | duplicates (2)
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
#include "muscle.h"
#include "profile.h"

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

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