]> git.donarmstrong.com Git - mothur.git/blobdiff - readblast.cpp
fixed cluster.split with average method
[mothur.git] / readblast.cpp
index 49e370836bb2c9e2edd59e99d9835de8acfc5582..4833d0125d8a286e0116be5ae0644c33f5443803 100644 (file)
@@ -169,6 +169,7 @@ int ReadBlast::read(NameAssignment* nameMap) {
                                        map<int, float>::iterator itDist;
                                        for(it=thisRowsBlastScores.begin(); it!=thisRowsBlastScores.end(); it++) {  
                                                distance = 1.0 - (it->second / refScore);
+               
                                                
                                                //do we already have the distance calculated for b->a
                                                map<string,int>::iterator itA = nameMap->find(currentRow);
@@ -176,10 +177,12 @@ int ReadBlast::read(NameAssignment* nameMap) {
                                                
                                                //if we have it then compare
                                                if (itDist != dists[it->first].end()) {
+               if (distance < 0.0) { cout << currentRow << '\t' << nameMap->get(it->first) << '\t' << "score = " << it->second << " refscore = " << refScore << " distance = " << distance << " distance = " << itDist->second << endl;        }
+
                                                        //if you want the minimum blast score ratio, then pick max distance
                                                        if(minWanted) {  distance = max(itDist->second, distance);  }
                                                        else{   distance = min(itDist->second, distance);  }
-                                                       
+
                                                        //is this distance below cutoff
                                                        if (distance < cutoff) {
                                                                if (!hclusterWanted) {
@@ -311,11 +314,15 @@ int ReadBlast::readNames(NameAssignment* nameMap) {
                ifstream in;
                openInputFile(blastfile, in);
                
+               ofstream outName;
+               openOutputFile("tempOutNames", outName);
+               
                //read first line
                in >> prevName;
+       
                for (int i = 0; i < 11; i++) {  in >> hold;  }
                gobble(in);
-               
+                               
                //save name in nameMap
                nameMap->push_back(prevName);
                
@@ -324,6 +331,7 @@ int ReadBlast::readNames(NameAssignment* nameMap) {
                        
                        //read line
                        in >> name;
+       
                        for (int i = 0; i < 11; i++) {  in >> hold;  }
                        gobble(in);