当前位置: 首页>>代码示例>>C++>>正文


C++ TrackList::getTrackCount方法代码示例

本文整理汇总了C++中TrackList::getTrackCount方法的典型用法代码示例。如果您正苦于以下问题:C++ TrackList::getTrackCount方法的具体用法?C++ TrackList::getTrackCount怎么用?C++ TrackList::getTrackCount使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TrackList的用法示例。


在下文中一共展示了TrackList::getTrackCount方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: init

bool Alignment::init(const LcbList & lcbList, const VariantList & variantList, const ReferenceList & referenceList, const TrackList & trackList)
{
	totalLength = 0;
	filterFlags = 0;
	filterPass = true;
	filterPassScale = true;
	filterShow = false;
	trackReference = 0;
	destroyRegions();
	
	lcbs.resize(lcbList.getLcbCount());
	tracks.resize(trackList.getTrackCount());
	
	for ( int i = 0; i < tracks.size(); i++ )
	{
		tracks[i] = new QVector<Region *>(lcbList.getLcbCount());
	}
	
	for ( int i = 0; i < lcbList.getLcbCount(); i++ )
	{
		const LcbList::Lcb & lcb = lcbList.getLcb(i);
		
		int id = i;
		
		lcbs[id].concordance = 1 - lcb.concordance;
		//lcbs[id].number = atoi(lcb.name().c_str());
		
		QVector<Region *> * regions = new QVector<Region *>(lcb.regions.size());
		
		for ( int j = 0; j < lcb.regions.size(); j++ )
		{
			const LcbList::Region & lcbRegion = lcb.regions.at(j);
			
			int track = j;
			
			char * snps = 0;
			
			Region * region = new Region
			(
			 id,
			 lcbRegion.position,
			 lcbRegion.length,
			 lcbRegion.reverse,
			 snps
			 );
			
			(*regions)[track] = region;
			(*tracks[track])[id] = region;
			
			if ( track == 0 )
			{
				totalLength += region->getLength();
			}
		}
		
		lcbs[id].regions = regions;
	}
	
	for ( int i = 0; i < tracks.size(); i++ )
	{
		qSort(tracks[i]->begin(), tracks[i]->end(), Region::lessThan);
		
		// determine total length
		//
		unsigned int length = 0;
		//
		for ( int j = 0; j < tracks[i]->size(); j++ )
		{
			length += (*tracks[i])[j]->getLength();
		}
		
		// assigned scaled
		//
		unsigned int position = 0;
		//
		for ( int j = 0; j < tracks[i]->size(); j++ )
		{
			(*tracks[i])[j]->setScaled
			(
			 (float)position / length,
			 (float)(position + (*tracks[i])[j]->getLength()) / length
			 );
			
			position += (*tracks[i])[j]->getLength();
		}
	}
	
	snpMap.clear();
	filters.resize(variantList.getFilterCount());
	
	for ( int i = 0; i < variantList.getFilterCount(); i++ )
	{
		const VariantList::Filter & msgFilter = variantList.getFilter(i);
		
		Filter & filter = filters[i];
		filter.flag = msgFilter.flag;
		filter.name = QString::fromStdString(msgFilter.name);
		filter.description = QString::fromStdString(msgFilter.description);
	}
	
//.........这里部分代码省略.........
开发者ID:marbl,项目名称:gingr,代码行数:101,代码来源:Alignment.cpp


注:本文中的TrackList::getTrackCount方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。