亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? setgscweights.cpp

?? unix,linux下編譯。用于蛋白質
?? CPP
字號:
/***
Gerstein/Sonnhammer/Chothia ad hoc sequence weighting.
The algorithm was deduced by reverse-engineering the
HMMer code.

I used an alternative representation that I prefer over
HMMer's. The HMMer code is full of tree manipulations
that do something to the left child and then the equivalent
thing to the right child. It was clear that there must be
a re-formulation that does everything once for each node,
which would reduce the number of operations expressed
in the code by a factor of two. This gives a more elegant
and less error-prone way to code it.

These notes explain the correspondence between my design
and Eddy's.

HMMer stores a data structure phylo_s for each non-leaf
node in the cluster tree. This structure contains the
following fields:

	diff		Weight of the node
	lblen		Left branch length
	rblen		Right branch length

The lblen and rblen branch lengths are calculated as:

	this.lblen = this.diff - left.diff
	this.rblen = this.diff - right.diff

My code stores one ClusterNode data structure per node
in the cluster tree, including leaves. I store only the
weight. I can recover the HMMer branch length fields
in a trivial O(1) calculation as follows:

	lblen = Node.GetWeight() - Node.GetLeft()->GetWeight()
	rblen = Node.GetWeight() - Node.GetRight()->GetWeight()

For the GSC weights calculation, HMMer constructs the
following vectors, which have entries for all nodes,
including leaves:

	lwt		Left weight
	rwt		Right weight

The "left weight" is calculated as the sum of the weights in
all the nodes reachable through the left branch, including
the node itself. (This is not immediately obvious from the
code, which does the calculation using branch lengths rather
than weights, but this is an equivalent, and to my mind clearer,
statement of what they are). Similarly, the "right weight" is
the sum of all weights reachable via the right branch. I define
the "cluster weight" to be the summed weight of all nodes in the
subtree under the node, including the node itself. I provide
a function Node.GetClusterWeight() which calculates the cluster
weight using a O(ln N) recursion through the tree. The lwt and
rwt values can be recovered as follows:

	lwt		= Node.GetLeft()->GetClusterWeight()
			+ Node.GetWeight()

	lwt		= Node.GetLeft()->GetClusterWeight()
			+ Node.GetWeight()

HMMer calculates a further vector fwt as follows.

	this.fwt = parent.fwt * parent.lwt / (parent.lwt + parent.rwt)

This applies to nodes reached via a left branch, for nodes reached
via a right branch:

	this.fwt = parent.fwt * parent.rwt / (parent.lwt + parent.rwt)

The values of fwt at the leaf nodes are the final GSC weights.
We derive the various terms using our equivalents.

	parent.lwt	= Parent.GetLeft()->GetClusterWeight()
				+ Parent.GetWeight()

	parent.rwt	= Parent.GetRight()->GetClusterWeight()
				+ Parent.GetWeight()

	parent.lwt + parent.rwt =
				{ Parent.GetLeft()->GetClusterWeight()
				+ Parent.GetRight()->GetClusterWeight()
				+ Parent.GetWeight() }
				+ Parent.GetWeight()

We recognize the term {...} as the cluster weight of the
parent, so

	parent.lwt + parent.rwt
				= Parent.GetClusterWeight()
				+ Parent.GetWeight()

As you would expect, repeating this exercise for parent.rwt gives
exactly the same expression.

The GSC weights (fwt) are stored in the Weight2 field of the cluster
tree, the Weight field stores the original (BLOSUM) weights used
as input to this algorithm.
***/

#include "muscle.h"
#include "msa.h"
#include "cluster.h"
#include "distfunc.h"

// Set weights of all sequences in the subtree under given node.
void MSA::SetSubtreeWeight2(const ClusterNode *ptrNode) const
	{
	if (0 == ptrNode)
		return;

	const ClusterNode *ptrRight = ptrNode->GetRight();
	const ClusterNode *ptrLeft = ptrNode->GetLeft();

// If leaf, set weight
	if (0 == ptrRight && 0 == ptrLeft)
		{
		unsigned uIndex = ptrNode->GetIndex();
		double dWeight = ptrNode->GetWeight2();
		WEIGHT w = DoubleToWeight(dWeight);
		m_Weights[uIndex] = w;
		return;
		}

// Otherwise, recursively set subtrees
	SetSubtreeWeight2(ptrLeft);
	SetSubtreeWeight2(ptrRight);
	}

void MSA::SetSubtreeGSCWeight(ClusterNode *ptrNode) const
	{
	if (0 == ptrNode)
		return;

	ClusterNode *ptrParent = ptrNode->GetParent();
	double dParentWeight2 = ptrParent->GetWeight2();
	double dParentClusterWeight = ptrParent->GetClusterWeight();
	if (0.0 == dParentClusterWeight)
		{
		double dThisClusterSize = ptrNode->GetClusterSize();
		double dParentClusterSize = ptrParent->GetClusterSize();
		double dWeight2 =
		  dParentWeight2*dThisClusterSize/dParentClusterSize;
		ptrNode->SetWeight2(dWeight2);
		}
	else
		{
	// Could cache cluster weights for better performance.
	// We calculate cluster weight of each node twice, so this
	// would give x2 improvement.
	// As weighting is not very expensive, we don't care.
		double dThisClusterWeight = ptrNode->GetClusterWeight();
		double dParentWeight = ptrParent->GetWeight();

		double dNum = dThisClusterWeight + dParentWeight;
		double dDenom = dParentClusterWeight + dParentWeight;
		double dWeight2 = dParentWeight2*(dNum/dDenom);

		ptrNode->SetWeight2(dWeight2);
		}

	SetSubtreeGSCWeight(ptrNode->GetLeft());
	SetSubtreeGSCWeight(ptrNode->GetRight());
	}

void MSA::SetGSCWeights() const
	{
	ClusterTree CT;
	CalcBLOSUMWeights(CT);

// Calculate weights and store in tree.
	ClusterNode *ptrRoot = CT.GetRoot();
	ptrRoot->SetWeight2(1.0);
	SetSubtreeGSCWeight(ptrRoot->GetLeft());
	SetSubtreeGSCWeight(ptrRoot->GetRight());

// Copy weights from tree to MSA.
	SetSubtreeWeight2(ptrRoot);
	}
 
void MSA::ListWeights() const
	{
	const unsigned uSeqCount = GetSeqCount();
	Log("Weights:\n");
	WEIGHT wTotal = 0;
	for (unsigned n = 0; n < uSeqCount; ++n)
		{
		wTotal += GetSeqWeight(n);
		Log("%6.3f %s\n", GetSeqWeight(n), GetSeqName(n));
		}
	Log("Total weights = %6.3f, should be 1.0\n", wTotal);
	}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
精品久久久久久久久久久久久久久 | 一区二区三区成人| 日韩电影在线免费| 国产99久久精品| 日韩欧美一区二区视频| 亚洲一区在线电影| caoporen国产精品视频| 欧美v日韩v国产v| 亚洲国产成人va在线观看天堂| 国产精品91一区二区| 911精品产国品一二三产区| 综合激情成人伊人| 丁香五精品蜜臀久久久久99网站| 91精品国产91热久久久做人人| 亚洲欧洲另类国产综合| 国产一区二区电影| 日韩欧美久久久| 亚洲电影一区二区| 色网综合在线观看| 中文字幕av一区二区三区高| 久热成人在线视频| 884aa四虎影成人精品一区| 亚洲图片你懂的| 丁香天五香天堂综合| 精品美女一区二区| 日本美女一区二区| 欧美精品第1页| 亚洲午夜视频在线| 色婷婷激情一区二区三区| 国产精品视频一二| 国产成人鲁色资源国产91色综 | 欧美性感一区二区三区| 中文字幕一区二区日韩精品绯色| 国产河南妇女毛片精品久久久| 日韩一区二区三区四区五区六区| 亚洲高清久久久| 欧美天堂一区二区三区| 洋洋av久久久久久久一区| 91年精品国产| 亚洲人成在线观看一区二区| 97精品超碰一区二区三区| 亚洲天堂a在线| 91亚洲国产成人精品一区二三| 国产精品午夜春色av| 国产在线精品免费av| 久久影音资源网| 国产传媒一区在线| 国产视频一区在线播放| 国产成人亚洲综合a∨婷婷图片| 久久免费视频一区| 国产精品一区二区在线观看不卡 | 3d动漫精品啪啪1区2区免费| 午夜精品视频一区| 欧美一区二区视频在线观看| 日韩电影在线免费| 精品国产乱码久久久久久图片| 久久99国内精品| 久久久综合激的五月天| 国产成人鲁色资源国产91色综| 中文字幕精品—区二区四季| a在线欧美一区| 亚洲免费观看高清完整版在线观看| 色婷婷久久久久swag精品| 亚洲国产成人精品视频| 日韩一区二区三区在线视频| 激情综合网激情| 中文字幕av免费专区久久| 99精品久久只有精品| 亚洲综合色在线| 欧美一区午夜精品| 国产专区欧美精品| 国产精品蜜臀在线观看| 色婷婷久久久综合中文字幕| 午夜精品久久久久久久| 亚洲精品一区二区三区蜜桃下载| 国产成人三级在线观看| 成人免费在线播放视频| 欧美日韩一本到| 精品一区二区三区免费播放| 国产精品麻豆一区二区| 在线观看亚洲a| 青娱乐精品视频| 国产精品嫩草影院com| 欧洲日韩一区二区三区| 久久se这里有精品| 亚洲人成人一区二区在线观看| 欧美日韩国产另类一区| 久久99久久99精品免视看婷婷 | 精品国产免费人成在线观看| 国产不卡视频一区| 亚洲高清免费视频| 国产欧美一区二区三区沐欲| 在线视频欧美区| 国产综合久久久久久鬼色| 亚洲私人影院在线观看| 日韩一级欧美一级| 波多野结衣91| 日本不卡1234视频| 中文字幕一区二区三区视频| 欧美一级黄色片| 99国产精品视频免费观看| 日日嗨av一区二区三区四区| 欧美激情资源网| 欧美浪妇xxxx高跟鞋交| 成人免费视频一区| 日韩电影在线一区二区三区| 中文字幕一区二区三中文字幕| 欧美一区二区三区思思人| 99国产欧美另类久久久精品| 精品在线一区二区三区| 一区二区三区电影在线播| 国产婷婷精品av在线| 欧美一级午夜免费电影| 91免费看视频| 国产aⅴ精品一区二区三区色成熟| 亚洲va在线va天堂| 国产精品超碰97尤物18| 欧美大肚乱孕交hd孕妇| 欧美综合一区二区| 国产999精品久久久久久| 日韩av电影免费观看高清完整版| 18欧美亚洲精品| 久久午夜羞羞影院免费观看| 宅男在线国产精品| 色综合亚洲欧洲| 风间由美性色一区二区三区| 毛片av中文字幕一区二区| 亚洲国产欧美另类丝袜| 国产精品免费av| 久久亚洲私人国产精品va媚药| 欧美日韩精品一区二区在线播放| 91亚洲国产成人精品一区二三| 国产美女一区二区三区| 老司机精品视频在线| 亚洲成人av福利| 亚洲综合一区二区精品导航| 国产精品电影院| 亚洲国产精品ⅴa在线观看| 精品国一区二区三区| 欧美精品丝袜中出| 91福利在线导航| 91电影在线观看| 91麻豆.com| 91美女片黄在线观看91美女| 99久久精品国产毛片| eeuss鲁片一区二区三区在线看| 成人免费视频网站在线观看| 国产69精品一区二区亚洲孕妇| 国产精品2024| 国产成人福利片| 国产福利91精品一区二区三区| 狠狠色狠狠色合久久伊人| 狠狠狠色丁香婷婷综合激情| 精品一区二区三区在线视频| 经典三级视频一区| 国产在线精品免费av| 国产黄色成人av| 岛国av在线一区| 成人动漫视频在线| 91麻豆自制传媒国产之光| 色综合久久综合网97色综合| 91小视频免费观看| 91女厕偷拍女厕偷拍高清| 91麻豆自制传媒国产之光| 91香蕉视频在线| av不卡在线播放| 91黄色免费版| av日韩在线网站| 99久久99久久免费精品蜜臀| 成人自拍视频在线| 99久久婷婷国产综合精品| heyzo一本久久综合| 99视频在线精品| 成人av在线看| 成人av在线网| 一本大道久久a久久综合 | 久久精子c满五个校花| 日韩欧美一二三| 欧美大肚乱孕交hd孕妇| 久久尤物电影视频在线观看| 久久精品在线观看| 国产精品久久毛片a| 国产精品国产三级国产普通话99| 亚洲青青青在线视频| 亚洲精品国产一区二区三区四区在线 | 国产精品综合二区| 丁香天五香天堂综合| 日本精品免费观看高清观看| 日本伦理一区二区| 欧美日韩在线一区二区| 9i看片成人免费高清| 在线观看亚洲a| 91精品国产入口在线| 日韩精品欧美精品| 国产精品乱码一区二三区小蝌蚪| 中文字幕一区二区在线观看| 亚洲成av人片一区二区三区| 日本网站在线观看一区二区三区| 精品中文字幕一区二区小辣椒 | 日韩欧美一区二区在线视频|