]> git.donarmstrong.com Git - mothur.git/blobdiff - shhhseqscommand.h
changing command name classify.shared to classifyrf.shared
[mothur.git] / shhhseqscommand.h
index 5aceca8888e959c4ac4e511b15f954e7564c40c5..ffd72b9ebdc161291f9705333f018cb56c09559c 100644 (file)
@@ -29,8 +29,10 @@ public:
        vector<string> setParameters();
        string getCommandName()                 { return "shhh.seqs";   }
        string getCommandCategory()             { return "Sequence Processing";         }
+       
        string getHelpString(); 
-       string getCitation() { return "http://www.mothur.org/wiki/Shhh.seqs"; }
+    string getOutputPattern(string);   
+       string getCitation() { return "Schloss PD, Gevers D, Westcott SL (2011).  Reducing the effects of PCR amplification and sequencing artifacts on 16S rRNA-based studies.  PLoS ONE.  6:e27310.\nQuince C, Lanzen A, Davenport RJ, Turnbaugh PJ (2011).  Removing noise from pyrosequenced amplicons.  BMC Bioinformatics  12:38.\nhttp://www.mothur.org/wiki/Shhh.seqs"; }
        string getDescription()         { return "shhh.seqs"; }
        
        
@@ -55,8 +57,8 @@ private:
        int loadData(correctDist*, seqNoise&, vector<string>&, vector<string>&, vector<string>&, vector<int>&, map<string, string>&, vector<Sequence>&);
 
        int driver(seqNoise&, vector<string>&, vector<string>&, vector<string>&, vector<int>&, string, string, string, string);
-       int driverGroups(SequenceParser&, string, string, string, int, int, vector<string>);
-       int createProcessesGroups(SequenceParser&, string, string, string, vector<string>);
+       vector<string> driverGroups(SequenceParser&, string, string, string, int, int, vector<string>);
+       vector<string> createProcessesGroups(SequenceParser&, string, string, string, vector<string>);
        int deconvoluteResults(string, string);
 
 
@@ -75,8 +77,9 @@ struct shhhseqsData {
        MothurOut* m;
        int start;
        int end;
-       int sigma, threadID;
+       int sigma, threadID, count;
        vector<string> groups;
+       vector<string> mapfileNames;
        
        shhhseqsData(){}
        shhhseqsData(string f, string n, string g, string nff,  string nnf, string nmf, vector<string> gr, MothurOut* mout, int st, int en, int s, int tid) {
@@ -85,18 +88,19 @@ struct shhhseqsData {
                groupfile = g;
                newFName = nff;
                newNName = nnf;
-               newNName = nmf;
+               newMName = nmf;
                m = mout;
                start = st;
                end = en;
                sigma = s;
                threadID = tid;
                groups = gr;
+        count=0;
        }
 };
 
 /**************************************************************************************************/
-#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
 #else
 static DWORD WINAPI MyShhhSeqsThreadFunction(LPVOID lpParam){ 
        shhhseqsData* pDataArray;
@@ -110,12 +114,14 @@ static DWORD WINAPI MyShhhSeqsThreadFunction(LPVOID lpParam){
                //precluster each group
                for (int k = pDataArray->start; k < pDataArray->end; k++) {
                        
+            pDataArray->count++;
+            
                        int start = time(NULL);
                        
                        if (pDataArray->m->control_pressed) {  return 0; }
                        
                        pDataArray->m->mothurOutEndLine(); pDataArray->m->mothurOut("Processing group " + pDataArray->groups[k] + ":"); pDataArray->m->mothurOutEndLine();
-                       
+
                        map<string, string> thisNameMap;
                        thisNameMap = parser.getNameMap(pDataArray->groups[k]); 
                        vector<Sequence> thisSeqs = parser.getSeqs(pDataArray->groups[k]);
@@ -311,10 +317,9 @@ static DWORD WINAPI MyShhhSeqsThreadFunction(LPVOID lpParam){
                        
                        pDataArray->m->appendFiles(pDataArray->newFName+pDataArray->groups[k], pDataArray->newFName); pDataArray->m->mothurRemove(pDataArray->newFName+pDataArray->groups[k]);
                        pDataArray->m->appendFiles(pDataArray->newNName+pDataArray->groups[k], pDataArray->newNName); pDataArray->m->mothurRemove(pDataArray->newNName+pDataArray->groups[k]);
+                       pDataArray->mapfileNames.push_back(pDataArray->newMName+pDataArray->groups[k]+".map");
                        
                        pDataArray->m->mothurOut("It took " + toString(time(NULL) - start) + " secs to process group " + pDataArray->groups[k] + "."); pDataArray->m->mothurOutEndLine(); 
-                       
-                                                       
                }
                
                return 0;
@@ -322,7 +327,7 @@ static DWORD WINAPI MyShhhSeqsThreadFunction(LPVOID lpParam){
                
        }
        catch(exception& e) {
-               pDataArray->m->errorOut(e, "PreClusterCommand", "MyPreclusterThreadFunction");
+               pDataArray->m->errorOut(e, "ShhhSeqsCommand", "MyShhhSeqsThreadFunction");
                exit(1);
        }
 }