+ //check to make sure all parameters are valid for command
+ for (map<string, string>::iterator it = parameters.begin(); it != parameters.end(); it++) {
+ if (validParameter.isValidParameter(it->first, myArray, it->second) != true) { abort = true; }
+ }
+
+ globaldata->newRead();
+
+ //check for required parameters
+ treefile = validParameter.validFile(parameters, "tree", true);
+ if (treefile == "not open") { abort = true; }
+ else if (treefile == "not found") { treefile = ""; mothurOut("tree is a required parameter for the read.tree command."); mothurOutEndLine(); abort = true; }
+ else { globaldata->setTreeFile(treefile); globaldata->setFormat("tree"); }
+
+ groupfile = validParameter.validFile(parameters, "group", true);
+ if (groupfile == "not open") { abort = true; }
+ else if (groupfile == "not found") { groupfile = ""; mothurOut("group is a required parameter for the read.tree command."); mothurOutEndLine(); abort = true; }
+ else {
+ globaldata->setGroupFile(groupfile);
+ //read in group map info.
+ treeMap = new TreeMap(groupfile);
+ treeMap->readMap();
+ globaldata->gTreemap = treeMap;
+ }
+
+ if (abort == false) {
+ filename = treefile;
+ read = new ReadNewickTree(filename);
+ }
+
+ }