本文整理汇总了C++中MultiPath::print方法的典型用法代码示例。如果您正苦于以下问题:C++ MultiPath::print方法的具体用法?C++ MultiPath::print怎么用?C++ MultiPath::print使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MultiPath
的用法示例。
在下文中一共展示了MultiPath::print方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: fast_expand_multi_path_for_combo_scores
//.........这里部分代码省略.........
{
pop_heap(combo_heap.begin(),combo_heap.end());
var_combo& combo = combo_heap[max_num_paths-1];
combo.path_score = path_score;
combo.var_idxs = var_idxs;
combo.node_scores = node_scores;
push_heap(combo_heap.begin(),combo_heap.end());
}
}
}
int j=0;
while (j<num_multi_var_edges)
{
var_idxs[j]++;
if (var_idxs[j]==num_vars[j])
{
var_idxs[j++]=0;
}
else
break;
}
if (j==num_multi_var_edges)
break;
}
seq_paths.clear();
seq_paths.resize(combo_heap.size(),template_path);
int i;
for (i=0; i<combo_heap.size(); i++)
{
const var_combo& combo = combo_heap[i];
SeqPath& seq_path = seq_paths[i];
// fill in info that changes with multi-variant edges
int j;
for (j=0; j<num_multi_var_edges; j++)
{
const int var_pos = var_positions[j];
const int e_idx = multi_path.edge_idxs[var_pos];
const MultiEdge& edge = get_multi_edge(e_idx);
const int pos_idx = var_edge_positions[j];
if (seq_path.positions[pos_idx].edge_idx != e_idx)
{
cout << "POS: " << pos_idx << endl;
cout << "Error: mismatch in pos_idx and e_idx of a multipath!" << endl;
cout << "looking for " << e_idx << endl;
cout << "edge idxs:" << endl;
int k;
for (k=0; k<seq_path.positions.size(); k++)
cout << k << "\t" << seq_path.positions[k].edge_idx << "\tnidx: " <<
seq_path.positions[k].node_idx << endl;
cout << endl;
multi_path.print(config);
this->print();
exit(1);
}
PathPos& pos = seq_path.positions[pos_idx];
const int variant_idx = combo.var_idxs[j];
int *variant_ptr = edge.variant_ptrs[variant_idx];
const int num_aa = *variant_ptr++;
int *aas = variant_ptr;
if (num_aa != edge.num_aa)
{
cout << "Error: edge and variant mixup!" << endl;
exit(1);
}
pos.node_score = combo.node_scores[j];
pos.edge_variant_score = edge.variant_scores[variant_idx];
pos.variant_ptr = edge.variant_ptrs[variant_idx];
pos.aa = aas[0];
if (edge.num_aa == 1)
continue;
int k;
for (k=1; k<edge.num_aa; k++)
{
PathPos& pos = seq_path.positions[pos_idx+k];
pos.aa = aas[k];
}
}
seq_path.positions[seq_path.positions.size()-1].node_score = combo.node_scores[num_multi_var_edges];
seq_path.path_score=combo.path_score;
float pen = seq_path.adjust_complete_sequence_penalty(this);
seq_path.make_seq_str(config);
}
}
示例2: fast_expand_multi_path
//.........这里部分代码省略.........
make_heap(combo_heap.begin(),combo_heap.end());
}
else
{
const score_t score = template_path.path_score + idxs_score;
if (score>combo_heap[0].path_score)
{
pop_heap(combo_heap.begin(),combo_heap.end());
combo_heap[max_num_paths-1].path_score = score;
combo_heap[max_num_paths-1].var_idxs = idxs;
push_heap(combo_heap.begin(),combo_heap.end());
}
}
}
int j=0;
while (j<num_multi_var_edges)
{
idxs[j]++;
if (idxs[j]==num_vars[j])
{
idxs[j++]=0;
}
else
break;
}
if (j==num_multi_var_edges)
break;
}
seq_paths.clear();
seq_paths.resize(combo_heap.size(),template_path);
int i;
for (i=0; i<combo_heap.size(); i++)
{
const var_combo& combo = combo_heap[i];
SeqPath& seq_path = seq_paths[i];
// fill in info that changes with multi-variant edges
int j;
for (j=0; j<num_multi_var_edges; j++)
{
const int var_pos = var_positions[j];
const int e_idx = multi_path.edge_idxs[var_pos];
const MultiEdge& edge = get_multi_edge(e_idx);
const int pos_idx = var_edge_positions[j];
if (seq_path.positions[pos_idx].edge_idx != e_idx)
{
cout << "POS: " << pos_idx << endl;
cout << "Error: mismatch in pos_idx and e_idx of a multipath!" << endl;
cout << "looking for " << e_idx << endl;
cout << "edge idxs:" << endl;
int k;
for (k=0; k<seq_path.positions.size(); k++)
cout << k << "\t" << seq_path.positions[k].edge_idx << "\tnidx: " <<
seq_path.positions[k].node_idx << endl;
cout << endl;
multi_path.print(config);
this->print();
exit(1);
}
PathPos& pos = seq_path.positions[pos_idx];
const int variant_idx = combo.var_idxs[j];
int *variant_ptr = edge.variant_ptrs[variant_idx];
const int num_aa = *variant_ptr++;
int *aas = variant_ptr;
if (num_aa != edge.num_aa)
{
cout << "Error: edge and variant mixup!" << endl;
exit(1);
}
pos.edge_variant_score = edge.variant_scores[variant_idx];
pos.aa = aas[0];
// pos.edge_var_idx = variant_idx;
if (edge.num_aa == 1)
continue;
int k;
for (k=1; k<edge.num_aa; k++)
{
PathPos& pos = seq_path.positions[pos_idx+k];
pos.aa = aas[k];
}
}
//seq_path.path_score = max_path_score + combo.path_delta;
seq_path.path_score=combo.path_score;
seq_path.make_seq_str(config);
}
}