From e189982e0a9b7352ad57cc38ccee675f128be22e Mon Sep 17 00:00:00 2001 From: westcott Date: Wed, 14 Apr 2010 11:32:59 +0000 Subject: [PATCH] some changes while testing 1.9 --- Mothur.xcodeproj/project.pbxproj | 2 + bayesian.cpp | 21 +- chimeraccodecommand.cpp | 2 +- chimeracheckcommand.cpp | 2 +- chimerapintailcommand.cpp | 4 +- chimeraslayercommand.cpp | 2 +- classifyseqscommand.cpp | 18 +- cluster.cpp | 19 +- clustercommand.cpp | 2 +- filterseqscommand.cpp | 71 +- filterseqscommand.h | 121 ++- getrabundcommand.cpp | 13 +- getsabundcommand.cpp | 9 +- globaldata.cpp | 1 + hclustercommand.cpp | 2 +- heatmapcommand.cpp | 2 +- makefile | 1625 ++++++++++++++++++++++++++++++ mgclustercommand.cpp | 4 +- mothur.cpp | 339 ++++--- mothur.h | 19 +- mothurout.cpp | 298 +++--- mothurout.h | 90 +- nameassignment.cpp | 20 +- parselistscommand.cpp | 2 +- parsesffcommand.cpp | 3 +- phylotree.cpp | 13 +- phylotree.h | 2 +- phylotypecommand.cpp | 2 +- readcluster.cpp | 5 +- readcluster.h | 4 +- readcolumn.cpp | 1 + readotucommand.cpp | 24 +- removeseqscommand.cpp | 12 +- setdircommand.cpp | 1 - sharedrabundvector.cpp | 8 +- sparsematrix.cpp | 2 +- taxonomyequalizer.cpp | 4 +- taxonomyequalizer.h | 4 +- validparameter.cpp | 10 +- 39 files changed, 2231 insertions(+), 552 deletions(-) create mode 100644 makefile diff --git a/Mothur.xcodeproj/project.pbxproj b/Mothur.xcodeproj/project.pbxproj index 24351a0..8fc67bd 100644 --- a/Mothur.xcodeproj/project.pbxproj +++ b/Mothur.xcodeproj/project.pbxproj @@ -11,6 +11,7 @@ A747E79C1163442A00FB9042 /* chimeracheckcommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = chimeracheckcommand.cpp; sourceTree = ""; }; A747E81C116365E000FB9042 /* chimeraslayercommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = chimeraslayercommand.h; sourceTree = ""; }; A747E81D116365E000FB9042 /* chimeraslayercommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = chimeraslayercommand.cpp; sourceTree = ""; }; + A7639F8D1175DF35008F5578 /* makefile */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.make; path = makefile; sourceTree = ""; }; A78254461164D7790002E2DD /* chimerapintailcommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = chimerapintailcommand.h; sourceTree = ""; }; A78254471164D7790002E2DD /* chimerapintailcommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = chimerapintailcommand.cpp; sourceTree = ""; }; A7825502116519F70002E2DD /* chimerabellerophoncommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = chimerabellerophoncommand.h; sourceTree = ""; }; @@ -423,6 +424,7 @@ 08FB7794FE84155DC02AAC07 /* mothur */ = { isa = PBXGroup; children = ( + A7639F8D1175DF35008F5578 /* makefile */, A7DA1FF0113FECD400BF472F /* alignment.cpp */, A7DA1FF1113FECD400BF472F /* alignment.hpp */, A7DA1FF6113FECD400BF472F /* averagelinkage.cpp */, diff --git a/bayesian.cpp b/bayesian.cpp index af1fa27..b007c00 100644 --- a/bayesian.cpp +++ b/bayesian.cpp @@ -33,11 +33,11 @@ Classify(tfile, tempFile, method, ksize, 0.0, 0.0, 0.0, 0.0), kmerSize(ksize), c /************calculate the probablity that each word will be in a specific taxonomy*************/ ofstream out; - string probFileName = tempFile.substr(0,tempFile.find_last_of(".")+1) + char('0'+ kmerSize) + "mer.prob"; + string probFileName = tfile.substr(0,tfile.find_last_of(".")+1) + tempFile.substr(0,tempFile.find_last_of(".")+1) + char('0'+ kmerSize) + "mer.prob"; ifstream probFileTest(probFileName.c_str()); ofstream out2; - string probFileName2 = tempFile.substr(0,tempFile.find_last_of(".")+1) + char('0'+ kmerSize) + "mer.numNonZero"; + string probFileName2 = tfile.substr(0,tfile.find_last_of(".")+1) + tempFile.substr(0,tempFile.find_last_of(".")+1) + char('0'+ kmerSize) + "mer.numNonZero"; ifstream probFileTest2(probFileName2.c_str()); int start = time(NULL); @@ -106,15 +106,21 @@ string Bayesian::getTaxonomy(Sequence* seq) { //get words contained in query //getKmerString returns a string where the index in the string is hte kmer number //and the character at that index can be converted to be the number of times that kmer was seen + string queryKmerString = kmer.getKmerString(seq->getUnaligned()); + vector queryKmers; for (int i = 0; i < queryKmerString.length(); i++) { if (queryKmerString[i] != '!') { //this kmer is in the query queryKmers.push_back(i); + } } - + + if (queryKmers.size() == 0) { m->mothurOut(seq->getName() + "is bad."); m->mothurOutEndLine(); return "bad seq"; } + int index = getMostProbableTaxonomy(queryKmers); + if (m->control_pressed) { return tax; } @@ -171,9 +177,10 @@ string Bayesian::bootstrapResults(vector kmers, int tax, int numToSelect) { }else{ confidenceScores[taxonomy.level][taxonomy.name]++; } - + taxonomy = phyloTree->get(taxonomy.parent); } + } string confidenceTax = ""; @@ -181,7 +188,7 @@ string Bayesian::bootstrapResults(vector kmers, int tax, int numToSelect) { TaxNode seqTax = phyloTree->get(tax); while (seqTax.level != 0) { //while you are not at the root - + itBoot2 = confidenceScores[seqTax.level].find(seqTax.name); //is this a classification we already have a count on int confidence = 0; @@ -197,6 +204,7 @@ string Bayesian::bootstrapResults(vector kmers, int tax, int numToSelect) { seqTax = phyloTree->get(seqTax.parent); } + if (confidenceTax == "") { confidenceTax = "unclassified;"; simpleTax = "unclassified;"; } return confidenceTax; } @@ -208,12 +216,11 @@ string Bayesian::bootstrapResults(vector kmers, int tax, int numToSelect) { /**************************************************************************************************/ int Bayesian::getMostProbableTaxonomy(vector queryKmer) { try { - int indexofGenus; + int indexofGenus = 0; double maxProbability = -1000000.0; //find taxonomy with highest probability that this sequence is from it for (int k = 0; k < genusNodes.size(); k++) { - //for each taxonomy calc its probability double prob = 1.0; for (int i = 0; i < queryKmer.size(); i++) { diff --git a/chimeraccodecommand.cpp b/chimeraccodecommand.cpp index 748163e..a18fd4f 100644 --- a/chimeraccodecommand.cpp +++ b/chimeraccodecommand.cpp @@ -371,7 +371,7 @@ int ChimeraCcodeCommand::execute(){ #else ifstream inFASTA; - openInputFile(candidateFileNames[s], inFASTA); + openInputFile(fastafile, inFASTA); numSeqs=count(istreambuf_iterator(inFASTA),istreambuf_iterator(), '>'); inFASTA.close(); lines.push_back(new linePair(0, numSeqs)); diff --git a/chimeracheckcommand.cpp b/chimeracheckcommand.cpp index ba5e5be..d80cce6 100644 --- a/chimeracheckcommand.cpp +++ b/chimeracheckcommand.cpp @@ -294,7 +294,7 @@ int ChimeraCheckCommand::execute(){ #else ifstream inFASTA; - openInputFile(candidateFileNames[s], inFASTA); + openInputFile(fastafile, inFASTA); numSeqs=count(istreambuf_iterator(inFASTA),istreambuf_iterator(), '>'); inFASTA.close(); lines.push_back(new linePair(0, numSeqs)); diff --git a/chimerapintailcommand.cpp b/chimerapintailcommand.cpp index 919285d..f565fd3 100644 --- a/chimerapintailcommand.cpp +++ b/chimerapintailcommand.cpp @@ -21,7 +21,7 @@ ChimeraPintailCommand::ChimeraPintailCommand(string option) { else { //valid paramters for this command - string Array[] = {"fasta","filter","processors","window" "increment","template","conservation","quantile","mask","outputdir","inputdir"}; + string Array[] = {"fasta","filter","processors","window" ,"increment","template","conservation","quantile","mask","outputdir","inputdir"}; vector myArray (Array, Array+(sizeof(Array)/sizeof(string))); OptionParser parser(option); @@ -381,7 +381,7 @@ int ChimeraPintailCommand::execute(){ #else ifstream inFASTA; - openInputFile(candidateFileNames[s], inFASTA); + openInputFile(fastafile, inFASTA); numSeqs=count(istreambuf_iterator(inFASTA),istreambuf_iterator(), '>'); inFASTA.close(); lines.push_back(new linePair(0, numSeqs)); diff --git a/chimeraslayercommand.cpp b/chimeraslayercommand.cpp index 336dba9..1a5ae09 100644 --- a/chimeraslayercommand.cpp +++ b/chimeraslayercommand.cpp @@ -405,7 +405,7 @@ int ChimeraSlayerCommand::execute(){ #else ifstream inFASTA; - openInputFile(candidateFileNames[s], inFASTA); + openInputFile(fastafile, inFASTA); numSeqs=count(istreambuf_iterator(inFASTA),istreambuf_iterator(), '>'); inFASTA.close(); lines.push_back(new linePair(0, numSeqs)); diff --git a/classifyseqscommand.cpp b/classifyseqscommand.cpp index a9f0a36..26df57f 100644 --- a/classifyseqscommand.cpp +++ b/classifyseqscommand.cpp @@ -313,6 +313,7 @@ int ClassifySeqsCommand::execute(){ for (int i = 0; i < lines.size(); i++) { delete lines[i]; } lines.clear(); #ifdef USE_MPI + int pid, end, numSeqsPerProcessor; int tag = 2001; vector MPIPos; @@ -392,6 +393,7 @@ int ClassifySeqsCommand::execute(){ MPI_File_close(&outMPITempTax); #else + //read namefile if(namefile != "") { nameMap.clear(); //remove old names @@ -469,7 +471,9 @@ int ClassifySeqsCommand::execute(){ driver(lines[0], newTaxonomyFile, tempTaxonomyFile, fastaFileNames[s]); #endif #endif - + + delete classify; + #ifdef USE_MPI if (pid == 0) { //this part does not need to be paralellized #endif @@ -484,6 +488,7 @@ int ClassifySeqsCommand::execute(){ //read in users taxonomy file and add sequences to tree string name, taxon; + while(!in.eof()){ in >> name >> taxon; gobble(in); @@ -561,7 +566,6 @@ int ClassifySeqsCommand::execute(){ m->mothurOut("It took " + toString(time(NULL) - start) + " secs to classify " + toString(numFastaSeqs) + " sequences."); m->mothurOutEndLine(); m->mothurOutEndLine(); } - delete classify; return 0; } catch(exception& e) { @@ -677,13 +681,13 @@ int ClassifySeqsCommand::driver(linePair* line, string taxFName, string tempTFNa if (m->control_pressed) { return 0; } Sequence* candidateSeq = new Sequence(inFASTA); - + if (candidateSeq->getName() != "") { taxonomy = classify->getTaxonomy(candidateSeq); if (m->control_pressed) { delete candidateSeq; return 0; } - if (taxonomy != "bad seq") { + if ((taxonomy != "bad seq") && (taxonomy != "")) { //output confidence scores or not if (probs) { outTax << candidateSeq->getName() << '\t' << taxonomy << endl; @@ -692,7 +696,7 @@ int ClassifySeqsCommand::driver(linePair* line, string taxFName, string tempTFNa } outTaxSimple << candidateSeq->getName() << '\t' << classify->getSimpleTax() << endl; - } + }else{ m->mothurOut("Sequence: " + candidateSeq->getName() + " is bad."); m->mothurOutEndLine(); } } delete candidateSeq; @@ -744,7 +748,7 @@ int ClassifySeqsCommand::driverMPI(int start, int num, MPI_File& inMPI, MPI_File if (candidateSeq->getName() != "") { taxonomy = classify->getTaxonomy(candidateSeq); - if (taxonomy != "bad seq") { + if ((taxonomy != "bad seq") && (taxonomy != "")) { //output confidence scores or not if (probs) { outputString = candidateSeq->getName() + "\t" + taxonomy + "\n"; @@ -764,7 +768,7 @@ int ClassifySeqsCommand::driverMPI(int start, int num, MPI_File& inMPI, MPI_File strcpy(buf, outputString.c_str()); MPI_File_write_shared(tempFile, buf, length, MPI_CHAR, &statusTemp); - } + }else{ cout << "Sequence: " << candidateSeq->getName() << " is bad." << endl; } } delete candidateSeq; diff --git a/cluster.cpp b/cluster.cpp index e2d307e..96ca440 100644 --- a/cluster.cpp +++ b/cluster.cpp @@ -50,14 +50,17 @@ rabund(rav), list(lv), dMatrix(dm), method(f) // a list contains pointers (iterators) to the all distances related // to a certain sequence. The Vector is accessed via the index of a // sequence in the distance matrix. - - +//ofstream outtemp; +//string temp = "temp"; +//openOutputFile(temp, outtemp); +//cout << lv->size() << endl; seqVec = vector(lv->size()); for (MatData currentCell = dMatrix->begin(); currentCell != dMatrix->end(); currentCell++) { +//outtemp << currentCell->row << '\t' << currentCell->column << '\t' << currentCell->dist << endl; seqVec[currentCell->row].push_back(currentCell); seqVec[currentCell->column].push_back(currentCell); } - +//outtemp.close(); mapWanted = false; //set to true by mgcluster to speed up overlap merge //save so you can modify as it changes in average neighbor @@ -74,11 +77,16 @@ void Cluster::getRowColCells() { smallRow = smallCell->row; // get its row smallCol = smallCell->column; // get its column smallDist = smallCell->dist; // get the smallest distance - + //cout << "small row = " << smallRow << "small col = " << smallCol << "small dist = " << smallDist << endl; + rowCells = seqVec[smallRow]; // all distances related to the row index colCells = seqVec[smallCol]; // all distances related to the column index nRowCells = rowCells.size(); nColCells = colCells.size(); +//cout << "num rows = " << nRowCells << "num col = " << nColCells << endl; + + //for (int i = 0; i < nColCells; i++) { cout << colCells[i]->row << '\t' << colCells[i]->column << endl; } + //for (int i = 0; i < nRowCells; i++) { cout << rowCells[i]->row << '\t' << rowCells[i]->column << endl; } } catch(exception& e) { m->errorOut(e, "Cluster", "getRowColCells"); @@ -132,7 +140,9 @@ void Cluster::removeCell(const MatData& cell, int vrow, int vcol, bool rmMatrix) seqVec[dcol].erase(seqVec[dcol].begin()+vcol); if (rmMatrix) { + //cout << " removing = " << cell->row << '\t' << cell->column << '\t' << cell->dist << endl; dMatrix->rmCell(cell); + // cout << "done" << endl; } } @@ -188,6 +198,7 @@ void Cluster::clusterNames(){ void Cluster::update(double& cutOFF){ try { getRowColCells(); +//cout << "got rowcells" << endl; vector foundCol(nColCells, 0); diff --git a/clustercommand.cpp b/clustercommand.cpp index 5e6a9b4..6f6e309 100644 --- a/clustercommand.cpp +++ b/clustercommand.cpp @@ -154,7 +154,7 @@ int ClusterCommand::execute(){ double saveCutoff = cutoff; while (matrix->getSmallDist() < cutoff && matrix->getNNodes() > 0){ - + if (m->control_pressed) { //clean up delete globaldata->gSparseMatrix; globaldata->gSparseMatrix = NULL; delete globaldata->gListVector; globaldata->gListVector = NULL; diff --git a/filterseqscommand.cpp b/filterseqscommand.cpp index 3d3062b..b992750 100644 --- a/filterseqscommand.cpp +++ b/filterseqscommand.cpp @@ -637,40 +637,45 @@ string FilterSeqsCommand::createFilter() { MPI_Status status; MPI_Comm_rank(MPI_COMM_WORLD, &pid); - if (pid == 0) { //only one process should output the filter - vector temp; temp.resize(alignmentLength+1); - - //get the frequencies from the child processes - for(int i = 0; i < ((processors-1)*5); i++) { - MPI_Recv(&temp[0], (alignmentLength+1), MPI_INT, MPI_ANY_SOURCE, 2001, MPI_COMM_WORLD, &status); - int receiveTag = temp[temp.size()-1]; //child process added a int to the end to indicate what letter count this is for - - if (receiveTag == Atag) { //you are recieveing the A frequencies - for (int k = 0; k < alignmentLength; k++) { F.a[k] += temp[k]; } - }else if (receiveTag == Ttag) { //you are recieveing the T frequencies - for (int k = 0; k < alignmentLength; k++) { F.t[k] += temp[k]; } - }else if (receiveTag == Ctag) { //you are recieveing the C frequencies - for (int k = 0; k < alignmentLength; k++) { F.c[k] += temp[k]; } - }else if (receiveTag == Gtag) { //you are recieveing the G frequencies - for (int k = 0; k < alignmentLength; k++) { F.g[k] += temp[k]; } - }else if (receiveTag == Gaptag) { //you are recieveing the gap frequencies - for (int k = 0; k < alignmentLength; k++) { F.gap[k] += temp[k]; } - } - } - }else{ - - //send my fequency counts - F.a.push_back(Atag); - int ierr = MPI_Send(&(F.a[0]), (alignmentLength+1), MPI_INT, 0, 2001, MPI_COMM_WORLD); - F.t.push_back(Ttag); - ierr = MPI_Send (&(F.t[0]), (alignmentLength+1), MPI_INT, 0, 2001, MPI_COMM_WORLD); - F.c.push_back(Ctag); - ierr = MPI_Send(&(F.c[0]), (alignmentLength+1), MPI_INT, 0, 2001, MPI_COMM_WORLD); - F.g.push_back(Gtag); - ierr = MPI_Send(&(F.g[0]), (alignmentLength+1), MPI_INT, 0, 2001, MPI_COMM_WORLD); - F.gap.push_back(Gaptag); - ierr = MPI_Send(&(F.gap[0]), (alignmentLength+1), MPI_INT, 0, 2001, MPI_COMM_WORLD); + if(trump != '*' || isTrue(vertical) || soft != 0){ + + if (pid == 0) { //only one process should output the filter + + vector temp; temp.resize(alignmentLength+1); + + //get the frequencies from the child processes + for(int i = 0; i < ((processors-1)*5); i++) { + MPI_Recv(&temp[0], (alignmentLength+1), MPI_INT, MPI_ANY_SOURCE, 2001, MPI_COMM_WORLD, &status); + int receiveTag = temp[temp.size()-1]; //child process added a int to the end to indicate what letter count this is for + + if (receiveTag == Atag) { //you are recieveing the A frequencies + for (int k = 0; k < alignmentLength; k++) { F.a[k] += temp[k]; } + }else if (receiveTag == Ttag) { //you are recieveing the T frequencies + for (int k = 0; k < alignmentLength; k++) { F.t[k] += temp[k]; } + }else if (receiveTag == Ctag) { //you are recieveing the C frequencies + for (int k = 0; k < alignmentLength; k++) { F.c[k] += temp[k]; } + }else if (receiveTag == Gtag) { //you are recieveing the G frequencies + for (int k = 0; k < alignmentLength; k++) { F.g[k] += temp[k]; } + }else if (receiveTag == Gaptag) { //you are recieveing the gap frequencies + for (int k = 0; k < alignmentLength; k++) { F.gap[k] += temp[k]; } + } + } + }else{ + + //send my fequency counts + F.a.push_back(Atag); + int ierr = MPI_Send(&(F.a[0]), (alignmentLength+1), MPI_INT, 0, 2001, MPI_COMM_WORLD); + F.t.push_back(Ttag); + ierr = MPI_Send (&(F.t[0]), (alignmentLength+1), MPI_INT, 0, 2001, MPI_COMM_WORLD); + F.c.push_back(Ctag); + ierr = MPI_Send(&(F.c[0]), (alignmentLength+1), MPI_INT, 0, 2001, MPI_COMM_WORLD); + F.g.push_back(Gtag); + ierr = MPI_Send(&(F.g[0]), (alignmentLength+1), MPI_INT, 0, 2001, MPI_COMM_WORLD); + F.gap.push_back(Gaptag); + ierr = MPI_Send(&(F.gap[0]), (alignmentLength+1), MPI_INT, 0, 2001, MPI_COMM_WORLD); + } + } if (pid == 0) { //only one process should output the filter diff --git a/filterseqscommand.h b/filterseqscommand.h index 3c46036..848d08a 100644 --- a/filterseqscommand.h +++ b/filterseqscommand.h @@ -1,61 +1,60 @@ -#ifndef FILTERSEQSCOMMAND_H -#define FILTERSEQSCOMMAND_H - -/* - * filterseqscommand.h - * Mothur - * - * Created by Thomas Ryabin on 5/4/09. - * Copyright 2009 Schloss Lab UMASS Amherst. All rights reserved. - * - */ - -#include "command.hpp" -#include "filters.h" -#include "mpi.h" - -class Sequence; -class FilterSeqsCommand : public Command { - -public: - FilterSeqsCommand(string); - ~FilterSeqsCommand() {}; - int execute(); - void help(); - -private: - struct linePair { - int start; - int num; - linePair(long int i, long int j) : start(i), num(j) {} - }; - vector lines; - vector processIDS; - - string vertical, filter, fasta, hard, outputDir, filterFileName; - vector fastafileNames; - int alignmentLength, processors; - vector bufferSizes; - vector outputNames; - - char trump; - bool abort; - float soft; - int numSeqs; - - string createFilter(); - int filterSequences(); - int createProcessesCreateFilter(Filters&, string); - int createProcessesRunFilter(string, string); - int driverRunFilter(string, string, string, linePair*); - int driverCreateFilter(Filters& F, string filename, linePair* line); - #ifdef USE_MPI - int driverMPIRun(int, int, MPI_File&, MPI_File&, vector&); - int MPICreateFilter(int, int, Filters&, MPI_File&, vector&); - #endif - int setLines(string); - - -}; - -#endif +#ifndef FILTERSEQSCOMMAND_H +#define FILTERSEQSCOMMAND_H + +/* + * filterseqscommand.h + * Mothur + * + * Created by Thomas Ryabin on 5/4/09. + * Copyright 2009 Schloss Lab UMASS Amherst. All rights reserved. + * + */ + +#include "command.hpp" +#include "filters.h" + +class Sequence; +class FilterSeqsCommand : public Command { + +public: + FilterSeqsCommand(string); + ~FilterSeqsCommand() {}; + int execute(); + void help(); + +private: + struct linePair { + int start; + int num; + linePair(long int i, long int j) : start(i), num(j) {} + }; + vector lines; + vector processIDS; + + string vertical, filter, fasta, hard, outputDir, filterFileName; + vector fastafileNames; + int alignmentLength, processors; + vector bufferSizes; + vector outputNames; + + char trump; + bool abort; + float soft; + int numSeqs; + + string createFilter(); + int filterSequences(); + int createProcessesCreateFilter(Filters&, string); + int createProcessesRunFilter(string, string); + int driverRunFilter(string, string, string, linePair*); + int driverCreateFilter(Filters& F, string filename, linePair* line); + #ifdef USE_MPI + int driverMPIRun(int, int, MPI_File&, MPI_File&, vector&); + int MPICreateFilter(int, int, Filters&, MPI_File&, vector&); + #endif + int setLines(string); + + +}; + +#endif diff --git a/getrabundcommand.cpp b/getrabundcommand.cpp index 6b68c32..b665c88 100644 --- a/getrabundcommand.cpp +++ b/getrabundcommand.cpp @@ -120,7 +120,7 @@ int GetRAbundCommand::execute(){ set processedLabels; set userLabels = labels; - if (m->control_pressed) { out.close(); remove(filename.c_str()); delete read; delete input; delete list; globaldata->gListVector = NULL; return 0; } + if (m->control_pressed) { out.close(); remove(filename.c_str()); delete list; globaldata->gListVector = NULL; return 0; } while((list != NULL) && ((allLines == 1) || (userLabels.size() != 0))) { @@ -129,7 +129,7 @@ int GetRAbundCommand::execute(){ rabund = new RAbundVector(); *rabund = (list->getRAbundVector()); - if (m->control_pressed) { out.close(); remove(filename.c_str()); delete read; delete input; delete list; delete rabund; globaldata->gListVector = NULL; return 0; } + if (m->control_pressed) { out.close(); remove(filename.c_str()); delete list; delete rabund; globaldata->gListVector = NULL; return 0; } if(sorted) { rabund->print(out); } @@ -151,7 +151,7 @@ int GetRAbundCommand::execute(){ rabund = new RAbundVector(); *rabund = (list->getRAbundVector()); - if (m->control_pressed) { out.close(); remove(filename.c_str()); delete read; delete input; delete list; delete rabund; globaldata->gListVector = NULL; return 0; } + if (m->control_pressed) { out.close(); remove(filename.c_str()); delete list; delete rabund; globaldata->gListVector = NULL; return 0; } if(sorted) { rabund->print(out); } else { rabund->nonSortedPrint(out); } @@ -193,7 +193,7 @@ int GetRAbundCommand::execute(){ rabund = new RAbundVector(); *rabund = (list->getRAbundVector()); - if (m->control_pressed) { out.close(); remove(filename.c_str()); delete read; delete input; delete list; delete rabund; globaldata->gListVector = NULL; return 0; } + if (m->control_pressed) { out.close(); remove(filename.c_str()); delete list; delete rabund; globaldata->gListVector = NULL; return 0; } if(sorted) { rabund->print(out); } else { rabund->nonSortedPrint(out); } @@ -206,11 +206,10 @@ int GetRAbundCommand::execute(){ m->mothurOut("Output File Name: "); m->mothurOutEndLine(); m->mothurOut(filename); m->mothurOutEndLine(); m->mothurOutEndLine(); - out.close(); - delete read; delete input; - globaldata->gListVector = NULL; + + globaldata->gListVector = NULL; return 0; } diff --git a/getsabundcommand.cpp b/getsabundcommand.cpp index 9260a5c..ca8c8a6 100644 --- a/getsabundcommand.cpp +++ b/getsabundcommand.cpp @@ -115,7 +115,7 @@ int GetSAbundCommand::execute(){ set processedLabels; set userLabels = labels; - if (m->control_pressed) { out.close(); remove(filename.c_str()); delete read; delete input; delete order; globaldata->gorder = NULL; return 0; } + if (m->control_pressed) { out.close(); remove(filename.c_str()); delete order; globaldata->gorder = NULL; return 0; } while((order != NULL) && ((allLines == 1) || (userLabels.size() != 0))) { @@ -127,7 +127,7 @@ int GetSAbundCommand::execute(){ sabund->print(out); delete sabund; - if (m->control_pressed) { out.close(); remove(filename.c_str()); delete read; delete input; delete order; globaldata->gorder = NULL; return 0; } + if (m->control_pressed) { out.close(); remove(filename.c_str()); delete order; globaldata->gorder = NULL; return 0; } processedLabels.insert(order->getLabel()); userLabels.erase(order->getLabel()); @@ -145,7 +145,7 @@ int GetSAbundCommand::execute(){ sabund->print(out); delete sabund; - if (m->control_pressed) { out.close(); remove(filename.c_str()); delete read; delete input; delete order; globaldata->gorder = NULL; return 0; } + if (m->control_pressed) { out.close(); remove(filename.c_str()); delete order; globaldata->gorder = NULL; return 0; } processedLabels.insert(order->getLabel()); userLabels.erase(order->getLabel()); @@ -185,12 +185,11 @@ int GetSAbundCommand::execute(){ sabund->print(out); delete sabund; - if (m->control_pressed) { out.close(); remove(filename.c_str()); delete read; delete input; delete order; globaldata->gorder = NULL; return 0; } + if (m->control_pressed) { out.close(); remove(filename.c_str()); delete order; globaldata->gorder = NULL; return 0; } delete order; } globaldata->gorder = NULL; - delete read; delete input; out.close(); diff --git a/globaldata.cpp b/globaldata.cpp index 58d00ff..69dccb5 100644 --- a/globaldata.cpp +++ b/globaldata.cpp @@ -80,6 +80,7 @@ void GlobalData::clear() { // fastafile = ""; //do we need this? treefile = ""; sharedfile = ""; + format = ""; } diff --git a/hclustercommand.cpp b/hclustercommand.cpp index d9a14d9..f981908 100644 --- a/hclustercommand.cpp +++ b/hclustercommand.cpp @@ -189,7 +189,7 @@ int HClusterCommand::execute(){ time_t estart = time(NULL); if (!sorted) { - read = new ReadCluster(distfile, cutoff); + read = new ReadCluster(distfile, cutoff, outputDir); read->setFormat(format); read->read(globaldata->nameMap); diff --git a/heatmapcommand.cpp b/heatmapcommand.cpp index 5d7e1d6..7aa978d 100644 --- a/heatmapcommand.cpp +++ b/heatmapcommand.cpp @@ -182,7 +182,7 @@ int HeatMapCommand::execute(){ lastLabel = lookup[0]->getLabel(); //prevent memory leak - for (int i = 0; i < lookup.size(); i++) { delete lookup[i]; } + for (int i = 0; i < lookup.size(); i++) { delete lookup[i]; lookup[i] = NULL; } //get next line to process lookup = input->getSharedRAbundVectors(); diff --git a/makefile b/makefile new file mode 100644 index 0000000..451d613 --- /dev/null +++ b/makefile @@ -0,0 +1,1625 @@ +################################################### +# +# Makefile for mothur +# Creator [Xcode -> Makefile Ver: Feb 14 2007 09:18:41] +# Created: [Thu Mar 4 08:31:03 2010] +# +################################################### + +# +# Macros +# + +CC = mpic++ +CC_OPTIONS = -O3 +LNK_OPTIONS = + +# if you do not want to use the readline library set to no, default yes. +# make sure you have the library installed + +USEREADLINE ?= yes + +ifeq ($(strip $(USEREADLINE)),yes) + CC_OPTIONS += -DUSE_READLINE + LNK_OPTIONS += \ + -lreadline\ + -lncurses\ + -L../readline-6.0 +endif + +USEMPI ?= no + +ifeq ($(strip $(USEMPI)),yes) + CC_OPTIONS += -DUSE_MPI +endif + +# +# INCLUDE directories for mothur +# + + INCLUDE = -I. + +# +# Build mothur +# + +mothur : \ + ./sharedutilities.o\ + ./treegroupscommand.o\ + ./bootstrapsharedcommand.o\ + ./matrixoutputcommand.o\ + ./getoturepcommand.o\ + ./screenseqscommand.o\ + ./chimera.o\ + ./decalc.o\ + ./readotucommand.o\ + ./readdistcommand.o\ + ./commandfactory.o\ + ./alignment.o\ + ./alignmentcell.o\ + ./gotohoverlap.o\ + ./overlap.o\ + ./needlemanoverlap.o\ + ./blastalign.o\ + ./noalign.o\ + ./suffixdb.o\ + ./suffixnodes.o\ + ./suffixtree.o\ + ./blastdb.o\ + ./nast.o\ + ./nastreport.o\ + ./boneh.o\ + ./efron.o\ + ./solow.o\ + ./unifracweightedcommand.o\ + ./weighted.o\ + ./unweighted.o\ + ./unifracunweightedcommand.o\ + ./getsabundcommand.o\ + ./getrabundcommand.o\ + ./bellerophon.o\ + ./pintail.o\ + ./sharedanderbergs.o\ + ./venncommand.o\ + ./venn.o\ + ./fullmatrix.o\ + ./heatmap.o\ + ./heatmapcommand.o\ + ./libshuffcommand.o\ + ./nocommands.o\ + ./sharedbraycurtis.o\ + ./sharedkulczynski.o\ + ./sharedlennon.o\ + ./sharedkulczynskicody.o\ + ./sharedmorisitahorn.o\ + ./sharedochiai.o\ + ./readcolumn.o\ + ./readotu.o\ + ./readphylip.o\ + ./consensuscommand.o\ + ./heatmapsimcommand.o\ + ./heatmapsim.o\ + ./optionparser.o\ + ./filterseqscommand.o\ + ./goodscoverage.o\ + ./sequencedb.o\ + ./sharedjackknife.o\ + ./sharedmarczewski.o\ + ./aligncommand.o\ + ./treemap.o\ + ./parsimonycommand.o\ + ./parsimony.o\ + ./seqsummarycommand.o\ + ./chimeraccodecommand.o\ + ./chimerabellerophoncommand.o\ + ./chimeracheckcommand.o\ + ./chimeraslayercommand.o\ + ./chimerapintailcommand.o\ + ./chimeraseqscommand.o\ + ./sharedlistvector.o\ + ./tree.o\ + ./readtree.o\ + ./sharedsobscollectsummary.o\ + ./deconvolutecommand.o\ + ./listseqscommand.o\ + ./getseqscommand.o\ + ./removeseqscommand.o\ + ./systemcommand.o\ + ./binsequencecommand.o\ + ./distancecommand.o\ + ./ace.o\ + ./averagelinkage.o\ + ./bootstrap.o\ + ./calculator.o\ + ./chao1.o\ + ./cluster.o\ + ./clustercommand.o\ + ./collect.o\ + ./collectcommand.o\ + ./collectsharedcommand.o\ + ./commandoptionparser.o\ + ./completelinkage.o\ + ./database.o\ + ./engine.o\ + ./fastamap.o\ + ./fileoutput.o\ + ./globaldata.o\ + ./groupmap.o\ + ./helpcommand.o\ + ./inputdata.o\ + ./jackknife.o\ + ./kmer.o\ + ./kmerdb.o\ + ./listvector.o\ + ./mothur.o\ + ./nameassignment.o\ + ./npshannon.o\ + ./ordervector.o\ + ./progress.o\ + ./quitcommand.o\ + ./rabundvector.o\ + ./rarecalc.o\ + ./raredisplay.o\ + ./rarefact.o\ + ./rarefactcommand.o\ + ./rarefactsharedcommand.o\ + ./sabundvector.o\ + ./sequence.o\ + ./shannon.o\ + ./sharedace.o\ + ./sharedchao1.o\ + ./sharedcommand.o\ + ./sharedjabund.o\ + ./sharedjclass.o\ + ./sharedjest.o\ + ./sharedordervector.o\ + ./sharedrabundvector.o\ + ./sharedsabundvector.o\ + ./sharedsobs.o\ + ./sharedsorabund.o\ + ./sharedsorclass.o\ + ./sharedsorest.o\ + ./sharedthetan.o\ + ./sharedthetayc.o\ + ./simpson.o\ + ./singlelinkage.o\ + ./sparsematrix.o\ + ./summarycommand.o\ + ./summarysharedcommand.o\ + ./uvest.o\ + ./validcalculator.o\ + ./validparameter.o\ + ./treenode.o\ + ./readtreecommand.o\ + ./reversecommand.o\ + ./trimseqscommand.o\ + ./slibshuff.o\ + ./libshuff.o\ + ./dlibshuff.o\ + ./mergefilecommand.o\ + ./coverage.o\ + ./whittaker.o\ + ./preclustercommand.o\ + ./otuhierarchycommand.o\ + ./setdircommand.o\ + ./getgroupcommand.o\ + ./getlabelcommand.o\ + ./secondarystructurecommand.o\ + ./mothurout.o\ + ./parselistscommand.o\ + ./readblast.o\ + ./chimeracheckrdp.o\ + ./hclustercommand.o\ + ./hcluster.o\ + ./getlistcountcommand.o\ + ./readcluster.o\ + ./ccode.o\ + ./taxonomyequalizer.o\ + ./phylotypecommand.o\ + ./classifyseqscommand.o\ + ./parsesffcommand.o\ + ./classify.o\ + ./phylotree.o\ + ./bayesian.o\ + ./alignmentdb.o\ + ./knn.o\ + ./distancedb.o\ + ./chimeraslayer.o\ + ./slayer.o\ + ./pcacommand.o\ + ./formatcolumn.o\ + ./formatphylip.o\ + ./mgclustercommand.o\ + ./getsharedotucommand.o\ + ./maligner.o\ + ./chimerarealigner.o\ + ./bergerparker.o\ + ./bstick.o\ + ./sharedkstest.o\ + ./qstat.o\ + ./shen.o\ + ./logsd.o\ + ./geom.o + $(CC) $(LNK_OPTIONS) \ + ./sharedutilities.o\ + ./treegroupscommand.o\ + ./bootstrapsharedcommand.o\ + ./matrixoutputcommand.o\ + ./getoturepcommand.o\ + ./screenseqscommand.o\ + ./chimera.o\ + ./decalc.o\ + ./readotucommand.o\ + ./readdistcommand.o\ + ./commandfactory.o\ + ./alignment.o\ + ./alignmentcell.o\ + ./gotohoverlap.o\ + ./overlap.o\ + ./needlemanoverlap.o\ + ./blastalign.o\ + ./noalign.o\ + ./suffixdb.o\ + ./suffixnodes.o\ + ./suffixtree.o\ + ./blastdb.o\ + ./nast.o\ + ./nastreport.o\ + ./boneh.o\ + ./efron.o\ + ./solow.o\ + ./unifracweightedcommand.o\ + ./weighted.o\ + ./unweighted.o\ + ./unifracunweightedcommand.o\ + ./getsabundcommand.o\ + ./getrabundcommand.o\ + ./bellerophon.o\ + ./pintail.o\ + ./sharedanderbergs.o\ + ./venncommand.o\ + ./venn.o\ + ./fullmatrix.o\ + ./heatmap.o\ + ./heatmapcommand.o\ + ./libshuffcommand.o\ + ./nocommands.o\ + ./sharedbraycurtis.o\ + ./sharedkulczynski.o\ + ./sharedlennon.o\ + ./sharedkulczynskicody.o\ + ./sharedmorisitahorn.o\ + ./sharedochiai.o\ + ./readcolumn.o\ + ./readotu.o\ + ./readphylip.o\ + ./consensuscommand.o\ + ./heatmapsimcommand.o\ + ./heatmapsim.o\ + ./optionparser.o\ + ./filterseqscommand.o\ + ./goodscoverage.o\ + ./sequencedb.o\ + ./sharedjackknife.o\ + ./sharedmarczewski.o\ + ./aligncommand.o\ + ./treemap.o\ + ./parsimonycommand.o\ + ./parsimony.o\ + ./seqsummarycommand.o\ + ./chimeraccodecommand.o\ + ./chimerabellerophoncommand.o\ + ./chimeracheckcommand.o\ + ./chimeraslayercommand.o\ + ./chimerapintailcommand.o\ + ./chimeraseqscommand.o\ + ./sharedlistvector.o\ + ./tree.o\ + ./readtree.o\ + ./sharedsobscollectsummary.o\ + ./deconvolutecommand.o\ + ./listseqscommand.o\ + ./getseqscommand.o\ + ./removeseqscommand.o\ + ./systemcommand.o\ + ./binsequencecommand.o\ + ./distancecommand.o\ + ./ace.o\ + ./averagelinkage.o\ + ./bootstrap.o\ + ./calculator.o\ + ./chao1.o\ + ./cluster.o\ + ./clustercommand.o\ + ./collect.o\ + ./collectcommand.o\ + ./collectsharedcommand.o\ + ./commandoptionparser.o\ + ./completelinkage.o\ + ./database.o\ + ./engine.o\ + ./fastamap.o\ + ./fileoutput.o\ + ./globaldata.o\ + ./groupmap.o\ + ./helpcommand.o\ + ./inputdata.o\ + ./jackknife.o\ + ./kmer.o\ + ./kmerdb.o\ + ./listvector.o\ + ./mothur.o\ + ./nameassignment.o\ + ./npshannon.o\ + ./ordervector.o\ + ./progress.o\ + ./quitcommand.o\ + ./rabundvector.o\ + ./rarecalc.o\ + ./raredisplay.o\ + ./rarefact.o\ + ./rarefactcommand.o\ + ./rarefactsharedcommand.o\ + ./sabundvector.o\ + ./sequence.o\ + ./shannon.o\ + ./sharedace.o\ + ./sharedchao1.o\ + ./sharedcommand.o\ + ./sharedjabund.o\ + ./sharedjclass.o\ + ./sharedjest.o\ + ./sharedordervector.o\ + ./sharedrabundvector.o\ + ./sharedsabundvector.o\ + ./sharedsobs.o\ + ./sharedsorabund.o\ + ./sharedsorclass.o\ + ./sharedsorest.o\ + ./sharedthetan.o\ + ./sharedthetayc.o\ + ./simpson.o\ + ./singlelinkage.o\ + ./sparsematrix.o\ + ./summarycommand.o\ + ./summarysharedcommand.o\ + ./uvest.o\ + ./validcalculator.o\ + ./validparameter.o\ + ./treenode.o\ + ./readtreecommand.o\ + ./reversecommand.o\ + ./trimseqscommand.o\ + ./slibshuff.o\ + ./libshuff.o\ + ./dlibshuff.o\ + ./mergefilecommand.o\ + ./coverage.o\ + ./whittaker.o\ + ./preclustercommand.o\ + ./otuhierarchycommand.o\ + ./setdircommand.o\ + ./getgroupcommand.o\ + ./getlabelcommand.o\ + ./secondarystructurecommand.o\ + ./mothurout.o\ + ./parselistscommand.o\ + ./readblast.o\ + ./chimeracheckrdp.o\ + ./hclustercommand.o\ + ./hcluster.o\ + ./getlistcountcommand.o\ + ./readcluster.o\ + ./ccode.o\ + ./taxonomyequalizer.o\ + ./phylotypecommand.o\ + ./classifyseqscommand.o\ + ./parsesffcommand.o\ + ./classify.o\ + ./phylotree.o\ + ./bayesian.o\ + ./alignmentdb.o\ + ./knn.o\ + ./distancedb.o\ + ./chimeraslayer.o\ + ./slayer.o\ + ./pcacommand.o\ + ./formatcolumn.o\ + ./formatphylip.o\ + ./mgclustercommand.o\ + ./getsharedotucommand.o\ + ./maligner.o\ + ./chimerarealigner.o\ + ./bergerparker.o\ + ./bstick.o\ + ./sharedkstest.o\ + ./qstat.o\ + ./shen.o\ + ./logsd.o\ + ./geom.o\ + -o ../Release/mothur + +clean : + rm \ + ./sharedutilities.o\ + ./treegroupscommand.o\ + ./bootstrapsharedcommand.o\ + ./matrixoutputcommand.o\ + ./getoturepcommand.o\ + ./screenseqscommand.o\ + ./chimera.o\ + ./decalc.o\ + ./readotucommand.o\ + ./readdistcommand.o\ + ./commandfactory.o\ + ./alignment.o\ + ./alignmentcell.o\ + ./gotohoverlap.o\ + ./overlap.o\ + ./needlemanoverlap.o\ + ./blastalign.o\ + ./noalign.o\ + ./suffixdb.o\ + ./suffixnodes.o\ + ./suffixtree.o\ + ./blastdb.o\ + ./nast.o\ + ./nastreport.o\ + ./boneh.o\ + ./efron.o\ + ./solow.o\ + ./unifracweightedcommand.o\ + ./weighted.o\ + ./unweighted.o\ + ./unifracunweightedcommand.o\ + ./getsabundcommand.o\ + ./getrabundcommand.o\ + ./bellerophon.o\ + ./pintail.o\ + ./sharedanderbergs.o\ + ./venncommand.o\ + ./venn.o\ + ./fullmatrix.o\ + ./heatmap.o\ + ./heatmapcommand.o\ + ./libshuffcommand.o\ + ./nocommands.o\ + ./sharedbraycurtis.o\ + ./sharedkulczynski.o\ + ./sharedlennon.o\ + ./sharedkulczynskicody.o\ + ./sharedmorisitahorn.o\ + ./sharedochiai.o\ + ./readcolumn.o\ + ./readotu.o\ + ./readphylip.o\ + ./consensuscommand.o\ + ./heatmapsimcommand.o\ + ./heatmapsim.o\ + ./optionparser.o\ + ./filterseqscommand.o\ + ./goodscoverage.o\ + ./sequencedb.o\ + ./sharedjackknife.o\ + ./sharedmarczewski.o\ + ./aligncommand.o\ + ./treemap.o\ + ./parsimonycommand.o\ + ./parsimony.o\ + ./seqsummarycommand.o\ + ./chimeraccodecommand.o\ + ./chimerabellerophoncommand.o\ + ./chimeracheckcommand.o\ + ./chimeraslayercommand.o\ + ./chimerapintailcommand.o\ + ./chimeraseqscommand.o\ + ./sharedlistvector.o\ + ./tree.o\ + ./readtree.o\ + ./sharedsobscollectsummary.o\ + ./deconvolutecommand.o\ + ./listseqscommand.o\ + ./getseqscommand.o\ + ./removeseqscommand.o\ + ./systemcommand.o\ + ./binsequencecommand.o\ + ./distancecommand.o\ + ./ace.o\ + ./averagelinkage.o\ + ./bootstrap.o\ + ./calculator.o\ + ./chao1.o\ + ./cluster.o\ + ./clustercommand.o\ + ./collect.o\ + ./collectcommand.o\ + ./collectsharedcommand.o\ + ./commandoptionparser.o\ + ./completelinkage.o\ + ./database.o\ + ./engine.o\ + ./fastamap.o\ + ./fileoutput.o\ + ./globaldata.o\ + ./groupmap.o\ + ./helpcommand.o\ + ./inputdata.o\ + ./jackknife.o\ + ./kmer.o\ + ./kmerdb.o\ + ./listvector.o\ + ./mothur.o\ + ./nameassignment.o\ + ./npshannon.o\ + ./ordervector.o\ + ./progress.o\ + ./quitcommand.o\ + ./rabundvector.o\ + ./rarecalc.o\ + ./raredisplay.o\ + ./rarefact.o\ + ./rarefactcommand.o\ + ./rarefactsharedcommand.o\ + ./sabundvector.o\ + ./sequence.o\ + ./shannon.o\ + ./sharedace.o\ + ./sharedchao1.o\ + ./sharedcommand.o\ + ./sharedjabund.o\ + ./sharedjclass.o\ + ./sharedjest.o\ + ./sharedordervector.o\ + ./sharedrabundvector.o\ + ./sharedsabundvector.o\ + ./sharedsobs.o\ + ./sharedsorabund.o\ + ./sharedsorclass.o\ + ./sharedsorest.o\ + ./sharedthetan.o\ + ./sharedthetayc.o\ + ./simpson.o\ + ./singlelinkage.o\ + ./sparsematrix.o\ + ./summarycommand.o\ + ./summarysharedcommand.o\ + ./uvest.o\ + ./validcalculator.o\ + ./validparameter.o\ + ./treenode.o\ + ./readtreecommand.o\ + ./reversecommand.o\ + ./trimseqscommand.o\ + ./slibshuff.o\ + ./libshuff.o\ + ./dlibshuff.o\ + ./mergefilecommand.o\ + ./coverage.o\ + ./whittaker.o\ + ./preclustercommand.o\ + ./otuhierarchycommand.o\ + ./setdircommand.o\ + ./getgroupcommand.o\ + ./getlabelcommand.o\ + ./secondarystructurecommand.o\ + ./mothurout.o\ + ./parselistscommand.o\ + ./readblast.o\ + ./chimeracheckrdp.o\ + ./hclustercommand.o\ + ./hcluster.o\ + ./getlistcountcommand.o\ + ./readcluster.o\ + ./ccode.o\ + ./taxonomyequalizer.o\ + ./phylotypecommand.o\ + ./classifyseqscommand.o\ + ./parsesffcommand.o\ + ./classify.o\ + ./phylotree.o\ + ./bayesian.o\ + ./alignmentdb.o\ + ./knn.o\ + ./distancedb.o\ + ./chimeraslayer.o\ + ./slayer.o\ + ./pcacommand.o\ + ./formatcolumn.o\ + ./formatphylip.o\ + ./mgclustercommand.o\ + ./getsharedotucommand.o\ + ./maligner.o\ + ./chimerarealigner.o\ + ./bergerparker.o\ + ./bstick.o\ + ./sharedkstest.o\ + ./qstat.o\ + ./shen.o\ + ./logsd.o\ + ./geom.o\ + mothur + +install : mothur + #cp mothur ../Release/mothur + +# +# Build the parts of mothur +# + + +# Item # 1 -- sharedutilities -- +./sharedutilities.o : sharedutilities.cpp + $(CC) $(CC_OPTIONS) sharedutilities.cpp -c $(INCLUDE) -o ./sharedutilities.o + + +# Item # 2 -- treegroupscommand -- +./treegroupscommand.o : treegroupscommand.cpp + $(CC) $(CC_OPTIONS) treegroupscommand.cpp -c $(INCLUDE) -o ./treegroupscommand.o + + +# Item # 3 -- bootstrapsharedcommand -- +./bootstrapsharedcommand.o : bootstrapsharedcommand.cpp + $(CC) $(CC_OPTIONS) bootstrapsharedcommand.cpp -c $(INCLUDE) -o ./bootstrapsharedcommand.o + + +# Item # 4 -- matrixoutputcommand -- +./matrixoutputcommand.o : matrixoutputcommand.cpp + $(CC) $(CC_OPTIONS) matrixoutputcommand.cpp -c $(INCLUDE) -o ./matrixoutputcommand.o + + +# Item # 5 -- getoturepcommand -- +./getoturepcommand.o : getoturepcommand.cpp + $(CC) $(CC_OPTIONS) getoturepcommand.cpp -c $(INCLUDE) -o ./getoturepcommand.o + + +# Item # 6 -- screenseqscommand -- +./screenseqscommand.o : screenseqscommand.cpp + $(CC) $(CC_OPTIONS) screenseqscommand.cpp -c $(INCLUDE) -o ./screenseqscommand.o + + +# Item # 7 -- chimera -- +./chimera.o : chimera.cpp + $(CC) $(CC_OPTIONS) chimera.cpp -c $(INCLUDE) -o ./chimera.o + + +# Item # 8 -- decalc -- +./decalc.o : decalc.cpp + $(CC) $(CC_OPTIONS) decalc.cpp -c $(INCLUDE) -o ./decalc.o + + +# Item # 9 -- readotucommand -- +./readotucommand.o : readotucommand.cpp + $(CC) $(CC_OPTIONS) readotucommand.cpp -c $(INCLUDE) -o ./readotucommand.o + + +# Item # 10 -- readdistcommand -- +./readdistcommand.o : readdistcommand.cpp + $(CC) $(CC_OPTIONS) readdistcommand.cpp -c $(INCLUDE) -o ./readdistcommand.o + + +# Item # 11 -- commandfactory -- +./commandfactory.o : commandfactory.cpp + $(CC) $(CC_OPTIONS) commandfactory.cpp -c $(INCLUDE) -o ./commandfactory.o + + +# Item # 12 -- alignment -- +./alignment.o : alignment.cpp + $(CC) $(CC_OPTIONS) alignment.cpp -c $(INCLUDE) -o ./alignment.o + + +# Item # 13 -- alignmentcell -- +./alignmentcell.o : alignmentcell.cpp + $(CC) $(CC_OPTIONS) alignmentcell.cpp -c $(INCLUDE) -o ./alignmentcell.o + + +# Item # 14 -- gotohoverlap -- +./gotohoverlap.o : gotohoverlap.cpp + $(CC) $(CC_OPTIONS) gotohoverlap.cpp -c $(INCLUDE) -o ./gotohoverlap.o + + +# Item # 15 -- overlap -- +./overlap.o : overlap.cpp + $(CC) $(CC_OPTIONS) overlap.cpp -c $(INCLUDE) -o ./overlap.o + + +# Item # 16 -- needlemanoverlap -- +./needlemanoverlap.o : needlemanoverlap.cpp + $(CC) $(CC_OPTIONS) needlemanoverlap.cpp -c $(INCLUDE) -o ./needlemanoverlap.o + + +# Item # 17 -- blastalign -- +./blastalign.o : blastalign.cpp + $(CC) $(CC_OPTIONS) blastalign.cpp -c $(INCLUDE) -o ./blastalign.o + + +# Item # 18 -- noalign -- +./noalign.o : noalign.cpp + $(CC) $(CC_OPTIONS) noalign.cpp -c $(INCLUDE) -o ./noalign.o + + +# Item # 19 -- suffixdb -- +./suffixdb.o : suffixdb.cpp + $(CC) $(CC_OPTIONS) suffixdb.cpp -c $(INCLUDE) -o ./suffixdb.o + + +# Item # 20 -- suffixnodes -- +./suffixnodes.o : suffixnodes.cpp + $(CC) $(CC_OPTIONS) suffixnodes.cpp -c $(INCLUDE) -o ./suffixnodes.o + + +# Item # 21 -- suffixtree -- +./suffixtree.o : suffixtree.cpp + $(CC) $(CC_OPTIONS) suffixtree.cpp -c $(INCLUDE) -o ./suffixtree.o + + +# Item # 22 -- blastdb -- +./blastdb.o : blastdb.cpp + $(CC) $(CC_OPTIONS) blastdb.cpp -c $(INCLUDE) -o ./blastdb.o + + +# Item # 23 -- nast -- +./nast.o : nast.cpp + $(CC) $(CC_OPTIONS) nast.cpp -c $(INCLUDE) -o ./nast.o + + +# Item # 24 -- nastreport -- +./nastreport.o : nastreport.cpp + $(CC) $(CC_OPTIONS) nastreport.cpp -c $(INCLUDE) -o ./nastreport.o + + +# Item # 25 -- boneh -- +./boneh.o : boneh.cpp + $(CC) $(CC_OPTIONS) boneh.cpp -c $(INCLUDE) -o ./boneh.o + + +# Item # 26 -- efron -- +./efron.o : efron.cpp + $(CC) $(CC_OPTIONS) efron.cpp -c $(INCLUDE) -o ./efron.o + + +# Item # 27 -- solow -- +./solow.o : solow.cpp + $(CC) $(CC_OPTIONS) solow.cpp -c $(INCLUDE) -o ./solow.o + + +# Item # 28 -- unifracweightedcommand -- +./unifracweightedcommand.o : unifracweightedcommand.cpp + $(CC) $(CC_OPTIONS) unifracweightedcommand.cpp -c $(INCLUDE) -o ./unifracweightedcommand.o + + +# Item # 29 -- weighted -- +./weighted.o : weighted.cpp + $(CC) $(CC_OPTIONS) weighted.cpp -c $(INCLUDE) -o ./weighted.o + + +# Item # 30 -- unweighted -- +./unweighted.o : unweighted.cpp + $(CC) $(CC_OPTIONS) unweighted.cpp -c $(INCLUDE) -o ./unweighted.o + + +# Item # 31 -- unifracunweightedcommand -- +./unifracunweightedcommand.o : unifracunweightedcommand.cpp + $(CC) $(CC_OPTIONS) unifracunweightedcommand.cpp -c $(INCLUDE) -o ./unifracunweightedcommand.o + + +# Item # 32 -- getsabundcommand -- +./getsabundcommand.o : getsabundcommand.cpp + $(CC) $(CC_OPTIONS) getsabundcommand.cpp -c $(INCLUDE) -o ./getsabundcommand.o + + +# Item # 33 -- getrabundcommand -- +./getrabundcommand.o : getrabundcommand.cpp + $(CC) $(CC_OPTIONS) getrabundcommand.cpp -c $(INCLUDE) -o ./getrabundcommand.o + + +# Item # 34 -- bellerophon -- +./bellerophon.o : bellerophon.cpp + $(CC) $(CC_OPTIONS) bellerophon.cpp -c $(INCLUDE) -o ./bellerophon.o + + +# Item # 35 -- pintail -- +./pintail.o : pintail.cpp + $(CC) $(CC_OPTIONS) pintail.cpp -c $(INCLUDE) -o ./pintail.o + + +# Item # 36 -- sharedanderbergs -- +./sharedanderbergs.o : sharedanderbergs.cpp + $(CC) $(CC_OPTIONS) sharedanderbergs.cpp -c $(INCLUDE) -o ./sharedanderbergs.o + + +# Item # 37 -- venncommand -- +./venncommand.o : venncommand.cpp + $(CC) $(CC_OPTIONS) venncommand.cpp -c $(INCLUDE) -o ./venncommand.o + + +# Item # 38 -- venn -- +./venn.o : venn.cpp + $(CC) $(CC_OPTIONS) venn.cpp -c $(INCLUDE) -o ./venn.o + + +# Item # 39 -- fullmatrix -- +./fullmatrix.o : fullmatrix.cpp + $(CC) $(CC_OPTIONS) fullmatrix.cpp -c $(INCLUDE) -o ./fullmatrix.o + + +# Item # 40 -- heatmap -- +./heatmap.o : heatmap.cpp + $(CC) $(CC_OPTIONS) heatmap.cpp -c $(INCLUDE) -o ./heatmap.o + + +# Item # 41 -- heatmapcommand -- +./heatmapcommand.o : heatmapcommand.cpp + $(CC) $(CC_OPTIONS) heatmapcommand.cpp -c $(INCLUDE) -o ./heatmapcommand.o + + +# Item # 42 -- libshuffcommand -- +./libshuffcommand.o : libshuffcommand.cpp + $(CC) $(CC_OPTIONS) libshuffcommand.cpp -c $(INCLUDE) -o ./libshuffcommand.o + + +# Item # 43 -- nocommands -- +./nocommands.o : nocommands.cpp + $(CC) $(CC_OPTIONS) nocommands.cpp -c $(INCLUDE) -o ./nocommands.o + + +# Item # 44 -- sharedbraycurtis -- +./sharedbraycurtis.o : sharedbraycurtis.cpp + $(CC) $(CC_OPTIONS) sharedbraycurtis.cpp -c $(INCLUDE) -o ./sharedbraycurtis.o + + +# Item # 45 -- sharedkulczynski -- +./sharedkulczynski.o : sharedkulczynski.cpp + $(CC) $(CC_OPTIONS) sharedkulczynski.cpp -c $(INCLUDE) -o ./sharedkulczynski.o + + +# Item # 46 -- sharedlennon -- +./sharedlennon.o : sharedlennon.cpp + $(CC) $(CC_OPTIONS) sharedlennon.cpp -c $(INCLUDE) -o ./sharedlennon.o + + +# Item # 47 -- sharedkulczynskicody -- +./sharedkulczynskicody.o : sharedkulczynskicody.cpp + $(CC) $(CC_OPTIONS) sharedkulczynskicody.cpp -c $(INCLUDE) -o ./sharedkulczynskicody.o + + +# Item # 48 -- sharedmorisitahorn -- +./sharedmorisitahorn.o : sharedmorisitahorn.cpp + $(CC) $(CC_OPTIONS) sharedmorisitahorn.cpp -c $(INCLUDE) -o ./sharedmorisitahorn.o + + +# Item # 49 -- sharedochiai -- +./sharedochiai.o : sharedochiai.cpp + $(CC) $(CC_OPTIONS) sharedochiai.cpp -c $(INCLUDE) -o ./sharedochiai.o + + +# Item # 50 -- readcolumn -- +./readcolumn.o : readcolumn.cpp + $(CC) $(CC_OPTIONS) readcolumn.cpp -c $(INCLUDE) -o ./readcolumn.o + + +# Item # 51 -- readotu -- +./readotu.o : readotu.cpp + $(CC) $(CC_OPTIONS) readotu.cpp -c $(INCLUDE) -o ./readotu.o + + +# Item # 52 -- readphylip -- +./readphylip.o : readphylip.cpp + $(CC) $(CC_OPTIONS) readphylip.cpp -c $(INCLUDE) -o ./readphylip.o + + +# Item # 53 -- consensuscommand -- +./consensuscommand.o : consensuscommand.cpp + $(CC) $(CC_OPTIONS) consensuscommand.cpp -c $(INCLUDE) -o ./consensuscommand.o + + +# Item # 54 -- heatmapsimcommand -- +./heatmapsimcommand.o : heatmapsimcommand.cpp + $(CC) $(CC_OPTIONS) heatmapsimcommand.cpp -c $(INCLUDE) -o ./heatmapsimcommand.o + + +# Item # 55 -- heatmapsim -- +./heatmapsim.o : heatmapsim.cpp + $(CC) $(CC_OPTIONS) heatmapsim.cpp -c $(INCLUDE) -o ./heatmapsim.o + + +# Item # 56 -- optionparser -- +./optionparser.o : optionparser.cpp + $(CC) $(CC_OPTIONS) optionparser.cpp -c $(INCLUDE) -o ./optionparser.o + + +# Item # 57 -- filterseqscommand -- +./filterseqscommand.o : filterseqscommand.cpp + $(CC) $(CC_OPTIONS) filterseqscommand.cpp -c $(INCLUDE) -o ./filterseqscommand.o + + +# Item # 58 -- goodscoverage -- +./goodscoverage.o : goodscoverage.cpp + $(CC) $(CC_OPTIONS) goodscoverage.cpp -c $(INCLUDE) -o ./goodscoverage.o + + +# Item # 59 -- sequencedb -- +./sequencedb.o : sequencedb.cpp + $(CC) $(CC_OPTIONS) sequencedb.cpp -c $(INCLUDE) -o ./sequencedb.o + + +# Item # 60 -- sharedjackknife -- +./sharedjackknife.o : sharedjackknife.cpp + $(CC) $(CC_OPTIONS) sharedjackknife.cpp -c $(INCLUDE) -o ./sharedjackknife.o + + +# Item # 61 -- sharedmarczewski -- +./sharedmarczewski.o : sharedmarczewski.cpp + $(CC) $(CC_OPTIONS) sharedmarczewski.cpp -c $(INCLUDE) -o ./sharedmarczewski.o + + +# Item # 62 -- aligncommand -- +./aligncommand.o : aligncommand.cpp + $(CC) $(CC_OPTIONS) aligncommand.cpp -c $(INCLUDE) -o ./aligncommand.o + + +# Item # 63 -- treemap -- +./treemap.o : treemap.cpp + $(CC) $(CC_OPTIONS) treemap.cpp -c $(INCLUDE) -o ./treemap.o + + +# Item # 64 -- parsimonycommand -- +./parsimonycommand.o : parsimonycommand.cpp + $(CC) $(CC_OPTIONS) parsimonycommand.cpp -c $(INCLUDE) -o ./parsimonycommand.o + + +# Item # 65 -- parsimony -- +./parsimony.o : parsimony.cpp + $(CC) $(CC_OPTIONS) parsimony.cpp -c $(INCLUDE) -o ./parsimony.o + + +# Item # 66 -- seqsummarycommand -- +./seqsummarycommand.o : seqsummarycommand.cpp + $(CC) $(CC_OPTIONS) seqsummarycommand.cpp -c $(INCLUDE) -o ./seqsummarycommand.o + + +# Item # 67 -- chimeraseqscommand -- +./chimeraseqscommand.o : chimeraseqscommand.cpp + $(CC) $(CC_OPTIONS) chimeraseqscommand.cpp -c $(INCLUDE) -o ./chimeraseqscommand.o + + +# Item # 68 -- sharedlistvector -- +./sharedlistvector.o : sharedlistvector.cpp + $(CC) $(CC_OPTIONS) sharedlistvector.cpp -c $(INCLUDE) -o ./sharedlistvector.o + + +# Item # 69 -- tree -- +./tree.o : tree.cpp + $(CC) $(CC_OPTIONS) tree.cpp -c $(INCLUDE) -o ./tree.o + + +# Item # 70 -- readtree -- +./readtree.o : readtree.cpp + $(CC) $(CC_OPTIONS) readtree.cpp -c $(INCLUDE) -o ./readtree.o + + +# Item # 71 -- sharedsobscollectsummary -- +./sharedsobscollectsummary.o : sharedsobscollectsummary.cpp + $(CC) $(CC_OPTIONS) sharedsobscollectsummary.cpp -c $(INCLUDE) -o ./sharedsobscollectsummary.o + + +# Item # 72 -- deconvolutecommand -- +./deconvolutecommand.o : deconvolutecommand.cpp + $(CC) $(CC_OPTIONS) deconvolutecommand.cpp -c $(INCLUDE) -o ./deconvolutecommand.o + + +# Item # 73 -- listseqscommand -- +./listseqscommand.o : listseqscommand.cpp + $(CC) $(CC_OPTIONS) listseqscommand.cpp -c $(INCLUDE) -o ./listseqscommand.o + + +# Item # 74 -- getseqscommand -- +./getseqscommand.o : getseqscommand.cpp + $(CC) $(CC_OPTIONS) getseqscommand.cpp -c $(INCLUDE) -o ./getseqscommand.o + + +# Item # 75 -- removeseqscommand -- +./removeseqscommand.o : removeseqscommand.cpp + $(CC) $(CC_OPTIONS) removeseqscommand.cpp -c $(INCLUDE) -o ./removeseqscommand.o + + +# Item # 76 -- systemcommand -- +./systemcommand.o : systemcommand.cpp + $(CC) $(CC_OPTIONS) systemcommand.cpp -c $(INCLUDE) -o ./systemcommand.o + + +# Item # 77 -- binsequencecommand -- +./binsequencecommand.o : binsequencecommand.cpp + $(CC) $(CC_OPTIONS) binsequencecommand.cpp -c $(INCLUDE) -o ./binsequencecommand.o + + +# Item # 78 -- distancecommand -- +./distancecommand.o : distancecommand.cpp + $(CC) $(CC_OPTIONS) distancecommand.cpp -c $(INCLUDE) -o ./distancecommand.o + + +# Item # 79 -- ace -- +./ace.o : ace.cpp + $(CC) $(CC_OPTIONS) ace.cpp -c $(INCLUDE) -o ./ace.o + + +# Item # 80 -- averagelinkage -- +./averagelinkage.o : averagelinkage.cpp + $(CC) $(CC_OPTIONS) averagelinkage.cpp -c $(INCLUDE) -o ./averagelinkage.o + + +# Item # 81 -- bootstrap -- +./bootstrap.o : bootstrap.cpp + $(CC) $(CC_OPTIONS) bootstrap.cpp -c $(INCLUDE) -o ./bootstrap.o + + +# Item # 82 -- calculator -- +./calculator.o : calculator.cpp + $(CC) $(CC_OPTIONS) calculator.cpp -c $(INCLUDE) -o ./calculator.o + + +# Item # 83 -- chao1 -- +./chao1.o : chao1.cpp + $(CC) $(CC_OPTIONS) chao1.cpp -c $(INCLUDE) -o ./chao1.o + + +# Item # 84 -- cluster -- +./cluster.o : cluster.cpp + $(CC) $(CC_OPTIONS) cluster.cpp -c $(INCLUDE) -o ./cluster.o + + +# Item # 85 -- clustercommand -- +./clustercommand.o : clustercommand.cpp + $(CC) $(CC_OPTIONS) clustercommand.cpp -c $(INCLUDE) -o ./clustercommand.o + + +# Item # 86 -- collect -- +./collect.o : collect.cpp + $(CC) $(CC_OPTIONS) collect.cpp -c $(INCLUDE) -o ./collect.o + + +# Item # 87 -- collectcommand -- +./collectcommand.o : collectcommand.cpp + $(CC) $(CC_OPTIONS) collectcommand.cpp -c $(INCLUDE) -o ./collectcommand.o + + +# Item # 88 -- collectsharedcommand -- +./collectsharedcommand.o : collectsharedcommand.cpp + $(CC) $(CC_OPTIONS) collectsharedcommand.cpp -c $(INCLUDE) -o ./collectsharedcommand.o + + +# Item # 89 -- commandoptionparser -- +./commandoptionparser.o : commandoptionparser.cpp + $(CC) $(CC_OPTIONS) commandoptionparser.cpp -c $(INCLUDE) -o ./commandoptionparser.o + + +# Item # 90 -- completelinkage -- +./completelinkage.o : completelinkage.cpp + $(CC) $(CC_OPTIONS) completelinkage.cpp -c $(INCLUDE) -o ./completelinkage.o + + +# Item # 91 -- database -- +./database.o : database.cpp + $(CC) $(CC_OPTIONS) database.cpp -c $(INCLUDE) -o ./database.o + + +# Item # 92 -- engine -- +./engine.o : engine.cpp + $(CC) $(CC_OPTIONS) engine.cpp -c $(INCLUDE) -o ./engine.o + + +# Item # 93 -- fastamap -- +./fastamap.o : fastamap.cpp + $(CC) $(CC_OPTIONS) fastamap.cpp -c $(INCLUDE) -o ./fastamap.o + + +# Item # 94 -- fileoutput -- +./fileoutput.o : fileoutput.cpp + $(CC) $(CC_OPTIONS) fileoutput.cpp -c $(INCLUDE) -o ./fileoutput.o + + +# Item # 95 -- globaldata -- +./globaldata.o : globaldata.cpp + $(CC) $(CC_OPTIONS) globaldata.cpp -c $(INCLUDE) -o ./globaldata.o + + +# Item # 96 -- groupmap -- +./groupmap.o : groupmap.cpp + $(CC) $(CC_OPTIONS) groupmap.cpp -c $(INCLUDE) -o ./groupmap.o + + +# Item # 97 -- helpcommand -- +./helpcommand.o : helpcommand.cpp + $(CC) $(CC_OPTIONS) helpcommand.cpp -c $(INCLUDE) -o ./helpcommand.o + + +# Item # 98 -- inputdata -- +./inputdata.o : inputdata.cpp + $(CC) $(CC_OPTIONS) inputdata.cpp -c $(INCLUDE) -o ./inputdata.o + + +# Item # 99 -- jackknife -- +./jackknife.o : jackknife.cpp + $(CC) $(CC_OPTIONS) jackknife.cpp -c $(INCLUDE) -o ./jackknife.o + + +# Item # 100 -- kmer -- +./kmer.o : kmer.cpp + $(CC) $(CC_OPTIONS) kmer.cpp -c $(INCLUDE) -o ./kmer.o + + +# Item # 101 -- kmerdb -- +./kmerdb.o : kmerdb.cpp + $(CC) $(CC_OPTIONS) kmerdb.cpp -c $(INCLUDE) -o ./kmerdb.o + + +# Item # 102 -- listvector -- +./listvector.o : listvector.cpp + $(CC) $(CC_OPTIONS) listvector.cpp -c $(INCLUDE) -o ./listvector.o + + +# Item # 103 -- mothur -- +./mothur.o : mothur.cpp + $(CC) $(CC_OPTIONS) mothur.cpp -c $(INCLUDE) -o ./mothur.o + + +# Item # 104 -- nameassignment -- +./nameassignment.o : nameassignment.cpp + $(CC) $(CC_OPTIONS) nameassignment.cpp -c $(INCLUDE) -o ./nameassignment.o + + +# Item # 105 -- npshannon -- +./npshannon.o : npshannon.cpp + $(CC) $(CC_OPTIONS) npshannon.cpp -c $(INCLUDE) -o ./npshannon.o + + +# Item # 106 -- ordervector -- +./ordervector.o : ordervector.cpp + $(CC) $(CC_OPTIONS) ordervector.cpp -c $(INCLUDE) -o ./ordervector.o + + +# Item # 107 -- progress -- +./progress.o : progress.cpp + $(CC) $(CC_OPTIONS) progress.cpp -c $(INCLUDE) -o ./progress.o + + +# Item # 108 -- quitcommand -- +./quitcommand.o : quitcommand.cpp + $(CC) $(CC_OPTIONS) quitcommand.cpp -c $(INCLUDE) -o ./quitcommand.o + + +# Item # 109 -- rabundvector -- +./rabundvector.o : rabundvector.cpp + $(CC) $(CC_OPTIONS) rabundvector.cpp -c $(INCLUDE) -o ./rabundvector.o + + +# Item # 110 -- rarecalc -- +./rarecalc.o : rarecalc.cpp + $(CC) $(CC_OPTIONS) rarecalc.cpp -c $(INCLUDE) -o ./rarecalc.o + + +# Item # 111 -- raredisplay -- +./raredisplay.o : raredisplay.cpp + $(CC) $(CC_OPTIONS) raredisplay.cpp -c $(INCLUDE) -o ./raredisplay.o + + +# Item # 112 -- rarefact -- +./rarefact.o : rarefact.cpp + $(CC) $(CC_OPTIONS) rarefact.cpp -c $(INCLUDE) -o ./rarefact.o + + +# Item # 113 -- rarefactcommand -- +./rarefactcommand.o : rarefactcommand.cpp + $(CC) $(CC_OPTIONS) rarefactcommand.cpp -c $(INCLUDE) -o ./rarefactcommand.o + + +# Item # 114 -- rarefactsharedcommand -- +./rarefactsharedcommand.o : rarefactsharedcommand.cpp + $(CC) $(CC_OPTIONS) rarefactsharedcommand.cpp -c $(INCLUDE) -o ./rarefactsharedcommand.o + + +# Item # 115 -- sabundvector -- +./sabundvector.o : sabundvector.cpp + $(CC) $(CC_OPTIONS) sabundvector.cpp -c $(INCLUDE) -o ./sabundvector.o + + +# Item # 116 -- sequence -- +./sequence.o : sequence.cpp + $(CC) $(CC_OPTIONS) sequence.cpp -c $(INCLUDE) -o ./sequence.o + + +# Item # 117 -- shannon -- +./shannon.o : shannon.cpp + $(CC) $(CC_OPTIONS) shannon.cpp -c $(INCLUDE) -o ./shannon.o + + +# Item # 118 -- sharedace -- +./sharedace.o : sharedace.cpp + $(CC) $(CC_OPTIONS) sharedace.cpp -c $(INCLUDE) -o ./sharedace.o + + +# Item # 119 -- sharedchao1 -- +./sharedchao1.o : sharedchao1.cpp + $(CC) $(CC_OPTIONS) sharedchao1.cpp -c $(INCLUDE) -o ./sharedchao1.o + + +# Item # 120 -- sharedcommand -- +./sharedcommand.o : sharedcommand.cpp + $(CC) $(CC_OPTIONS) sharedcommand.cpp -c $(INCLUDE) -o ./sharedcommand.o + + +# Item # 121 -- sharedjabund -- +./sharedjabund.o : sharedjabund.cpp + $(CC) $(CC_OPTIONS) sharedjabund.cpp -c $(INCLUDE) -o ./sharedjabund.o + + +# Item # 122 -- sharedjclass -- +./sharedjclass.o : sharedjclass.cpp + $(CC) $(CC_OPTIONS) sharedjclass.cpp -c $(INCLUDE) -o ./sharedjclass.o + + +# Item # 123 -- sharedjest -- +./sharedjest.o : sharedjest.cpp + $(CC) $(CC_OPTIONS) sharedjest.cpp -c $(INCLUDE) -o ./sharedjest.o + + +# Item # 124 -- sharedordervector -- +./sharedordervector.o : sharedordervector.cpp + $(CC) $(CC_OPTIONS) sharedordervector.cpp -c $(INCLUDE) -o ./sharedordervector.o + + +# Item # 125 -- sharedrabundvector -- +./sharedrabundvector.o : sharedrabundvector.cpp + $(CC) $(CC_OPTIONS) sharedrabundvector.cpp -c $(INCLUDE) -o ./sharedrabundvector.o + + +# Item # 126 -- sharedsabundvector -- +./sharedsabundvector.o : sharedsabundvector.cpp + $(CC) $(CC_OPTIONS) sharedsabundvector.cpp -c $(INCLUDE) -o ./sharedsabundvector.o + + +# Item # 127 -- sharedsobs -- +./sharedsobs.o : sharedsobs.cpp + $(CC) $(CC_OPTIONS) sharedsobs.cpp -c $(INCLUDE) -o ./sharedsobs.o + + +# Item # 128 -- sharedsorabund -- +./sharedsorabund.o : sharedsorabund.cpp + $(CC) $(CC_OPTIONS) sharedsorabund.cpp -c $(INCLUDE) -o ./sharedsorabund.o + + +# Item # 129 -- sharedsorclass -- +./sharedsorclass.o : sharedsorclass.cpp + $(CC) $(CC_OPTIONS) sharedsorclass.cpp -c $(INCLUDE) -o ./sharedsorclass.o + + +# Item # 130 -- sharedsorest -- +./sharedsorest.o : sharedsorest.cpp + $(CC) $(CC_OPTIONS) sharedsorest.cpp -c $(INCLUDE) -o ./sharedsorest.o + + +# Item # 131 -- sharedthetan -- +./sharedthetan.o : sharedthetan.cpp + $(CC) $(CC_OPTIONS) sharedthetan.cpp -c $(INCLUDE) -o ./sharedthetan.o + + +# Item # 132 -- sharedthetayc -- +./sharedthetayc.o : sharedthetayc.cpp + $(CC) $(CC_OPTIONS) sharedthetayc.cpp -c $(INCLUDE) -o ./sharedthetayc.o + + +# Item # 133 -- simpson -- +./simpson.o : simpson.cpp + $(CC) $(CC_OPTIONS) simpson.cpp -c $(INCLUDE) -o ./simpson.o + + +# Item # 134 -- singlelinkage -- +./singlelinkage.o : singlelinkage.cpp + $(CC) $(CC_OPTIONS) singlelinkage.cpp -c $(INCLUDE) -o ./singlelinkage.o + + +# Item # 135 -- sparsematrix -- +./sparsematrix.o : sparsematrix.cpp + $(CC) $(CC_OPTIONS) sparsematrix.cpp -c $(INCLUDE) -o ./sparsematrix.o + + +# Item # 136 -- summarycommand -- +./summarycommand.o : summarycommand.cpp + $(CC) $(CC_OPTIONS) summarycommand.cpp -c $(INCLUDE) -o ./summarycommand.o + + +# Item # 137 -- summarysharedcommand -- +./summarysharedcommand.o : summarysharedcommand.cpp + $(CC) $(CC_OPTIONS) summarysharedcommand.cpp -c $(INCLUDE) -o ./summarysharedcommand.o + + +# Item # 138 -- uvest -- +./uvest.o : uvest.cpp + $(CC) $(CC_OPTIONS) uvest.cpp -c $(INCLUDE) -o ./uvest.o + + +# Item # 139 -- validcalculator -- +./validcalculator.o : validcalculator.cpp + $(CC) $(CC_OPTIONS) validcalculator.cpp -c $(INCLUDE) -o ./validcalculator.o + + +# Item # 140 -- validparameter -- +./validparameter.o : validparameter.cpp + $(CC) $(CC_OPTIONS) validparameter.cpp -c $(INCLUDE) -o ./validparameter.o + + +# Item # 141 -- treenode -- +./treenode.o : treenode.cpp + $(CC) $(CC_OPTIONS) treenode.cpp -c $(INCLUDE) -o ./treenode.o + + +# Item # 142 -- readtreecommand -- +./readtreecommand.o : readtreecommand.cpp + $(CC) $(CC_OPTIONS) readtreecommand.cpp -c $(INCLUDE) -o ./readtreecommand.o + + +# Item # 143 -- reversecommand -- +./reversecommand.o : reversecommand.cpp + $(CC) $(CC_OPTIONS) reversecommand.cpp -c $(INCLUDE) -o ./reversecommand.o + + +# Item # 144 -- trimseqscommand -- +./trimseqscommand.o : trimseqscommand.cpp + $(CC) $(CC_OPTIONS) trimseqscommand.cpp -c $(INCLUDE) -o ./trimseqscommand.o + + +# Item # 145 -- slibshuff -- +./slibshuff.o : slibshuff.cpp + $(CC) $(CC_OPTIONS) slibshuff.cpp -c $(INCLUDE) -o ./slibshuff.o + + +# Item # 146 -- libshuff -- +./libshuff.o : libshuff.cpp + $(CC) $(CC_OPTIONS) libshuff.cpp -c $(INCLUDE) -o ./libshuff.o + + +# Item # 147 -- dlibshuff -- +./dlibshuff.o : dlibshuff.cpp + $(CC) $(CC_OPTIONS) dlibshuff.cpp -c $(INCLUDE) -o ./dlibshuff.o + + +# Item # 148 -- mergefilecommand -- +./mergefilecommand.o : mergefilecommand.cpp + $(CC) $(CC_OPTIONS) mergefilecommand.cpp -c $(INCLUDE) -o ./mergefilecommand.o + + +# Item # 149 -- coverage -- +./coverage.o : coverage.cpp + $(CC) $(CC_OPTIONS) coverage.cpp -c $(INCLUDE) -o ./coverage.o + + +# Item # 150 -- whittaker -- +./whittaker.o : whittaker.cpp + $(CC) $(CC_OPTIONS) whittaker.cpp -c $(INCLUDE) -o ./whittaker.o + + +# Item # 151 -- preclustercommand -- +./preclustercommand.o : preclustercommand.cpp + $(CC) $(CC_OPTIONS) preclustercommand.cpp -c $(INCLUDE) -o ./preclustercommand.o + + +# Item # 152 -- otuhierarchycommand -- +./otuhierarchycommand.o : otuhierarchycommand.cpp + $(CC) $(CC_OPTIONS) otuhierarchycommand.cpp -c $(INCLUDE) -o ./otuhierarchycommand.o + + +# Item # 153 -- setdircommand -- +./setdircommand.o : setdircommand.cpp + $(CC) $(CC_OPTIONS) setdircommand.cpp -c $(INCLUDE) -o ./setdircommand.o + + +# Item # 154 -- getgroupcommand -- +./getgroupcommand.o : getgroupcommand.cpp + $(CC) $(CC_OPTIONS) getgroupcommand.cpp -c $(INCLUDE) -o ./getgroupcommand.o + + +# Item # 155 -- getlabelcommand -- +./getlabelcommand.o : getlabelcommand.cpp + $(CC) $(CC_OPTIONS) getlabelcommand.cpp -c $(INCLUDE) -o ./getlabelcommand.o + + +# Item # 156 -- secondarystructurecommand -- +./secondarystructurecommand.o : secondarystructurecommand.cpp + $(CC) $(CC_OPTIONS) secondarystructurecommand.cpp -c $(INCLUDE) -o ./secondarystructurecommand.o + + +# Item # 157 -- mothurout -- +./mothurout.o : mothurout.cpp + $(CC) $(CC_OPTIONS) mothurout.cpp -c $(INCLUDE) -o ./mothurout.o + + +# Item # 158 -- parselistscommand -- +./parselistscommand.o : parselistscommand.cpp + $(CC) $(CC_OPTIONS) parselistscommand.cpp -c $(INCLUDE) -o ./parselistscommand.o + + +# Item # 159 -- readblast -- +./readblast.o : readblast.cpp + $(CC) $(CC_OPTIONS) readblast.cpp -c $(INCLUDE) -o ./readblast.o + + +# Item # 160 -- chimeracheckrdp -- +./chimeracheckrdp.o : chimeracheckrdp.cpp + $(CC) $(CC_OPTIONS) chimeracheckrdp.cpp -c $(INCLUDE) -o ./chimeracheckrdp.o + + +# Item # 161 -- hclustercommand -- +./hclustercommand.o : hclustercommand.cpp + $(CC) $(CC_OPTIONS) hclustercommand.cpp -c $(INCLUDE) -o ./hclustercommand.o + + +# Item # 162 -- hcluster -- +./hcluster.o : hcluster.cpp + $(CC) $(CC_OPTIONS) hcluster.cpp -c $(INCLUDE) -o ./hcluster.o + + +# Item # 163 -- getlistcountcommand -- +./getlistcountcommand.o : getlistcountcommand.cpp + $(CC) $(CC_OPTIONS) getlistcountcommand.cpp -c $(INCLUDE) -o ./getlistcountcommand.o + + +# Item # 164 -- readcluster -- +./readcluster.o : readcluster.cpp + $(CC) $(CC_OPTIONS) readcluster.cpp -c $(INCLUDE) -o ./readcluster.o + + +# Item # 165 -- ccode -- +./ccode.o : ccode.cpp + $(CC) $(CC_OPTIONS) ccode.cpp -c $(INCLUDE) -o ./ccode.o + + +# Item # 166 -- taxonomyequalizer -- +./taxonomyequalizer.o : taxonomyequalizer.cpp + $(CC) $(CC_OPTIONS) taxonomyequalizer.cpp -c $(INCLUDE) -o ./taxonomyequalizer.o + + +# Item # 167 -- phylotypecommand -- +./phylotypecommand.o : phylotypecommand.cpp + $(CC) $(CC_OPTIONS) phylotypecommand.cpp -c $(INCLUDE) -o ./phylotypecommand.o + + +# Item # 168 -- classifyseqscommand -- +./classifyseqscommand.o : classifyseqscommand.cpp + $(CC) $(CC_OPTIONS) classifyseqscommand.cpp -c $(INCLUDE) -o ./classifyseqscommand.o + + +# Item # 169 -- classify -- +./classify.o : classify.cpp + $(CC) $(CC_OPTIONS) classify.cpp -c $(INCLUDE) -o ./classify.o + + +# Item # 170 -- phylotree -- +./phylotree.o : phylotree.cpp + $(CC) $(CC_OPTIONS) phylotree.cpp -c $(INCLUDE) -o ./phylotree.o + + +# Item # 171 -- bayesian -- +./bayesian.o : bayesian.cpp + $(CC) $(CC_OPTIONS) bayesian.cpp -c $(INCLUDE) -o ./bayesian.o + + +# Item # 172 -- alignmentdb -- +./alignmentdb.o : alignmentdb.cpp + $(CC) $(CC_OPTIONS) alignmentdb.cpp -c $(INCLUDE) -o ./alignmentdb.o + + +# Item # 173 -- knn -- +./knn.o : knn.cpp + $(CC) $(CC_OPTIONS) knn.cpp -c $(INCLUDE) -o ./knn.o + + +# Item # 174 -- distancedb -- +./distancedb.o : distancedb.cpp + $(CC) $(CC_OPTIONS) distancedb.cpp -c $(INCLUDE) -o ./distancedb.o + + +# Item # 175 -- chimeraslayer -- +./chimeraslayer.o : chimeraslayer.cpp + $(CC) $(CC_OPTIONS) chimeraslayer.cpp -c $(INCLUDE) -o ./chimeraslayer.o + + +# Item # 176 -- slayer -- +./slayer.o : slayer.cpp + $(CC) $(CC_OPTIONS) slayer.cpp -c $(INCLUDE) -o ./slayer.o + + +# Item # 177 -- pcacommand -- +./pcacommand.o : pcacommand.cpp + $(CC) $(CC_OPTIONS) pcacommand.cpp -c $(INCLUDE) -o ./pcacommand.o + + +# Item # 178 -- formatcolumn -- +./formatcolumn.o : formatcolumn.cpp + $(CC) $(CC_OPTIONS) formatcolumn.cpp -c $(INCLUDE) -o ./formatcolumn.o + + +# Item # 179 -- formatphylip -- +./formatphylip.o : formatphylip.cpp + $(CC) $(CC_OPTIONS) formatphylip.cpp -c $(INCLUDE) -o ./formatphylip.o + + +# Item # 180 -- mgclustercommand -- +./mgclustercommand.o : mgclustercommand.cpp + $(CC) $(CC_OPTIONS) mgclustercommand.cpp -c $(INCLUDE) -o ./mgclustercommand.o + + +# Item # 181 -- getsharedotucommand -- +./getsharedotucommand.o : getsharedotucommand.cpp + $(CC) $(CC_OPTIONS) getsharedotucommand.cpp -c $(INCLUDE) -o ./getsharedotucommand.o + + +# Item # 182 -- maligner -- +./maligner.o : maligner.cpp + $(CC) $(CC_OPTIONS) maligner.cpp -c $(INCLUDE) -o ./maligner.o + + +# Item # 183 -- chimerarealigner -- +./chimerarealigner.o : chimerarealigner.cpp + $(CC) $(CC_OPTIONS) chimerarealigner.cpp -c $(INCLUDE) -o ./chimerarealigner.o + + +# Item # 184 -- bergerparker -- +./bergerparker.o : bergerparker.cpp + $(CC) $(CC_OPTIONS) bergerparker.cpp -c $(INCLUDE) -o ./bergerparker.o + + +# Item # 185 -- bstick -- +./bstick.o : bstick.cpp + $(CC) $(CC_OPTIONS) bstick.cpp -c $(INCLUDE) -o ./bstick.o + + +# Item # 186 -- sharedkstest -- +./sharedkstest.o : sharedkstest.cpp + $(CC) $(CC_OPTIONS) sharedkstest.cpp -c $(INCLUDE) -o ./sharedkstest.o + + +# Item # 187 -- qstat -- +./qstat.o : qstat.cpp + $(CC) $(CC_OPTIONS) qstat.cpp -c $(INCLUDE) -o ./qstat.o + + +# Item # 188 -- shen -- +./shen.o : shen.cpp + $(CC) $(CC_OPTIONS) shen.cpp -c $(INCLUDE) -o ./shen.o + + +# Item # 189 -- logsd -- +./logsd.o : logsd.cpp + $(CC) $(CC_OPTIONS) logsd.cpp -c $(INCLUDE) -o ./logsd.o + + +# Item # 190 -- geom -- +./geom.o : geom.cpp + $(CC) $(CC_OPTIONS) geom.cpp -c $(INCLUDE) -o ./geom.o + +# Item # 191 -- parsesffcommand -- +./parsesffcommand.o : parsesffcommand.cpp + $(CC) $(CC_OPTIONS) parsesffcommand.cpp -c $(INCLUDE) -o ./parsesffcommand.o + +# Item # 192 -- chimeraccodecommand -- +./chimeraccodecommand.o : chimeraccodecommand.cpp + $(CC) $(CC_OPTIONS) chimeraccodecommand.cpp -c $(INCLUDE) -o ./chimeraccodecommand.o + +# Item # 193 -- chimeracheckcommand -- +./chimeracheckcommand.o : chimeracheckcommand.cpp + $(CC) $(CC_OPTIONS) chimeracheckcommand.cpp -c $(INCLUDE) -o ./chimeracheckcommand.o + + +# Item # 194 -- chimeraslayercommand -- +./chimeraslayercommand.o : chimeraslayercommand.cpp + $(CC) $(CC_OPTIONS) chimeraslayercommand.cpp -c $(INCLUDE) -o ./chimeraslayercommand.o + +# Item # 195 -- chimerapintailcommand -- +./chimerapintailcommand.o : chimerapintailcommand.cpp + $(CC) $(CC_OPTIONS) chimerapintailcommand.cpp -c $(INCLUDE) -o ./chimerapintailcommand.o + +# Item # 196 -- chimerabellerophoncommand -- +./chimerabellerophoncommand.o : chimerabellerophoncommand.cpp + $(CC) $(CC_OPTIONS) chimerabellerophoncommand.cpp -c $(INCLUDE) -o ./chimerabellerophoncommand.o + + +##### END RUN #### diff --git a/mgclustercommand.cpp b/mgclustercommand.cpp index 6d5acb2..6eb9c7d 100644 --- a/mgclustercommand.cpp +++ b/mgclustercommand.cpp @@ -538,12 +538,12 @@ ListVector* MGClusterCommand::mergeOPFs(map binInfo, float dist){ void MGClusterCommand::sortHclusterFiles(string unsortedDist, string unsortedOverlap) { try { //sort distFile - string sortedDistFile = sortFile(unsortedDist); + string sortedDistFile = sortFile(unsortedDist, outputDir); remove(unsortedDist.c_str()); //delete unsorted file distFile = sortedDistFile; //sort overlap file - string sortedOverlapFile = sortFile(unsortedOverlap); + string sortedOverlapFile = sortFile(unsortedOverlap, outputDir); remove(unsortedOverlap.c_str()); //delete unsorted file overlapFile = sortedOverlapFile; } diff --git a/mothur.cpp b/mothur.cpp index 6236012..cb72ac6 100644 --- a/mothur.cpp +++ b/mothur.cpp @@ -1,168 +1,171 @@ -/* - * interface.cpp - * - * - * Created by Pat Schloss on 8/14/08. - * Copyright 2008 Patrick D. Schloss. All rights reserved. - * - */ - -#include "mothur.h" -#include "engine.hpp" -#include "globaldata.hpp" -#include "mothurout.h" - - -/**************************************************************************************************/ - -GlobalData* GlobalData::_uniqueInstance = 0; -CommandFactory* CommandFactory::_uniqueInstance = 0; -MothurOut* MothurOut::_uniqueInstance = 0; - -/***********************************************************************/ -volatile int ctrlc_pressed = 0; -void ctrlc_handler ( int sig ) { - MothurOut* m = MothurOut::getInstance(); - ctrlc_pressed = 1; - m->control_pressed = ctrlc_pressed; - - if (m->executing) { //if mid command quit execution, else quit mothur - m->mothurOutEndLine(); m->mothurOut("quitting command..."); m->mothurOutEndLine(); - }else{ - m->mothurOut("quitting mothur"); m->mothurOutEndLine(); - exit(1); - } -} -/***********************************************************************/ -int main(int argc, char *argv[]){ - MothurOut* m = MothurOut::getInstance(); - try { - - signal(SIGINT, ctrlc_handler ); - - time_t ltime = time(NULL); /* calendar time */ - string logFileName = "mothur." + toString(ltime) + ".logfile"; - - #ifdef USE_MPI - MPI_Init(&argc, &argv); - #endif - - m->setFileName(logFileName); - - - //version - #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) - system("clear"); - #if defined (__APPLE__) || (__MACH__) - m->mothurOutJustToLog("Mac version"); - m->mothurOutEndLine(); m->mothurOutEndLine(); - #else - m->mothurOutJustToLog("Linux version"); - >m->mothurOutEndLine(); m->mothurOutEndLine(); - #endif - - #else - system("CLS"); - m->mothurOutJustToLog("Windows version"); - m->mothurOutEndLine(); m->mothurOutEndLine(); - #endif - - #ifdef USE_READLINE - m->mothurOutJustToLog("Using ReadLine"); - m->mothurOutEndLine(); m->mothurOutEndLine(); - #endif - - //header - m->mothurOut("mothur v.1.8"); - m->mothurOutEndLine(); - m->mothurOut("Last updated: 2/02/2010"); - m->mothurOutEndLine(); - m->mothurOutEndLine(); - m->mothurOut("by"); - m->mothurOutEndLine(); - m->mothurOut("Patrick D. Schloss"); - m->mothurOutEndLine(); - m->mothurOutEndLine(); - m->mothurOut("Department of Microbiology & Immunology"); - m->mothurOutEndLine(); - m->mothurOut("University of Michigan"); - m->mothurOutEndLine(); - m->mothurOut("pschloss@umich.edu"); - m->mothurOutEndLine(); - m->mothurOut("http://www.mothur.org"); - m->mothurOutEndLine(); - m->mothurOutEndLine(); - m->mothurOut("When using, please cite:"); - m->mothurOutEndLine(); - m->mothurOut("Schloss, P.D., et al., Introducing mothur: Open-source, platform-independent, community-supported software for describing and comparing microbial communities. Appl Environ Microbiol, 2009. 75(23):7537-41."); - m->mothurOutEndLine(); - m->mothurOutEndLine(); - m->mothurOut("Distributed under the GNU General Public License"); - m->mothurOutEndLine(); - m->mothurOutEndLine(); - m->mothurOut("Type 'help()' for information on the commands that are available"); - m->mothurOutEndLine(); - m->mothurOutEndLine(); - m->mothurOut("Type 'quit()' to exit program"); - m->mothurOutEndLine(); - - #ifdef USE_MPI - m->mothurOutJustToLog("Using MPI\tversion "); - int version, subversion; - MPI_Get_version(&version, &subversion); - m->mothurOutJustToLog(toString(version) + "." + toString(subversion) + "\n"); - #endif - - //srand(54321); - srand( (unsigned)time( NULL ) ); - - Engine* mothur; - bool bail = 0; - string input; - - if(argc>1){ - input = argv[1]; - - if (input[0] == '#') { - m->mothurOutJustToLog("Script Mode"); - m->mothurOutEndLine(); m->mothurOutEndLine(); - - mothur = new ScriptEngine(argv[0], argv[1]); - }else{ - m->mothurOutJustToLog("Batch Mode"); - m->mothurOutEndLine(); m->mothurOutEndLine(); - - mothur = new BatchEngine(argv[0], argv[1]); - } - } - else{ - m->mothurOutJustToLog("Interactive Mode"); - m->mothurOutEndLine(); m->mothurOutEndLine(); - - mothur = new InteractEngine(argv[0]); - } - - while(bail == 0) { bail = mothur->getInput(); } - - string outputDir = mothur->getOutputDir(); - string newlogFileName = outputDir + logFileName; - - //need this because m->mothurOut makes the logfile, but doesn't know where to put it - rename(logFileName.c_str(), newlogFileName.c_str()); //logfile with timestamp - - delete mothur; - - #ifdef USE_MPI - MPI_Finalize(); - #endif - - return 0; - } - catch(exception& e) { - m->errorOut(e, "mothur", "main"); - exit(1); - } -} - -/**************************************************************************************************/ - +/* + * interface.cpp + * + * + * Created by Pat Schloss on 8/14/08. + * Copyright 2008 Patrick D. Schloss. All rights reserved. + * + */ + +#include "mothur.h" +#include "engine.hpp" +#include "globaldata.hpp" +#include "mothurout.h" + + +/**************************************************************************************************/ + +GlobalData* GlobalData::_uniqueInstance = 0; +CommandFactory* CommandFactory::_uniqueInstance = 0; +MothurOut* MothurOut::_uniqueInstance = 0; + +/***********************************************************************/ +volatile int ctrlc_pressed = 0; +void ctrlc_handler ( int sig ) { + MothurOut* m = MothurOut::getInstance(); + ctrlc_pressed = 1; + m->control_pressed = ctrlc_pressed; + + if (m->executing) { //if mid command quit execution, else quit mothur + m->mothurOutEndLine(); m->mothurOut("quitting command..."); m->mothurOutEndLine(); + }else{ + m->mothurOut("quitting mothur"); m->mothurOutEndLine(); + exit(1); + } +} +/***********************************************************************/ +int main(int argc, char *argv[]){ + MothurOut* m = MothurOut::getInstance(); + try { + + signal(SIGINT, ctrlc_handler ); + + time_t ltime = time(NULL); /* calendar time */ + string logFileName = "mothur." + toString(ltime) + ".logfile"; + + #ifdef USE_MPI + MPI_Init(&argc, &argv); + #endif + + m->setFileName(logFileName); + + + //version + #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) + system("clear"); + #if defined (__APPLE__) || (__MACH__) + m->mothurOutJustToLog("Mac version"); + m->mothurOutEndLine(); m->mothurOutEndLine(); + #else + m->mothurOutJustToLog("Linux version"); + >m->mothurOutEndLine(); m->mothurOutEndLine(); + #endif + + #else + system("CLS"); + m->mothurOutJustToLog("Windows version"); + m->mothurOutEndLine(); m->mothurOutEndLine(); + #endif + + #ifdef USE_READLINE + m->mothurOutJustToLog("Using ReadLine"); + m->mothurOutEndLine(); m->mothurOutEndLine(); + #endif + + //header + m->mothurOut("mothur v.1.9"); + m->mothurOutEndLine(); + m->mothurOut("Last updated: 4/09/2010"); + m->mothurOutEndLine(); + m->mothurOutEndLine(); + m->mothurOut("by"); + m->mothurOutEndLine(); + m->mothurOut("Patrick D. Schloss"); + m->mothurOutEndLine(); + m->mothurOutEndLine(); + m->mothurOut("Department of Microbiology & Immunology"); + m->mothurOutEndLine(); + m->mothurOut("University of Michigan"); + m->mothurOutEndLine(); + m->mothurOut("pschloss@umich.edu"); + m->mothurOutEndLine(); + m->mothurOut("http://www.mothur.org"); + m->mothurOutEndLine(); + m->mothurOutEndLine(); + m->mothurOut("When using, please cite:"); + m->mothurOutEndLine(); + m->mothurOut("Schloss, P.D., et al., Introducing mothur: Open-source, platform-independent, community-supported software for describing and comparing microbial communities. Appl Environ Microbiol, 2009. 75(23):7537-41."); + m->mothurOutEndLine(); + m->mothurOutEndLine(); + m->mothurOut("Distributed under the GNU General Public License"); + m->mothurOutEndLine(); + m->mothurOutEndLine(); + m->mothurOut("Type 'help()' for information on the commands that are available"); + m->mothurOutEndLine(); + m->mothurOutEndLine(); + m->mothurOut("Type 'quit()' to exit program"); + m->mothurOutEndLine(); + + #ifdef USE_MPI + m->mothurOutJustToLog("Using MPI\tversion "); + int version, subversion; + MPI_Get_version(&version, &subversion); + m->mothurOutJustToLog(toString(version) + "." + toString(subversion) + "\n"); + #endif + + //srand(54321); + srand( (unsigned)time( NULL ) ); + + Engine* mothur; + bool bail = 0; + string input; + + if(argc>1){ + input = argv[1]; + + if (input[0] == '#') { + m->mothurOutJustToLog("Script Mode"); + m->mothurOutEndLine(); m->mothurOutEndLine(); + + mothur = new ScriptEngine(argv[0], argv[1]); + }else{ + m->mothurOutJustToLog("Batch Mode"); + m->mothurOutEndLine(); m->mothurOutEndLine(); + + mothur = new BatchEngine(argv[0], argv[1]); + } + } + else{ + m->mothurOutJustToLog("Interactive Mode"); + m->mothurOutEndLine(); m->mothurOutEndLine(); + + mothur = new InteractEngine(argv[0]); + } + + while(bail == 0) { bail = mothur->getInput(); } + + string outputDir = mothur->getOutputDir(); + string newlogFileName = outputDir + logFileName; + + //closes logfile so we can rename + m->closeLog(); + + //need this because m->mothurOut makes the logfile, but doesn't know where to put it + rename(logFileName.c_str(), newlogFileName.c_str()); //logfile with timestamp + + delete mothur; + + #ifdef USE_MPI + MPI_Finalize(); + #endif + + return 0; + } + catch(exception& e) { + m->errorOut(e, "mothur", "main"); + exit(1); + } +} + +/**************************************************************************************************/ + diff --git a/mothur.h b/mothur.h index dcb026c..062c481 100644 --- a/mothur.h +++ b/mothur.h @@ -459,15 +459,16 @@ inline string getFullPathName(string fileName){ int index = dirs.size()-1; - + while((pos = path.rfind("./")) != -1) { //while you don't have a complete path - if (path[(pos-1)] == '.') { //you want your parent directory ../ + if (pos == 0) { break; //you are at the end + }else if (path[(pos-1)] == '.') { //you want your parent directory ../ path = path.substr(0, pos-1); index--; if (index == 0) { break; } }else if (path[(pos-1)] == '/') { //you want the current working dir ./ path = path.substr(0, pos); - }else if (pos == 1) { break; + }else if (pos == 1) { break; //you are at the end }else { cout << "cannot resolve path for " << fileName << endl; return fileName; } } @@ -501,14 +502,15 @@ inline string getFullPathName(string fileName){ int index = dirs.size()-1; while((pos = path.rfind(".\\")) != -1) { //while you don't have a complete path - if (path[(pos-1)] == '.') { //you want your parent directory ../ + if (pos == 0) { break; //you are at the end + }else if (path[(pos-1)] == '.') { //you want your parent directory ../ path = path.substr(0, pos-1); index--; if (index == 0) { break; } }else if (path[(pos-1)] == '\\') { //you want the current working dir ./ path = path.substr(0, pos); - }else if (pos == 1) { break; - }else { cout << "cannot resolve path for " << fileName << endl; return fileName; } + }else if (pos == 1) { break; //you are at the end + }else { cout << "cannot resolve path for " << fileName << endl; return fileName; } } for (int i = index; i >= 0; i--) { @@ -880,9 +882,12 @@ inline void appendFiles(string temp, string filename) { } /**************************************************************************************************/ -inline string sortFile(string distFile){ +inline string sortFile(string distFile, string outputDir){ try { + + //if (outputDir == "") { outputDir += hasPath(distFile); } string outfile = getRootName(distFile) + "sorted.dist"; + //if you can, use the unix sort since its been optimized for years #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) diff --git a/mothurout.cpp b/mothurout.cpp index fe6fd26..ca1a40b 100644 --- a/mothurout.cpp +++ b/mothurout.cpp @@ -1,144 +1,154 @@ -/* - * m->mothurOut.cpp - * Mothur - * - * Created by westcott on 2/25/10. - * Copyright 2010 Schloss Lab. All rights reserved. - * - */ - -#include "mothurout.h" - -/******************************************************/ -MothurOut* MothurOut::getInstance() { - if( _uniqueInstance == 0) { - _uniqueInstance = new MothurOut(); - } - return _uniqueInstance; -} -/*********************************************************************************************/ -void MothurOut::setFileName(string filename) { - try { - logFileName = filename; - - #ifdef USE_MPI - int pid; - MPI_Comm_rank(MPI_COMM_WORLD, &pid); - - if (pid == 0) { //only one process should output to screen - #endif - - openOutputFile(filename, out); - - #ifdef USE_MPI - } - #endif - } - catch(exception& e) { - errorOut(e, "MothurOut", "setFileName"); - exit(1); - } -} -/*********************************************************************************************/ -MothurOut::~MothurOut() { - try { - _uniqueInstance = 0; - - #ifdef USE_MPI - int pid; - MPI_Comm_rank(MPI_COMM_WORLD, &pid); - - if (pid == 0) { //only one process should output to screen - #endif - - out.close(); - - #ifdef USE_MPI - } - #endif - } - catch(exception& e) { - errorOut(e, "MothurOut", "MothurOut"); - exit(1); - } -} - -/*********************************************************************************************/ -void MothurOut::mothurOut(string output) { - try { - - #ifdef USE_MPI - int pid; - MPI_Comm_rank(MPI_COMM_WORLD, &pid); - - if (pid == 0) { //only one process should output to screen - #endif - - cout << output; - out << output; - - #ifdef USE_MPI - } - #endif - } - catch(exception& e) { - errorOut(e, "MothurOut", "MothurOut"); - exit(1); - } -} -/*********************************************************************************************/ -void MothurOut::mothurOutEndLine() { - try { - #ifdef USE_MPI - int pid; - MPI_Comm_rank(MPI_COMM_WORLD, &pid); - - if (pid == 0) { //only one process should output to screen - #endif - - cout << endl; - out << endl; - - #ifdef USE_MPI - } - #endif - } - catch(exception& e) { - errorOut(e, "MothurOut", "MothurOutEndLine"); - exit(1); - } -} -/*********************************************************************************************/ -void MothurOut::mothurOutJustToLog(string output) { - try { - #ifdef USE_MPI - int pid; - MPI_Comm_rank(MPI_COMM_WORLD, &pid); - - if (pid == 0) { //only one process should output to screen - #endif - - out << output; - - #ifdef USE_MPI - } - #endif - } - catch(exception& e) { - errorOut(e, "MothurOut", "MothurOutJustToLog"); - exit(1); - } -} -/*********************************************************************************************/ -void MothurOut::errorOut(exception& e, string object, string function) { - mothurOut("Error: "); - mothurOut(toString(e.what())); - mothurOut(" has occurred in the " + object + " class function " + function + ". Please contact Pat Schloss at mothur.bugs@gmail.com, and be sure to include the mothur.logFile with your inquiry."); - mothurOutEndLine(); -} -/*********************************************************************************************/ - - - - - +/* + * m->mothurOut.cpp + * Mothur + * + * Created by westcott on 2/25/10. + * Copyright 2010 Schloss Lab. All rights reserved. + * + */ + +#include "mothurout.h" + +/******************************************************/ +MothurOut* MothurOut::getInstance() { + if( _uniqueInstance == 0) { + _uniqueInstance = new MothurOut(); + } + return _uniqueInstance; +} +/*********************************************************************************************/ +void MothurOut::setFileName(string filename) { + try { + logFileName = filename; + + #ifdef USE_MPI + int pid; + MPI_Comm_rank(MPI_COMM_WORLD, &pid); + + if (pid == 0) { //only one process should output to screen + #endif + + openOutputFile(filename, out); + + #ifdef USE_MPI + } + #endif + } + catch(exception& e) { + errorOut(e, "MothurOut", "setFileName"); + exit(1); + } +} +/*********************************************************************************************/ +void MothurOut::closeLog() { + try { + + #ifdef USE_MPI + int pid; + MPI_Comm_rank(MPI_COMM_WORLD, &pid); + + if (pid == 0) { //only one process should output to screen + #endif + + out.close(); + + #ifdef USE_MPI + } + #endif + } + catch(exception& e) { + errorOut(e, "MothurOut", "closeLog"); + exit(1); + } +} + +/*********************************************************************************************/ +MothurOut::~MothurOut() { + try { + _uniqueInstance = 0; + + } + catch(exception& e) { + errorOut(e, "MothurOut", "MothurOut"); + exit(1); + } +} +/*********************************************************************************************/ +void MothurOut::mothurOut(string output) { + try { + + #ifdef USE_MPI + int pid; + MPI_Comm_rank(MPI_COMM_WORLD, &pid); + + if (pid == 0) { //only one process should output to screen + #endif + + cout << output; + out << output; + + #ifdef USE_MPI + } + #endif + } + catch(exception& e) { + errorOut(e, "MothurOut", "MothurOut"); + exit(1); + } +} +/*********************************************************************************************/ +void MothurOut::mothurOutEndLine() { + try { + #ifdef USE_MPI + int pid; + MPI_Comm_rank(MPI_COMM_WORLD, &pid); + + if (pid == 0) { //only one process should output to screen + #endif + + cout << endl; + out << endl; + + #ifdef USE_MPI + } + #endif + } + catch(exception& e) { + errorOut(e, "MothurOut", "MothurOutEndLine"); + exit(1); + } +} +/*********************************************************************************************/ +void MothurOut::mothurOutJustToLog(string output) { + try { + #ifdef USE_MPI + int pid; + MPI_Comm_rank(MPI_COMM_WORLD, &pid); + + if (pid == 0) { //only one process should output to screen + #endif + + out << output; + + #ifdef USE_MPI + } + #endif + } + catch(exception& e) { + errorOut(e, "MothurOut", "MothurOutJustToLog"); + exit(1); + } +} +/*********************************************************************************************/ +void MothurOut::errorOut(exception& e, string object, string function) { + mothurOut("Error: "); + mothurOut(toString(e.what())); + mothurOut(" has occurred in the " + object + " class function " + function + ". Please contact Pat Schloss at mothur.bugs@gmail.com, and be sure to include the mothur.logFile with your inquiry."); + mothurOutEndLine(); +} +/*********************************************************************************************/ + + + + + diff --git a/mothurout.h b/mothurout.h index 7b4732b..d2ba6b9 100644 --- a/mothurout.h +++ b/mothurout.h @@ -1,44 +1,46 @@ -#ifndef MOTHUROUT_H -#define MOTHUROUT_H - -/* - * m->mothurOut.h - * Mothur - * - * Created by westcott on 2/25/10. - * Copyright 2010 Schloss Lab. All rights reserved. - * - */ - -#include "mothur.h" - -/***********************************************/ - -class MothurOut { - - public: - static MothurOut* getInstance(); - void setFileName(string); - - void mothurOut(string); - void mothurOutEndLine(); - void mothurOutJustToLog(string); - void errorOut(exception&, string, string); - int control_pressed; - bool executing; - - private: - static MothurOut* _uniqueInstance; - MothurOut( const MothurOut& ); // Disable copy constructor - void operator=( const MothurOut& ); // Disable assignment operator - MothurOut() {}; - ~MothurOut(); - - string logFileName; - ofstream out; - -}; -/***********************************************/ - -#endif - +#ifndef MOTHUROUT_H +#define MOTHUROUT_H + +/* + * mothurOut.h + * Mothur + * + * Created by westcott on 2/25/10. + * Copyright 2010 Schloss Lab. All rights reserved. + * + */ + +#include "mothur.h" + +/***********************************************/ + +class MothurOut { + + public: + static MothurOut* getInstance(); + void setFileName(string); + + void mothurOut(string); + void mothurOutEndLine(); + void mothurOutJustToLog(string); + void errorOut(exception&, string, string); + void closeLog(); + + int control_pressed; + bool executing; + + private: + static MothurOut* _uniqueInstance; + MothurOut( const MothurOut& ); // Disable copy constructor + void operator=( const MothurOut& ); // Disable assignment operator + MothurOut() { control_pressed = false; }; + ~MothurOut(); + + string logFileName; + ofstream out; + +}; +/***********************************************/ + +#endif + diff --git a/nameassignment.cpp b/nameassignment.cpp index 42d374d..0c30898 100644 --- a/nameassignment.cpp +++ b/nameassignment.cpp @@ -17,19 +17,23 @@ void NameAssignment::readMap(){ string firstCol, secondCol, skip; // int index = 0; - -// map data; + + map::iterator itData; int rowIndex = 0; - + while(fileHandle){ fileHandle >> firstCol; //read from first column fileHandle >> secondCol; //read from second column + + itData = (*this).find(firstCol); + if (itData == (*this).end()) { + + (*this)[firstCol] = rowIndex++; + list.push_back(secondCol); //adds data's value to list + reverse[rowIndex] = firstCol; + + }else{ m->mothurOut(firstCol + " is already in namesfile. I will use first definition."); m->mothurOutEndLine(); } -// data[firstCol] = secondCol; //store data in map - - list.push_back(secondCol); //adds data's value to list - reverse[rowIndex] = firstCol; - (*this)[firstCol] = rowIndex++; gobble(fileHandle); } fileHandle.close(); diff --git a/parselistscommand.cpp b/parselistscommand.cpp index 9955a19..d09910b 100644 --- a/parselistscommand.cpp +++ b/parselistscommand.cpp @@ -97,7 +97,7 @@ ParseListCommand::ParseListCommand(string option) { //********************************************************************************************************************** void ParseListCommand::help(){ try { - m->mothurOut("The parse.list command reads a list and group file and generates a list file for each group in the groupfile \n"); + m->mothurOut("The parse.list command reads a list and group file and generates a list file for each group in the groupfile. \n"); m->mothurOut("The parse.list command parameters are list, group and label.\n"); m->mothurOut("The list and group parameters are required.\n"); m->mothurOut("The label parameter is used to read specific labels in your input you want to use.\n"); diff --git a/parsesffcommand.cpp b/parsesffcommand.cpp index ed26be0..d210ce8 100644 --- a/parsesffcommand.cpp +++ b/parsesffcommand.cpp @@ -453,7 +453,6 @@ bool ParseSFFCommand::screenSeq(string& sequence, int& group){ } } - int fPrimer = 1; for(int i=0;icontrol_pressed) { return 0; } + //somehow the parent is getting one too many accnos //use print to reassign the taxa id taxon = getNextTaxon(seqTaxonomy); @@ -154,7 +159,7 @@ void PhyloTree::assignHeirarchyIDs(int index){ tree[it->second].heirarchyID = tree[index].heirarchyID + '.' + toString(counter); counter++; tree[it->second].level = tree[index].level + 1; - + //save maxLevel for binning the unclassified seqs if (tree[it->second].level > maxLevel) { maxLevel = tree[it->second].level; } diff --git a/phylotree.h b/phylotree.h index 345e2e7..75abffc 100644 --- a/phylotree.h +++ b/phylotree.h @@ -33,7 +33,7 @@ public: PhyloTree(); PhyloTree(string); //pass it a taxonomy file and it makes the tree ~PhyloTree() {}; - void addSeqToTree(string, string); + int addSeqToTree(string, string); void assignHeirarchyIDs(int); void print(ofstream&); vector getGenusNodes(); diff --git a/phylotypecommand.cpp b/phylotypecommand.cpp index 410ada9..1828eb1 100644 --- a/phylotypecommand.cpp +++ b/phylotypecommand.cpp @@ -119,7 +119,7 @@ int PhylotypeCommand::execute(){ //reads in taxonomy file and makes all the taxonomies the same length //by appending the last taxon to a given taxonomy as many times as needed to //make it as long as the longest taxonomy in the file - TaxEqualizer* taxEqual = new TaxEqualizer(taxonomyFileName, cutoff); + TaxEqualizer* taxEqual = new TaxEqualizer(taxonomyFileName, cutoff, outputDir); if (m->control_pressed) { delete taxEqual; return 0; } diff --git a/readcluster.cpp b/readcluster.cpp index acbebae..c8a8bc7 100644 --- a/readcluster.cpp +++ b/readcluster.cpp @@ -11,11 +11,12 @@ /***********************************************************************/ -ReadCluster::ReadCluster(string distfile, float c){ +ReadCluster::ReadCluster(string distfile, float c, string o){ globaldata = GlobalData::getInstance(); m = MothurOut::getInstance(); distFile = distfile; cutoff = c; + outputDir = o; } /***********************************************************************/ @@ -28,7 +29,7 @@ int ReadCluster::read(NameAssignment* nameMap){ if (m->control_pressed) { return 0; } - OutPutFile = sortFile(distFile); + OutPutFile = sortFile(distFile, outputDir); return 0; diff --git a/readcluster.h b/readcluster.h index 4574c80..fae7c26 100644 --- a/readcluster.h +++ b/readcluster.h @@ -21,7 +21,7 @@ class ReadCluster { public: - ReadCluster(string, float); + ReadCluster(string, float, string); ~ReadCluster(); int read(NameAssignment*); string getOutputFile() { return OutPutFile; } @@ -30,7 +30,7 @@ public: private: GlobalData* globaldata; - string distFile; + string distFile, outputDir; string OutPutFile, format; ListVector* list; float cutoff; diff --git a/readcolumn.cpp b/readcolumn.cpp index f61a40c..f29f70b 100644 --- a/readcolumn.cpp +++ b/readcolumn.cpp @@ -53,6 +53,7 @@ int ReadColumnMatrix::read(NameAssignment* nameMap){ if(itB == nameMap->end()){ cerr << "ABError: Sequence '" << secondName << "' was not found in the names file, please correct\n"; exit(1); } +//if (((itA->second == 8) && (itB->second == 1588)) || ((itA->second == 1588) && (itB->second == 8))) { cout << "found it" << endl; } if (distance == -1) { distance = 1000000; } else if (globaldata->sim) { distance = 1.0 - distance; } //user has entered a sim matrix that we need to convert. diff --git a/readotucommand.cpp b/readotucommand.cpp index 4ad63da..30dc553 100644 --- a/readotucommand.cpp +++ b/readotucommand.cpp @@ -34,7 +34,7 @@ ReadOtuCommand::ReadOtuCommand(string option) { for (it = parameters.begin(); it != parameters.end(); it++) { if (validParameter.isValidParameter(it->first, myArray, it->second) != true) { abort = true; } } - + globaldata->newRead(); //if the user changes the input directory command factory will send this info to us in the output parameter @@ -156,18 +156,17 @@ ReadOtuCommand::ReadOtuCommand(string option) { } globaldata->allLines = allLines; - + orderfile = validParameter.validFile(parameters, "order", true); if (orderfile == "not open") { abort = true; } else if (orderfile == "not found") { orderfile = ""; } else { globaldata->setOrderFile(orderfile); } - + if (abort == false) { //gets whichever one of the above is set filename = globaldata->inputFileName; } - } } @@ -204,17 +203,14 @@ void ReadOtuCommand::help(){ //********************************************************************************************************************** - -ReadOtuCommand::~ReadOtuCommand(){ - } - +ReadOtuCommand::~ReadOtuCommand(){} //********************************************************************************************************************** int ReadOtuCommand::execute(){ try { if (abort == true) { return 0; } - + if (globaldata->getFormat() == "shared") { shared = new SharedCommand(outputDir); @@ -225,11 +221,11 @@ int ReadOtuCommand::execute(){ globaldata->setListFile(""); globaldata->setGroupFile(""); globaldata->setSharedFile(""); - }else { - m->mothurOutEndLine(); - m->mothurOut("Output File Name: "); m->mothurOutEndLine(); - m->mothurOut(globaldata->getSharedFile()); m->mothurOutEndLine(); - m->mothurOutEndLine(); + }else { //shared command outputs the filenames + //m->mothurOutEndLine(); + //m->mothurOut("Output File Name: "); m->mothurOutEndLine(); + //m->mothurOut(globaldata->getSharedFile()); m->mothurOutEndLine(); + //m->mothurOutEndLine(); } delete shared; diff --git a/removeseqscommand.cpp b/removeseqscommand.cpp index 07e946b..43ec945 100644 --- a/removeseqscommand.cpp +++ b/removeseqscommand.cpp @@ -199,7 +199,7 @@ int RemoveSeqsCommand::execute(){ int RemoveSeqsCommand::readFasta(){ try { if (outputDir == "") { outputDir += hasPath(fastafile); } - string outputFileName = getRootName(fastafile) + "pick" + getExtension(fastafile); + string outputFileName = outputDir + getRootName(getSimpleName(fastafile)) + "pick" + getExtension(fastafile); ofstream out; openOutputFile(outputFileName, out); @@ -245,7 +245,7 @@ int RemoveSeqsCommand::readFasta(){ int RemoveSeqsCommand::readList(){ try { if (outputDir == "") { outputDir += hasPath(listfile); } - string outputFileName = getRootName(listfile) + "pick" + getExtension(listfile); + string outputFileName = outputDir + getRootName(getSimpleName(listfile)) + "pick" + getExtension(listfile); ofstream out; openOutputFile(outputFileName, out); @@ -316,8 +316,8 @@ int RemoveSeqsCommand::readList(){ int RemoveSeqsCommand::readName(){ try { if (outputDir == "") { outputDir += hasPath(namefile); } - string outputFileName = getRootName(namefile) + "pick" + getExtension(namefile); - string outputFileName2 = getRootName(namefile) + "dups.accnos"; + string outputFileName = outputDir + getRootName(getSimpleName(namefile)) + "pick" + getExtension(namefile); + string outputFileName2 = outputDir + getRootName(getSimpleName(namefile)) + "dups.accnos"; ofstream out2; if (dups) { openOutputFile(outputFileName2, out2); } @@ -415,7 +415,7 @@ int RemoveSeqsCommand::readName(){ int RemoveSeqsCommand::readGroup(){ try { if (outputDir == "") { outputDir += hasPath(groupfile); } - string outputFileName = getRootName(groupfile) + "pick" + getExtension(groupfile); + string outputFileName = outputDir + getRootName(getSimpleName(groupfile)) + "pick" + getExtension(groupfile); ofstream out; openOutputFile(outputFileName, out); @@ -460,7 +460,7 @@ int RemoveSeqsCommand::readGroup(){ int RemoveSeqsCommand::readAlign(){ try { if (outputDir == "") { outputDir += hasPath(alignfile); } - string outputFileName = getRootName(getRootName(alignfile)) + "pick.align.report"; + string outputFileName = outputDir + getRootName(getSimpleName(alignfile)) + "pick.align.report"; ofstream out; openOutputFile(outputFileName, out); diff --git a/setdircommand.cpp b/setdircommand.cpp index 407e57b..b6626b8 100644 --- a/setdircommand.cpp +++ b/setdircommand.cpp @@ -79,7 +79,6 @@ int SetDirectoryCommand::execute(){ commandFactory = CommandFactory::getInstance(); - //redirect output if ((output == "clear") || (output == "")) { output = ""; commandFactory->setOutputDirectory(output); } else { diff --git a/sharedrabundvector.cpp b/sharedrabundvector.cpp index 114de90..d135091 100644 --- a/sharedrabundvector.cpp +++ b/sharedrabundvector.cpp @@ -70,7 +70,7 @@ SharedRAbundVector::SharedRAbundVector(ifstream& f) : DataVector(), maxRank(0), string holdLabel, nextLabel, groupN; individual newguy; - for (int i = 0; i < lookup.size(); i++) { delete lookup[i]; } + for (int i = 0; i < lookup.size(); i++) { delete lookup[i]; lookup[i] = NULL; } lookup.clear(); //read in first row since you know there is at least 1 group. @@ -95,8 +95,8 @@ SharedRAbundVector::SharedRAbundVector(ifstream& f) : DataVector(), maxRank(0), lookup[0]->push_back(inputData, groupN); //abundance, bin, group push_back(inputData, groupN); - numSeqs += inputData; - numBins++; + //numSeqs += inputData; + //numBins++; if (inputData > maxRank) { maxRank = inputData; } } @@ -363,7 +363,7 @@ vector SharedRAbundVector::getSharedRAbundVectors(){ for (int i = 0; i < lookup.size(); i++) { //if this sharedrabund is not from a group the user wants then delete it. if (util->isValidGroup(lookup[i]->getGroup(), globaldata->Groups) == false) { - delete lookup[i]; + delete lookup[i]; lookup[i] = NULL; lookup.erase(lookup.begin()+i); i--; } diff --git a/sparsematrix.cpp b/sparsematrix.cpp index bd54433..3a0ec65 100644 --- a/sparsematrix.cpp +++ b/sparsematrix.cpp @@ -136,7 +136,7 @@ PCell* SparseMatrix::getSmallestCell(){ // if the mins vector is empty go here... if(mins.empty()){ mins.clear(); - + smallDist = begin()->dist; //set the first candidate small distance for(MatData currentCell=begin();currentCell!=end();currentCell++){ diff --git a/taxonomyequalizer.cpp b/taxonomyequalizer.cpp index fc36eb6..c7e8cb9 100644 --- a/taxonomyequalizer.cpp +++ b/taxonomyequalizer.cpp @@ -10,7 +10,7 @@ #include "taxonomyequalizer.h" /**************************************************************************************************/ -TaxEqualizer::TaxEqualizer(string tfile, int c) : cutoff(c) { +TaxEqualizer::TaxEqualizer(string tfile, int c, string o) : cutoff(c), outputDir(o) { try { m = MothurOut::getInstance(); containsConfidence = false; @@ -35,7 +35,7 @@ TaxEqualizer::TaxEqualizer(string tfile, int c) : cutoff(c) { openInputFile(tfile, in); ofstream out; - equalizedFile = getRootName(tfile) + "equalized.taxonomy"; + equalizedFile = outputDir + getRootName(getSimpleName(tfile)) + "equalized.taxonomy"; openOutputFile(equalizedFile, out); diff --git a/taxonomyequalizer.h b/taxonomyequalizer.h index e060c9e..c1e43f4 100644 --- a/taxonomyequalizer.h +++ b/taxonomyequalizer.h @@ -23,7 +23,7 @@ class TaxEqualizer { public: - TaxEqualizer(string, int); + TaxEqualizer(string, int, string); ~TaxEqualizer() {}; string getEqualizedTaxFile() { return equalizedFile; } @@ -31,7 +31,7 @@ public: private: - string equalizedFile, testTax; + string equalizedFile, testTax, outputDir; bool containsConfidence; int cutoff, highestLevel; map seqLevels; //maps name to level of taxonomy diff --git a/validparameter.cpp b/validparameter.cpp index 2d29ee3..d693bcb 100644 --- a/validparameter.cpp +++ b/validparameter.cpp @@ -216,14 +216,16 @@ string ValidParameters::validFile(map container, string paramete #endif ableToOpen = openInputFile(it->second, in); - - if (ableToOpen == 1) { return "not open"; } in.close(); - + #ifdef USE_MPI + MPI_Bcast(&ableToOpen, 1, MPI_INT, 0, MPI_COMM_WORLD); //send ableToOPen + }else { + MPI_Bcast(&ableToOpen, 1, MPI_INT, 0, MPI_COMM_WORLD); //get ableToOPen } #endif - + + if (ableToOpen == 1) { return "not open"; } } }else { return "not found"; } -- 2.39.2