X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=validparameter.cpp;fp=validparameter.cpp;h=7855ddedd11f05b8e8c628e2d5c49c82be646a9b;hb=10c8178dc5e3f96ef8e92a986f1eddd13e622173;hp=4b263b491c59c0cd14abaf0d4553ffa20fdd26f6;hpb=0e051b4cfda410b0d441da6ff2f96d4bbe1d9e5a;p=mothur.git diff --git a/validparameter.cpp b/validparameter.cpp index 4b263b4..7855dde 100644 --- a/validparameter.cpp +++ b/validparameter.cpp @@ -291,6 +291,18 @@ string ValidParameters::validFile(map& container, string paramet m->mothurOut("Unable to open " + container[parameter]); m->mothurOutEndLine(); return "not open"; } + + //check phylip file to make sure its really phylip and not column + if ((it->first == "phylip") && (ableToOpen != 1)) { + ifstream inPhylip; + m->openInputFile(it->second, inPhylip); + + string numTest, name; + inPhylip >> numTest >> name; + inPhylip.close(); + + if (!m->isContainingOnlyDigits(numTest)) { m->mothurOut("[ERROR]: expected a number and got " + numTest + ". I suspect you entered a column formatted file as a phylip file, aborting."); m->mothurOutEndLine(); return "not found"; } + } } }else { return "not found"; }