//if the users entered no valid calculators don't execute command
if (treeCalculators.size() == 0) { return 0; }
-
- if (format == "sharedfile") {
- read = new ReadOTUFile(globaldata->inputFileName);
- read->read(&*globaldata);
-
- input = globaldata->ginput;
- order = input->getSharedOrderVector();
- }else {
- //you are using a list and a groupfile
- read = new ReadOTUFile(globaldata->inputFileName);
- read->read(&*globaldata);
-
- input = globaldata->ginput;
- SharedList = globaldata->gSharedList;
- order = SharedList->getSharedOrderVector();
- }
+ //read first line
+ read = new ReadOTUFile(globaldata->inputFileName);
+ read->read(&*globaldata);
+ input = globaldata->ginput;
+ order = input->getSharedOrderVector();
+
//set users groups
util->setGroups(globaldata->Groups, globaldata->gGroupmap->namesOfGroups, "treegroup");
numGroups = globaldata->Groups.size();
}
//get next line to process
- if (format == "sharedfile") {
- order = input->getSharedOrderVector();
- }else {
- //you are using a list and a groupfile
- SharedList = input->getSharedListVector(); //get new list vector to process
- if (SharedList != NULL) {
- order = SharedList->getSharedOrderVector(); //gets new order vector with group info.
- }else {
- break;
- }
- }
+ order = input->getSharedOrderVector();
count++;
}
//if the users entered no valid calculators don't execute command
if (cDisplays.size() == 0) { return 0; }
- if (format == "sharedfile") {
- read = new ReadOTUFile(globaldata->inputFileName);
- read->read(&*globaldata);
+ read = new ReadOTUFile(globaldata->inputFileName);
+ read->read(&*globaldata);
- input = globaldata->ginput;
- order = input->getSharedOrderVector();
- }else {
- //you are using a list and a groupfile
- read = new ReadOTUFile(globaldata->inputFileName);
- read->read(&*globaldata);
+ input = globaldata->ginput;
+ order = input->getSharedOrderVector();
- input = globaldata->ginput;
- SharedList = globaldata->gSharedList;
- order = SharedList->getSharedOrderVector();
- }
set<string> orderList;
//set users groups
}
//get next line to process
- if (format == "sharedfile") {
- order = input->getSharedOrderVector();
- }else {
- //you are using a list and a groupfile
- SharedList = input->getSharedListVector(); //get new list vector to process
- if (SharedList != NULL) {
- order = SharedList->getSharedOrderVector(); //gets new order vector with group info.
- }else {
- break;
- }
- }
-
+ order = input->getSharedOrderVector();
count++;
}
set<string>::iterator i;
string GlobalData::getEnds() { return ends; }
string GlobalData::getProcessors() { return processors; }
-void GlobalData::setListFile(string file) { listfile = file; inputFileName = file;}
-void GlobalData::setRabundFile(string file) { rabundfile = file; inputFileName = file;}
-void GlobalData::setSabundFile(string file) { sabundfile = file; inputFileName = file;}
-void GlobalData::setPhylipFile(string file) { phylipfile = file; inputFileName = file;}
-void GlobalData::setColumnFile(string file) { columnfile = file; inputFileName = file;}
+void GlobalData::setListFile(string file) { listfile = file; inputFileName = file;}
+void GlobalData::setGroupFile(string file) { groupfile = file; }
+void GlobalData::setRabundFile(string file) { rabundfile = file; inputFileName = file;}
+void GlobalData::setSabundFile(string file) { sabundfile = file; inputFileName = file;}
+void GlobalData::setPhylipFile(string file) { phylipfile = file; inputFileName = file;}
+void GlobalData::setColumnFile(string file) { columnfile = file; inputFileName = file;}
+void GlobalData::setSharedFile(string file) { sharedfile = file; inputFileName = file; fileroot = file;}
void GlobalData::setNameFile(string file) { namefile = file; }
void GlobalData::setFormat(string Format) { format = Format; }
void GlobalData::setRandomTree(string Random) { randomtree = Random; }
void setListFile(string);
+ void setGroupFile(string file);
void setPhylipFile(string);
void setColumnFile(string);
void setNameFile(string);
void setRabundFile(string);
void setSabundFile(string);
+ void setSharedFile(string);
void setFormat(string);
void setRandomTree(string);
void setGroups(string);
int HeatMapCommand::execute(){
try {
int count = 1;
-
+
if (format == "sharedfile") {
//you have groups
read = new ReadOTUFile(globaldata->inputFileName);
input = globaldata->ginput;
lookup = input->getSharedRAbundVectors();
- }else if (format == "shared") {
- //you are using a list and a groupfile
- read = new ReadOTUFile(globaldata->inputFileName);
- read->read(&*globaldata);
-
- input = globaldata->ginput;
- SharedList = globaldata->gSharedList;
- lookup = SharedList->getSharedRAbundVector();
}else if (format == "list") {
//you are using just a list file and have only one group
read = new ReadOTUFile(globaldata->inputFileName);
//if the users entered no valid calculators don't execute command
if (rDisplays.size() == 0) { return 0; }
- if (format == "sharedfile") {
- read = new ReadOTUFile(globaldata->inputFileName);
- read->read(&*globaldata);
+ read = new ReadOTUFile(globaldata->inputFileName);
+ read->read(&*globaldata);
- input = globaldata->ginput;
- order = input->getSharedOrderVector();
- }else {
- //you are using a list and a groupfile
- read = new ReadOTUFile(globaldata->inputFileName);
- read->read(&*globaldata);
-
- input = globaldata->ginput;
- SharedList = globaldata->gSharedList;
- order = SharedList->getSharedOrderVector();
- }
-
+ input = globaldata->ginput;
+ order = input->getSharedOrderVector();
+
//set users groups
util->setGroups(globaldata->Groups, globaldata->gGroupmap->namesOfGroups, "rarefact");
}
//get next line to process
- if (format == "sharedfile") {
- order = input->getSharedOrderVector();
- }else {
- //you are using a list and a groupfile
- SharedList = input->getSharedListVector(); //get new list vector to process
- if (SharedList != NULL) {
- order = SharedList->getSharedOrderVector(); //gets new order vector with group info.
- }else {
- break;
- }
- }
-
+ order = input->getSharedOrderVector();
count++;
}
parselist = new ParseListCommand();
parselist->execute();
+
+ //change format to shared to speed up commands
+ globaldata->setFormat("sharedfile");
+ globaldata->setListFile("");
+ globaldata->setGroupFile("");
+ globaldata->setSharedFile(getRootName(filename) + "shared");
}
return 0;
}
}
}
- if (format == "sharedfile") {
- read = new ReadOTUFile(globaldata->inputFileName);
- read->read(&*globaldata);
+ read = new ReadOTUFile(globaldata->inputFileName);
+ read->read(&*globaldata);
- input = globaldata->ginput;
- order = input->getSharedOrderVector();
- }else {
- //you are using a list and a groupfile
- read = new ReadOTUFile(globaldata->inputFileName);
- read->read(&*globaldata);
-
- input = globaldata->ginput;
- SharedList = globaldata->gSharedList;
- order = SharedList->getSharedOrderVector();
- }
-
+ input = globaldata->ginput;
+ order = input->getSharedOrderVector();
+
//set users groups
util->setGroups(globaldata->Groups, globaldata->gGroupmap->namesOfGroups, "summary");
}
//get next line to process
- if (format == "sharedfile") {
- order = input->getSharedOrderVector();
- }else {
- //you are using a list and a groupfile
- SharedList = input->getSharedListVector(); //get new list vector to process
- if (SharedList != NULL) {
- order = SharedList->getSharedOrderVector(); //gets new order vector with group info.
- }else {
- break;
- }
- }
+ order = input->getSharedOrderVector();
count++;
}
//if the users entered no valid calculators don't execute command
if (treeCalculators.size() == 0) { return 0; }
- if (format == "sharedfile") {
- //you have groups
- read = new ReadOTUFile(globaldata->inputFileName);
- read->read(&*globaldata);
+ //you have groups
+ read = new ReadOTUFile(globaldata->inputFileName);
+ read->read(&*globaldata);
- input = globaldata->ginput;
- lookup = input->getSharedRAbundVectors();
- }else {
- //you are using a list and a groupfile
- read = new ReadOTUFile(globaldata->inputFileName);
- read->read(&*globaldata);
-
- input = globaldata->ginput;
- SharedList = globaldata->gSharedList;
- lookup = SharedList->getSharedRAbundVector();
- }
-
+ input = globaldata->ginput;
+ lookup = input->getSharedRAbundVectors();
+
if (lookup.size() < 2) { cout << "You have not provided enough valid groups. I cannot run the command." << endl; }
numGroups = globaldata->Groups.size();
input = globaldata->ginput;
lookup = input->getSharedRAbundVectors();
- }else if (format == "shared") {
- //you are using a list and a groupfile
- read = new ReadOTUFile(globaldata->inputFileName);
- read->read(&*globaldata);
-
- input = globaldata->ginput;
- SharedList = globaldata->gSharedList;
- lookup = SharedList->getSharedRAbundVector();
}else if (format == "list") {
//you are using just a list file and have only one group
read = new ReadOTUFile(globaldata->inputFileName);