+ fileHandle.close(); //let's start over
+ D->clear(); //let's start over
+
+ m->openInputFile(distFile, fileHandle); //let's start over
+
+ while(fileHandle){
+ fileHandle >> firstName >> secondName >> distance;
+
+ if (m->control_pressed) { fileHandle.close(); delete reading; return 0; }
+
+ map<string,int>::iterator itA = nameMap->find(firstName);
+ map<string,int>::iterator itB = nameMap->find(secondName);
+
+ if(itA == nameMap->end()){ m->mothurOut("AAError: Sequence '" + firstName + "' was not found in the names file, please correct\n"); exit(1); }
+ if(itB == nameMap->end()){ m->mothurOut("ABError: Sequence '" + secondName + "' was not found in the names file, please correct\n"); exit(1); }
+
+ if (distance == -1) { distance = 1000000; }
+ else if (sim) { distance = 1.0 - distance; } //user has entered a sim matrix that we need to convert.
+
+ if(distance < cutoff && itA->second > itB->second){
+ PCell value(itA->second, itB->second, distance);
+ D->addCell(value);
+ reading->update(itA->second * nseqs);
+ }
+
+ m->gobble(fileHandle);
+ }
+ }
+
+ if (m->control_pressed) { fileHandle.close(); delete reading; return 0; }
+
+ reading->finish();
+ fileHandle.close();
+
+ list->setLabel("0");
+
+ return 1;
+