本文整理汇总了C++中Bank::rewind_all方法的典型用法代码示例。如果您正苦于以下问题:C++ Bank::rewind_all方法的具体用法?C++ Bank::rewind_all怎么用?C++ Bank::rewind_all使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Bank
的用法示例。
在下文中一共展示了Bank::rewind_all方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: construct_graph
id_els GraphOutput::construct_graph(string linear_seqs_name) // PIERRE: i need to know the last nb_nodes
{
Bank *Nodes = new Bank((char *)linear_seqs_name.c_str());
id_els nb_els = first_id_els; //Alexan: stucture for print id elements in graph output
char * rseq;
int readlen;
Nodes->rewind_all();
sizeKmer--; // nodes extremities overlap by (k-1)-mers, so let's extract (k-1)-mers
// for each node, output all the out-edges (in-edges will correspond to out-edges of neighbors)
while (Nodes->get_next_seq(&rseq,&readlen))
{
kmer_type left_kmer, right_kmer, left_kmer_fw, left_kmer_rc, right_kmer_fw, right_kmer_rc;
set<node_strand>::iterator it;
left_kmer = extractKmerFromRead(rseq,0,&left_kmer_fw,&left_kmer_rc, false);
right_kmer = extractKmerFromRead(rseq,readlen-sizeKmer,&right_kmer_fw,&right_kmer_rc, false);
Strand left_strand = (left_kmer == left_kmer_fw)?FW:RC;
Strand right_strand = (right_kmer == right_kmer_fw)?FW:RC;
// left edges (are revcomp extensions)
for (it = kmer_links[left_kmer].begin(); it != kmer_links[left_kmer].end(); it++)
{
long cur_node = it->node;
Strand cur_strand = it->strand;
LeftOrRight cur_left_or_right = it->left_or_right;
if (cur_node ==nb_els.node) // prevent self loops on same kmer
if (readlen == sizeKmer)
continue;
string label = "R";
if (cur_left_or_right == LEFT)
{
if (cur_strand != left_strand)
label+=(string)"F";
else
continue;
}
else
{
if (cur_strand == left_strand)
label+=(string)"R";
else
continue;
}
print_edge(nb_els.edge, nb_els.node,cur_node,label);
nb_els.edge++;
}
// right edges
for (it = kmer_links[right_kmer].begin(); it != kmer_links[right_kmer].end(); it++)
{
long cur_node = it->node;
Strand cur_strand = it->strand;
LeftOrRight cur_left_or_right = it->left_or_right;
if (cur_node == nb_els.node) // prevent self loops on same kmer
if (readlen == sizeKmer)
continue;
string label = "F";
if (cur_left_or_right == LEFT)
{
if (cur_strand == right_strand)
label+=(string)"F";
else
continue;
}
else
{
if (cur_strand != right_strand)
label+=(string)"R";
else
continue;
}
print_edge(nb_els.edge, nb_els.node,cur_node,label);
nb_els.edge++;
}
//nodes
print_node(nb_els.node, rseq);
nb_els.node++;
}
sizeKmer++; // make sure to restore k
Nodes->close();
delete Nodes;
return nb_els;
//.........这里部分代码省略.........