Skip to content

Commit

Permalink
Merge branch 'development'
Browse files Browse the repository at this point in the history
  • Loading branch information
rrwick committed Oct 15, 2015
2 parents 0dc8b14 + 501955f commit e8cbf8b
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 2 deletions.
12 changes: 11 additions & 1 deletion graph/assemblygraph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,8 @@ void AssemblyGraph::resetNodeContiguityStatus()
i.value()->resetContiguityStatus();
}
m_contiguitySearchDone = false;

resetAllNodeColours();
}

void AssemblyGraph::resetAllNodeColours()
Expand Down Expand Up @@ -1945,12 +1947,20 @@ void AssemblyGraph::duplicateNodePair(DeBruijnNode * node, MyGraphicsScene * sce

double newReadDepth = node->getReadDepth() / 2.0;

//Create the new nodes.
DeBruijnNode * newPosNode = new DeBruijnNode(newPosNodeName, newReadDepth, originalPosNode->getSequence());
DeBruijnNode * newNegNode = new DeBruijnNode(newNegNodeName, newReadDepth, originalNegNode->getSequence());

newPosNode->setReverseComplement(newNegNode);
newNegNode->setReverseComplement(newPosNode);

//Copy over additional stuff from the original nodes.
newPosNode->setCustomColour(originalPosNode->getCustomColour());
newNegNode->setCustomColour(originalNegNode->getCustomColour());
newPosNode->setCustomLabel(originalPosNode->getCustomLabel());
newNegNode->setCustomLabel(originalNegNode->getCustomLabel());
newPosNode->setCsvData(originalPosNode->getAllCsvData());
newNegNode->setCsvData(originalNegNode->getAllCsvData());

m_deBruijnGraphNodes.insert(newPosNodeName, newPosNode);
m_deBruijnGraphNodes.insert(newNegNodeName, newNegNode);

Expand Down
17 changes: 16 additions & 1 deletion ui/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1030,7 +1030,6 @@ void MainWindow::switchColourScheme()
void MainWindow::determineContiguityFromSelectedNode()
{
g_assemblyGraph->resetNodeContiguityStatus();
g_assemblyGraph->resetAllNodeColours();

std::vector<DeBruijnNode *> selectedNodes = m_scene->getSelectedNodes();
if (selectedNodes.size() > 0)
Expand Down Expand Up @@ -2228,7 +2227,11 @@ void MainWindow::removeSelection()

g_assemblyGraph->determineGraphInfo();
displayGraphDetails();

//Now that the graph has changed, we have to reset BLAST and contiguity
//stuff, as they may no longer apply.
cleanUpAllBlast();
g_assemblyGraph->resetNodeContiguityStatus();
}


Expand Down Expand Up @@ -2259,7 +2262,11 @@ void MainWindow::duplicateSelectedNodes()

g_assemblyGraph->determineGraphInfo();
displayGraphDetails();

//Now that the graph has changed, we have to reset BLAST and contiguity
//stuff, as they may no longer apply.
cleanUpAllBlast();
g_assemblyGraph->resetNodeContiguityStatus();
}

void MainWindow::mergeSelectedNodes()
Expand Down Expand Up @@ -2300,7 +2307,11 @@ void MainWindow::mergeSelectedNodes()

g_assemblyGraph->determineGraphInfo();
displayGraphDetails();

//Now that the graph has changed, we have to reset BLAST and contiguity
//stuff, as they may no longer apply.
cleanUpAllBlast();
g_assemblyGraph->resetNodeContiguityStatus();
}

void MainWindow::mergeAllPossible()
Expand Down Expand Up @@ -2328,7 +2339,11 @@ void MainWindow::mergeAllPossible()
{
g_assemblyGraph->determineGraphInfo();
displayGraphDetails();

//Now that the graph has changed, we have to reset BLAST and contiguity
//stuff, as they may no longer apply.
cleanUpAllBlast();
g_assemblyGraph->resetNodeContiguityStatus();
}
else
QMessageBox::information(this, "No possible merges", "The graph contains no nodes that can be merged.");
Expand Down

0 comments on commit e8cbf8b

Please sign in to comment.