]> git.donarmstrong.com Git - mothur.git/commitdiff
1.12.1
authorwestcott <westcott>
Thu, 29 Jul 2010 13:09:06 +0000 (13:09 +0000)
committerwestcott <westcott>
Thu, 29 Jul 2010 13:09:06 +0000 (13:09 +0000)
bayesian.cpp
chimeraslayercommand.cpp
classifyseqscommand.cpp
engine.cpp
filterseqscommand.cpp
getrelabundcommand.cpp
makefile
mothur.cpp
venn.cpp

index d0c0a16fe834b1a2e8a5c87698e0b02fba41fbf8..e5ab89e6216426e2cd9ca1c8a7eca16db203cd00 100644 (file)
@@ -71,6 +71,8 @@ Classify(), kmerSize(ksize), confidenceThreshold(cutoff), iters(i)  {
                        
                                for (int j = 0; j < wordGenusProb.size(); j++) {        wordGenusProb[j].resize(genusNodes.size());             }
                                
+                               ofstream out;
+                               ofstream out2;
                                
                                #ifdef USE_MPI
                                        int pid;
@@ -79,12 +81,11 @@ Classify(), kmerSize(ksize), confidenceThreshold(cutoff), iters(i)  {
                                        if (pid == 0) {  
                                #endif
 
-                               ofstream out;
+                               
                                openOutputFile(probFileName, out);
                                
                                out << numKmers << endl;
                                
-                               ofstream out2;
                                openOutputFile(probFileName2, out2);
                                
                                #ifdef USE_MPI
@@ -94,7 +95,7 @@ Classify(), kmerSize(ksize), confidenceThreshold(cutoff), iters(i)  {
                                
                                //for each word
                                for (int i = 0; i < numKmers; i++) {
-                                       if (m->control_pressed) { break; }
+                                       if (m->control_pressed) {  break; }
                                        
                                        #ifdef USE_MPI
                                                MPI_Comm_rank(MPI_COMM_WORLD, &pid); //find out who we are
@@ -128,7 +129,9 @@ Classify(), kmerSize(ksize), confidenceThreshold(cutoff), iters(i)  {
                                                wordGenusProb[i][k] = log((count[genusNodes[k]] + probabilityInTemplate) / (float) (genusTotals[k] + 1));  
                                                if (count[genusNodes[k]] != 0) { 
                                                        #ifdef USE_MPI
+                                                               int pid;
                                                                MPI_Comm_rank(MPI_COMM_WORLD, &pid); //find out who we are
+                                               
                                                                if (pid == 0) {  
                                                        #endif
 
@@ -144,6 +147,7 @@ Classify(), kmerSize(ksize), confidenceThreshold(cutoff), iters(i)  {
                                        
                                        #ifdef USE_MPI
                                                MPI_Comm_rank(MPI_COMM_WORLD, &pid); //find out who we are
+                               
                                                if (pid == 0) {  
                                        #endif
                                        
@@ -157,6 +161,7 @@ Classify(), kmerSize(ksize), confidenceThreshold(cutoff), iters(i)  {
                                
                                #ifdef USE_MPI
                                        MPI_Comm_rank(MPI_COMM_WORLD, &pid); //find out who we are
+                               
                                        if (pid == 0) {  
                                #endif
                                
index 321883be75a2a165bfc61e3e34a97c7de95e37cb..1dd3d4221975a33bf52e5e6031029c97d66e0ca5 100644 (file)
@@ -150,7 +150,7 @@ ChimeraSlayerCommand::ChimeraSlayerCommand(string option)  {
                        temp = validParameter.validFile(parameters, "minbs", false);                    if (temp == "not found") { temp = "90"; }
                        convert(temp, minBS);
                        
-                       temp = validParameter.validFile(parameters, "minsnp", false);                   if (temp == "not found") { temp = "10"; }
+                       temp = validParameter.validFile(parameters, "minsnp", false);                   if (temp == "not found") { temp = "100"; }
                        convert(temp, minSNP);
 
                        temp = validParameter.validFile(parameters, "parents", false);                  if (temp == "not found") { temp = "3"; }
@@ -205,7 +205,7 @@ void ChimeraSlayerCommand::help(){
                m->mothurOut("The minsim parameter allows you to specify a minimum similarity with the parent fragments, default=90. \n");
                m->mothurOut("The mincov parameter allows you to specify minimum coverage by closest matches found in template. Default is 70, meaning 70%. \n");
                m->mothurOut("The minbs parameter allows you to specify minimum bootstrap support for calling a sequence chimeric. Default is 90, meaning 90%. \n");
-               m->mothurOut("The minsnp parameter allows you to specify percent of SNPs to sample on each side of breakpoint for computing bootstrap support (default: 10) \n");
+               m->mothurOut("The minsnp parameter allows you to specify percent of SNPs to sample on each side of breakpoint for computing bootstrap support (default: 100) \n");
                m->mothurOut("The search parameter allows you to specify search method for finding the closest parent. Choices are distance, blast, and kmer, default distance. \n");
                m->mothurOut("The realign parameter allows you to realign the query to the potential parents. Choices are true or false, default false.  \n");
                m->mothurOut("The chimera.slayer command should be in the following format: \n");
index 0635fdeb4cd9a72de87d786d6a0aa30056b99a7d..a95f436dd7ffdf4403d316be77a1f8ab580f21f5 100644 (file)
@@ -399,10 +399,15 @@ int ClassifySeqsCommand::execute(){
                
                        m->mothurOut("Classifying sequences from " + fastaFileNames[s] + " ..." ); m->mothurOutEndLine();
                        
+                       string RippedTaxName = getRootName(getSimpleName(taxonomyFileName));
+                       RippedTaxName = getExtension(RippedTaxName.substr(0, RippedTaxName.length()-1));
+                       if (RippedTaxName[0] == '.') { RippedTaxName = RippedTaxName.substr(1, RippedTaxName.length()); }
+                       RippedTaxName +=  "."; 
+               
                        if (outputDir == "") { outputDir += hasPath(fastaFileNames[s]); }
-                       string newTaxonomyFile = outputDir + getRootName(getSimpleName(fastaFileNames[s])) + getRootName(getSimpleName(taxonomyFileName)) + "taxonomy";
+                       string newTaxonomyFile = outputDir + getRootName(getSimpleName(fastaFileNames[s])) + RippedTaxName + "taxonomy";
                        string tempTaxonomyFile = outputDir + getRootName(getSimpleName(fastaFileNames[s])) + "taxonomy.temp";
-                       string taxSummary = outputDir + getRootName(getSimpleName(fastaFileNames[s])) + getRootName(getSimpleName(taxonomyFileName)) + "tax.summary";
+                       string taxSummary = outputDir + getRootName(getSimpleName(fastaFileNames[s])) + RippedTaxName + "tax.summary";
                        
                        outputNames.push_back(newTaxonomyFile);
                        outputNames.push_back(taxSummary);
index 7bcb4e41185bfa2104b3ef29432db0af7cbe58a2..7bacec5c0e757c7b77d3c8801970c17bd3cc5a4a 100644 (file)
@@ -51,17 +51,50 @@ bool InteractEngine::getInput(){
                
                while(quitCommandCalled != 1){
 
-
+                       #ifdef USE_MPI
+                               int pid, processors;
+                               MPI_Status status;
+                               MPI_Comm_rank(MPI_COMM_WORLD, &pid); 
+                               MPI_Comm_size(MPI_COMM_WORLD, &processors);
+                               
+                               if (pid == 0) {
+                               
+                       #endif
+                       
                        mout->mothurOutEndLine();
                        
                        input = getCommand();   
                        mout->mothurOutEndLine();       
-               
+                       
                        if (mout->control_pressed) { input = "quit()"; }
                        
                        //allow user to omit the () on the quit command
                        if (input == "quit") { input = "quit()"; }
+
+                       
+                       #ifdef USE_MPI
+                               //send commandName
+                               for(int i = 1; i < processors; i++) { 
+                                               int length = input.length();
+                                               MPI_Send(&length, 1, MPI_INT, i, 2001, MPI_COMM_WORLD);
+                                               MPI_Send(&input[0], length, MPI_CHAR, i, 2001, MPI_COMM_WORLD);
+       
+                                       }
+                               }else {
+                                       int length;
+                                       MPI_Recv(&length, 1, MPI_INT, 0, 2001, MPI_COMM_WORLD, &status);
+                                       //recieve container
+                                       char* tempBuf = new char[length];
+                                       MPI_Recv(&tempBuf[0], length, MPI_CHAR, 0, 2001, MPI_COMM_WORLD, &status);
+                                       
+                                       input = tempBuf;
+                                       if (input.length() > length) { input = input.substr(0, length);  }
+                                       delete tempBuf; 
+                               }
+
                        
+                       #endif
+               
                        CommandOptionParser parser(input);
                        commandName = parser.getCommandString();
        
@@ -72,9 +105,9 @@ bool InteractEngine::getInput(){
                                        #ifdef USE_MPI
                                                int pid;
                                                MPI_Comm_rank(MPI_COMM_WORLD, &pid); 
-//cout << pid << " is here " << commandName << endl;
+                                               
                                                if ((cFactory->MPIEnabled(commandName)) || (pid == 0)) {
+                                       //cout << pid << " is in execute " << commandName << endl;
                                        #endif
                                        //executes valid command
                                        Command* command = cFactory->getCommand(commandName, options);
@@ -100,9 +133,6 @@ bool InteractEngine::getInput(){
 /***********************************************************************/
 string Engine::getCommand()  {
        try {
-               #ifdef USE_MPI
-                       MPI_Barrier(MPI_COMM_WORLD);
-               #endif
        
                #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
                        #ifdef USE_READLINE
@@ -181,10 +211,45 @@ bool BatchEngine::getInput(){
                int quitCommandCalled = 0;
            int count = 0;
                while(quitCommandCalled == 0){
-       
+                       
+                       #ifdef USE_MPI
+                               int pid, processors;
+                               MPI_Status status;
+                               MPI_Comm_rank(MPI_COMM_WORLD, &pid); 
+                               MPI_Comm_size(MPI_COMM_WORLD, &processors);
+                               
+                               if (pid == 0) {
+                               
+                       #endif
+                       
                        input = getNextCommand(inputBatchFile);
                        count++;
                        
+                       #ifdef USE_MPI
+                               //send commandName
+                               for(int i = 1; i < processors; i++) { 
+                                               int length = input.length();
+                                               MPI_Send(&length, 1, MPI_INT, i, 2001, MPI_COMM_WORLD);
+                                               MPI_Send(&input[0], length, MPI_CHAR, i, 2001, MPI_COMM_WORLD);
+       
+                                       }
+                               }else {
+                                       int length;
+                                       MPI_Recv(&length, 1, MPI_INT, 0, 2001, MPI_COMM_WORLD, &status);
+                                       //recieve container
+                                       char* tempBuf = new char[length];
+                                       MPI_Recv(&tempBuf[0], length, MPI_CHAR, 0, 2001, MPI_COMM_WORLD, &status);
+                                       
+                                       input = tempBuf;
+                                       if (input.length() > length) { input = input.substr(0, length);  }
+                                       delete tempBuf; 
+                               }
+
+                       
+                       #endif
+
+                       
+                       
                        if (input[0] != '#') {
                                
                                mout->mothurOutEndLine();
@@ -239,11 +304,6 @@ bool BatchEngine::getInput(){
 string BatchEngine::getNextCommand(ifstream& inputBatchFile) {
        try {
                
-               #ifdef USE_MPI
-                       int err = MPI_Barrier(MPI_COMM_WORLD);
-//cout << "barrier = " << err << '\t' << MPI_SUCCESS << endl;
-               #endif
-               
                string nextcommand = "";
                
                if (inputBatchFile.eof()) { nextcommand = "quit()"; }
@@ -294,7 +354,17 @@ bool ScriptEngine::getInput(){
                int quitCommandCalled = 0;
        
                while(quitCommandCalled == 0){
-               
+                       
+                       #ifdef USE_MPI
+                               int pid, processors;
+                               MPI_Status status;
+                               MPI_Comm_rank(MPI_COMM_WORLD, &pid); 
+                               MPI_Comm_size(MPI_COMM_WORLD, &processors);
+                               
+                               if (pid == 0) {
+                               
+                       #endif
+                       
                        input = getNextCommand(listOfCommands); 
                        
                        if (input == "") { input = "quit()"; }
@@ -303,6 +373,30 @@ bool ScriptEngine::getInput(){
                        mout->mothurOut("mothur > " + input);
                        mout->mothurOutEndLine();
                        
+                       #ifdef USE_MPI
+                               //send commandName
+                               for(int i = 1; i < processors; i++) { 
+                                               int length = input.length();
+                                               MPI_Send(&length, 1, MPI_INT, i, 2001, MPI_COMM_WORLD);
+                                               MPI_Send(&input[0], length, MPI_CHAR, i, 2001, MPI_COMM_WORLD);
+       
+                                       }
+                               }else {
+                                       int length;
+                                       MPI_Recv(&length, 1, MPI_INT, 0, 2001, MPI_COMM_WORLD, &status);
+                                       //recieve container
+                                       char* tempBuf = new char[length];
+                                       MPI_Recv(&tempBuf[0], length, MPI_CHAR, 0, 2001, MPI_COMM_WORLD, &status);
+                                       
+                                       input = tempBuf;
+                                       if (input.length() > length) { input = input.substr(0, length);  }
+                                       delete tempBuf; 
+                               }
+
+                       
+                       #endif
+                       
+                       
                        if (mout->control_pressed) { input = "quit()"; }
                                
                        //allow user to omit the () on the quit command
@@ -354,10 +448,6 @@ bool ScriptEngine::getInput(){
 string ScriptEngine::getNextCommand(string& commandString) {
        try {
                
-               #ifdef USE_MPI
-                       MPI_Barrier(MPI_COMM_WORLD);
-               #endif
-               
                string nextcommand = "";
                int count = 0;
                
index d2c7c6bb1f46e9e3ee1eef49ff83b6d4e840d173..7ab00a7822f7a7fc7ddd1ef0de00d2d24b8c51de 100644 (file)
@@ -263,7 +263,7 @@ int FilterSeqsCommand::filterSequences() {
                                MPI_Status status; 
                                MPI_Comm_size(MPI_COMM_WORLD, &processors); //set processors to the number of mpi processes running
                                MPI_Comm_rank(MPI_COMM_WORLD, &pid); //find out who we are
-                               
+       cout << pid << "is in create filter " << endl;                  
                                MPI_File outMPI;
                                MPI_File tempMPI;
                                MPI_File inMPI;
index 90d084f3e9be3f27f0723f4e5b095bd3cc61a1c7..037cd3ee70b970a7f0ecce05e2e0c073e449562e 100644 (file)
@@ -244,7 +244,6 @@ int GetRelAbundCommand::getRelAbundance(vector<SharedRAbundVector*>& thisLookUp,
                                        //calc the total in this otu
                                        int totalOtu = 0;
                                        for (int l = 0; l < thisLookUp.size(); l++) {  totalOtu += thisLookUp[l]->getAbundance(j); }
-                                       
                                        relabund = abund / (float) totalOtu;
                                }else if (scale == "averagegroup") {
                                        relabund = abund / (float) (thisLookUp[i]->getNumSeqs() / (float) thisLookUp[i]->getNumBins());
index 55039af257bbc7297baa8a04c423eba92de12c07..d751bb6b310fada520a10a292b3e45f5b8f4b309 100644 (file)
--- a/makefile
+++ b/makefile
@@ -39,7 +39,7 @@ endif
 # if you do not want to use the readline library, set this to no.
 # make sure you have the library installed
 
-USEREADLINE ?= no
+USEREADLINE ?= yes
 
 ifeq  ($(strip $(USEREADLINE)),yes)
     CXXFLAGS += -DUSE_READLINE
index a95c381658009f988e6caff879181a9412851c3d..c413cedeef8dac80a552349a48129dfb54d50a1d 100644 (file)
@@ -98,9 +98,9 @@ int main(int argc, char *argv[]){
                #endif
                
                //header
-               m->mothurOut("mothur v.1.12.0");
+               m->mothurOut("mothur v.1.12.1");
                m->mothurOutEndLine();          
-               m->mothurOut("Last updated: 7/23/2010");
+               m->mothurOut("Last updated: 7/29/2010");
                m->mothurOutEndLine();  
                m->mothurOutEndLine();          
                m->mothurOut("by");
index 7e2404997fc8ea4b02e89b870905cd832e123041..443c36ce95c0c8a8bb9233f2aa40c3518126e28d 100644 (file)
--- a/venn.cpp
+++ b/venn.cpp
@@ -34,7 +34,7 @@ vector<string> Venn::getPic(SAbundVector* sabund, vector<Calculator*> vCalcs) {
                vector<string> outputNames;
                
                for(int i=0;i<vCalcs.size();i++){
-                       string filenamesvg = outputDir + getSimpleName(globaldata->inputFileName) + ".venn." + sabund->getLabel() + vCalcs[i]->getName() + ".svg";
+                       string filenamesvg = outputDir + getRootName(getSimpleName(globaldata->inputFileName)) + "." + sabund->getLabel() + "." + vCalcs[i]->getName() + ".svg";
                        outputNames.push_back(filenamesvg);
                        openOutputFile(filenamesvg, outsvg);
                        
@@ -88,7 +88,7 @@ vector<string> Venn::getPic(vector<SharedRAbundVector*> lookup, vector<Calculato
                        
                        //make a file for each calculator
                        for(int i=0;i<vCalcs.size();i++){
-                               string filenamesvg = outputDir + getSimpleName(globaldata->inputFileName) + lookup[0]->getLabel() + ".venn." + vCalcs[i]->getName() + ".svg";
+                               string filenamesvg = outputDir + getRootName(getSimpleName(globaldata->inputFileName)) + lookup[0]->getLabel() + "." + vCalcs[i]->getName() + "." + lookup[0]->getGroup() + ".svg";
                                outputNames.push_back(filenamesvg);
                                openOutputFile(filenamesvg, outsvg);
                                
@@ -140,7 +140,8 @@ vector<string> Venn::getPic(vector<SharedRAbundVector*> lookup, vector<Calculato
                        
                        //make a file for each calculator
                        for(int i=0;i<vCalcs.size();i++){
-                               string filenamesvg = outputDir + getSimpleName(globaldata->inputFileName) + lookup[0]->getLabel() + ".venn." + vCalcs[i]->getName() + ".svg";
+                               string filenamesvg = outputDir + getRootName(getSimpleName(globaldata->inputFileName)) + lookup[0]->getLabel() + "." + vCalcs[i]->getName() + "." + lookup[0]->getGroup() + "-" + lookup[1]->getGroup() + ".svg";
+
                                outputNames.push_back(filenamesvg);
                                openOutputFile(filenamesvg, outsvg);
                                
@@ -214,7 +215,8 @@ vector<string> Venn::getPic(vector<SharedRAbundVector*> lookup, vector<Calculato
                        //make a file for each calculator
                        for(int i=0;i<vCalcs.size();i++){
                        
-                               string filenamesvg = outputDir + getSimpleName(globaldata->inputFileName) + lookup[0]->getLabel() + ".venn." + vCalcs[i]->getName() + ".svg";
+                               string filenamesvg = outputDir + getRootName(getSimpleName(globaldata->inputFileName)) + lookup[0]->getLabel() + "." + vCalcs[i]->getName() + "." + lookup[0]->getGroup() + "-" + lookup[1]->getGroup() + "-" + lookup[2]->getGroup() + ".svg";
+
                                outputNames.push_back(filenamesvg);
                                openOutputFile(filenamesvg, outsvg);
                                
@@ -475,7 +477,7 @@ vector<string> Venn::getPic(vector<SharedRAbundVector*> lookup, vector<Calculato
                                
                                if ((vCalcs[i]->getName() != "sharedsobs") && (vCalcs[i]->getName() != "sharedchao")) { m->mothurOut(vCalcs[i]->getName() + " is not a valid calculator with four groups.  It will be disregarded. "); m->mothurOutEndLine(); }
                                else{
-                                       string filenamesvg = outputDir + getSimpleName(globaldata->inputFileName) + lookup[0]->getLabel() + ".venn." + vCalcs[i]->getName() + ".svg";
+                                       string filenamesvg = outputDir + getRootName(getSimpleName(globaldata->inputFileName)) + lookup[0]->getLabel() + "." + vCalcs[i]->getName() + "." + lookup[0]->getGroup() + "-" + lookup[1]->getGroup() + "-" + lookup[2]->getGroup() + "-" + lookup[3]->getGroup() + ".svg";
                                        outputNames.push_back(filenamesvg);
                                        openOutputFile(filenamesvg, outsvg);