| 920 | }; |
| 921 | |
| 922 | static void |
| 923 | processGraph( |
| 924 | const Resolution& resolution, |
| 925 | ImaginaryContigPaths& supportedPaths, |
| 926 | ImaginaryContigPaths& unsupportedPaths) |
| 927 | { |
| 928 | progressStart("New paths and vertices setup", resolution.repeatSupportMap.size() * 3); |
| 929 | |
| 930 | assert(!resolution.failed); |
| 931 | |
| 932 | std::vector<OldEdge> edges2remove; |
| 933 | std::vector<NewEdge> edges2add; |
| 934 | std::vector<NewVertex> vertices2add; |
| 935 | |
| 936 | std::map<int, std::vector<RepeatInstance>> repeatInstancesMap; |
| 937 | |
| 938 | size_t lastId = num_vertices(g_contigGraph) / 2; |
| 939 | |
| 940 | const auto start = resolution.repeatSupportMap.begin(); |
| 941 | const auto end = resolution.repeatSupportMap.end(); |
| 942 | |
| 943 | #ifdef _OPENMP |
| 944 | int threads = omp_get_num_threads(); |
| 945 | #else |
| 946 | int threads = 1; |
| 947 | #endif |
| 948 | |
| 949 | // 1 |
| 950 | iteratorMultithreading( |
| 951 | start, |
| 952 | end, |
| 953 | [&](const std::pair<int, SupportMap>& repeatSupport) { |
| 954 | (void)repeatSupport; |
| 955 | return true; |
| 956 | }, |
| 957 | [&](const std::pair<int, SupportMap>& repeatSupport) { |
| 958 | const auto repeat = ContigNode(repeatSupport.first); |
| 959 | const auto& supportMap = repeatSupport.second; |
| 960 | |
| 961 | #pragma omp critical(repeatInstancesMap) |
| 962 | { |
| 963 | repeatInstancesMap.emplace(repeat.index(), std::vector<RepeatInstance>()); |
| 964 | repeatInstancesMap.emplace((repeat ^ true).index(), std::vector<RepeatInstance>()); |
| 965 | } |
| 966 | |
| 967 | for (const auto& intigIdxAndOutigsSupp : supportMap) { |
| 968 | const auto intig = ContigNode(intigIdxAndOutigsSupp.first); |
| 969 | for (const auto& outigIdxAndSupp : intigIdxAndOutigsSupp.second) { |
| 970 | const auto outig = ContigNode(outigIdxAndSupp.first); |
| 971 | const auto& support = outigIdxAndSupp.second; |
| 972 | int dist1 = distanceBetween(intig, repeat); |
| 973 | int dist2 = distanceBetween(repeat, outig); |
| 974 | |
| 975 | ImaginaryContigPath path = { { intig, 0 }, |
| 976 | { repeat, dist1 }, |
| 977 | { outig, dist2 } }; |
| 978 | |
| 979 | if (support.good()) { |
no test coverage detected