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

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

?? progressive_align.cpp

?? ViennaRNA-1.6.1
?? CPP
字號:
/*  Copyright by Matthias Hoechsmann (C) 2002-2004  =====================================                                     You may use, copy and distribute this file freely as long as you  - do not change the file,  - leave this copyright notice in the file,  - do not make any profit with the distribution of this file  - give credit where credit is due  You are not allowed to copy or distribute this file otherwise  The commercial usage and distribution of this file is prohibited  Please report bugs and suggestions to <mhoechsm@TechFak.Uni-Bielefeld.DE>*/#include <algorithm>#include <fstream>#include "alignment.h"#include "progressive_align.h"#include "alignment.t.cpp"using namespace std;// !!! this operator is defined as > !!!bool operator < (pair<double,RNAProfileAlignment*> &l, pair<double,RNAProfileAlignment*> &r){  if(l.second->getNumStructures() < r.second->getNumStructures())    return false;  else    return true;}void progressiveAlign(deque<RNAProfileAlignment*> &inputList, deque<pair<double,RNAProfileAlignment*> > &resultList, const DoubleScoreProfileAlgebraType *alg,const RNAforesterOptions &options){    RNAProfileAliMapType inputMapProfile;	deque<RNAProfileAliKeyPairType> alignList;	RNAProfileAliMapType::iterator it,it2;	long x,y,bestx,besty;  // keys of stuctures in inputMapProfile	RNAProfileAlignment *ppfx=NULL,*ppfy=NULL,*ppf=NULL;	int level=1;	double bestScore,threshold,cutoff;	string clusterfilename;	ofstream s;	Matrix<double> *score_mtrx;		bool local;	local=options.has(RNAforesterOptions::LocalSimilarity);	cout << "*** Calculation ***" << endl << endl;	// create inputMapProfile to access a profile by an index value	deque<RNAProfileAlignment*>::const_iterator inpIt;	long i=1;	for(inpIt=inputList.begin();inpIt!=inputList.end();inpIt++)	  {	    inputMapProfile[i]=*inpIt;	    i++;	  }	inputList.clear();	// create matrix for all against all comparison	bestScore=alg->worst_score();	score_mtrx=new Matrix<double>(inputMapProfile.size(),inputMapProfile.size());	// set threshold for the clustering algorithm	if(options.has(RNAforesterOptions::CalculateDistance))		options.get(RNAforesterOptions::ClusterThreshold,threshold,20.0);	else		options.get(RNAforesterOptions::ClusterThreshold,threshold,0.7);	cout << "clustering threshold is: " << threshold << endl;	// set cutoff value for clustering	if(options.has(RNAforesterOptions::CalculateDistance))	        options.get(RNAforesterOptions::ClusterJoinCutoff,cutoff,100.0);	else	        options.get(RNAforesterOptions::ClusterJoinCutoff,cutoff,0.0);	cout << "join clusters cutoff is: " << cutoff << endl << endl;	// generate dot file	clusterfilename=options.generateFilename(RNAforesterOptions::Help,"_cluster.dot", "cluster.dot");  // use Help as dummy	s.open(clusterfilename.c_str());	s << "digraph forest" << endl << "{" << endl;	// generate nodes for the input forests	for(it=inputMapProfile.begin();it!=inputMapProfile.end();it++) 	{		ppf=it->second;		s << "\"" << ppf->getName() << "\"" << "[label=\"" << ppf->getName() << "\"]" << endl;		s << "\"" << ppf->getName() << "\"" << "[label=\"" << ppf->getName() << "\"]" << endl;	}	// compute all pairwise distances	// !! NOTE !! iterating through the map is ordered by key number	// as i only calculate a triangle matrix this is a prerequisite	cout << "Computing all pairwise similarities" << endl;	for(it=inputMapProfile.begin();it!=inputMapProfile.end();it++)	{	  		x=it->first;		ppfx=it->second;		for(it2=inputMapProfile.begin();it2->first<it->first;it2++)		{			y=it2->first;			ppfy=it2->second;
			Alignment<double,RNA_Alphabet_Profile,RNA_Alphabet_Profile> ali(ppfx,ppfy,*alg,local);			if(local)			  score_mtrx->setAt(x-1,y-1,ali.getLocalOptimum());			else			  score_mtrx->setAt(x-1,y-1,ali.getGlobalOptimumRelative());						cout << x << "," << y << ": " << score_mtrx->getAt(x-1,y-1) << endl;			WATCH(DBG_MULTIPLE,"progressiveAlign",x);			WATCH(DBG_MULTIPLE,"progressiveAlign",y);			WATCH(DBG_MULTIPLE,"progressiveAlign",ali.getGlobalOptimumRelative());		}	}	cout << endl;	while(inputMapProfile.size()>1)	{		// find the best score of all pairwise alignments		bestScore=alg->worst_score();		for(it=inputMapProfile.begin();it!=inputMapProfile.end();it++)		{			x=it->first;			for(it2=inputMapProfile.begin();it2->first < it->first;it2++)			{				double old_bestScore=bestScore;				y=it2->first;	      				WATCH(DBG_MULTIPLE,"progressiveAlign",x);				WATCH(DBG_MULTIPLE,"progressiveAlign",y);				WATCH(DBG_MULTIPLE,"progressiveAlign",score_mtrx->getAt(x-1,y-1));				WATCH(DBG_MULTIPLE,"progressiveAlign",bestScore);				bestScore=alg->choice(bestScore,score_mtrx->getAt(x-1,y-1));				if(bestScore!=old_bestScore)				{					bestx=it->first;					besty=it2->first;					old_bestScore=bestScore;				}			}		}		WATCH(DBG_MULTIPLE,"progressiveAlign",bestScore);		cout << "joining alignments:" << endl;		// if threshold is set generate a list of best pairs within threshold 		if(alg->choice(bestScore,threshold)!= threshold)		{			Graph graph;			int *mate;			int maximize;			graph=makePairsGraph(inputMapProfile,alg,score_mtrx,threshold);			if(options.has(RNAforesterOptions::CalculateDistance))				maximize=0;			else				maximize=1;			mate = Weighted_Match(graph,1,maximize);			for(x=1;x<=score_mtrx->xDim();x++)  // !! begins at 1 !!			{				if(x<mate[x])				{							// if it is a best pair put it in the align list					ppfx=inputMapProfile[x];					inputMapProfile.erase(x);					alignList.push_back(make_pair(x,ppfx));					ppfy=inputMapProfile[mate[x]];					inputMapProfile.erase(mate[x]);					alignList.push_back(make_pair(mate[x],ppfy));				}			}			free(mate);			free(graph);		}		else		{			// if there us no pair below the threshold			// combine those two profile forests, that produced the best score			ppfx=inputMapProfile[bestx];			ppfy=inputMapProfile[besty];			inputMapProfile.erase(bestx);			inputMapProfile.erase(besty);			alignList.push_back(make_pair(bestx,ppfx));			alignList.push_back(make_pair(besty,ppfy));		}		// align all forests in the align list. 		while(alignList.size()>1)		{			string aliName;			x=alignList.front().first;			ppfx=alignList.front().second;			alignList.erase(alignList.begin());			y=alignList.front().first;			ppfy=alignList.front().second;			alignList.erase(alignList.begin());			// compute alignment again 			Alignment<double,RNA_Alphabet_Profile,RNA_Alphabet_Profile> bestali(ppfx,ppfy,*alg,local);			if(local)			  bestScore=bestali.getLocalOptimum();			else			  bestScore=bestali.getGlobalOptimumRelative();			// test, if score is worse than the cutoff value			if(alg->choice(bestScore,cutoff)== cutoff)			{				// copy involved forests to the result list				cout << x << "," << y << ": alignment is below cutoff." << endl; 				if(ppfx->getNumStructures()>1)				  resultList.push_back(make_pair(ppfx->maxScore(*alg),ppfx));				if(ppfy->getNumStructures()>1)				  resultList.push_back(make_pair(ppfy->maxScore(*alg),ppfy));							  			}			else			{			        // calculate optimal alignment and add it to inputMapProfile			  ppf=new RNAProfileAlignment(ppfx->getNumStructures(),ppfy->getNumStructures());			  if(local)			    {			      Uint xbasepos,ybasepos;			      bestali.getOptLocalAlignment(*ppf,xbasepos,ybasepos);			    }			  else			    {			      bestali.getOptGlobalAlignment(*ppf);			    }							ppf->addStrNames(ppfx->getStrNames());				ppf->addStrNames(ppfy->getStrNames());				aliName=ppfx->getName() + "." +ppfy->getName();				ppf->setName(aliName);				// for debug purposes
				//string dotfilename;
				//dotfilename=ppf->getName() + string(".dot");
				//				ofstream s("test.dot");
				//				ppf->printDot(s);				// generate nodes in cluster file (dot format)				s << "\"" << ppf->getName() << "\"" << "[shape=\"diamond\" label=\"" << bestScore << "\"]" << endl;				s << "\"" << ppf->getName() << "\"" << "-> {\"" <<  ppfx->getName() << "\" \"" << ppfy->getName() << "\"}";								cout << x << "," << y << ": " << bestScore << " -> " << min(x,y) << endl;								delete ppfx;				delete ppfy;      				// calculate distance to all forests in the list				cout << "Calculate similarities to other clusters" << endl;				ppfx=ppf;				// x remains x !!				for(it=inputMapProfile.begin();it!=inputMapProfile.end();it++)				  {				    y=it->first;				    ppfy=it->second;				    Alignment<double,RNA_Alphabet_Profile,RNA_Alphabet_Profile> ali(ppfx,ppfy,*alg,local);				    if(local)				      {					score_mtrx->setAt(min(x-1,y-1),max(x-1,y-1),ali.getLocalOptimum());  // min - max = fill the upper triangle					cout << min(x,y) << "," << max(x,y) << ": " << ali.getLocalOptimum() <<  endl;									      }				    else				      {					score_mtrx->setAt(min(x-1,y-1),max(x-1,y-1),ali.getGlobalOptimumRelative());  // min - max = fill the upper triangle					cout << min(x,y) << "," << max(x,y) << ": " << ali.getGlobalOptimumRelative() <<  endl;				      }				  } 				cout << endl;								// ... and append it to the list				inputMapProfile.insert(make_pair(x,ppf));			}		}		level++;	}	assert(inputMapProfile.size()<2);	// copy last profile to resultList	if(inputMapProfile.size()==1)	{	    ppf=inputMapProfile.begin()->second;		resultList.push_back(make_pair(ppf->maxScore(*alg),ppf));		inputMapProfile.clear();	}	// end of dot file	s << "}" << endl;	// sort result list	//	std::sort(resultList.begin(),resultList.end());			delete score_mtrx;}Graph makePairsGraph(const RNAProfileAliMapType &inputMapProfile, const DoubleScoreProfileAlgebraType *alg, const Matrix<double> *score_mtrx, double threshold){	Graph graph;	RNAProfileAliMapType::const_iterator it,it2;	RNAProfileAlignment *ppfx=NULL,*ppfy=NULL;	graph = NewGraph(score_mtrx->xDim());	for(int i=0;i<score_mtrx->xDim();i++)	{		Xcoord(graph,i+1) = 0;		Ycoord(graph,i+1) = 0;	}	for(it=inputMapProfile.begin();it!=inputMapProfile.end();it++)	{		ppfx=it->second;		for(it2=inputMapProfile.begin();it2->first<it->first;it2++)		{			double score;			ppfy=it2->second;			score=score_mtrx->getAt(it->first-1,it2->first-1);			if(alg->choice(score,threshold) != threshold)  // is it better than the threshold ?			{				AddEdge (graph,it->first,it2->first,(int)(score*100.0));      			}		}	}	WriteGraph (graph,"test.out");	return graph;}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲福利一二三区| 麻豆精品在线观看| 六月丁香婷婷久久| 99久久综合国产精品| 欧美sm美女调教| 丝袜脚交一区二区| 色视频成人在线观看免| 国产欧美一区二区精品性色| 免费在线观看精品| 欧美日韩一级黄| 亚洲精品v日韩精品| www.欧美.com| 亚洲欧美日韩一区| 激情图片小说一区| 欧美在线你懂得| 亚洲三级电影网站| 日韩电影在线观看电影| 91久久精品国产91性色tv| 欧美精品一区二区在线播放| 综合电影一区二区三区| 韩国av一区二区三区| 欧美精品一二三四| 国产精品毛片大码女人 | 国产乱人伦精品一区二区在线观看 | 欧美mv日韩mv亚洲| 亚洲一区二区三区四区在线观看| 久久国产婷婷国产香蕉| 91久久精品日日躁夜夜躁欧美| 欧美v国产在线一区二区三区| 亚洲精品高清在线观看| 国产高清不卡二三区| 欧美剧在线免费观看网站| 一级日本不卡的影视| 99久久国产综合精品色伊 | 国产成人精品在线看| 欧美三级蜜桃2在线观看| 亚洲欧洲日韩在线| 99久久精品99国产精品| 国产精品久久久久久久久搜平片 | 三级一区在线视频先锋 | 欧美在线你懂的| 亚洲三级久久久| 欧美精品v国产精品v日韩精品| 日本欧美肥老太交大片| 精品国产一区二区三区不卡| 色一区在线观看| 同产精品九九九| 精品国产免费一区二区三区香蕉| 国产精品99久久久久久有的能看| 中文字幕成人在线观看| 欧美狂野另类xxxxoooo| 国产成人av电影在线观看| 亚洲同性同志一二三专区| 欧美丝袜自拍制服另类| 亚洲综合丁香婷婷六月香| 在线亚洲+欧美+日本专区| 亚洲人成网站色在线观看| 久久免费电影网| 人人精品人人爱| 亚洲成av人影院| 亚洲午夜精品网| 午夜伦欧美伦电影理论片| 亚洲激情综合网| 亚洲成av人片一区二区| 亚洲成av人片一区二区三区| 五月婷婷综合激情| 国产精品美女久久久久久久久 | 性感美女久久精品| 欧美日韩一区二区三区四区 | 亚洲自拍都市欧美小说| 欧美色欧美亚洲另类二区| 日韩主播视频在线| 中文字幕一区二区三区在线不卡 | 国产精品国产三级国产aⅴ中文 | 国产在线精品一区在线观看麻豆| 日韩码欧中文字| 亚洲精品一区二区三区在线观看| 7777精品伊人久久久大香线蕉完整版 | 亚洲一区二区在线观看视频| 91福利精品第一导航| 欧美aaaaa成人免费观看视频| 强制捆绑调教一区二区| 色综合天天做天天爱| 日本不卡一二三区黄网| 久久久国产午夜精品| 久久久久国产精品人| 久久久久九九视频| 国产精品亲子乱子伦xxxx裸| 1024成人网| 亚洲午夜精品网| 免费成人在线视频观看| 久久国产成人午夜av影院| 五月天欧美精品| 亚洲电影在线免费观看| 国产精品视频你懂的| 国产日韩欧美精品一区| 精品国产乱码久久久久久浪潮| 欧美久久免费观看| 欧美性色欧美a在线播放| 在线免费观看日本一区| 久久精品国产精品亚洲综合| 精品在线播放免费| 亚洲第一主播视频| 亚洲超碰精品一区二区| 亚洲自拍偷拍综合| 午夜不卡在线视频| 日韩av电影免费观看高清完整版| 亚洲一区国产视频| 亚洲成人中文在线| 老司机精品视频线观看86| 久久99精品视频| 懂色av一区二区三区免费观看| 国产精品66部| 色综合天天做天天爱| 欧美精品欧美精品系列| 7799精品视频| 中文字幕精品三区| 亚洲国产综合色| 国产精品一二三四| 欧美一区二区久久久| 欧美综合视频在线观看| 久久精品亚洲一区二区三区浴池| 欧美成人一区二区三区| 欧美日韩一区二区三区免费看| 欧美少妇性性性| 国产午夜精品久久久久久久| 亚瑟在线精品视频| 国产精品国产馆在线真实露脸 | 精品一区二区三区在线视频| 国产裸体歌舞团一区二区| 在线视频综合导航| 国产视频一区二区在线| 亚洲国产综合91精品麻豆| 国产精品一区二区你懂的| 91国模大尺度私拍在线视频| 国产一区二区中文字幕| 成人永久aaa| 国产偷国产偷亚洲高清人白洁| 一区二区三区精品在线| 国产成人综合在线| 精品国产精品网麻豆系列| 婷婷亚洲久悠悠色悠在线播放 | 午夜不卡av免费| 91网站最新地址| 中文无字幕一区二区三区| 九九视频精品免费| 欧美mv和日韩mv国产网站| 久久精品国产一区二区| 日韩天堂在线观看| 六月婷婷色综合| 日韩精品一区二区三区视频在线观看| 亚洲老妇xxxxxx| 色综合色狠狠综合色| 国产精品久久久久久久久免费相片 | 日韩影院免费视频| 亚洲欧美日韩国产另类专区| 国产精品一区二区x88av| 国产精品视频在线看| 精品久久一区二区三区| 成人av免费在线播放| 国产一区二区不卡| 亚洲制服欧美中文字幕中文字幕| 在线观看91av| 蜜臀91精品一区二区三区| av影院午夜一区| 亚洲18女电影在线观看| 精品精品欲导航| 成人免费电影视频| av电影在线观看不卡| 777a∨成人精品桃花网| 欧美日韩成人综合| 欧美综合天天夜夜久久| 亚洲资源中文字幕| 欧美日韩一区二区在线观看| 五月激情丁香一区二区三区| 欧亚一区二区三区| 婷婷综合五月天| 精品日产卡一卡二卡麻豆| 激情av综合网| 中文天堂在线一区| 99国产精品久久久久| 亚洲综合色在线| 中文字幕中文字幕一区二区| 欧美视频在线一区二区三区| 久久99精品久久久久久国产越南 | 日韩制服丝袜av| 国产欧美日韩不卡| 日韩免费电影一区| 欧美猛男男办公室激情| 粉嫩高潮美女一区二区三区| 免费成人美女在线观看.| 亚洲码国产岛国毛片在线| 中文欧美字幕免费| 2020国产精品| 欧美成人女星排行榜| 欧美精品v日韩精品v韩国精品v| 91电影在线观看| 在线观看视频一区二区| 在线免费观看日本欧美| 不卡一区二区三区四区|