+ if ((commandName == "collect.single") || (commandName == "rarefaction.single") || (commandName == "summary.single")){
+ if ((globaldata->getListFile() == "") && (globaldata->getRabundFile() == "") && (globaldata->getSabundFile() == "")) { cout << "You must read a list, sabund or rabund before you can use the collect.single, rarefaction.single or summary.single commands." << endl; return false; }
+ }
+
+ if (commandName == "get.rabund") {
+ if (globaldata->getListFile() == "") { cout << "You must read a listfile before you can use the get.rabund command." << endl; return false; }
+ }
+
+ if (commandName == "get.sabund") {
+ if ((globaldata->getListFile() == "") && (globaldata->getRabundFile() == "")) { cout << "You must read a list or rabund before you can use the get.sabund command." << endl; return false; }
+ }
+
+ if ((commandName == "collect.shared") || (commandName == "rarefaction.shared") || (commandName == "summary.shared") || (commandName == "bootstrap.shared") || (commandName == "dist.shared")){
+ if (globaldata->getSharedFile() == "") {
+ if (globaldata->getListFile() == "") { cout << "You must read a list and a group, or a shared before you can use the collect.shared, rarefaction.shared, summary.shared, tree.shared, bootstrap.shared or dist.shared commands." << endl; return false; }
+ else if (globaldata->getGroupFile() == "") { cout << "You must read a list and a group, or a shared before you can use the collect.shared, rarefaction.shared, summary.shared, tree.shared, bootstrap.shared or dist.shared commands." << endl; return false; }
+ }
+ }
+
+ if (commandName == "tree.shared") {
+ //given no files
+ if ((globaldata->getSharedFile() == "") && ((phylipfile == "") && (columnfile == ""))) { cout << "You must run the read.otu command or provide a distance file before running the tree.shared command." << endl; return false; }
+ //you want to do single commands
+ else if ((globaldata->getSharedFile() == "") && ((phylipfile != "") || (columnfile != ""))) {
+ validateReadDist();
+ }
+ }
+
+ if ((commandName == "heatmap") || (commandName == "venn")) {
+ if ((globaldata->getListFile() == "") && (globaldata->getSharedFile() == "")) {
+ cout << "You must read a list, or a list and a group, or a shared before you can use the heatmap or venn commands." << endl; return false;
+ }
+ }
+
+ if (commandName == "filter.seqs") {
+ if (fastafile == "") {
+ cout << "You must enter either a fasta file before you can use the filter.seqs command." << endl; return false;
+ }
+ validateReadFiles();
+ }
+
+ if (commandName == "dist.seqs") {
+ if (fastafile == "") {
+ cout << "You must enter either a fasta file before you can use the dist.seqs command." << endl; return false;
+ }else {
+ ifstream filehandle;
+ int ableToOpen = openInputFile(fastafile, filehandle);
+ filehandle.close();
+ //unable to open
+ if (ableToOpen == 1) { return false; }
+ }
+ }
+
+ if (commandName == "align.seqs") {
+ if ((fastafile == "") || (candidatefile == "")) {
+ cout << "You must enter fasta and a candidate file to use the align.seqs command." << endl; return false;
+ }
+ validateReadFiles();
+
+ ifstream filehandle;
+ int ableToOpen = openInputFile(candidatefile, filehandle);
+ filehandle.close();
+ //unable to open
+ if (ableToOpen == 1) { return false; }