MCPcopy Create free account
hub / github.com/BirolLab/abyss / performNetworkDiscoverBubbles

Method performNetworkDiscoverBubbles

Parallel/NetworkSequenceCollection.cpp:945–1007  ·  view source on GitHub ↗

Discover bubbles to pop. */

Source from the content-addressed store, hash-verified

943
944/** Discover bubbles to pop. */
945size_t NetworkSequenceCollection::
946performNetworkDiscoverBubbles()
947{
948 NetworkSequenceCollection* seqCollection = this;
949 Timer timer("NetworkDiscoverBubbles");
950
951 // The branch ids
952 uint64_t branchGroupID = 0;
953 m_finishedGroups.clear();
954
955 // make sure the branch group structure is initially empty
956 assert(m_activeBranchGroups.empty());
957
958 size_t count = 0;
959
960 // Set the cutoffs
961 const unsigned maxNumBranches = 3;
962
963 for (iterator iter = seqCollection->begin();
964 iter != seqCollection->end(); ++iter) {
965 if (iter->second.deleted())
966 continue;
967
968 if (++count % 100000 == 0)
969 logger(1) << "Popping bubbles: " << count << '\n';
970
971 SymbolSetPair extRec = iter->second.extension();
972 for (extDirection dir = SENSE; dir <= ANTISENSE; ++dir) {
973 if (extRec.dir[dir].isAmbiguous()) {
974 BranchGroupMap::iterator groupIter
975 = m_activeBranchGroups.insert(
976 BranchGroupMap::value_type(branchGroupID,
977 BranchGroup(dir, maxNumBranches,
978 iter->first))).first;
979 BranchGroup& group = groupIter->second;
980 AssemblyAlgorithms::initiateBranchGroup(
981 group, iter->first, extRec.dir[dir]);
982 generateExtensionRequests(branchGroupID++,
983 group.begin(), group.end());
984 }
985 }
986
987 // Primitive load balancing
988 if (m_activeBranchGroups.size() > MAX_ACTIVE) {
989 while (m_activeBranchGroups.size() > LOW_ACTIVE) {
990 seqCollection->pumpNetwork();
991 processBranchesDiscoverBubbles();
992 }
993 }
994
995 processBranchesDiscoverBubbles();
996 seqCollection->pumpNetwork();
997 }
998
999 // Wait until the groups finish extending.
1000 while (processBranchesDiscoverBubbles())
1001 seqCollection->pumpNetwork();
1002 assert(m_activeBranchGroups.empty());

Callers

nothing calls this directly

Calls 12

BranchGroupClass · 0.85
initiateBranchGroupFunction · 0.85
deletedMethod · 0.80
extensionMethod · 0.80
clearMethod · 0.45
emptyMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
isAmbiguousMethod · 0.45
insertMethod · 0.45
sizeMethod · 0.45
pumpNetworkMethod · 0.45

Tested by

no test coverage detected