X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=mgclustercommand.cpp;h=9a1ac215388e09e6477fffa034e0542c38c208b1;hb=ccaad73f103d8f105264d65491ce19e5df80477d;hp=b92927b1d3d51c0505fbcadd14231eade34b78e5;hpb=a8367302932de9be5434e77f6e5829d7609e2aec;p=mothur.git diff --git a/mgclustercommand.cpp b/mgclustercommand.cpp index b92927b..9a1ac21 100644 --- a/mgclustercommand.cpp +++ b/mgclustercommand.cpp @@ -500,13 +500,16 @@ ListVector* MGClusterCommand::mergeOPFs(map binInfo, float dist){ float overlapDistance; inOverlap >> firstName >> secondName >> overlapDistance; gobble(inOverlap); - map::iterator itA = nameMap->find(firstName); - map::iterator itB = nameMap->find(secondName); - if(itA == nameMap->end()){ cerr << "AAError: Sequence '" << firstName << "' was not found in the names file, please correct\n"; exit(1); } - if(itB == nameMap->end()){ cerr << "ABError: Sequence '" << secondName << "' was not found in the names file, please correct\n"; exit(1); } + //commented out because we check this in readblast already + //map::iterator itA = nameMap->find(firstName); + //map::iterator itB = nameMap->find(secondName); + //if(itA == nameMap->end()){ cerr << "AAError: Sequence '" << firstName << "' was not found in the names file, please correct\n"; exit(1); } + //if(itB == nameMap->end()){ cerr << "ABError: Sequence '" << secondName << "' was not found in the names file, please correct\n"; exit(1); } - overlapNode.seq1 = itA->second; - overlapNode.seq2 = itB->second; + //overlapNode.seq1 = itA->second; + //overlapNode.seq2 = itB->second; + overlapNode.seq1 = nameMap->get(firstName); + overlapNode.seq2 = nameMap->get(secondName); overlapNode.dist = overlapDistance; }else { inOverlap.close(); break; } } @@ -517,14 +520,17 @@ ListVector* MGClusterCommand::mergeOPFs(map binInfo, float dist){ string name2 = nameMap->get(overlapNode.seq2); //use binInfo to find out if they are already in the same bin - map::iterator itBin1 = binInfo.find(name1); - map::iterator itBin2 = binInfo.find(name2); + //map::iterator itBin1 = binInfo.find(name1); + //map::iterator itBin2 = binInfo.find(name2); - if(itBin1 == binInfo.end()){ cerr << "AAError: Sequence '" << name1 << "' does not have any bin info.\n"; exit(1); } - if(itBin2 == binInfo.end()){ cerr << "ABError: Sequence '" << name2 << "' does not have any bin info.\n"; exit(1); } + //if(itBin1 == binInfo.end()){ cerr << "AAError: Sequence '" << name1 << "' does not have any bin info.\n"; exit(1); } + //if(itBin2 == binInfo.end()){ cerr << "ABError: Sequence '" << name2 << "' does not have any bin info.\n"; exit(1); } - int binKeep = itBin1->second; - int binRemove = itBin2->second; + //int binKeep = itBin1->second; + //int binRemove = itBin2->second; + + int binKeep = binInfo[name1]; + int binRemove = binInfo[name2]; //if not merge bins and update binInfo if(binKeep != binRemove) {