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

Method performNetworkTrim

Parallel/NetworkSequenceCollection.cpp:850–911  ·  view source on GitHub ↗

Distributed trimming function. */

Source from the content-addressed store, hash-verified

848
849/** Distributed trimming function. */
850size_t NetworkSequenceCollection::performNetworkTrim()
851{
852 Timer timer("NetworkTrim");
853 NetworkSequenceCollection* seqCollection = this;
854 size_t numBranchesRemoved = 0;
855
856 // The branch ids
857 uint64_t branchGroupID = 0;
858
859 for (iterator iter = seqCollection->begin();
860 iter != seqCollection->end(); ++iter) {
861 if (iter->second.deleted())
862 continue;
863
864 extDirection dir;
865 // dir will be set to the trimming direction if the sequence
866 // can be trimmed.
867 SeqContiguity status = AssemblyAlgorithms::checkSeqContiguity(
868 *iter, dir);
869 if (status == SC_CONTIGUOUS)
870 continue;
871 else if(status == SC_ISLAND)
872 {
873 seqCollection->mark(iter->first);
874 numBranchesRemoved++;
875 continue;
876 }
877
878 bool inserted = m_activeBranchGroups.insert(
879 BranchGroupMap::value_type(branchGroupID,
880 BranchGroup(dir, 1, iter->first,
881 BranchRecord(dir))))
882 .second;
883 assert(inserted);
884 (void)inserted;
885
886 generateExtensionRequest(branchGroupID, 0, iter->first);
887 branchGroupID++;
888 numBranchesRemoved += processBranchesTrim();
889 seqCollection->pumpNetwork();
890
891 // Primitive load balancing
892 if(m_activeBranchGroups.size() > MAX_ACTIVE)
893 {
894 while(m_activeBranchGroups.size() > LOW_ACTIVE)
895 {
896 seqCollection->pumpNetwork();
897 numBranchesRemoved += processBranchesTrim();
898 }
899 }
900 }
901
902 // Clear out the remaining branches
903 while(!m_activeBranchGroups.empty())
904 {
905 numBranchesRemoved += processBranchesTrim();
906 seqCollection->pumpNetwork();
907 }

Callers

nothing calls this directly

Calls 11

checkSeqContiguityFunction · 0.85
BranchGroupClass · 0.85
BranchRecordClass · 0.85
deletedMethod · 0.80
beginMethod · 0.45
endMethod · 0.45
markMethod · 0.45
insertMethod · 0.45
pumpNetworkMethod · 0.45
sizeMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected