本文整理汇总了C++中Site::has_fwd_edge方法的典型用法代码示例。如果您正苦于以下问题:C++ Site::has_fwd_edge方法的具体用法?C++ Site::has_fwd_edge怎么用?C++ Site::has_fwd_edge使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Site
的用法示例。
在下文中一共展示了Site::has_fwd_edge方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: check_valid_graph
void Node::check_valid_graph() const
{
vector<Site> *sites = sequence->get_sites();
for(unsigned int i=0;i<sites->size();i++)
{
Site *ssite = &sites->at(i);
if( ssite->has_fwd_edge() )
{
Edge *edge = ssite->get_first_fwd_edge();
Site *esite = &sites->at(edge->get_end_site_index());
if(!esite->contains_bwd_edge(edge,true))
{
Log_output::write_out("Node: site "+Log_output::itos(i)+" has fwd edge from "+Log_output::itos(edge->get_start_site_index())+
" to "+Log_output::itos(edge->get_end_site_index())+" but no return\n",1);
}
while( ssite->has_next_fwd_edge() )
{
edge = ssite->get_next_fwd_edge();
esite = &sites->at(edge->get_end_site_index());
if(!esite->contains_bwd_edge(edge,true))
{
Log_output::write_out("Node: site "+Log_output::itos(i)+" has fwd edge from "+Log_output::itos(edge->get_start_site_index())+
" to "+Log_output::itos(edge->get_end_site_index())+" but no return\n",1);
}
}
}
if( ssite->has_bwd_edge() )
{
Edge *edge = ssite->get_first_bwd_edge();
Site *esite = &sites->at(edge->get_start_site_index());
if(!esite->contains_fwd_edge(edge,true))
{
Log_output::write_out("Node: site "+Log_output::itos(i)+" has bwd edge from "+Log_output::itos(edge->get_start_site_index())+
" to "+Log_output::itos(edge->get_end_site_index())+" but no return\n",1);
}
while( ssite->has_next_bwd_edge() )
{
edge = ssite->get_next_bwd_edge();
esite = &sites->at(edge->get_start_site_index());
if(!esite->contains_fwd_edge(edge,true))
{
Log_output::write_out("Node: site "+Log_output::itos(i)+" has bwd edge from "+Log_output::itos(edge->get_start_site_index())+
" to "+Log_output::itos(edge->get_end_site_index())+" but no return\n",1);
}
}
}
}
}
示例2: check_skipped_boundaries
void Basic_alignment::check_skipped_boundaries(Sequence *sequence)
{
vector<Site> *sites = sequence->get_sites();
// First, find 'Match/Skipped' and 'Skipped/Matched' boundaries and update the counts
//
for(unsigned int i=0;i<sites->size();i++)
{
Site *tsite = &sites->at(i);
if( tsite->has_bwd_edge() )
{
Edge *edge = tsite->get_first_bwd_edge();
while( tsite->has_next_bwd_edge() )
{
Edge *another = tsite->get_next_bwd_edge();
if( another->get_start_site_index() > edge->get_start_site_index() )
edge = another;
}
Site *psite = &sites->at( edge->get_start_site_index() );
if( ( psite->get_path_state()==Site::matched || psite->get_path_state()==Site::start_site )
&& ( tsite->get_path_state()==Site::xskipped || tsite->get_path_state()==Site::yskipped ) )
{
edge->increase_branch_count_as_skipped_edge();
}
}
if( tsite->has_fwd_edge() )
{
Edge *edge = tsite->get_first_fwd_edge();
while( tsite->has_next_fwd_edge() )
{
Edge *another = tsite->get_next_fwd_edge();
if( another->get_start_site_index() < edge->get_start_site_index() )
edge = another;
}
Site *nsite = &sites->at( edge->get_end_site_index() );
if( ( tsite->get_path_state()==Site::xskipped || tsite->get_path_state()==Site::yskipped )
&& ( nsite->get_path_state()==Site::matched || nsite->get_path_state()==Site::ends_site ) )
{
edge->increase_branch_count_as_skipped_edge();
}
}
}
// Then, see if any pair of boundaries (covering a skipped gap) is above the limit. Delete the range.
//
bool non_skipped = true;
int skip_start = -1;
for(unsigned int i=1;i<sites->size();i++)
{
Site *tsite = &sites->at(i);
int tstate = tsite->get_path_state();
if( non_skipped && ( tstate == Site::xskipped || tstate == Site::yskipped ) )
{
if( tsite->has_bwd_edge() )
{
Edge *edge = tsite->get_first_bwd_edge();
while( tsite->has_next_bwd_edge() )
{
Edge *another = tsite->get_next_bwd_edge();
if( another->get_start_site_index() > edge->get_start_site_index() )
edge = another;
}
if(edge->get_branch_count_as_skipped_edge()>max_allowed_match_skip_branches)
{
skip_start = i;
}
}
non_skipped = false;
}
if(!non_skipped && skip_start>=0 && tstate == Site::matched)
{
int edge_ind = -1;
if( tsite->has_bwd_edge() )
{
Edge *edge = tsite->get_first_bwd_edge();
if(edge->get_branch_count_as_skipped_edge()>max_allowed_match_skip_branches)
edge_ind = edge->get_index();
while( tsite->has_next_bwd_edge() )
{
edge = tsite->get_next_bwd_edge();
if(edge->get_branch_count_as_skipped_edge()>max_allowed_match_skip_branches)
edge_ind = edge->get_index();
//.........这里部分代码省略.........