]> git.donarmstrong.com Git - mothur.git/commitdiff
added parameter to chimera.uchime
authorwestcott <westcott>
Tue, 17 May 2011 19:06:36 +0000 (19:06 +0000)
committerwestcott <westcott>
Tue, 17 May 2011 19:06:36 +0000 (19:06 +0000)
48 files changed:
addtargets2.cpp
alignchime.cpp
alignchimel.cpp
alnheuristics.h
alnparams.cpp
alnparams.h
alpha.cpp
alpha.h
alpha2.cpp
blastdb.cpp
chainer.h
chime.h
chimerauchimecommand.cpp
chimerauchimecommand.h
diagbox.h
dp.h
evalue.h
fractid.cpp
getparents.cpp
globalalign2.cpp
help.h
hsp.h
hspfinder.h
make3way.cpp
mx.cpp
mx.h
myopts.h
myutils.cpp
myutils.h
orf.h
out.h
path.cpp
path.h
searchchime.cpp
seq.h
seqdb.cpp
seqdb.h
setnucmx.cpp
sfasta.cpp
sfasta.h
timing.h
tracebackbit.cpp
uc.h
uchime_main.cpp
usort.cpp
viterbifast.cpp
windex.h
writechhit.cpp

index 4e0dbd1fea24d32885e00b3e83b62690d6c8065b..57a4ef58b1b77b586ff104c5f62c25f0bd901941 100644 (file)
@@ -1,5 +1,5 @@
 //#if  UCHIMES\r
-\r
+//uchime by Robert C. Edgar http://drive5.com/uchime This code is donated to the public domain.\r
 #include "myutils.h"\r
 #include "chime.h"\r
 #include "ultra.h"\r
index d7b05a877f2e2e09746d4ed02864fb0884349613..c97c333ce42ad6d50fcdca96cb2758c30dc8d213 100644 (file)
@@ -1,3 +1,5 @@
+//uchime by Robert C. Edgar http://drive5.com/uchime This code is donated to the public domain.\r
+\r
 #include "myutils.h"\r
 #include "seq.h"\r
 #include "chime.h"\r
index ae152af8dea0d02ff298b367756971468d0ca078..8f4cbd57bd1cda8e29e8f1cbdde32292643aeb5d 100644 (file)
@@ -1,3 +1,5 @@
+//uchime by Robert C. Edgar http://drive5.com/uchime This code is donated to the public domain.\r
+\r
 #include "myutils.h"\r
 #include "seq.h"\r
 #include "chime.h"\r
index 9a8d283ed4f710b8951a2d72faf7ce9f39450e83..cd346cf1201d5ac6e265da145f99476a1168b82d 100644 (file)
@@ -1,3 +1,5 @@
+//uchime by Robert C. Edgar http://drive5.com/uchime This code is donated to the public domain.\r
+\r
 #ifndef alnheuristics_h\r
 #define alnheuristics_h\r
 \r
index d1b90364212dc4aa41bd275166e22cf37afc2038..41ee738027921b1a217544a67a449ff0dc5fb761 100644 (file)
@@ -1,3 +1,5 @@
+//uchime by Robert C. Edgar http://drive5.com/uchime This code is donated to the public domain.\r
+\r
 #include "myutils.h"\r
 #include <float.h>     // for FLT_MAX\r
 #include "mx.h"\r
@@ -6,12 +8,12 @@
 \r
 #define TEST   0\r
 \r
-void SetBLOSUM62();
+void SetBLOSUM62();\r
 void SetNucSubstMx(double Match, double Mismatch);\r
 void ReadSubstMx(const string &FileName, Mx<float> &Mxf);\r
-
-extern Mx<float> g_SubstMxf;
-extern float **g_SubstMx;
+\r
+extern Mx<float> g_SubstMxf;\r
+extern float **g_SubstMx;\r
 \r
 void AlnParams::Clear()\r
        {\r
@@ -313,14 +315,14 @@ void AlnParams::SetPenalties(const string &OpenStr, const string &ExtStr)
 void AlnParams::SetMxFromCmdLine(bool IsNucleo)\r
        {\r
        if (IsNucleo)\r
-               SetNucSubstMx(opt_match, opt_mismatch);
+               SetNucSubstMx(opt_match, opt_mismatch);\r
        else\r
                {\r
                if (opt_matrix == "")\r
                        {\r
                        SubstMxName = "BLOSUM62";\r
-                       SetBLOSUM62();
-                       }
+                       SetBLOSUM62();\r
+                       }\r
                else\r
                        {\r
                        ReadSubstMx(opt_matrix, g_SubstMxf);\r
@@ -361,9 +363,9 @@ void AlnParams::InitFromCmdLine(bool IsNucleo)
 \r
 // Global\r
        if (IsNucleo)\r
-               Init4(g_SubstMx, -10.0, -1.0, -0.5, -0.5);
+               Init4(g_SubstMx, -10.0, -1.0, -0.5, -0.5);\r
        else\r
-               Init4(g_SubstMx, -17.0, -1.0, -0.5, -0.5);
+               Init4(g_SubstMx, -17.0, -1.0, -0.5, -0.5);\r
        SetPenalties(opt_gapopen, opt_gapext);\r
        }\r
 \r
index 4037912566144aff0ce326609029004395a15a6f..b159179098426ae1eaac9ab11c20251b15c9e0dc 100644 (file)
@@ -1,3 +1,5 @@
+//uchime by Robert C. Edgar http://drive5.com/uchime This code is donated to the public domain.\r
+\r
 #ifndef alnparams_h\r
 #define alnparams_h\r
 \r
index 0efca3ba0bc09a61c0ad980948a7f9c49761a3f7..9d82f350eb7d8045d59f1005af13057a5ec1a3ac 100644 (file)
--- a/alpha.cpp
+++ b/alpha.cpp
@@ -1,4 +1,5 @@
 // Generated by /p/py/alphac.py
+//uchime by Robert C. Edgar http://drive5.com/uchime This code is donated to the public domain.
 #include "alpha.h"
 
 unsigned g_CharToLetterAminoStop[256] =
diff --git a/alpha.h b/alpha.h
index e021b7fbc307ea1277a26d4a86275415cc167754..e491c9c602ffe0186f0d3b2aec6d514d87832b05 100644 (file)
--- a/alpha.h
+++ b/alpha.h
@@ -1,3 +1,5 @@
+//uchime by Robert C. Edgar http://drive5.com/uchime This code is donated to the public domain.\r
+\r
 #ifndef alpha_h\r
 #define alpha_h\r
 \r
index 26bc1c6bac30ae7c3c024d74eb0fb97d55477397..08f6e21cefab25906fa8b54a0afa330099a6079c 100644 (file)
@@ -1,3 +1,5 @@
+//uchime by Robert C. Edgar http://drive5.com/uchime This code is donated to the public domain.\r
+\r
 #include "myutils.h"\r
 #include "alpha.h"\r
 #include "timing.h"\r
index 70349e50f0264b68fba76c4f04ebbddd0c8c96f6..b1a7b48d1108d747c1423eb0f8bad19e3ceede42 100644 (file)
@@ -83,8 +83,10 @@ vector<int> BlastDB::findClosestSequences(Sequence* seq, int n) {
                        blastCommand = path + "blast/bin/blastall -p blastn -d " + dbFileName + " -m 8 -W 28 -v " + toString(n) + " -b " + toString(n);;
                        blastCommand += (" -i " + (queryFileName+seq->getName()) + " -o " + blastFileName+seq->getName());
                #else
-                       blastCommand =  "\"" + path + "blast\\bin\\blastall\" -p blastn -d " + dbFileName + " -m 8 -W 28 -v " + toString(n) + " -b " + toString(n);;
+                       blastCommand =  "\"" + path + "blast\\bin\\blastall\" -p blastn -d " + "\"" + dbFileName + "\"" + " -m 8 -W 28 -v " + toString(n) + " -b " + toString(n);
                        blastCommand += (" -i " + (queryFileName+seq->getName()) + " -o " + blastFileName+seq->getName());
+                       //wrap entire string in ""
+                       blastCommand = "\"" + blastCommand + "\"";
                #endif
                system(blastCommand.c_str());
                
@@ -140,8 +142,11 @@ vector<int> BlastDB::findClosestMegaBlast(Sequence* seq, int n, int minPerID) {
                        blastCommand = path + "blast/bin/megablast -e 1e-10 -d " + dbFileName + " -m 8 -b " + toString(n) + " -v " + toString(n); //-W 28 -p blastn
                        blastCommand += (" -i " + (queryFileName+seq->getName()) + " -o " + blastFileName+seq->getName());
                #else
-                       blastCommand =  "\"" + path + "blast\\bin\\megablast\" -e 1e-10 -d " + dbFileName + " -m 8 -b " + toString(n) + " -v " + toString(n); //-W 28 -p blastn
+                       blastCommand =  "\"" + path + "blast\\bin\\megablast\" -e 1e-10 -d " + "\"" + dbFileName + "\"" + " -m 8 -b " + toString(n) + " -v " + toString(n); //-W 28 -p blastn
                        blastCommand += (" -i " + (queryFileName+seq->getName()) + " -o " + blastFileName+seq->getName());
+                       //wrap entire string in ""
+                       blastCommand = "\"" + blastCommand + "\"";
+
                #endif
                
                system(blastCommand.c_str());
@@ -213,7 +218,9 @@ void BlastDB::generateDB() {
                #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
                        formatdbCommand = path + "blast/bin/formatdb -p F -o T -i " + dbFileName;       //      format the database, -o option gives us the ability
                #else
-                       formatdbCommand = "\"" + path + "blast\\bin\\formatdb\" -p F -o T -i " + dbFileName;
+                       formatdbCommand = "\"" + path + "blast\\bin\\formatdb\" -p F -o T -i " + "\"" +  dbFileName + "\"";
+                       //wrap entire string in ""
+                       formatdbCommand = "\"" + formatdbCommand + "\"";
                #endif
                system(formatdbCommand.c_str());                                                                //      to get the right sequence names, i think. -p F
                                                                                                                                        //      option tells formatdb that seqs are DNA, not prot
index a954dc04b326b54d5ce2f83f027f492b3f4dd73a..7f541311e721e6778fd3b5312266fd3578fa5d42 100644 (file)
--- a/chainer.h
+++ b/chainer.h
@@ -1,3 +1,5 @@
+//uchime by Robert C. Edgar http://drive5.com/uchime This code is donated to the public domain.\r
+\r
 #ifndef chainer_h\r
 #define chainer_h\r
 \r
diff --git a/chime.h b/chime.h
index 1b0662a6ef39fe1eadd98bdf46fc4fa1abb8b3ce..f143ea10795df3ed995660b0862bb0142f2db91b 100644 (file)
--- a/chime.h
+++ b/chime.h
@@ -1,3 +1,5 @@
+//uchime by Robert C. Edgar http://drive5.com/uchime This code is donated to the public domain.\r
+\r
 #ifndef chime_h\r
 #define chime_h\r
 \r
index 891b77b63a082c43002d337986ba258e8f88ee0f..a47aed0ca840197331cdf251ef48bcb68cf9df56 100644 (file)
@@ -22,6 +22,24 @@ vector<string> ChimeraUchimeCommand::setParameters(){
                CommandParameter pprocessors("processors", "Number", "", "1", "", "", "",false,false); parameters.push_back(pprocessors);
                CommandParameter pinputdir("inputdir", "String", "", "", "", "", "",false,false); parameters.push_back(pinputdir);
                CommandParameter poutputdir("outputdir", "String", "", "", "", "", "",false,false); parameters.push_back(poutputdir);
+               CommandParameter pabskew("abskew", "Number", "", "1.9", "", "", "",false,false); parameters.push_back(pabskew);
+               CommandParameter pchimealns("chimealns", "Boolean", "", "F", "", "", "",false,false); parameters.push_back(pchimealns);
+               CommandParameter pminh("minh", "Number", "", "0.3", "", "", "",false,false); parameters.push_back(pminh);
+               CommandParameter pmindiv("mindiv", "Number", "", "0.5", "", "", "",false,false); parameters.push_back(pmindiv);
+               CommandParameter pxn("xn", "Number", "", "8.0", "", "", "",false,false); parameters.push_back(pxn);
+               CommandParameter pdn("dn", "Number", "", "1.4", "", "", "",false,false); parameters.push_back(pdn);
+               CommandParameter pxa("xa", "Number", "", "1", "", "", "",false,false); parameters.push_back(pxa);
+               CommandParameter pchunks("chunks", "Number", "", "4", "", "", "",false,false); parameters.push_back(pchunks);
+               CommandParameter pminchunk("minchunk", "Number", "", "64", "", "", "",false,false); parameters.push_back(pminchunk);
+               CommandParameter pidsmoothwindow("idsmoothwindow", "Number", "", "32", "", "", "",false,false); parameters.push_back(pidsmoothwindow);
+               CommandParameter pminsmoothid("minsmoothid", "Number", "", "0.95", "", "", "",false,false); parameters.push_back(pminsmoothid);
+               CommandParameter pmaxp("maxp", "Number", "", "2", "", "", "",false,false); parameters.push_back(pmaxp);
+               CommandParameter pskipgaps("skipgaps", "Boolean", "", "T", "", "", "",false,false); parameters.push_back(pskipgaps);
+               CommandParameter pskipgaps2("skipgaps2", "Boolean", "", "T", "", "", "",false,false); parameters.push_back(pskipgaps2);
+               CommandParameter pminlen("minlen", "Number", "", "10", "", "", "",false,false); parameters.push_back(pminlen);
+               CommandParameter pmaxlen("maxlen", "Number", "", "10000", "", "", "",false,false); parameters.push_back(pmaxlen);
+               CommandParameter pucl("ucl", "Boolean", "", "F", "", "", "",false,false); parameters.push_back(pucl);
+               CommandParameter pqueryfract("queryfract", "Number", "", "0.5", "", "", "",false,false); parameters.push_back(pqueryfract);
                
                vector<string> myArray;
                for (int i = 0; i < parameters.size(); i++) {   myArray.push_back(parameters[i].name);          }
@@ -38,12 +56,30 @@ string ChimeraUchimeCommand::getHelpString(){
                string helpString = "";
                helpString += "The chimera.uchime command reads a fastafile and referencefile and outputs potentially chimeric sequences.\n";
                helpString += "This command is a wrapper for uchime written by Robert C. Edgar.\n";
-               helpString += "The chimera.uchime command parameters are fasta, name, reference and processors.\n";
+               helpString += "The chimera.uchime command parameters are fasta, name, reference, processors, abskew, chimealns, minh, mindiv, xn, dn, xa, chunks, minchunk, idsmoothwindow, minsmoothid, maxp, skipgaps, skipgaps2, minlen, maxlen, ucl and queryfact.\n";
                helpString += "The fasta parameter allows you to enter the fasta file containing your potentially chimeric sequences, and is required, unless you have a valid current fasta file. \n";
                helpString += "The name parameter allows you to provide a name file, if you are using template=self. \n";
                helpString += "You may enter multiple fasta files by separating their names with dashes. ie. fasta=abrecovery.fasta-amazon.fasta \n";
                helpString += "The reference parameter allows you to enter a reference file containing known non-chimeric sequences, and is required. You may also set template=self, in this case the abundant sequences will be used as potential parents. \n";
                helpString += "The processors parameter allows you to specify how many processors you would like to use.  The default is 1. \n";
+               helpString += "The abskew parameter can only be used with template=self. Minimum abundance skew. Default 1.9. Abundance skew is: min [ abund(parent1), abund(parent2) ] / abund(query).\n";
+               helpString += "The chimealns parameter allows you to indicate you would like a file containing multiple alignments of query sequences to parents in human readable format. Alignments show columns with differences that support or contradict a chimeric model.\n";
+               helpString += "The minh parameter - mininum score to report chimera. Default 0.3. Values from 0.1 to 5 might be reasonable. Lower values increase sensitivity but may report more false positives. If you decrease xn you may need to increase minh, and vice versa.\n";
+               helpString += "The mindiv parameter - minimum divergence ratio, default 0.5. Div ratio is 100%% - %%identity between query sequence and the closest candidate for being a parent. If you don't care about very close chimeras, then you could increase mindiv to, say, 1.0 or 2.0, and also decrease --min h, say to 0.1, to increase sensitivity. How well this works will depend on your data. Best is to tune parameters on a good benchmark.\n";
+               helpString += "The xn parameter - weight of a no vote. Default 8.0. Decreasing this weight to around 3 or 4 may give better performance on denoised data.\n";
+               helpString += "The dn parameter - pseudo-count prior on number of no votes. Default 1.4. Probably no good reason to change this unless you can retune to a good benchmark for your data. Reasonable values are probably in the range from 0.2 to 2.\n";
+               helpString += "The xa parameter - weight of an abstain vote. Default 1. So far, results do not seem to be very sensitive to this parameter, but if you have a good training set might be worth trying. Reasonable values might range from 0.1 to 2.\n";
+               helpString += "The chunks parameter is the number of chunks to extract from the query sequence when searching for parents. Default 4.\n";
+               helpString += "The minchunk parameter is the minimum length of a chunk. Default 64.\n";
+               helpString += "The idsmoothwindow parameter is the length of id smoothing window. Default 32.\n";
+               helpString += "The minsmoothid parameter - minimum factional identity over smoothed window of candidate parent. Default 0.95.\n";
+               helpString += "The maxp parameter - maximum number of candidate parents to consider. Default 2. In tests so far, increasing maxp gives only a very small improvement in sensivity but tends to increase the error rate quite a bit.\n";
+               helpString += "The skipgaps parameter controls how gapped columns affect counting of diffs. If skipgaps is set to T, columns containing gaps do not found as diffs. Default = T.\n";
+               helpString += "The skipgaps2 parameter controls how gapped columns affect counting of diffs. If skipgaps2 is set to T, if column is immediately adjacent to a column containing a gap, it is not counted as a diff. Default = T.\n";
+               helpString += "The minlen parameter is the minimum unaligned sequence length. Defaults 10. Applies to both query and reference sequences.\n";
+               helpString += "The maxlen parameter is the maximum unaligned sequence length. Defaults 10000. Applies to both query and reference sequences.\n";
+               helpString += "The ucl parameter - use local-X alignments. Default is global-X or false. On tests so far, global-X is always better; this option is retained because it just might work well on some future type of data.\n";
+               helpString += "The queryfract parameter - minimum fraction of the query sequence that must be covered by a local-X alignment. Default 0.5. Applies only when ucl is true.\n";
 #ifdef USE_MPI
                helpString += "When using MPI, the processors parameter is set to the number of MPI processes running. \n";
 #endif
@@ -66,6 +102,7 @@ ChimeraUchimeCommand::ChimeraUchimeCommand(){
                vector<string> tempOutNames;
                outputTypes["chimera"] = tempOutNames;
                outputTypes["accnos"] = tempOutNames;
+               outputTypes["alns"] = tempOutNames;
        }
        catch(exception& e) {
                m->errorOut(e, "ChimeraUchimeCommand", "ChimeraUchimeCommand");
@@ -98,6 +135,7 @@ ChimeraUchimeCommand::ChimeraUchimeCommand(string option)  {
                        vector<string> tempOutNames;
                        outputTypes["chimera"] = tempOutNames;
                        outputTypes["accnos"] = tempOutNames;
+                       outputTypes["alns"] = tempOutNames;
                        
                        //if the user changes the input directory command factory will send this info to us in the output parameter 
                        string inputDir = validParameter.validFile(parameters, "inputdir", false);              
@@ -278,6 +316,38 @@ ChimeraUchimeCommand::ChimeraUchimeCommand(string option)  {
                        string temp = validParameter.validFile(parameters, "processors", false);        if (temp == "not found"){       temp = m->getProcessors();      }
                        m->setProcessors(temp);
                        convert(temp, processors);
+                       
+                       abskew = validParameter.validFile(parameters, "abskew", false); if (abskew == "not found"){     useAbskew = false;  abskew = "1.9";     }else{  useAbskew = true;  }
+                       if (useAbskew && templatefile != "self") { m->mothurOut("The abskew parameter is only valid with template=self, ignoring."); m->mothurOutEndLine(); useAbskew = false; }
+                       
+                       temp = validParameter.validFile(parameters, "chimealns", false);                        if (temp == "not found") { temp = "f"; }
+                       chimealns = m->isTrue(temp); 
+                       
+                       minh = validParameter.validFile(parameters, "minh", false);                                             if (minh == "not found")                        { useMinH = false; minh = "0.3";                                        }       else{ useMinH = true;                   }
+                       mindiv = validParameter.validFile(parameters, "mindiv", false);                                 if (mindiv == "not found")                      { useMindiv = false; mindiv = "0.5";                            }       else{ useMindiv = true;                 }
+                       xn = validParameter.validFile(parameters, "xn", false);                                                 if (xn == "not found")                          { useXn = false; xn = "8.0";                                            }       else{ useXn = true;                             }
+                       dn = validParameter.validFile(parameters, "dn", false);                                                 if (dn == "not found")                          { useDn = false; dn = "1.4";                                            }       else{ useDn = true;                             }
+                       xa = validParameter.validFile(parameters, "xa", false);                                                 if (xa == "not found")                          { useXa = false; xa = "1";                                                      }       else{ useXa = true;                             }
+                       chunks = validParameter.validFile(parameters, "chunks", false);                                 if (chunks == "not found")                      { useChunks = false; chunks = "4";                                      }       else{ useChunks = true;                 }
+                       minchunk = validParameter.validFile(parameters, "minchunk", false);                             if (minchunk == "not found")            { useMinchunk = false; minchunk = "64";                         }       else{ useMinchunk = true;               }
+                       idsmoothwindow = validParameter.validFile(parameters, "idsmoothwindow", false); if (idsmoothwindow == "not found")      { useIdsmoothwindow = false; idsmoothwindow = "32";     }       else{ useIdsmoothwindow = true; }
+                       minsmoothid = validParameter.validFile(parameters, "minsmoothid", false);               if (minsmoothid == "not found")         { useMinsmoothid = false; minsmoothid = "0.95";         }       else{ useMinsmoothid = true;    }
+                       maxp = validParameter.validFile(parameters, "maxp", false);                                             if (maxp == "not found")                        { useMaxp = false; maxp = "2";                                          }       else{ useMaxp = true;                   }
+                       minlen = validParameter.validFile(parameters, "minlen", false);                                 if (minlen == "not found")                      { useMinlen = false; minlen = "10";                                     }       else{ useMinlen = true;                 }
+                       maxlen = validParameter.validFile(parameters, "maxlen", false);                                 if (maxlen == "not found")                      { useMaxlen = false; maxlen = "10000";                          }       else{ useMaxlen = true;                 }
+                       
+                       temp = validParameter.validFile(parameters, "ucl", false);                                              if (temp == "not found") { temp = "f"; }
+                       ucl = m->isTrue(temp);
+                       
+                       queryfract = validParameter.validFile(parameters, "queryfract", false);                 if (queryfract == "not found")          { useQueryfract = false; queryfract = "0.5";            }       else{ useQueryfract = true;             }
+                       if (!ucl && useQueryfract) { m->mothurOut("queryfact may only be used when ucl=t, ignoring."); m->mothurOutEndLine(); useQueryfract = false; }
+                       
+                       temp = validParameter.validFile(parameters, "skipgaps", false);                                 if (temp == "not found") { temp = "t"; }
+                       skipgaps = m->isTrue(temp); 
+
+                       temp = validParameter.validFile(parameters, "skipgaps2", false);                                if (temp == "not found") { temp = "t"; }
+                       skipgaps2 = m->isTrue(temp); 
+
                }
        }
        catch(exception& e) {
@@ -291,6 +361,8 @@ int ChimeraUchimeCommand::execute(){
        try{
                if (abort == true) { if (calledHelp) { return 0; }  return 2;   }
                
+               m->mothurOut("\nuchime by Robert C. Edgar\nhttp://drive5.com/uchime\nThis code is donated to the public domain.\n\n");
+               
                for (int s = 0; s < fastaFileNames.size(); s++) {
                        
                        m->mothurOut("Checking sequences from " + fastaFileNames[s] + " ..." ); m->mothurOutEndLine();
@@ -375,23 +447,27 @@ int ChimeraUchimeCommand::execute(){
                        }
                        
                        if (outputDir == "") { outputDir = m->hasPath(fastaFileNames[s]);  }//if user entered a file with a path then preserve it                               
-                       string outputFileName = outputDir + m->getRootName(m->getSimpleName(fastaFileNames[s])) + "slayer.chimera";
-                       string accnosFileName = outputDir + m->getRootName(m->getSimpleName(fastaFileNames[s]))  + "slayer.accnos";
+                       string outputFileName = outputDir + m->getRootName(m->getSimpleName(fastaFileNames[s])) + "uchime.chimera";
+                       string accnosFileName = outputDir + m->getRootName(m->getSimpleName(fastaFileNames[s]))  + "uchime.accnos";
+                       string alnsFileName = outputDir + m->getRootName(m->getSimpleName(fastaFileNames[s]))  + "uchime.alns";
                        
                        if (m->control_pressed) {  for (int j = 0; j < outputNames.size(); j++) {       remove(outputNames[j].c_str()); }  return 0;    }
                        
                        int numSeqs = 0;
 #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
-                       if(processors == 1){ numSeqs = driver(outputFileName, fastaFileNames[s], accnosFileName); }
-                       else{   numSeqs = createProcesses(outputFileName, fastaFileNames[s], accnosFileName); }
+                       if(processors == 1){ numSeqs = driver(outputFileName, fastaFileNames[s], accnosFileName, alnsFileName); }
+                       else{   numSeqs = createProcesses(outputFileName, fastaFileNames[s], accnosFileName, alnsFileName); }
 #else
-                       numSeqs = driver(outputFileName, fastaFileNames[s], accnosFileName);
+                       numSeqs = driver(outputFileName, fastaFileNames[s], accnosFileName, alnsFileName);
 #endif
                        if (m->control_pressed) { for (int j = 0; j < outputNames.size(); j++) {        remove(outputNames[j].c_str()); } return 0; }
-
+                       
+                       //remove file made for uchime
+                       if (templatefile == "self") {  remove(fastaFileNames[s].c_str()); }
                        
                        outputNames.push_back(outputFileName); outputTypes["chimera"].push_back(outputFileName);
                        outputNames.push_back(accnosFileName); outputTypes["accnos"].push_back(accnosFileName);
+                       if (chimealns) { outputNames.push_back(alnsFileName); outputTypes["alns"].push_back(alnsFileName); }
                        
                        m->mothurOutEndLine(); m->mothurOut("It took " + toString(time(NULL) - start) + " secs to check " + toString(numSeqs) + " sequences."); m->mothurOutEndLine();
                }
@@ -418,7 +494,7 @@ int ChimeraUchimeCommand::execute(){
 }
 //**********************************************************************************************************************
 
-int ChimeraUchimeCommand::driver(string outputFName, string filename, string accnos){
+int ChimeraUchimeCommand::driver(string outputFName, string filename, string accnos, string alns){
        try {
                
                vector<char*> cPara;
@@ -453,6 +529,160 @@ int ChimeraUchimeCommand::driver(string outputFName, string filename, string acc
                strcpy(tempout, outputFName.c_str());
                cPara.push_back(tempout);
                
+               if (chimealns) {
+                       char* tempA = new char[12]; 
+                       strcpy(tempA, "--uchimealns"); 
+                       cPara.push_back(tempA);
+                       char* tempa = new char[alns.length()];
+                       strcpy(tempa, alns.c_str());
+                       cPara.push_back(tempa);
+               }
+               
+               if (useAbskew) {
+                       char* tempskew = new char[8]; 
+                       strcpy(tempskew, "--abskew"); 
+                       cPara.push_back(tempskew);
+                       char* tempSkew = new char[abskew.length()];
+                       strcpy(tempSkew, abskew.c_str());
+                       cPara.push_back(tempSkew);
+               }
+               
+               if (useMinH) {
+                       char* tempminh = new char[6]; 
+                       strcpy(tempminh, "--minh"); 
+                       cPara.push_back(tempminh);
+                       char* tempMinH = new char[minh.length()];
+                       strcpy(tempMinH, minh.c_str());
+                       cPara.push_back(tempMinH);
+               }
+               
+               if (useMindiv) {
+                       char* tempmindiv = new char[8]; 
+                       strcpy(tempmindiv, "--mindiv"); 
+                       cPara.push_back(tempmindiv);
+                       char* tempMindiv = new char[mindiv.length()];
+                       strcpy(tempMindiv, mindiv.c_str());
+                       cPara.push_back(tempMindiv);
+               }
+               
+               if (useXn) {
+                       char* tempxn = new char[4]; 
+                       strcpy(tempxn, "--xn"); 
+                       cPara.push_back(tempxn);
+                       char* tempXn = new char[xn.length()];
+                       strcpy(tempXn, xn.c_str());
+                       cPara.push_back(tempXn);
+               }
+               
+               if (useDn) {
+                       char* tempdn = new char[4]; 
+                       strcpy(tempdn, "--dn"); 
+                       cPara.push_back(tempdn);
+                       char* tempDn = new char[dn.length()];
+                       strcpy(tempDn, dn.c_str());
+                       cPara.push_back(tempDn);
+               }
+               
+               if (useXa) {
+                       char* tempxa = new char[4]; 
+                       strcpy(tempxa, "--xa"); 
+                       cPara.push_back(tempxa);
+                       char* tempXa = new char[xa.length()];
+                       strcpy(tempXa, xa.c_str());
+                       cPara.push_back(tempXa);
+               }
+               
+               if (useChunks) {
+                       char* tempchunks = new char[8]; 
+                       strcpy(tempchunks, "--chunks"); 
+                       cPara.push_back(tempchunks);
+                       char* tempChunks = new char[chunks.length()];
+                       strcpy(tempChunks, chunks.c_str());
+                       cPara.push_back(tempChunks);
+               }
+               
+               if (useMinchunk) {
+                       char* tempminchunk = new char[10]; 
+                       strcpy(tempminchunk, "--minchunk"); 
+                       cPara.push_back(tempminchunk);
+                       char* tempMinchunk = new char[minchunk.length()];
+                       strcpy(tempMinchunk, minchunk.c_str());
+                       cPara.push_back(tempMinchunk);
+               }
+               
+               if (useIdsmoothwindow) {
+                       char* tempidsmoothwindow = new char[16]; 
+                       strcpy(tempidsmoothwindow, "--idsmoothwindow"); 
+                       cPara.push_back(tempidsmoothwindow);
+                       char* tempIdsmoothwindow = new char[idsmoothwindow.length()];
+                       strcpy(tempIdsmoothwindow, idsmoothwindow.c_str());
+                       cPara.push_back(tempIdsmoothwindow);
+               }
+               
+               if (useMinsmoothid) {
+                       char* tempminsmoothid = new char[13]; 
+                       strcpy(tempminsmoothid, "--minsmoothid"); 
+                       cPara.push_back(tempminsmoothid);
+                       char* tempMinsmoothid = new char[minsmoothid.length()];
+                       strcpy(tempMinsmoothid, minsmoothid.c_str());
+                       cPara.push_back(tempMinsmoothid);
+               }
+               
+               if (useMaxp) {
+                       char* tempmaxp = new char[6]; 
+                       strcpy(tempmaxp, "--maxp"); 
+                       cPara.push_back(tempmaxp);
+                       char* tempMaxp = new char[maxp.length()];
+                       strcpy(tempMaxp, maxp.c_str());
+                       cPara.push_back(tempMaxp);
+               }
+               
+               if (!skipgaps) {
+                       char* tempskipgaps = new char[14]; 
+                       strcpy(tempskipgaps, "--[no]skipgaps"); 
+                       cPara.push_back(tempskipgaps);
+               }
+               
+               if (!skipgaps2) {
+                       char* tempskipgaps2 = new char[15]; 
+                       strcpy(tempskipgaps2, "--[no]skipgaps2"); 
+                       cPara.push_back(tempskipgaps2);
+               }
+               
+               if (useMinlen) {
+                       char* tempminlen = new char[8]; 
+                       strcpy(tempminlen, "--minlen"); 
+                       cPara.push_back(tempminlen);
+                       char* tempMinlen = new char[minlen.length()];
+                       strcpy(tempMinlen, minlen.c_str());
+                       cPara.push_back(tempMinlen);
+               }
+               
+               if (useMaxlen) {
+                       char* tempmaxlen = new char[8]; 
+                       strcpy(tempmaxlen, "--maxlen"); 
+                       cPara.push_back(tempmaxlen);
+                       char* tempMaxlen = new char[maxlen.length()];
+                       strcpy(tempMaxlen, maxlen.c_str());
+                       cPara.push_back(tempMaxlen);
+               }
+               
+               if (ucl) {
+                       char* tempucl = new char[5]; 
+                       strcpy(tempucl, "--ucl"); 
+                       cPara.push_back(tempucl);
+               }
+               
+               if (useQueryfract) {
+                       char* tempqueryfract = new char[12]; 
+                       strcpy(tempqueryfract, "--queryfract"); 
+                       cPara.push_back(tempqueryfract);
+                       char* tempQueryfract = new char[queryfract.length()];
+                       strcpy(tempQueryfract, queryfract.c_str());
+                       cPara.push_back(tempQueryfract);
+               }
+               
+               
                char** uchimeParameters;
                uchimeParameters = new char*[cPara.size()];
                for (int i = 0; i < cPara.size(); i++) {  uchimeParameters[i] = cPara[i];  } 
@@ -504,7 +734,7 @@ int ChimeraUchimeCommand::driver(string outputFName, string filename, string acc
 }
 /**************************************************************************************************/
 
-int ChimeraUchimeCommand::createProcesses(string outputFileName, string filename, string accnos) {
+int ChimeraUchimeCommand::createProcesses(string outputFileName, string filename, string accnos, string alns) {
        try {
                
                processIDS.clear();
@@ -526,7 +756,7 @@ int ChimeraUchimeCommand::createProcesses(string outputFileName, string filename
                MPI_Comm_size(MPI_COMM_WORLD, &processors); 
                                
                if (pid == 0) { //you are the root process 
-                       num = driver(outputFileName, files[0], accnos);
+                       num = driver(outputFileName, files[0], accnos, alns);
                        
                        if (templatefile != "self") {
                                //wait on chidren
@@ -540,11 +770,16 @@ int ChimeraUchimeCommand::createProcesses(string outputFileName, string filename
                                        
                                        m->appendFiles((accnos + toString(j) + ".temp"), accnos);
                                        remove((accnos + toString(j) + ".temp").c_str());
+                                       
+                                       if (chimealns) {
+                                               m->appendFiles((alns + toString(j) + ".temp"), alns);
+                                               remove((alns + toString(j) + ".temp").c_str());
+                                       }
                                }
                        }
                }else{ //you are a child process
                        if (templatefile != "self") { //if template=self we can only use 1 processor
-                               num = driver(outputFileName+toString(pid) + ".temp", files[pid], accnos+toString(pid) + ".temp");       
+                               num = driver(outputFileName+toString(pid) + ".temp", files[pid], accnos+toString(pid) + ".temp", alns+toString(pid) + ".temp"); 
                                
                                //send numSeqs to parent
                                MPI_Send(&num, 1, MPI_INT, 0, tag, MPI_COMM_WORLD);
@@ -562,7 +797,7 @@ int ChimeraUchimeCommand::createProcesses(string outputFileName, string filename
                                processIDS.push_back(pid);  //create map from line number to pid so you can append files in correct order later
                                process++;
                        }else if (pid == 0){
-                               num = driver(outputFileName + toString(getpid()) + ".temp", files[process], accnos + toString(getpid()) + ".temp");
+                               num = driver(outputFileName + toString(getpid()) + ".temp", files[process], accnos + toString(getpid()) + ".temp", alns + toString(getpid()) + ".temp");
                                
                                //pass numSeqs to parent
                                ofstream out;
@@ -580,7 +815,7 @@ int ChimeraUchimeCommand::createProcesses(string outputFileName, string filename
                }
                
                //do my part
-               num = driver(outputFileName, files[0], accnos);
+               num = driver(outputFileName, files[0], accnos, alns);
                
                //force parent to wait until all the processes are done
                for (int i=0;i<processIDS.size();i++) { 
@@ -604,6 +839,11 @@ int ChimeraUchimeCommand::createProcesses(string outputFileName, string filename
                        
                        m->appendFiles((accnos + toString(processIDS[i]) + ".temp"), accnos);
                        remove((accnos + toString(processIDS[i]) + ".temp").c_str());
+                       
+                       if (chimealns) {
+                               m->appendFiles((alns + toString(processIDS[i]) + ".temp"), alns);
+                               remove((alns + toString(processIDS[i]) + ".temp").c_str());
+                       }
                }
 #endif         
                //get rid of the file pieces.
index 36e4a39aae24570e6f6cb5965f19261f0b3c9b63..a7d5ad60435f753d088b441aa5b509bce1999808 100644 (file)
@@ -26,7 +26,7 @@ public:
        string getCommandName()                 { return "chimera.uchime";              }
        string getCommandCategory()             { return "Sequence Processing"; }
        string getHelpString(); 
-       string getCitation() { return "http://drive5.com/uchime/ \nhttp://www.mothur.org/wiki/Chimera.uchime"; }
+       string getCitation() { return "uchime by Robert C. Edgar\nhttp://drive5.com/uchime\nThis code is donated to the public domain.\nhttp://www.mothur.org/wiki/Chimera.uchime"; }
        
        
        int execute(); 
@@ -34,15 +34,11 @@ public:
        
 private:
        vector<int> processIDS;   //processid
-       int driver(string, string, string);
-       int createProcesses(string, string, string);
-       
-#ifdef USE_MPI
-       int driverMPI(int, int, MPI_File&, MPI_File&, MPI_File&, MPI_File&, vector<unsigned long int>&);
-#endif
-       
-       bool abort;
-       string fastafile, templatefile, outputDir, namefile;
+       int driver(string, string, string, string);
+       int createProcesses(string, string, string, string);
+               
+       bool abort, useAbskew, chimealns, useMinH, useMindiv, useXn, useDn, useXa, useChunks, useMinchunk, useIdsmoothwindow, useMinsmoothid, useMaxp, skipgaps, skipgaps2, useMinlen, useMaxlen, ucl, useQueryfract;
+       string fastafile, templatefile, outputDir, namefile, abskew, minh, mindiv, xn, dn, xa, chunks, minchunk, idsmoothwindow, minsmoothid, maxp, minlen, maxlen, queryfract;
        int processors;
        
        vector<string> outputNames;
index 0c5846ce28e510509266238eb0ac4ce7151e483f..2491a58accce9c691c21f471af5eccda75354c81 100644 (file)
--- a/diagbox.h
+++ b/diagbox.h
@@ -1,3 +1,5 @@
+//uchime by Robert C. Edgar http://drive5.com/uchime This code is donated to the public domain.\r
+\r
 #ifndef diagbox_h\r
 #define diagbox_h\r
 \r
@@ -184,10 +186,10 @@ Don't have proof..
                }\r
        };\r
 \r
-typedef const char *(*NWDIAG)(const byte *A, unsigned LA, const byte *B, unsigned LB,
-  unsigned DiagLo, unsigned DiagHi, bool LeftTerm, bool RightTerm);
-
-const char *NWBandWrap(NWDIAG NW, const byte *A, unsigned LA, const byte *B, unsigned LB,
-  unsigned DiagLo, unsigned DiagHi, bool LeftTerm, bool RightTerm);
+typedef const char *(*NWDIAG)(const byte *A, unsigned LA, const byte *B, unsigned LB,\r
+  unsigned DiagLo, unsigned DiagHi, bool LeftTerm, bool RightTerm);\r
+\r
+const char *NWBandWrap(NWDIAG NW, const byte *A, unsigned LA, const byte *B, unsigned LB,\r
+  unsigned DiagLo, unsigned DiagHi, bool LeftTerm, bool RightTerm);\r
 \r
 #endif // diagbox_h\r
diff --git a/dp.h b/dp.h
index c771538a32c648f8bc6f195a368fb58a14385124..d8581fbc6fbc6e91be56acb3b59dd52af1df64d2 100644 (file)
--- a/dp.h
+++ b/dp.h
@@ -1,3 +1,5 @@
+//uchime by Robert C. Edgar http://drive5.com/uchime This code is donated to the public domain.\r
+\r
 #ifndef dp_h\r
 #define dp_h\r
 \r
index c9308dbf4a1f7f89db5036f7e0e36bbd25f852cb..fe324f840f1da9b3886186068d26375bb53873a9 100644 (file)
--- a/evalue.h
+++ b/evalue.h
@@ -1,3 +1,5 @@
+//uchime by Robert C. Edgar http://drive5.com/uchime This code is donated to the public domain.\r
+\r
 #ifndef evalue_h\r
 #define evalue_h\r
 \r
index f2988771cac56bbaeda7e68d8be866a3e7f666b2..ad4c1579c43c1b75d41583e700fdf4ac85cc49e9 100644 (file)
@@ -1,3 +1,5 @@
+//uchime by Robert C. Edgar http://drive5.com/uchime This code is donated to the public domain.\r
+\r
 #include "myutils.h"\r
 #include "alpha.h"\r
 \r
index d82f9028b25f1ff9c37f8ec100970df5d687c511..26a2cd1099cf8dc8b6a51891a59a99ea9a916fd7 100644 (file)
@@ -1,3 +1,5 @@
+//uchime by Robert C. Edgar http://drive5.com/uchime This code is donated to the public domain.\r
+\r
 #include "myutils.h"\r
 #include "chime.h"\r
 #include "ultra.h"\r
index 6bb35a910737c2511b950625f750ef2dd363ded0..10f8032f02deb7b300eba638ccf3e155dc21d2b2 100644 (file)
@@ -1,5 +1,5 @@
 //#if  UCHIMES\r
-\r
+//uchime by Robert C. Edgar http://drive5.com/uchime This code is donated to the public domain.\r
 #include "dp.h"\r
 #include "seq.h"\r
 \r
diff --git a/help.h b/help.h
index 9d7a89f114d00d1e68fc74c75a6f50a585c141a2..1534cd171551736a145bbe33da893ac6bdd91fc5 100644 (file)
--- a/help.h
+++ b/help.h
@@ -1,3 +1,5 @@
+//uchime by Robert C. Edgar http://drive5.com/uchime This code is donated to the public domain.
+
 "\n"
 "Usage\n"
 "-----\n"
diff --git a/hsp.h b/hsp.h
index 339256f20efc395b50d3f28f31a5f5302337eaf6..7f003bf1a085733d35fe9ac251e4c350a6af7ee4 100644 (file)
--- a/hsp.h
+++ b/hsp.h
@@ -1,3 +1,5 @@
+//uchime by Robert C. Edgar http://drive5.com/uchime This code is donated to the public domain.\r
+\r
 #ifndef hsp_h\r
 #define hsp_h  1\r
 \r
index 2b8e9d84cac56d05d891beb9db9bdbf984a8bef5..dc287e991502f16c83fa7d678011eeaf4d9426d1 100644 (file)
@@ -1,3 +1,5 @@
+//uchime by Robert C. Edgar http://drive5.com/uchime This code is donated to the public domain.
+
 #ifndef hspfinder_h
 #define hspfinder_h
 
index ce88f8616bd21f2362e3706d58c9b7917928bf00..dbadd1ab26269b10ee98229c638582ea8774b30b 100644 (file)
@@ -1,3 +1,5 @@
+//uchime by Robert C. Edgar http://drive5.com/uchime This code is donated to the public domain.\r
+\r
 #include "myutils.h"\r
 #include "sfasta.h"\r
 #include "path.h"\r
diff --git a/mx.cpp b/mx.cpp
index 48c347e5832c461750cf72bd7b0a483013f7d57c..9e61d1beb368b75eb447f6f3159cfa4cecb74c25 100644 (file)
--- a/mx.cpp
+++ b/mx.cpp
@@ -1,3 +1,5 @@
+//uchime by Robert C. Edgar http://drive5.com/uchime This code is donated to the public domain.\r
+\r
 #include "myutils.h"\r
 #include "mx.h"\r
 #include "seqdb.h"\r
diff --git a/mx.h b/mx.h
index 143890086d59bb8d0f1d7f35d62cdd7dae3da1d0..24629377ed662bb9291704087243cbd95e9eef2e 100644 (file)
--- a/mx.h
+++ b/mx.h
@@ -1,3 +1,5 @@
+//uchime by Robert C. Edgar http://drive5.com/uchime This code is donated to the public domain.\r
+\r
 #ifndef mx_h\r
 #define mx_h\r
 \r
index ba901ea48e38ad5b9f59b85dc7be43e208e70a4b..812dd8baed5386990ba4160048ac98d2e783af1a 100644 (file)
--- a/myopts.h
+++ b/myopts.h
@@ -1,3 +1,5 @@
+//uchime by Robert C. Edgar http://drive5.com/uchime This code is donated to the public domain.\r
+\r
 #ifndef MY_VERSION\r
 #define MY_VERSION     "4.2"\r
 #endif\r
index ea983eb9e229a8549e1231aaaf75625d12135274..e9d52c2c936eb2d131109f7b46fe365d41931a9d 100755 (executable)
@@ -1,3 +1,5 @@
+//uchime by Robert C. Edgar http://drive5.com/uchime This code is donated to the public domain.\r
+\r
 #include <time.h>\r
 #include <stdarg.h>\r
 #include <sys/stat.h>\r
index b63ad3cff91af09741a5d53865916f9781a53973..61220546b81894283bb6350f5c2c51ecc8800cb2 100644 (file)
--- a/myutils.h
+++ b/myutils.h
@@ -1,8 +1,10 @@
+//uchime by Robert C. Edgar http://drive5.com/uchime This code is donated to the public domain.\r
+\r
 #ifndef myutils_h\r
 #define myutils_h\r
 \r
 #define RCE_MALLOC     0\r
-
+\r
 #include <stdio.h>\r
 #include <sys/types.h>\r
 #include <string>\r
@@ -267,8 +269,8 @@ void GetCmdLine(string &s);
 \r
 extern const char *SVN_VERSION;\r
 extern const char *SVN_MODS;\r
-extern bool opt_quiet;
-extern bool opt_version;
-extern FILE *g_fLog;
+extern bool opt_quiet;\r
+extern bool opt_version;\r
+extern FILE *g_fLog;\r
 \r
 #endif // myutils_h\r
diff --git a/orf.h b/orf.h
index 90b29d1441589b41e7f64525134a80e0364e820b..06f73a1f9a733d3c0a6b0f3cdea5fc414f9b3cd4 100644 (file)
--- a/orf.h
+++ b/orf.h
@@ -1,3 +1,5 @@
+//uchime by Robert C. Edgar http://drive5.com/uchime This code is donated to the public domain.\r
+\r
 #ifndef orf_h\r
 #define orf_h\r
 \r
diff --git a/out.h b/out.h
index 4ca50c7c3d3d0937a0b94b63b1fe0ea93082b6d0..595e08c889849aba8ad25501b3bff742ff14f855 100644 (file)
--- a/out.h
+++ b/out.h
@@ -1,3 +1,5 @@
+//uchime by Robert C. Edgar http://drive5.com/uchime This code is donated to the public domain.\r
+\r
 #ifndef out_h\r
 #define out_h\r
 \r
index 93403444ce9c0ce9780d896682ddde00ccc0bfdc..555830a9397eefa47fc52a9b1c590d7d50676ab4 100644 (file)
--- a/path.cpp
+++ b/path.cpp
@@ -1,3 +1,5 @@
+//uchime by Robert C. Edgar http://drive5.com/uchime This code is donated to the public domain.\r
+\r
 #include "myutils.h"\r
 #include "path.h"\r
 #include "timing.h"\r
diff --git a/path.h b/path.h
index f63be7ee109391164451d4397c16ab4715749ad3..b04ab74424691407f6a46a48588384ee630404a3 100644 (file)
--- a/path.h
+++ b/path.h
@@ -1,3 +1,5 @@
+//uchime by Robert C. Edgar http://drive5.com/uchime This code is donated to the public domain.\r
+\r
 #ifndef path_h\r
 #define path_h\r
 \r
index c00a9c43b9e08cd6fd9e3cc997af5908861ba995..a1c981a5dc32f7b267c8c0a11e727870a426e4fe 100644 (file)
@@ -1,3 +1,5 @@
+//uchime by Robert C. Edgar http://drive5.com/uchime This code is donated to the public domain.\r
+\r
 #include "myutils.h"\r
 #include "ultra.h"\r
 #include "chime.h"\r
diff --git a/seq.h b/seq.h
index 90146415cea631766f8d9ac8bd4c746e781eb8b5..83ba30fbafc3aa1317a6fe1f65e13907b7308069 100644 (file)
--- a/seq.h
+++ b/seq.h
@@ -1,3 +1,5 @@
+//uchime by Robert C. Edgar http://drive5.com/uchime This code is donated to the public domain.\r
+\r
 #ifndef seq_h\r
 #define seq_h\r
 \r
index 03de189b8780bb0a898677a6afd520cb6bccd705..be3373a692b33097ef5677738b518cd549cfd914 100644 (file)
--- a/seqdb.cpp
+++ b/seqdb.cpp
@@ -1,3 +1,5 @@
+//uchime by Robert C. Edgar http://drive5.com/uchime This code is donated to the public domain.\r
+\r
 #include "myutils.h"\r
 #include "seqdb.h"\r
 #include "alpha.h"\r
diff --git a/seqdb.h b/seqdb.h
index fafbdd93c547d50f29104f450bb5ec7ff49c4e5d..6907015095f7f004ff9b1cd0d07450b0c4a1bb41 100644 (file)
--- a/seqdb.h
+++ b/seqdb.h
@@ -1,3 +1,5 @@
+//uchime by Robert C. Edgar http://drive5.com/uchime This code is donated to the public domain.\r
+\r
 #ifndef seqdb_h\r
 #define seqdb_h\r
 \r
index 030ff5ab4dbb821cebaf539e0896792b7e0b65ba..123791d2b8dfafcb4313fc6d0fe45e092dafc573 100644 (file)
@@ -1,11 +1,13 @@
-#include "myutils.h"
-#include "mx.h"
-
-Mx<float> g_SubstMxf;
-float **g_SubstMx;
-
-static const char Alphabet[] = "ACGTU";
-
+//uchime by Robert C. Edgar http://drive5.com/uchime This code is donated to the public domain.\r
+\r
+#include "myutils.h"\r
+#include "mx.h"\r
+\r
+Mx<float> g_SubstMxf;\r
+float **g_SubstMx;\r
+\r
+static const char Alphabet[] = "ACGTU";\r
+\r
 void SetNucSubstMx(double Match, double Mismatch)\r
        {\r
        static bool Done = false;\r
index 5e794c67d5f5369df91f347e0a45b9365cb34ca0..95590404d57f43b94ed1c18a9d714cfed2bb11f7 100644 (file)
@@ -1,3 +1,5 @@
+//uchime by Robert C. Edgar http://drive5.com/uchime This code is donated to the public domain.\r
+\r
 #include "sfasta.h"\r
 #include "orf.h"\r
 #include "alpha.h"\r
@@ -225,8 +227,9 @@ const byte *SFasta::GetNextSeqLo()
                        if (!WarningDone)\r
                                {\r
                                if (isgap(c))\r
-                                       Warning("Ignoring gaps in FASTA file '%s'",\r
-                                               m_FileName.c_str());\r
+                                       //Warning("Ignoring gaps in FASTA file '%s'",\r
+                                               //m_FileName.c_str());\r
+                                       ;\r
                                else if (isprint(c))\r
                                        Warning("Invalid FASTA file '%s', non-letter '%c' in sequence >%s",\r
                                          m_FileName.c_str(), c, Label);\r
index ed2f2ffb56afea966a61b241e5b54645eb76f75c..79ab9617527efa014fad336156d8dd7064865748 100644 (file)
--- a/sfasta.h
+++ b/sfasta.h
@@ -1,3 +1,5 @@
+//uchime by Robert C. Edgar http://drive5.com/uchime This code is donated to the public domain.\r
+\r
 #ifndef sfasta_h\r
 #define sfasta_h\r
 \r
index b566e1b801a932374736991076457f0efd9dda4c..10bd1f7705bed69363a08c9a2b3d2dd99cf3c054 100644 (file)
--- a/timing.h
+++ b/timing.h
@@ -1,3 +1,5 @@
+//uchime by Robert C. Edgar http://drive5.com/uchime This code is donated to the public domain.
+
 #define TIMING 0
 #ifndef timing_h
 #define timing_h
index 94159cd24aa99ab7584df620d6b576164b11531e..d58b9002612aa2f0e3fab29d7ea26441af40e6f9 100644 (file)
@@ -1,3 +1,5 @@
+//uchime by Robert C. Edgar http://drive5.com/uchime This code is donated to the public domain.
+
 #include "dp.h"
 
 #define TRACE  0
diff --git a/uc.h b/uc.h
index 631ea36a3024606f0d1635b70034305111aae818..8edef832487b8756f108ef1e1323d5ab4076dcee 100644 (file)
--- a/uc.h
+++ b/uc.h
@@ -1,3 +1,5 @@
+//uchime by Robert C. Edgar http://drive5.com/uchime This code is donated to the public domain.\r
+\r
 #ifndef uc_h\r
 #define uc_h\r
 \r
index 40e7f44546668bb7d22d1a0b4e8800f29fc89e56..0465c720a6645c1ecd5a1d29155cbb0855748436 100644 (file)
@@ -1,3 +1,5 @@
+//uchime by Robert C. Edgar http://drive5.com/uchime This code is donated to the public domain.\r
+\r
 #include "myutils.h"\r
 #include "chime.h"\r
 #include "seqdb.h"\r
@@ -107,11 +109,7 @@ int uchime_main(int argc, char *argv[])
                return 0;\r
                }\r
 \r
-       //printf("uchime v" MY_VERSION ".%s\n", SVN_VERSION);\r
-       //printf("by Robert C. Edgar\n");\r
-       //printf("http://drive5.com/uchime\n");\r
-       //printf("This code is donated to the public domain.\n");\r
-       //printf("\n");\r
+               \r
        if (!optset_w)\r
                opt_w = 8;\r
        \r
@@ -203,10 +201,16 @@ int uchime_main(int argc, char *argv[])
 \r
                WriteChimeHit(g_fUChime, Hit);\r
 \r
-               ProgressStep(i, QuerySeqCount, "%u/%u chimeras found (%.1f%%)", HitCount, i, Pct(HitCount, i+1));\r
-               \r
+               //ProgressStep(i, QuerySeqCount, "%u/%u chimeras found (%.1f%%)", HitCount, i, Pct(HitCount, i+1));\r
+                       //report progress\r
+                       if((i+1) % 100 == 0){   m->mothurOut("Processing sequence: " + toString(i+1) + ", " + toString(HitCount) + " chimeras found."); m->mothurOutEndLine();          }\r
+               }\r
+               if (!m->control_pressed) { \r
+                       //report progress\r
+                       if((QuerySeqCount) % 100 != 0){ m->mothurOut("Processing sequence: " + toString(QuerySeqCount) + ", " + toString(HitCount) + " chimeras found."); m->mothurOutEndLine();                }\r
                }\r
 \r
+\r
        Log("\n");\r
        Log("%s: %u/%u chimeras found (%.1f%%)\n",\r
          opt_input.c_str(), HitCount, QuerySeqCount, Pct(HitCount, QuerySeqCount));\r
index 7afbf4279bb23aafdffdd474cdf7185ab226b6af..33f102e9363bc7ac39c3bf25f6b24059e647afd2 100644 (file)
--- a/usort.cpp
+++ b/usort.cpp
@@ -1,5 +1,5 @@
 //#if  UCHIMES\r
-\r
+//uchime by Robert C. Edgar http://drive5.com/uchime This code is donated to the public domain.\r
 #include "myutils.h"\r
 #include "seqdb.h"\r
 #include "seq.h"\r
index 2b201741448e5bad79aa93b7c9887b4cdf2bda42..3f3fc970a2075a248bdace6b599773e04a84db01 100644 (file)
@@ -1,9 +1,11 @@
+//uchime by Robert C. Edgar http://drive5.com/uchime This code is donated to the public domain.
+
 #include "dp.h"
 #include "out.h"
 #include "evalue.h"
 
 #define CMP_SIMPLE     0
-\r
+
 #if    SAVE_FAST
 static Mx<float> g_MxDPM;
 static Mx<float> g_MxDPD;
@@ -66,21 +68,21 @@ static void AllocSave(unsigned LA, unsigned LB)
        g_DPDSimple = g_DPDSimpleMx->GetData();
        g_DPISimple = g_DPISimpleMx->GetData();
 #endif
-       g_MxDPM.Alloc("FastM", LA+1, LB+1);\r
-       g_MxDPD.Alloc("FastD", LA+1, LB+1);\r
-       g_MxDPI.Alloc("FastI", LA+1, LB+1);\r
-\r
-       g_MxTBM.Alloc("FastTBM", LA+1, LB+1);\r
-       g_MxTBD.Alloc("FastTBD", LA+1, LB+1);\r
-       g_MxTBI.Alloc("FastTBI", LA+1, LB+1);\r
-\r
-       g_DPM = g_MxDPM.GetData();\r
-       g_DPD = g_MxDPD.GetData();\r
-       g_DPI = g_MxDPI.GetData();\r
-\r
-       g_TBM = g_MxTBM.GetData();\r
-       g_TBD = g_MxTBD.GetData();\r
-       g_TBI = g_MxTBI.GetData();\r
+       g_MxDPM.Alloc("FastM", LA+1, LB+1);
+       g_MxDPD.Alloc("FastD", LA+1, LB+1);
+       g_MxDPI.Alloc("FastI", LA+1, LB+1);
+
+       g_MxTBM.Alloc("FastTBM", LA+1, LB+1);
+       g_MxTBD.Alloc("FastTBD", LA+1, LB+1);
+       g_MxTBI.Alloc("FastTBI", LA+1, LB+1);
+
+       g_DPM = g_MxDPM.GetData();
+       g_DPD = g_MxDPD.GetData();
+       g_DPI = g_MxDPI.GetData();
+
+       g_TBM = g_MxTBM.GetData();
+       g_TBD = g_MxTBD.GetData();
+       g_TBI = g_MxTBI.GetData();
        }
 
 static void SAVE_DPM(unsigned i, unsigned j, float x)
index 0b324ca9f7b720859cb54c34253dc6f1ba67f6ff..b1e002db276469c0ad73a17c96b1416556340923 100644 (file)
--- a/windex.h
+++ b/windex.h
@@ -1,3 +1,5 @@
+//uchime by Robert C. Edgar http://drive5.com/uchime This code is donated to the public domain.\r
+\r
 #ifndef windex_h\r
 #define windex_h\r
 \r
index ea67061fe049908012cd7ac5b6fb8c1195c00de9..85ec26d7ed31ad1fda9349b0fb38e862e91d3ae5 100644 (file)
@@ -1,3 +1,5 @@
+//uchime by Robert C. Edgar http://drive5.com/uchime This code is donated to the public domain.\r
+\r
 #include "myutils.h"\r
 #include "chime.h"\r
 \r