msadist.h

来自「unix,linux下编译。用于蛋白质」· C头文件 代码 · 共 40 行

H
40
字号
#ifndef MSADist_h
#define MSADist_h

#include <math.h>

double GetScoreDist(const MSA &msa, unsigned SeqIndex1, unsigned SeqIndex2);

class MSADist
	{
public:
	MSADist(DISTANCE Distance)
		{
		m_Distance = Distance;
		}

	double ComputeDist(const MSA &msa, unsigned uSeqIndex1, unsigned uSeqIndex2)
		{
		if (m_Distance == DISTANCE_ScoreDist)
			return GetScoreDist(msa, uSeqIndex1, uSeqIndex2);

		double dPctId = msa.GetPctIdentityPair(uSeqIndex1, uSeqIndex2);
		switch(m_Distance)
			{
		case DISTANCE_PctIdKimura:
			return KimuraDist(dPctId);
		case DISTANCE_PctIdLog:
			if (dPctId < 0.05)
				dPctId = 0.05;
			return -log(dPctId);
			}
		Quit("MSADist::ComputeDist, invalid DISTANCE_%u", m_Distance);
		return 0;
		}

private:
	DISTANCE m_Distance;
	};

#endif	// MSADist_h

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?