match(m), // 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)
{
+ globaldata = GlobalData::getInstance();
+ path = globaldata->argv;
+ path = path.substr(0, (path.find_last_of('m')));
+
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)
// The blastCommand assumes that we have DNA sequences (blastn) and that they are fairly similar (-e 0.001) and
// that we don't want to apply any kind of complexity filtering (-F F)
- string blastCommand = "~/Pipeline/src/cpp/production/blast/bin/bl2seq -p blastn -i " + candidateFileName + " -j " + templateFileName + " -e 0.0001 -F F -o " + blastFileName + " -W 11";
+ string blastCommand = path + "blast/bin/bl2seq -p blastn -i " + candidateFileName + " -j " + templateFileName + " -e 0.0001 -F F -o " + blastFileName + " -W 11";
blastCommand += " -r " + toString(match) + " -q " + toString(mismatch);
blastCommand += " -G " + toString(gapOpen) + " -E " + toString(gapExtend);
*/
#include "mothur.h"
+#include "globaldata.hpp"
class BlastAlignment : public Alignment {
string candidateFileName;
string templateFileName;
string blastFileName;
+ string path;
void setPairwiseSeqs();
float match;
float mismatch;
float gapOpen;
float gapExtend;
+ GlobalData* globaldata;
};
BlastDB::BlastDB(string fastaFileName, float gO, float gE, float m, float mM) : Database(fastaFileName),
gapOpen(gO), gapExtend(gE), match(m), misMatch(mM) {
-
+
+ globaldata = GlobalData::getInstance();
+
cout << "Generating the temporary BLAST database...\t"; cout.flush();
int randNumber = rand();
}
unalignedFastaFile.close();
- string formatdbCommand = "~/Pipeline/src/cpp/production/blast/bin/formatdb -p F -o T -i " + dbFileName; // format the database, -o option gives us the ability
+ path = globaldata->argv;
+ path = path.substr(0, (path.find_last_of('m')));
+
+ string formatdbCommand = path + "blast/bin/formatdb -p F -o T -i " + dbFileName; // format the database, -o option gives us the ability
system(formatdbCommand.c_str()); // to get the right sequence names, i think. -p F
// option tells formatdb that seqs are DNA, not prot
cout << "DONE." << endl << endl; cout.flush();
// wordsize used in megablast. I'm sure we're sacrificing accuracy for speed, but anyother way would take way too
// long. With this setting, it seems comparable in speed to the suffix tree approach.
- string blastCommand = "~/Pipeline/src/cpp/production/blast/bin/blastall -p blastn -d " + dbFileName + " -b 1 -m 8 -W 28";
+ string blastCommand = path + "blast/bin/blastall -p blastn -d " + dbFileName + " -b 1 -m 8 -W 28";
blastCommand += (" -i " + queryFileName + " -o " + blastFileName);
system(blastCommand.c_str());
*/
#include "mothur.h"
+#include "globaldata.hpp"
class BlastDB : public Database {
public:
string dbFileName;
string queryFileName;
string blastFileName;
+ string path;
float gapOpen;
float gapExtend;
float match;
float misMatch;
Sequence* emptySequence;
+ GlobalData* globaldata;
};
#endif
/***********************************************************************/
-InteractEngine::InteractEngine(){
+InteractEngine::InteractEngine(string path){
globaldata = GlobalData::getInstance();
-
+ globaldata->argv = path;
+
system("clear");
// char buffer = ' ';
// ifstream header("introtext.txt");
/***********************************************************************/
//This function opens the batchfile to be used by BatchEngine::getInput.
-BatchEngine::BatchEngine(string batchFileName){
+BatchEngine::BatchEngine(string path, string batchFileName){
try {
globaldata = GlobalData::getInstance();
openedBatch = openInputFile(batchFileName, inputBatchFile);
+ globaldata->argv = path;
system("clear");
class BatchEngine : public Engine {
public:
- BatchEngine(string);
+ BatchEngine(string, string);
~BatchEngine();
virtual bool getInput();
int openedBatch;
class InteractEngine : public Engine {
public:
- InteractEngine();
+ InteractEngine(string);
~InteractEngine();
virtual bool getInput();
private:
FullMatrix* gMatrix;
TreeMap* gTreemap;
SequenceDB* gSequenceDB;
- string inputFileName, helpRequest, commandName, vertical;
+ string inputFileName, helpRequest, commandName, vertical, argv;
bool allLines;
vector<string> Estimators, Groups; //holds estimators to be used
set<int> lines; //hold lines to be used
bool bail = 0;
if(argc>1){
- mothur = new BatchEngine(argv[1]);
+ mothur = new BatchEngine(argv[0], argv[1]);
}
else{
- mothur = new InteractEngine();
+ mothur = new InteractEngine(argv[0]);
}
while(bail == 0) { bail = mothur->getInput(); }