//This constructor reads a distance matrix file and stores the data in the matrix.
FullMatrix::FullMatrix(ifstream& filehandle) {
try{
+ m = MothurOut::getInstance();
globaldata = GlobalData::getInstance();
groupmap = globaldata->gGroupmap;
matrix[i].resize(numSeqs, 0.0);
}
group = groupmap->getGroup(name);
- if(group == "not found") { mothurOut("Error: Sequence '" + name + "' was not found in the group file, please correct."); mothurOutEndLine(); exit(1); }
+ if(group == "not found") { m->mothurOut("Error: Sequence '" + name + "' was not found in the group file, please correct."); m->mothurOutEndLine(); exit(1); }
index.resize(numSeqs);
index[0].seqName = name;
index[0].groupName = group;
}
catch(exception& e) {
- errorOut(e, "FullMatrix", "FullMatrix");
+ m->errorOut(e, "FullMatrix", "FullMatrix");
exit(1);
}
}
index[i].seqName = name;
index[i].groupName = group;
- if(group == "not found") { mothurOut("Error: Sequence '" + name + "' was not found in the group file, please correct."); mothurOutEndLine(); exit(1); }
+ if(group == "not found") { m->mothurOut("Error: Sequence '" + name + "' was not found in the group file, please correct."); m->mothurOutEndLine(); exit(1); }
for(int j=0;j<numSeqs;j++){
filehandle >> matrix[i][j];
delete reading;
}
catch(exception& e) {
- errorOut(e, "FullMatrix", "readSquareMatrix");
+ m->errorOut(e, "FullMatrix", "readSquareMatrix");
exit(1);
}
}
index[i].seqName = name;
index[i].groupName = group;
- if(group == "not found") { mothurOut("Error: Sequence '" + name + "' was not found in the group file, please correct."); mothurOutEndLine(); exit(1); }
+ if(group == "not found") { m->mothurOut("Error: Sequence '" + name + "' was not found in the group file, please correct."); m->mothurOutEndLine(); exit(1); }
for(int j=0;j<i;j++){
filehandle >> distance;
delete reading;
}
catch(exception& e) {
- errorOut(e, "FullMatrix", "readLTMatrix");
+ m->errorOut(e, "FullMatrix", "readLTMatrix");
exit(1);
}
}
}
catch(exception& e) {
- errorOut(e, "FullMatrix", "sortGroups");
+ m->errorOut(e, "FullMatrix", "sortGroups");
exit(1);
}
}
}
catch(exception& e) {
- errorOut(e, "FullMatrix", "swapRows");
+ m->errorOut(e, "FullMatrix", "swapRows");
exit(1);
}
}
for (int i = 0; i < numSeqs; i++) { out << i << '\t' << index[i].seqName << endl; }
}
catch(exception& e) {
- errorOut(e, "FullMatrix", "printMatrix");
+ m->errorOut(e, "FullMatrix", "printMatrix");
exit(1);
}
}