本文整理汇总了C++中Bank::get_next_seq方法的典型用法代码示例。如果您正苦于以下问题:C++ Bank::get_next_seq方法的具体用法?C++ Bank::get_next_seq怎么用?C++ Bank::get_next_seq使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Bank
的用法示例。
在下文中一共展示了Bank::get_next_seq方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: load_nodes_extremities
void GraphOutput::load_nodes_extremities(string linear_seqs_name)
{
kmer_links.clear(); // PIERRE: reset previous stored kmer links
Bank *Nodes = new Bank((char *)linear_seqs_name.c_str());
long nb_nodes = first_id_els.node; //PIERRE;
char * rseq;
int readlen;
sizeKmer--; // nodes extremities overlap by (k-1)-mers, so let's extract (k-1)-mers
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;
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;
kmer_links[left_kmer].insert(node_strand(nb_nodes, left_strand, LEFT));
kmer_links[right_kmer].insert(node_strand(nb_nodes, right_strand, RIGHT));
nb_nodes++;
}
Nodes->close();
delete Nodes;
sizeKmer++; // make sure to restore k
}
示例2: Bank
Set *load_false_positives()
{
int64_t NbInsertedKmers = 0;
char * rseq;
int readlen;
kmer_type kmer, graine, graine_revcomp;
Bank *FalsePositives = new Bank(return_file_name(false_positive_kmers_file));
// alloc false positives with the just the right estimated size
uint64_t nbFP = countFP(FalsePositives);
FPSet *fp = new FPSet(nbFP);
while (FalsePositives->get_next_seq(&rseq,&readlen))
{
kmer = extractKmerFromRead(rseq,0,&graine,&graine_revcomp);
fp->insert(kmer);
NbInsertedKmers++;
if ((NbInsertedKmers%table_print_frequency)==0) fprintf (stderr,(char*)"%cInsert false positive Kmers in hash table %lld",13,NbInsertedKmers);
}
fp->finalize(); // always call this when finishing to create a FPSet
fprintf (stderr,"\nInserted %lld false positive kmers in the hash structure.\n\n",NbInsertedKmers);
print_size_summary(fp);
return fp;
}
示例3: 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;
//.........这里部分代码省略.........