/***********************************************************************/
ReadCluster::ReadCluster(string distfile, float c, string o, bool s){
- globaldata = GlobalData::getInstance();
m = MothurOut::getInstance();
distFile = distfile;
cutoff = c;
/***********************************************************************/
-int ReadCluster::read(NameAssignment* nameMap){
+int ReadCluster::read(NameAssignment*& nameMap){
try {
if (format == "phylip") { convertPhylip2Column(nameMap); }
}
/***********************************************************************/
-int ReadCluster::convertPhylip2Column(NameAssignment* nameMap){
+int ReadCluster::convertPhylip2Column(NameAssignment*& nameMap){
try {
//convert phylip file to column file
map<int, string> rowToName;
int square, nseqs;
string name;
vector<string> matrixNames;
-
- in >> nseqs >> name;
+
+ string numTest;
+ in >> numTest >> name;
+
+ if (!m->isContainingOnlyDigits(numTest)) { m->mothurOut("[ERROR]: expected a number and got " + numTest + ", quitting."); m->mothurOutEndLine(); exit(1); }
+ else { convert(numTest, nseqs); }
+
rowToName[0] = name;
matrixNames.push_back(name);
for(int i=0;i<matrixNames.size();i++){
nameMap->push_back(matrixNames[i]);
}
- globaldata->nameMap = nameMap;
}