本文整理汇总了C++中Kmer::complementVertex方法的典型用法代码示例。如果您正苦于以下问题:C++ Kmer::complementVertex方法的具体用法?C++ Kmer::complementVertex怎么用?C++ Kmer::complementVertex使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Kmer
的用法示例。
在下文中一共展示了Kmer::complementVertex方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: reverseContent
void GraphPath::reverseContent(GraphPath & newPath) const {
#ifdef CONFIG_ASSERT
assert(newPath.size() == 0);
#endif
newPath.setKmerLength(getKmerLength());
for(int i = size() - 1 ; i >= 0 ; --i) {
Kmer element;
at(i, &element);
// the false here drops support for colored data (SOLiD)
// anyway who cares
Kmer newElement = element.complementVertex(getKmerLength(), false);
newPath.push_back(&newElement);
}
#ifdef CONFIG_ASSERT
assert(size() == newPath.size());
assert(getKmerLength() == newPath.getKmerLength());
#endif
}
示例2: work
/**
* work method.
*
* \author Sébastien Boisvert
*
* Code reviews
*
* 2011-09-02 -- Code review by Élénie Godzaridis (found bug with worker states)
*
*/
void FusionWorker::work(){
/*
used tags:
TODO: does the code pay attention when the coverage indicates a repeated k-mer ? repeats slow things down...
RAY_MPI_TAG_ASK_VERTEX_PATHS_SIZE
RAY_MPI_TAG_ASK_VERTEX_PATH
RAY_MPI_TAG_GET_PATH_LENGTH
*/
if(m_isDone)
return;
if(m_position < (int) m_path->size()){
/* get the number of paths */
if(!m_requestedNumberOfPaths){
/*
if(m_position % 1000 == 0){
cout<<"FusionWorker "<<m_workerIdentifier<<" position: ["<<m_position<<"/"<<m_path->size()<<endl;
}
*/
Kmer kmer;
m_path->at(m_position,&kmer);
if(m_reverseStrand)
kmer=kmer.complementVertex(m_parameters->getWordSize(),m_parameters->getColorSpaceMode());
Rank destination=kmer.vertexRank(m_parameters->getSize(),
m_parameters->getWordSize(),m_parameters->getColorSpaceMode());
int elementsPerQuery=m_virtualCommunicator->getElementsPerQuery(RAY_MPI_TAG_ASK_VERTEX_PATHS_SIZE);
MessageUnit*message=(MessageUnit*)m_outboxAllocator->allocate(elementsPerQuery);
int outputPosition=0;
kmer.pack(message,&outputPosition);
Message aMessage(message,elementsPerQuery,destination,
RAY_MPI_TAG_ASK_VERTEX_PATHS_SIZE,m_parameters->getRank());
m_virtualCommunicator->pushMessage(m_workerIdentifier,&aMessage);
m_requestedNumberOfPaths=true;
m_receivedNumberOfPaths=false;
if(m_parameters->hasOption("-debug-fusions2")){
cout<<"worker "<<m_workerIdentifier<<" send RAY_MPI_TAG_ASK_VERTEX_PATHS_SIZE"<<endl;
}
/* receive the number of paths */
}else if(m_requestedNumberOfPaths && !m_receivedNumberOfPaths && m_virtualCommunicator->isMessageProcessed(m_workerIdentifier)){
vector<MessageUnit> response;
m_virtualCommunicator->getMessageResponseElements(m_workerIdentifier,&response);
m_numberOfPaths=response[0];
if(m_parameters->hasOption("-debug-fusions2"))
cout<<"worker "<<m_workerIdentifier<<" Got "<<m_numberOfPaths<<endl;
m_receivedNumberOfPaths=true;
m_pathIndex=0;
m_requestedPath=false;
/* 2^5 */
int maximumNumberOfPathsToProcess=32;
/* don't process repeated stuff */
if(m_numberOfPaths> maximumNumberOfPathsToProcess)
m_numberOfPaths=0;
}else if(m_receivedNumberOfPaths && m_pathIndex < m_numberOfPaths){
/* request a path */
if(!m_requestedPath){
Kmer kmer;
m_path->at(m_position,&kmer);
if(m_reverseStrand)
kmer=kmer.complementVertex(m_parameters->getWordSize(),m_parameters->getColorSpaceMode());
Rank destination=kmer.vertexRank(m_parameters->getSize(),
m_parameters->getWordSize(),m_parameters->getColorSpaceMode());
int elementsPerQuery=m_virtualCommunicator->getElementsPerQuery(RAY_MPI_TAG_ASK_VERTEX_PATH);
MessageUnit*message=(MessageUnit*)m_outboxAllocator->allocate(elementsPerQuery);
int outputPosition=0;
kmer.pack(message,&outputPosition);
message[outputPosition++]=m_pathIndex;
Message aMessage(message,elementsPerQuery,destination,
RAY_MPI_TAG_ASK_VERTEX_PATH,m_parameters->getRank());
m_virtualCommunicator->pushMessage(m_workerIdentifier,&aMessage);
if(m_parameters->hasOption("-debug-fusions2")){
cout<<"worker "<<m_workerIdentifier<<" send RAY_MPI_TAG_ASK_VERTEX_PATH "<<m_pathIndex<<endl;
//.........这里部分代码省略.........