Skip to content

Commit

Permalink
Add mode3::AssembyGraph::run4.
Browse files Browse the repository at this point in the history
  • Loading branch information
paoloshasta committed Jan 23, 2025
1 parent 31686a7 commit 3c0e701
Show file tree
Hide file tree
Showing 2 changed files with 69 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/mode3-AssemblyGraph.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -389,11 +389,15 @@ class shasta::mode3::AssemblyGraph:
bool assembleSequence,
bool debug);

// Alternate version for testing.
// Alternate versions for testing.
void run3(
uint64_t threadCount,
bool assembleSequence,
bool debug);
void run4(
uint64_t threadCount,
bool assembleSequence,
bool debug);



Expand Down
64 changes: 64 additions & 0 deletions src/mode3-AssemblyGraphDetangle4.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
// Shasta.
#include "mode3-AssemblyGraph.hpp"
#include "AssemblerOptions.hpp"
#include "performanceLog.hpp"
#include "timestamp.hpp"
using namespace shasta;
using namespace mode3;



void AssemblyGraph::run4(
uint64_t threadCount,
bool /* assembleSequence */,
bool debug)
{
cout << "AssemblyGraph::run4 begins for component " << componentId << endl;

SHASTA_ASSERT(std::is_sorted(orientedReadIds.begin(), orientedReadIds.end()));
SHASTA_ASSERT(std::is_sorted(anchorIds.begin(), anchorIds.end()));

write("A");

compress();
for(uint64_t iteration=0; ; iteration ++) {
performanceLog << timestamp << "Iteration " << iteration <<
" of bubble cleanup begins." << endl;
const uint64_t cleanedUpBubbleCount = cleanupBubbles(
debug,
options.assemblyGraphOptions.bubbleCleanupMaxOffset,
options.assemblyGraphOptions.chainTerminalCommonThreshold,
threadCount);
if(cleanedUpBubbleCount == 0) {
break;
}
cout << "Cleaned up " << cleanedUpBubbleCount << " bubbles." << endl;
compressBubbleChains();
compress();
}

expand();
// Using the Bayesian model can sometimes generate adjacent anchor pairs without common reads.
const bool useBayesianModel = true;
write("B");
detangleEdges(false,
options.assemblyGraphOptions.detangleToleranceLow, // Use 1
options.assemblyGraphOptions.detangleToleranceHigh, // Use 3
useBayesianModel,
options.assemblyGraphOptions.epsilon,
options.assemblyGraphOptions.minLogP);
write("C");
while(compressSequentialEdges());
compressBubbleChains();

// Expand, so we can do read following on the AssemblyGraph in the http server.
expand();
write("D");

// Assemble sequence.
assembleAllChainsMultithreaded(
options.assemblyGraphOptions.chainTerminalCommonThreshold,
threadCount);
writeAssemblyDetails();
write("Final", true);
}

0 comments on commit 3c0e701

Please sign in to comment.