X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=mgclustercommand.cpp;h=1861aa5b5d8c19f547ed90e3ec57866a3b53ecd2;hb=cc19310422f125d6628980bd1148e1e816792382;hp=a845e0bfe080782b2b12d2f1a634925781578d70;hpb=44f3a3c81a34fdee62550d98838a4b421e8df08e;p=mothur.git diff --git a/mgclustercommand.cpp b/mgclustercommand.cpp index a845e0b..1861aa5 100644 --- a/mgclustercommand.cpp +++ b/mgclustercommand.cpp @@ -13,8 +13,8 @@ vector MGClusterCommand::setParameters(){ try { CommandParameter pblast("blast", "InputTypes", "", "", "none", "none", "none",false,true); parameters.push_back(pblast); - CommandParameter pname("name", "InputTypes", "", "", "none", "none", "none",false,false); parameters.push_back(pname); - CommandParameter pcount("count", "InputTypes", "", "", "none", "none", "none",false,false); parameters.push_back(pcount); + CommandParameter pname("name", "InputTypes", "", "", "NameCount", "none", "ColumnName",false,false); parameters.push_back(pname); + CommandParameter pcount("count", "InputTypes", "", "", "NameCount", "none", "none",false,false); parameters.push_back(pcount); CommandParameter plength("length", "Number", "", "5", "", "", "",false,false); parameters.push_back(plength); CommandParameter ppenalty("penalty", "Number", "", "0.10", "", "", "",false,false); parameters.push_back(ppenalty); CommandParameter pcutoff("cutoff", "Number", "", "0.70", "", "", "",false,false); parameters.push_back(pcutoff); @@ -147,6 +147,14 @@ MGClusterCommand::MGClusterCommand(string option) { //if the user has not given a path then, add inputdir. else leave path alone. if (path == "") { parameters["name"] = inputDir + it->second; } } + + it = parameters.find("count"); + //user has given a template file + if(it != parameters.end()){ + path = m->hasPath(it->second); + //if the user has not given a path then, add inputdir. else leave path alone. + if (path == "") { parameters["count"] = inputDir + it->second; } + } } @@ -268,7 +276,9 @@ int MGClusterCommand::execute(){ string sabundFileName = fileroot+ tag + "." + getOutputFileNameTag("sabund"); string rabundFileName = fileroot+ tag + "." + getOutputFileNameTag("rabund"); - string listFileName = fileroot+ tag + "." + getOutputFileNameTag("list"); + string listFileName = fileroot+ tag + "."; + if (countfile != "") { listFileName += "unique_"; } + listFileName += getOutputFileNameTag("list"); if (countfile == "") { m->openOutputFile(sabundFileName, sabundFile); @@ -287,7 +297,7 @@ int MGClusterCommand::execute(){ if (!hclusterWanted) { //get distmatrix and overlap - SparseMatrix* distMatrix = read->getDistMatrix(); + SparseDistanceMatrix* distMatrix = read->getDistMatrix(); overlapMatrix = read->getOverlapMatrix(); //already sorted by read delete read;