Skip to content

Commit

Permalink
Fix bug with reverse complement nodes in separate-sequence GFAs
Browse files Browse the repository at this point in the history
  • Loading branch information
rrwick committed May 1, 2016
1 parent bcf728f commit 2b97c5a
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion graph/assemblygraph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@ QByteArray AssemblyGraph::getReverseComplement(QByteArray forwardSequence)
case '.': reverseComplement.append('.'); break;
case '-': reverseComplement.append('-'); break;
case '?': reverseComplement.append('?'); break;
case '*': reverseComplement.append('*'); break;
}
}

Expand Down Expand Up @@ -981,8 +982,14 @@ void AssemblyGraph::makeReverseComplementNodeIfNecessary(DeBruijnNode * node)
DeBruijnNode * reverseComplementNode = m_deBruijnGraphNodes[reverseComplementName];
if (reverseComplementNode == 0)
{
QByteArray nodeSequence;
if (node->sequenceIsMissing())
nodeSequence = "*";
else
nodeSequence = node->getSequence();
DeBruijnNode * newNode = new DeBruijnNode(reverseComplementName, node->getDepth(),
getReverseComplement(node->getSequence()));
getReverseComplement(nodeSequence),
node->getLength());
m_deBruijnGraphNodes.insert(reverseComplementName, newNode);
}
}
Expand Down

0 comments on commit 2b97c5a

Please sign in to comment.