X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=amovacommand.cpp;fp=amovacommand.cpp;h=74fbda7ff6164128551bead9cfb4c8bfabb7ba0e;hb=f6c7165727bc17a5fbbcbb774d75ccffeb7f3da5;hp=b9b5deeb5e670ef2f119eb09bded37ab870efe4d;hpb=85bf2e965f12d609c751763883b2224e6951eeba;p=mothur.git diff --git a/amovacommand.cpp b/amovacommand.cpp index b9b5dee..74fbda7 100644 --- a/amovacommand.cpp +++ b/amovacommand.cpp @@ -115,12 +115,12 @@ AmovaCommand::AmovaCommand(string option) { phylipFileName = validParameter.validFile(parameters, "phylip", true); if (phylipFileName == "not open") { phylipFileName = ""; abort = true; } - else if (phylipFileName == "not found") { phylipFileName = ""; } - else if (designFileName == "not found") { - designFileName = ""; - m->mothurOut("You must provide an phylip file."); - m->mothurOutEndLine(); - abort = true; + else if (phylipFileName == "not found") { + phylipFileName = ""; + + //check currentFiles for a phylip file + if (currentFiles->getPhylipFile() != "") { phylipFileName = currentFiles->getPhylipFile(); m->mothurOut("Using " + phylipFileName + " as phylip file."); m->mothurOutEndLine(); + }else { m->mothurOut("You must provide an phylip file."); m->mothurOutEndLine(); abort = true; } } //check for required parameters @@ -128,9 +128,10 @@ AmovaCommand::AmovaCommand(string option) { if (designFileName == "not open") { abort = true; } else if (designFileName == "not found") { designFileName = ""; - m->mothurOut("You must provide an design file."); - m->mothurOutEndLine(); - abort = true; + + //check currentFiles for a design file + if (currentFiles->getDesignFile() != "") { designFileName = currentFiles->getPhylipFile(); m->mothurOut("Using " + designFileName + " as phylip file."); m->mothurOutEndLine(); + }else { m->mothurOut("You must provide an design file."); m->mothurOutEndLine(); abort = true; } } string temp = validParameter.validFile(parameters, "iters", false);