]> git.donarmstrong.com Git - mothur.git/commitdiff
pat's edits from 1/26/2010
authorpschloss <pschloss>
Tue, 26 Jan 2010 18:13:06 +0000 (18:13 +0000)
committerpschloss <pschloss>
Tue, 26 Jan 2010 18:13:06 +0000 (18:13 +0000)
chimeraseqscommand.cpp
chimeraslayer.cpp
classifyseqscommand.cpp
mothur.cpp
preclustercommand.cpp
trimseqscommand.cpp

index 3632e6363b2414eb67b1d90fd958175f7f0bc8aa..9bd13e3a99578ab1374e2367fc73207e89225f50 100644 (file)
@@ -196,7 +196,7 @@ int ChimeraSeqsCommand::execute(){
                else if (method == "pintail")                   {               chimera = new Pintail(fastafile, templatefile);                         }
                else if (method == "ccode")                             {               chimera = new Ccode(fastafile, templatefile);                           }
                else if (method == "chimeracheck")              {               chimera = new ChimeraCheckRDP(fastafile, templatefile);         }
-               //else if (method == "chimeraslayer")           {               chimera = new ChimeraSlayer(fastafile, templatefile);           }
+               else if (method == "chimeraslayer")             {               chimera = new ChimeraSlayer(fastafile, templatefile);           }
                else { mothurOut("Not a valid method."); mothurOutEndLine(); return 0;          }
                
                //set user options
index 9b85b5cd4da6dc6e4bc28fcc9d279bbd768da7c5..ab4bd1fa18806f6650a3d75ed7efe95c4284d7e1 100644 (file)
@@ -33,11 +33,12 @@ void ChimeraSlayer::print(ostream& out) {
                for (int i = 0; i < querySeqs.size(); i++) {
                
                        if (chimeraFlags[i] == "yes") { 
+                               cout << i << endl;
                                if ((chimeraResults[i][0].bsa >= 90.0) || (chimeraResults[i][0].bsb >= 90.0)) {
                                        mothurOut(querySeqs[i]->getName() + "\tyes"); mothurOutEndLine();
                                        out << querySeqs[i]->getName() << "\tyes" << endl;
                                }else {
-                                       out << querySeqs[i]->getName() << "\tno" << endl;
+                                       out << querySeqs[i]->getName() << "\tyes" << endl;
                                        //mothurOut(querySeqs[i]->getName() + "\tno"); mothurOutEndLine();
                                }
 
index 3e4f6ad3b36f4a137ceef8cb774b905b238c2f20..473d4d11d78bed00e56a02472afeb4980e19e87e 100644 (file)
@@ -200,8 +200,8 @@ int ClassifySeqsCommand::execute(){
        try {
                if (abort == true) {    return 0;       }
                
-               if(method == "bayesian")                        {       classify = new Bayesian(taxonomyFileName, templateFileName, search, kmerSize, cutoff, iters);           }
-               else if(method == "knn")                        {       classify = new Knn(taxonomyFileName, templateFileName, search, kmerSize, gapOpen, gapExtend, match, misMatch, numWanted);                               }
+               if(method == "bayesian"){       classify = new Bayesian(taxonomyFileName, templateFileName, search, kmerSize, cutoff, iters);           }
+               else if(method == "knn"){       classify = new Knn(taxonomyFileName, templateFileName, search, kmerSize, gapOpen, gapExtend, match, misMatch, numWanted);                               }
                else {
                        mothurOut(search + " is not a valid method option. I will run the command using bayesian.");
                        mothurOutEndLine();
@@ -380,7 +380,7 @@ string ClassifySeqsCommand::addUnclassifieds(string tax, int maxlevel) {
                //keep what you have counting the levels
                while (tax.find_first_of(';') != -1) {
                        //get taxon
-                       taxon = tax.substr(0,tax.find_first_of(';'));
+                       taxon = tax.substr(0,tax.find_first_of(';'))+';';
                        tax = tax.substr(tax.find_first_of(';')+1, tax.length());
                        newTax += taxon;
                        level++;
@@ -480,13 +480,14 @@ int ClassifySeqsCommand::driver(linePair* line, string taxFName, string tempTFNa
                        
                        if (candidateSeq->getName() != "") {
                                taxonomy = classify->getTaxonomy(candidateSeq);
-                               
+
                                if (taxonomy != "bad seq") {
                                        //output confidence scores or not
                                        if (probs) {
                                                outTax << candidateSeq->getName() << '\t' << taxonomy << endl;
                                        }else{
                                                outTax << candidateSeq->getName() << '\t' << classify->getSimpleTax() << endl;
+                                               cout << classify->getSimpleTax() << endl;
                                        }
                                        
                                        outTaxSimple << candidateSeq->getName() << '\t' << classify->getSimpleTax() << endl;
index 7fd5d1e48fc25bee4af0aefa7213814695489cf2..ab4fea0e09482b3c8c988ade3e244fa4c8504750 100644 (file)
@@ -20,11 +20,11 @@ int main(int argc, char *argv[]){
        try {
                
                //remove old logfile
-               string log = "mothur.logFile";
-               remove(log.c_str());
+//             string log = "mothur.logFile";
+//             remove(log.c_str());
                
                time_t ltime = time(NULL); /* calendar time */  
-               string logFileName = "mothur." + toString(asctime( localtime(&ltime) )) + ".logfile";
+               string logFileName = "mothur." + toString(ltime) + ".logfile";
                
                //version
                #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
@@ -110,7 +110,7 @@ int main(int argc, char *argv[]){
        
                delete mothur;
                
-               rename(log.c_str(), logFileName.c_str()); //logfile with timestamp
+//             rename(log.c_str(), logFileName.c_str()); //logfile with timestamp
                
                return 0;
        }
index 66fd8500e3c7d583604106e0408e15bc36dc4a92..89e6cbfb9e2560e4860cae8dd6a0ee4632a687da 100644 (file)
@@ -99,12 +99,9 @@ int PreClusterCommand::execute(){
                //sort seqs by number of identical seqs
                sort(alignSeqs.begin(), alignSeqs.end(), comparePriority);
        
-               //go through active list and cluster everthing you can, until all nodes are inactive
-               //taking advantage of the fact that maps are already sorted
-//             map<string, bool>::iterator itActive;
-//             map<string, bool>::iterator it2Active;
                int count = 0;
-               
+
+               //think about running through twice...
                for (int i = 0; i < numSeqs; i++) {
                        
                        //are you active
index a6950aca22d383fdba9dde8d719d0430e62e32d4..b185da0905321c7980f2237a9d938bd260d9397d 100644 (file)
@@ -301,7 +301,9 @@ void TrimSeqsCommand::getOligos(vector<ofstream*>& outFASTAVec){
                                        forPrimer.push_back(oligo);
                                }
                                else if(type == "reverse"){
-                                       revPrimer.push_back(oligo);
+                                       Sequence oligoRC("reverse", oligo);
+                                       oligoRC.reverseComplement();
+                                       revPrimer.push_back(oligoRC.getUnaligned());
                                }
                                else if(type == "barcode"){
                                        inOligos >> group;
@@ -406,7 +408,7 @@ bool TrimSeqsCommand::stripReverse(Sequence& seq){
                        }
                        
                        if(compareDNASeq(oligo, rawSequence.substr(rawSequence.length()-oligo.length(),oligo.length()))){
-                               seq.setUnaligned(rawSequence.substr(rawSequence.length()-oligo.length()));
+                               seq.setUnaligned(rawSequence.substr(0,rawSequence.length()-oligo.length()));
                                success = 1;
                                break;
                        }