]> git.donarmstrong.com Git - mothur.git/blobdiff - chimeraslayercommand.cpp
added mantel command
[mothur.git] / chimeraslayercommand.cpp
index a7ed94f67bb42a3805e08eb487923889c3a55af6..38c097f18b8124f1dadbd657af8413fc74f895c8 100644 (file)
@@ -27,6 +27,7 @@ vector<string> ChimeraSlayerCommand::getValidParameters(){
 //**********************************************************************************************************************
 ChimeraSlayerCommand::ChimeraSlayerCommand(){  
        try {
+               abort = true; calledHelp = true;
                vector<string> tempOutNames;
                outputTypes["chimera"] = tempOutNames;
                outputTypes["accnos"] = tempOutNames;
@@ -63,10 +64,10 @@ vector<string> ChimeraSlayerCommand::getRequiredFiles(){
 //***************************************************************************************************************
 ChimeraSlayerCommand::ChimeraSlayerCommand(string option)  {
        try {
-               abort = false;
+               abort = false; calledHelp = false;   
                
                //allow user to run help
-               if(option == "help") { help(); abort = true; }
+               if(option == "help") { help(); abort = true; calledHelp = true; }
                
                else {
                        //valid paramters for this command
@@ -272,6 +273,9 @@ ChimeraSlayerCommand::ChimeraSlayerCommand(string option)  {
                        temp = validParameter.validFile(parameters, "trim", false);                             if (temp == "not found") { temp = "f"; }
                        trim = m->isTrue(temp); 
                        
+                       //temp = validParameter.validFile(parameters, "trimera", false);                                if (temp == "not found") { temp = "f"; }
+                       //trimera = m->isTrue(temp); 
+                       
                        search = validParameter.validFile(parameters, "search", false);                 if (search == "not found") { search = "distance"; }
                        
                        temp = validParameter.validFile(parameters, "iters", false);                    if (temp == "not found") { temp = "100"; }              
@@ -308,6 +312,7 @@ void ChimeraSlayerCommand::help(){
                m->mothurOut("When using MPI, the processors parameter is set to the number of MPI processes running. \n");
                #endif
                m->mothurOut("The trim parameter allows you to output a new fasta file containing your sequences with the chimeric ones trimmed to include only their longest piece, default=F. \n");
+               //m->mothurOut("The trimera parameter allows you to check both peices of a chimeric sequence for chimeras, thus looking for trimeras and quadmeras. default=F. \n");
                m->mothurOut("The window parameter allows you to specify the window size for searching for chimeras, default=50. \n");
                m->mothurOut("The increment parameter allows you to specify how far you move each window while finding chimeric sequences, default=5.\n");
                m->mothurOut("The numwanted parameter allows you to specify how many sequences you would each query sequence compared with, default=15.\n");
@@ -343,7 +348,7 @@ ChimeraSlayerCommand::~ChimeraSlayerCommand(){      /*      do nothing      */      }
 int ChimeraSlayerCommand::execute(){
        try{
                
-               if (abort == true) { return 0; }
+               if (abort == true) { if (calledHelp) { return 0; }  return 2;   }
                
                for (int s = 0; s < fastaFileNames.size(); s++) {
                                
@@ -618,6 +623,9 @@ int ChimeraSlayerCommand::driver(linePair* filePos, string outputFName, string f
                                        Sequence* trimmed = chimera->print(out, out2);
                                        
                                        if (trim) { trimmed->printSequence(out3); delete trimmed; }
+                                       
+                                       //do you want to check both pieces for chimeras
+                                       //if (trimera) {}
                                }
                        count++;
                        }
@@ -700,6 +708,9 @@ int ChimeraSlayerCommand::driverMPI(int start, int num, MPI_File& inMPI, MPI_Fil
                                                MPI_File_write_shared(outFastaMPI, buf2, length, MPI_CHAR, &status);
                                                delete buf2;
                                        }
+                                       
+                                       //do you want to check both pieces for chimeras
+                                       //if (trimera) {}
                                                
                                }
                        }