本文整理汇总了C++中Genome::GetChrLength方法的典型用法代码示例。如果您正苦于以下问题:C++ Genome::GetChrLength方法的具体用法?C++ Genome::GetChrLength怎么用?C++ Genome::GetChrLength使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Genome
的用法示例。
在下文中一共展示了Genome::GetChrLength方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
//.........这里部分代码省略.........
//exit( 1 ) ;
// Remove the connected edges involving the nodes in the cycle
for ( i = 0 ; i < contigCnt ; ++i )
{
if ( isInCycle[i] )
{
for ( int dummy = 0 ; dummy <= 1 ; ++dummy )
{
int ncnt = contigGraph.GetNeighbors( i, dummy, neighbors, MAX_NEIGHBOR ) ;
for ( int j = 0 ; j < ncnt ; ++j )
{
if ( neighbors[j].a == i + 2 * dummy - 1 && neighbors[j].b != dummy
&& genome.GetChrIdFromContigId( i ) == genome.GetChrIdFromContigId( neighbors[j].a ) )
continue ; // the connection created by the raw assembly
else
contigGraph.RemoveEdge( i, dummy, neighbors[j].a, neighbors[j].b ) ;
}
}
}
}
//delete[] isInCycle ;
//printf( "hi: %d %d\n", __LINE__, contigCnt ) ;
//printf( "%d %d\n", contigGraph.GetNeighbors( 0, 0, neighbors, MAX_NEIGHBOR ), contigGraph.GetNeighbors( 0, 1, neighbors, MAX_NEIGHBOR ) ) ;
// Sort the scaffolds from fasta file, so that longer scaffold come first
int scafCnt = genome.GetChrCount() ;
struct _pair *scafInfo = new struct _pair[scafCnt] ;
memset( scafInfo, -1, sizeof( struct _pair) * scafCnt ) ;
for ( i = 0 ; i < contigCnt ; ++i )
{
int chrId = genome.GetChrIdFromContigId( i ) ;
if ( scafInfo[chrId].a == -1 )
{
scafInfo[ chrId ].a = i ;
scafInfo[ chrId ].b = genome.GetChrLength( chrId ) ;
}
}
qsort( scafInfo, scafCnt, sizeof( struct _pair ), CompScaffold ) ;
// Merge the branches and build the scaffold
ContigGraph scaffold( contigCnt, 2 * contigCnt ) ;
// Use a method similar to topological sort
bool *used = new bool[contigCnt] ;
int *degree = new int[2 *contigCnt] ;
int *danglingVisitTime = new int[contigCnt] ;
int *counter = new int[contigCnt] ;
int *visitDummy = new int[ contigCnt ] ;
int *buffer = new int[contigCnt] ;
int *buffer2 = new int[contigCnt] ;
bool *isInQueue = new bool[ contigCnt ] ;
int *chosen = new int[contigCnt] ;
int chosenCnt ;
memset( isInCycle, false, sizeof( bool ) * contigCnt ) ;
memset( visitTime, -1, sizeof( int ) * contigCnt ) ;
memset( visitDummy, -1, sizeof( int ) * contigCnt ) ;
memset( counter, -1, sizeof( int ) * contigCnt ) ;
// Use those memory to remove triangular cycles
for ( i = 0 ; i < scafCnt ; ++i )
{
int from, to ;
if ( scafInfo[i].a == -1 )
continue ;
genome.GetChrContigRange( genome.GetChrIdFromContigId( scafInfo[i].a ), from, to ) ;
ForwardSearch( from, 0, i, visitTime, counter, visitDummy, contigGraph ) ;