Permalink
Browse files

Updates related files to include blastLocation

  • Loading branch information...
1 parent 3c6e19e commit 2ee0071371a357d218e579b58b1fd5fe5adcac01 @mothur-westcott mothur-westcott committed Aug 15, 2016
@@ -200,8 +200,8 @@ int CatchAllCommand::execute() {
if (abort == true) { if (calledHelp) { return 0; } return 2; }
//get location of catchall
- path = m->argv;
- path = path.substr(0, (path.find_last_of("othur")-5));
+ path = m->mothurProgramPath;
+ //path = path.substr(0, (path.find_last_of("othur")-5));
path = m->getFullPathName(path);
if (m->debug) { m->mothurOut("[DEBUG]: mothur's path = " + path + "\n"); }
@@ -556,10 +556,10 @@ ChimeraUchimeCommand::ChimeraUchimeCommand(string option) {
if (hasGroup && (templatefile != "self")) { m->mothurOut("You have provided a group file and the reference parameter is not set to self. I am not sure what reference you are trying to use, aborting."); m->mothurOutEndLine(); abort=true; }
//look for uchime exe
- 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')));
+ path = m->mothurProgramPath;
+ //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')));
string uchimeCommand;
#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
@@ -510,10 +510,10 @@ ChimeraVsearchCommand::ChimeraVsearchCommand(string option) {
if (hasGroup && (templatefile != "self")) { m->mothurOut("You have provided a group file and the reference parameter is not set to self. I am not sure what reference you are trying to use, aborting."); m->mothurOutEndLine(); abort=true; }
//look for uchime exe
- 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')));
+ path = m->mothurProgramPath;
+ //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')));
string vsearchCommand;
#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
@@ -371,11 +371,11 @@ int ClusterCommand::execute(){
int ClusterCommand::runVsearchCluster(){
try {
- //look for uchime exe
- 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')));
+ //look for vsearch exe
+ string path = m->mothurProgramPath;
+ //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')));
string vsearchCommand;
#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
@@ -1686,10 +1686,10 @@ bool ClusterSplitCommand::findVsearch(){
if (cutoffNotSet) { m->mothurOut("\nYou did not set a cutoff, using 0.03.\n"); cutoff = 0.03; }
//look for uchime exe
- 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')));
+ string path = m->mothurProgramPath;
+ //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')));
string vsearchCommand;
#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
@@ -84,7 +84,7 @@ int GetCommandInfoCommand::execute(){
int numNonHidden = 0;
- out << "mothurLocation=" << m->getFullPathName(m->argv) << endl;
+ out << "mothurLocation=" << m->getFullPathName(m->mothurProgramPath) << endl;
out << "mothurVersion=" << m->getVersion() << endl;
map<string, string> commands = commandFactory->getListCommands();
@@ -2981,10 +2981,10 @@ vector< vector<string> > MakeContigsCommand::readFileNames(string filename){
}
//look for mothur exe
- string mpath = m->argv;
- string tempPath = mpath;
- for (int i = 0; i < mpath.length(); i++) { tempPath[i] = tolower(mpath[i]); }
- mpath = mpath.substr(0, (tempPath.find_last_of('m')));
+ string mpath = m->mothurProgramPath;
+ //string tempPath = mpath;
+ //for (int i = 0; i < mpath.length(); i++) { tempPath[i] = tolower(mpath[i]); }
+ //mpath = mpath.substr(0, (tempPath.find_last_of('m')));
//check to make sure both are able to be opened
ifstream in2;
@@ -293,10 +293,10 @@ SffMultipleCommand::SffMultipleCommand(string option) {
temp = validParameter.validFile(parameters, "lookup", true);
if (temp == "not found") {
- 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')));
+ string path = m->mothurProgramPath;
+ //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/";
@@ -311,10 +311,10 @@ SffMultipleCommand::SffMultipleCommand(string option) {
lookupFileName = validParameter.validFile(parameters, "lookup", false);
//if you can't open it its not inputDir, try mothur excutable location
- string exepath = m->argv;
- string tempPath = exepath;
- for (int i = 0; i < exepath.length(); i++) { tempPath[i] = tolower(exepath[i]); }
- exepath = exepath.substr(0, (tempPath.find_last_of('m')));
+ string exepath = m->mothurProgramPath;
+ //string tempPath = exepath;
+ //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) + m->getSimpleName(lookupFileName);
m->mothurOut("Unable to open " + lookupFileName + ". Trying mothur's executable location " + tryPath); m->mothurOutEndLine();
@@ -231,10 +231,10 @@ ShhherCommand::ShhherCommand(string option) {
//if you can't open it its not in current working directory or inputDir, try mothur excutable location
if (ableToOpen == 1) {
- string exepath = m->argv;
- string tempPath = exepath;
- for (int i = 0; i < exepath.length(); i++) { tempPath[i] = tolower(exepath[i]); }
- exepath = exepath.substr(0, (tempPath.find_last_of('m')));
+ string exepath = m->mothurProgramPath;
+ //string tempPath = exepath;
+ //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) + m->getSimpleName(fName);
m->mothurOut("Unable to open " + fName + ". Trying mothur's executable location " + tryPath); m->mothurOutEndLine();
@@ -261,10 +261,10 @@ ShhherCommand::ShhherCommand(string option) {
string temp;
temp = validParameter.validFile(parameters, "lookup", true);
if (temp == "not found") {
- 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')));
+ string path = m->mothurProgramPath;
+ //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/";
@@ -304,10 +304,10 @@ ShhherCommand::ShhherCommand(string option) {
//if you can't open it its not in current working directory or inputDir, try mothur excutable location
if (ableToOpen == 1) {
- string exepath = m->argv;
- string tempPath = exepath;
- for (int i = 0; i < exepath.length(); i++) { tempPath[i] = tolower(exepath[i]); }
- exepath = exepath.substr(0, (tempPath.find_last_of('m')));
+ string exepath = m->mothurProgramPath;
+ //string tempPath = exepath;
+ //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) + m->getSimpleName(lookupFileName);
m->mothurOut("Unable to open " + lookupFileName + ". Trying mothur's executable location " + tryPath); m->mothurOutEndLine();
@@ -324,10 +324,10 @@ ShhherCommand::ShhherCommand(string option) {
lookupFileName = validParameter.validFile(parameters, "lookup", false);
//if you can't open it its not inputDir, try mothur excutable location
- string exepath = m->argv;
- string tempPath = exepath;
- for (int i = 0; i < exepath.length(); i++) { tempPath[i] = tolower(exepath[i]); }
- exepath = exepath.substr(0, (tempPath.find_last_of('m')));
+ string exepath = m->mothurProgramPath;
+ //string tempPath = exepath;
+ //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) + m->getSimpleName(lookupFileName);
m->mothurOut("Unable to open " + lookupFileName + ". Trying mothur's executable location " + tryPath); m->mothurOutEndLine();
@@ -22,8 +22,7 @@ BlastAlignment::BlastAlignment(float go, float ge, float ma, float mm) :
match(ma), // This is the score to award for two nucleotides matching (match >= 0)
mismatch(mm) // This is the penalty to assess for a mismatch (mismatch <= 0)
{
- path = m->argv;
- path = path.substr(0, (path.find_last_of('m')));
+ path = m->getBlastPath();
gapOpen = abs(go); // This is the penalty to assess for opening a gap (gapOpen >= 0)
gapExtend = abs(ge); // This is the penalty to assess for extending a gap (gapExtend >= 0)
@@ -33,10 +33,10 @@ gapOpen(gO), gapExtend(gE), match(mm), misMatch(mM) {
//make sure blast exists in the write place
if (path == "") {
- 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')));
+ path = m->getBlastPath();
+ //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 += "blast/bin/";
@@ -87,7 +87,7 @@ gapOpen(gO), gapExtend(gE), match(mm), misMatch(mM) {
megablastCommand = m->getFullPathName(megablastCommand);
ableToOpen = m->openInputFile(megablastCommand, in3, "no error"); in3.close();
if(ableToOpen == 1) { m->mothurOut("[ERROR]: " + megablastCommand + " file does not exist. mothur requires megablast.exe."); m->mothurOutEndLine(); m->control_pressed = true; }
-
+
}
catch(exception& e) {
m->errorOut(e, "BlastDB", "BlastDB");
@@ -105,10 +105,10 @@ BlastDB::BlastDB(string b, int tid) : Database() {
//make sure blast exists in the write place
if (path == "") {
- 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')));
+ path = m->getBlastPath();
+ //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 += "blast/bin/";
View
@@ -36,8 +36,10 @@ InteractEngine::InteractEngine(string path){
//this will happen if you set the path variable to contain mothur's exe location
if (temppath == "") { path = mout->findProgramPath("mothur"); }
+ else { path = temppath; }
- mout->argv = path;
+ mout->mothurProgramPath = mout->getFullPathName(path);
+ mout->setBlastPath(mout->mothurProgramPath);
//if you haven't set your own location
#ifdef MOTHUR_FILES
@@ -173,8 +175,10 @@ BatchEngine::BatchEngine(string path, string batchFileName){
//this will happen if you set the path variable to contain mothur's exe location
if (temppath == "") { path = mout->findProgramPath("mothur"); }
+ else { path = temppath; }
- mout->argv = path;
+ mout->mothurProgramPath = mout->getFullPathName(path);
+ mout->setBlastPath(mout->mothurProgramPath);
//if you haven't set your own location
#ifdef MOTHUR_FILES
@@ -308,8 +312,10 @@ ScriptEngine::ScriptEngine(string path, string commandString){
//this will happen if you set the path variable to contain mothur's exe location
if (temppath == "") { path = mout->findProgramPath("mothur"); }
+ else { path = temppath; }
- mout->argv = path;
+ mout->mothurProgramPath = mout->getFullPathName(path);
+ mout->setBlastPath(mout->mothurProgramPath);
//if you haven't set your own location
#ifdef MOTHUR_FILES
View
@@ -247,11 +247,11 @@ string ValidParameters::validFile(map<string, string>& container, string paramet
//if you can't open it, try mothur's location
if (ableToOpen == 1) {
- //look for uchime exe
- string mpath = m->argv;
- string tempPath = mpath;
- for (int i = 0; i < mpath.length(); i++) { tempPath[i] = tolower(mpath[i]); }
- mpath = mpath.substr(0, (tempPath.find_last_of('m')));
+ //look for mothurs exe
+ string mpath = m->mothurProgramPath;
+ //string tempPath = mpath;
+ //for (int i = 0; i < mpath.length(); i++) { tempPath[i] = tolower(mpath[i]); }
+ //mpath = mpath.substr(0, (tempPath.find_last_of('m')));
string tryPath = mpath + m->getSimpleName(it->second);
m->mothurOut("Unable to open " + it->second + ". Trying mothur's location " + tryPath); m->mothurOutEndLine();

0 comments on commit 2ee0071

Please sign in to comment.