]> git.donarmstrong.com Git - mothur.git/blobdiff - shhhercommand.cpp
changing command name classify.shared to classifyrf.shared
[mothur.git] / shhhercommand.cpp
index 9bd437ad3cb7b2a75b69770769c8ddbc942f4a35..4a6e5ff2375ce40560db1aa706edbdacefac0e0d 100644 (file)
@@ -266,7 +266,17 @@ ShhherCommand::ShhherCommand(string option) {
                        string temp;
                        temp = validParameter.validFile(parameters, "lookup", true);
                        if (temp == "not found")        {       
-                               lookupFileName = "LookUp_Titanium.pat"; 
+                               string path = m->argv;
+                string tempPath = path;
+                for (int i = 0; i < path.length(); i++) { tempPath[i] = tolower(path[i]); }
+                path = path.substr(0, (tempPath.find_last_of('m')));
+                
+#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
+                path += "lookupFiles/";
+#else
+                path += "lookupFiles\\";
+#endif
+                               lookupFileName = m->getFullPathName(path) + "LookUp_Titanium.pat";
                                
                                int ableToOpen;
                                ifstream in;
@@ -276,7 +286,7 @@ ShhherCommand::ShhherCommand(string option) {
                                //if you can't open it, try input location
                                if (ableToOpen == 1) {
                                        if (inputDir != "") { //default path is set
-                                               string tryPath = inputDir + lookupFileName;
+                                               string tryPath = inputDir + m->getSimpleName(lookupFileName);
                                                m->mothurOut("Unable to open " + lookupFileName + ". Trying input directory " + tryPath); m->mothurOutEndLine();
                                                ifstream in2;
                                                ableToOpen = m->openInputFile(tryPath, in2, "noerror");
@@ -324,7 +334,7 @@ ShhherCommand::ShhherCommand(string option) {
                                for (int i = 0; i < exepath.length(); i++) { tempPath[i] = tolower(exepath[i]); }
                                exepath = exepath.substr(0, (tempPath.find_last_of('m')));
                                        
-                               string tryPath = m->getFullPathName(exepath) + lookupFileName;
+                               string tryPath = m->getFullPathName(exepath) + m->getSimpleName(lookupFileName);
                                m->mothurOut("Unable to open " + lookupFileName + ". Trying mothur's executable location " + tryPath); m->mothurOutEndLine();
                                ifstream in2;
                                int ableToOpen = m->openInputFile(tryPath, in2, "noerror");
@@ -2727,7 +2737,8 @@ int ShhherCommand::cluster(string filename, string distFileName, string namesFil
         
                RAbundVector* rabund = new RAbundVector(list->getRAbundVector());
                
-               Cluster* cluster = new CompleteLinkage(rabund, list, matrix, cutoff, "furthest"); 
+        float adjust = -1.0;
+               Cluster* cluster = new CompleteLinkage(rabund, list, matrix, cutoff, "furthest", adjust);
                string tag = cluster->getTag();
                
                double clusterCutoff = cutoff;