]> git.donarmstrong.com Git - mothur.git/commitdiff
fixed some bugs
authorwestcott <westcott>
Thu, 4 Jun 2009 14:10:53 +0000 (14:10 +0000)
committerwestcott <westcott>
Thu, 4 Jun 2009 14:10:53 +0000 (14:10 +0000)
118 files changed:
Mothur.xcodeproj/project.pbxproj
alignment.cpp
alignment.hpp
alignmentcell.cpp
blastalign.cpp
blastdb.cpp
boneh.cpp
calculator.h
chao1.cpp
cluster.hpp
collect.h
collectdisplay.h
collectorscurvedata.h
command.hpp
commandfactory.cpp
commandoptionparser.cpp
coverage.cpp
database.cpp
database.hpp
datavector.hpp
deconvolutecommand.cpp
deconvolutecommand.h
display.h
distancecommand.cpp
distancecommand.h
distancedb.cpp
distancedb.hpp
efron.cpp
engine.cpp
engine.hpp
errorchecking.cpp
fastamap.cpp
fastamap.h
fileoutput.cpp
fileoutput.h
filterseqscommand.cpp
filterseqscommand.h
fullmatrix.h
globaldata.cpp
globaldata.hpp
gotohoverlap.cpp
groupmap.cpp
heatmap.cpp
heatmap.h
helpcommand.cpp
inputdata.h
kmer.cpp
kmerdb.cpp
libshuffcommand.h
listvector.cpp
mothur.cpp
mothur.h
nameassignment.cpp
nameassignment.hpp
nast.cpp
nastreport.cpp
nastreport.hpp
needlemanoverlap.cpp
noalign.hpp
observable.h
ordervector.cpp
overlap.cpp
parsimonycommand.h
progress.cpp
progress.hpp
rabundvector.cpp
raredisplay.cpp
raredisplay.h
rarefact.h
rarefactioncurvedata.h
readclustal.h
readfasta.cpp
readfasta.h
readnexus.h
readnexusal.h
readseqs.cpp
readseqs.h
readseqsphylip.cpp
readseqsphylip.h
readtree.h
sabundvector.cpp
sabundvector.hpp
screenseqscommand.h
seqsummarycommand.h
sequence.cpp
sequence.hpp
sequencedb.h
shared.h
sharedjackknife.cpp
sharedjackknife.h
sharedlistvector.cpp
sharedordervector.cpp
sharedordervector.h
sharedrabundvector.cpp
sharedsabundvector.cpp
sharedsabundvector.h
solow.cpp
sparsematrix.cpp
suffixdb.cpp
suffixdb.hpp
suffixnodes.cpp
suffixnodes.hpp
suffixtree.cpp
suffixtree.hpp
summarydata.h
tree.h
treecalculator.h
treemap.cpp
treenode.h
unifracunweightedcommand.h
unifracweightedcommand.h
uvest.h
validcalculator.h
validcommands.cpp
validcommands.h
validparameter.cpp
validparameter.h
venn.h

index 34dacfaa1bd701ec3387bb3faf3073b88cd3493e..ec6d06cfceaaa938c834bf17be5a77bca9d14aea 100644 (file)
@@ -12,6 +12,7 @@
                21DDC01B0F97A8FE0060691C /* bootstrapsharedcommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 21DDC01A0F97A8FE0060691C /* bootstrapsharedcommand.cpp */; };
                21E859D80FC4632E005E1A48 /* matrixoutputcommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 21E859D70FC4632E005E1A48 /* matrixoutputcommand.cpp */; };
                370B88070F8A4EE4005AB382 /* getoturepcommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 370B88060F8A4EE4005AB382 /* getoturepcommand.cpp */; };
+               371B30B40FD7EE67000414CA /* screenseqscommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 371B30B20FD7EE67000414CA /* screenseqscommand.cpp */; };
                372E12700F26365B0095CF7E /* readotucommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 372E126F0F26365B0095CF7E /* readotucommand.cpp */; };
                372E12960F263D5A0095CF7E /* readdistcommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 372E12950F263D5A0095CF7E /* readdistcommand.cpp */; };
                372E12ED0F264D320095CF7E /* commandfactory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 372E12EC0F264D320095CF7E /* commandfactory.cpp */; };
                21E859D70FC4632E005E1A48 /* matrixoutputcommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = matrixoutputcommand.cpp; sourceTree = SOURCE_ROOT; };
                370B88050F8A4EE4005AB382 /* getoturepcommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = getoturepcommand.h; sourceTree = SOURCE_ROOT; };
                370B88060F8A4EE4005AB382 /* getoturepcommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = getoturepcommand.cpp; sourceTree = SOURCE_ROOT; };
+               371B30B20FD7EE67000414CA /* screenseqscommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = screenseqscommand.cpp; sourceTree = "<group>"; };
+               371B30B30FD7EE67000414CA /* screenseqscommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = screenseqscommand.h; sourceTree = "<group>"; };
                372E126E0F26365B0095CF7E /* readotucommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = readotucommand.h; sourceTree = SOURCE_ROOT; };
                372E126F0F26365B0095CF7E /* readotucommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = readotucommand.cpp; sourceTree = SOURCE_ROOT; };
                372E12940F263D5A0095CF7E /* readdistcommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = readdistcommand.h; sourceTree = SOURCE_ROOT; };
                                372E126F0F26365B0095CF7E /* readotucommand.cpp */,
                                37E5F4900F2A3DA800F8D827 /* readtreecommand.h */,
                                37E5F4910F2A3DA800F8D827 /* readtreecommand.cpp */,
+                               371B30B30FD7EE67000414CA /* screenseqscommand.h */,
+                               371B30B20FD7EE67000414CA /* screenseqscommand.cpp */,
                                3799A94E0FD6A58C00E33EDE /* seqsummarycommand.cpp */,
                                3799A94F0FD6A58C00E33EDE /* seqsummarycommand.h */,
                                37D928270F21331F001D4494 /* sharedcommand.h */,
                                37D927D40F21331F001D4494 /* database.hpp */,
                                37D927D30F21331F001D4494 /* database.cpp */,
                                37D927D50F21331F001D4494 /* datavector.hpp */,
-                               3799A94C0FD6A58C00E33EDE /* distancedb.cpp */,
                                3799A94D0FD6A58C00E33EDE /* distancedb.hpp */,
+                               3799A94C0FD6A58C00E33EDE /* distancedb.cpp */,
                                37D927DC0F21331F001D4494 /* fastamap.h */,
                                37D927DB0F21331F001D4494 /* fastamap.cpp */,
                                375873EA0F7D64520040F377 /* fullmatrix.h */,
                                3749273F0FD5956B0031C06B /* getrabundcommand.cpp in Sources */,
                                3799A9500FD6A58C00E33EDE /* distancedb.cpp in Sources */,
                                3799A9510FD6A58C00E33EDE /* seqsummarycommand.cpp in Sources */,
+                               371B30B40FD7EE67000414CA /* screenseqscommand.cpp in Sources */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
index 6db3b3d9f707511fa761a6eb7cf837199770a3eb..55ba1a111640588e8426b6337a9600406ccc77cf 100644 (file)
@@ -9,15 +9,9 @@
  *  
  */
 
-using namespace std;
-
-#include <string>
-#include <vector>
-
 #include "alignmentcell.hpp"
 #include "alignment.hpp"
 
-#include <iostream>
 
 /**************************************************************************************************/
 
index 336781244b5a3370c37a7ad6f369cd9553f31618..b3175560af7f16aa7a4e6fe4d8e87a2a081ae7cf 100644 (file)
@@ -12,7 +12,6 @@
  *     As of 12/18/08 these included alignments based on blastn, needleman-wunsch, and the     Gotoh algorithms
  * 
  */
-using namespace std;
 
 #include "mothur.h"
 #include "alignmentcell.hpp"
index 544c218357cfa9c369abd6e60532463807ed8e9c..72bcb31de41e3d27673c9b8fab62221c553cb0b6 100644 (file)
@@ -13,6 +13,6 @@
 
 //********************************************************************************************************************
 
-AlignmentCell::AlignmentCell() : prevCell('x'), cValue(0.0000), dValue(0.0000), iValue(0.0000) {};
+AlignmentCell::AlignmentCell() : prevCell('x'), cValue(0.0000), dValue(0.0000), iValue(0.0000) {}
 
 //********************************************************************************************************************
index a4773138bd6f8102acaea659291fa675ea25a6fc..e4d5e8ac039d60f9f1352d6408121246f9d9864d 100644 (file)
@@ -11,7 +11,6 @@
  *
  */
 
-using namespace std;
 
 #include "alignment.hpp"
 #include "blastalign.hpp"
@@ -83,10 +82,10 @@ void BlastAlignment::setPairwiseSeqs(){     //      This method call assigns the blast ge
        
        string candidateName, templateName;
        
-       while(d=blastFile.get() != '='){};
+       while(d=blastFile.get() != '='){}
        blastFile >> candidateName;                                     //      Get the candidate sequence name from flatfile
        
-       while(d=blastFile.get() != '('){};
+       while(d=blastFile.get() != '('){}
        blastFile >> candidateLength;                           //      Get the candidate sequence length from flatfile
        
        while(d=blastFile.get()){
@@ -115,10 +114,10 @@ void BlastAlignment::setPairwiseSeqs(){   //      This method call assigns the blast ge
                }
        }
        
-       while(d=blastFile.get() != '='){};
+       while(d=blastFile.get() != '='){}
        blastFile >> templateLength;                            //      Get the template sequence length from flatfile
                
-       while(d=blastFile.get() != 'Q'){};                      //      Suck up everything else until we get to the start of the alignment
+       while(d=blastFile.get() != 'Q'){}                       //      Suck up everything else until we get to the start of the alignment
        int queryStart, sbjctStart, queryEnd, sbjctEnd;
        string queryLabel, sbjctLabel, query, sbjct;
 
index 82b104e0380b2f8794ebf9e0ce2693d835dd8cc0..6f4ebcc1fa84028113e150c39e028e340ae86c26 100644 (file)
@@ -7,8 +7,6 @@
  *
  */
 
-using namespace std;
-
 
 #include "database.hpp"
 #include "sequence.hpp"
index f5c8f90a175aa8d8e54190b7e49e8df9bf0cb683..32ec033e540dc24dbd8933aac8ac7e96b69f5bef 100644 (file)
--- a/boneh.cpp
+++ b/boneh.cpp
@@ -84,7 +84,7 @@ EstOutput Boneh::getValues(SAbundVector* sabund){
                cout << "An unknown error has occurred in the Coverage class function getValues. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
                exit(1);
        }       
-};
+}
 
 
 /***********************************************************************/
index 127c835e13318dbc8c0e853d510add1ddbc9c8a7..8b21f7071a40df4a7202176d4132d3f2d6173adc 100644 (file)
@@ -1,7 +1,6 @@
 #ifndef CALCULATOR_H
 #define CALCULATOR_H
 
-using namespace std;
 
 #include "mothur.h"
 #include "sabundvector.hpp"
@@ -14,7 +13,6 @@ It has 2 pure functions EstOutput getValues(SAbundVector*), which works on a sin
 EstOutput getValues(SharedRAbundVector* shared1, SharedRAbundVector* shared2), which compares 2 groups. */ 
 
 
-using namespace std;
 typedef vector<double> EstOutput;
 
 /***********************************************************************/
index c05bdef2b7179a01f722cf497ab67f5b72ed7e3c..7757fb0c776bd2e87916b025e8478a62d96d2257 100644 (file)
--- a/chao1.cpp
+++ b/chao1.cpp
@@ -67,6 +67,6 @@ EstOutput Chao1::getValues(SAbundVector* rank){
                cout << "An unknown error has occurred in the Chao1 class function getValues. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
                exit(1);
        }       
-};
+}
 
 /***********************************************************************/
index 5f010381f2fbb536a7ac96774523cbf39bc5b98d..de86f85502efc3b6416f5877102c16ca9e5694be 100644 (file)
@@ -1,7 +1,6 @@
 #ifndef CLUSTER_H
 #define CLUSTER_H
 
-using namespace std;
 
 #include "mothur.h"
 #include "sparsematrix.hpp"
index 295673eca402f1f82558e3f8cf2667607cadd2d1..134edf00ec71638af7e8309a1cc9dbf34469eb9d 100644 (file)
--- a/collect.h
+++ b/collect.h
@@ -1,10 +1,6 @@
 #ifndef COLLECT_H
 #define COLLECT_H
 
-using namespace std;
-
-
-
 #include "collectorscurvedata.h"
 #include "display.h"
 #include "ordervector.hpp"
index 7e40ad7359c7553a033ee03645ad6eb2421012ae..110d816f1718f374c5dca22afd4c65502ac889fa 100644 (file)
@@ -8,8 +8,6 @@
 #include "display.h"
 
 
-using namespace std;
-
 /***********************************************************************/
 
 class CollectDisplay : public Display {
index 480bc362bcea7bf2c39a0f4edf75492b4a86b846..5cbe2be6c38ad5762d9e5c8bd8ce47d30e9a9a6f 100644 (file)
@@ -1,13 +1,11 @@
 #ifndef COLLECTORSCURVEDATA_H
 #define COLLECTORSCURVEDATA_H
 
-#include "mothur.h"
 #include "sabundvector.hpp"
 #include "sharedrabundvector.h"
 #include "display.h"
 #include "observable.h"
 
-using namespace std;
 
 /***********************************************************************/
 
index e418de83e772dd824d83a6989ba51e1a92b60e06..c8dae405fe481a6c468d5e5b1f10f838b59f5763 100644 (file)
@@ -12,7 +12,6 @@
 
 /*This class is a parent to all the command classes.  It has one pure int execute(). */
 
-using namespace std;
 
 #include "mothur.h"
 
index 7b3a5c024fa31655a22946f3b5b2a86af6ae5b79..c9a3e6aab4841f8656e813f4acb9fc4e41817b60 100644 (file)
@@ -74,7 +74,7 @@ Command* CommandFactory::getCommand(string commandName){
                else if(commandName == "read.otu")                              {       command = new ReadOtuCommand();                         }
                else if(commandName == "read.tree")                             {       command = new ReadTreeCommand();                        }
                else if(commandName == "cluster")                               {       command = new ClusterCommand();                         }
-               else if(commandName == "deconvolute")                   {       command = new DeconvoluteCommand();                     }
+               else if(commandName == "unique.seqs")                   {       command = new DeconvoluteCommand();                     }
                else if(commandName == "parsimony")                             {       command = new ParsimonyCommand();                       }
                else if(commandName == "help")                                  {       command = new HelpCommand();                            }
                else if(commandName == "quit")                                  {       command = new QuitCommand();                            }
index a46c0a6ccfc47859d06ae6cae21e87a441be460c..6fc43ab9f44b980b677aa50bb8014a315fc34583 100644 (file)
@@ -8,9 +8,6 @@
  */
 
 
-using namespace std;
-
-
 #include "globaldata.hpp"
 #include "commandoptionparser.hpp"
 
index a93cbf335f8807d7f967d375fbbc3f14be211e77..441a029c264c913e420c4c81ac7d9d3191332709 100644 (file)
@@ -27,7 +27,7 @@ EstOutput Coverage::getValues(SAbundVector* rank){
                cout << "An unknown error has occurred in the Coverage class function getValues. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
                exit(1);
        }       
-};
+}
 
 
 /***********************************************************************/
index 44e663bde3c9a9d9bd40895ef1a600779594ce21..f8491469a3fec224f299125fdd960a38343f921b 100644 (file)
@@ -7,9 +7,7 @@
  *
  */
 
-using namespace std;
-
-
+#include "mothur.h"
 #include "sequence.hpp"
 #include "database.hpp"
 
index 09fea858247b23cf33b351b0d56278522cf930af..2fced3fcfb80ea3367a9116f5aca858d7baf88f1 100644 (file)
@@ -10,6 +10,9 @@
  *
  */
 
+
+/* This class is a parent to blastdb, distancedb, kmerdb, suffixdb.  Which are used to convert a squencedb object into that form. */
+
 #include "mothur.h"
 
 class Sequence;
index 18ac6958e09b64f209a39ff51098406021f5022b..692332f445aa76b0ff7ebe5ac1281c34b3a8f967 100644 (file)
@@ -1,7 +1,6 @@
 #ifndef datavector_h
 #define datavector_h
 
-using namespace std;
 
 #include "mothur.h"
 
index 36cc7766f03097235fa274f12330611d616cdacb..51362e55a0780ced0cfc9833a51ed8d71870edf2 100644 (file)
@@ -34,6 +34,9 @@ int DeconvoluteCommand::execute() {
                //the second column is the list of names of identical sequences separated by ','.
                fastamap->printNamesFile(out);
                fastamap->printCondensedFasta(outFasta);
+               
+               out.close();
+               outFasta.close();
        
                return 0;
        }
index fe5c0db5587d9909fdad12d1f65cb916f5901043..aaed841ed8012a274cb96c3153463b4c1b0a2bc0 100644 (file)
 #include "fastamap.h"
 #include "globaldata.hpp"
 
-/* The deconvolute command reads a fasta file, finds the duplicate sequences and outputs a names file
+/* The unique.seqs command reads a fasta file, finds the duplicate sequences and outputs a names file
        containing 2 columns.  The first being the groupname and the second the list of identical sequence names. */ 
 
-using namespace std;
 
 class DeconvoluteCommand : public Command {
 
index c4301baefec3d8590ef405fe47f1f08e0c9b3db8..0207bbfe2186228c324dcf25ba1a7909ed703fdf 100644 (file)
--- a/display.h
+++ b/display.h
@@ -7,8 +7,6 @@
 #include "fileoutput.h"
 
 
-using namespace std;
-
 /***********************************************************************/
 
 class Display {
index 1bc16f34bc231147a3610a894ad3ad04c2d49bed..fbec46c80fb35a1c97889d47ea61e8a4e9f5e686 100644 (file)
@@ -25,7 +25,7 @@ DistanceCommand::DistanceCommand(){
                convert(globaldata->getCutOff(), cutoff);
                
                int i;
-               if (countends == "T") {
+               if (isTrue(countends) == true) {
                        for (i=0; i<globaldata->Estimators.size(); i++) {
                                if (validCalculator->isValidCalculator("distance", globaldata->Estimators[i]) == true) { 
                                        if (globaldata->Estimators[i] == "nogaps") { 
index 6bd7572629f1ada2b372127110cadb1fce943f76..8bdf845e372a9dfc25c8700b14afaa9f6802c8b8 100644 (file)
@@ -22,8 +22,6 @@
 #include "readseqsphylip.h"
 
 
-using namespace std;
-
 class DistanceCommand : public Command {
 
 public:
index ce7485469fadce116664f4f26d5556192fe5866c..3cb739db9496dd64b01d24b31900edd5ecc9fb88 100644 (file)
@@ -8,9 +8,6 @@
  */
 
 
-using namespace std;
-
-
 #include "database.hpp"
 #include "sequence.hpp"
 #include "distancedb.hpp"
index dc4c9a6b46f8ee28b8db5b24b8b0bd083f03d033..9c13faffdb778cbebca30454b1372625a24de502 100644 (file)
@@ -11,8 +11,6 @@
  */
 
 
-using namespace std;
-
 #include "mothur.h"
 
 class DistanceDB : public Database {
index e88b025d9e3ff2bbd4ffc2ed5db463deb64f9d5f..62d924bb7a4641bc85de3802b6ca1f45d8b06a8f 100644 (file)
--- a/efron.cpp
+++ b/efron.cpp
@@ -35,7 +35,7 @@ EstOutput Efron::getValues(SAbundVector* rank){
                cout << "An unknown error has occurred in the Coverage class function getValues. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
                exit(1);
        }       
-};
+}
 
 
 /***********************************************************************/
index ddd6776cfc78f48f371ba677fd268c7a46964ade..d5192bf87b50a98a76e971305cd68a96e8750a0b 100644 (file)
@@ -10,7 +10,7 @@
  *  Fix later, don't have time now.
  *
  */
-using namespace std;
+
 
 #include "engine.hpp"
 
@@ -47,7 +47,7 @@ bool InteractEngine::getInput(){
                ErrorCheck* errorCheckor = new ErrorCheck();
                
                cout << "mothur v.1.3.0" << endl;
-               cout << "Last updated: 4/25/2009" << endl << endl;
+               cout << "Last updated: 5/29/2009" << endl << endl;
                cout << "by" << endl;
                cout << "Patrick D. Schloss" << endl << endl;
                cout << "Department of Microbiology" << endl;
index 276d29267a298dd7c2f52c9b550b3d9b37c555a0..d42406e46022bfa717e288ecf9fa05df2a3a8185 100644 (file)
@@ -19,9 +19,6 @@
 #include "commandfactory.hpp"
 #include "errorchecking.h"
 
-
-using namespace std;
-
 class GlobalData;
 
 class Engine {
index 06524921a4db4670bdb4a7253977178f468c9b19..caf7f73dc31cf02bd48ac7352f339e41b4f6cb96 100644 (file)
@@ -205,8 +205,8 @@ bool ErrorCheck::checkInput(string input) {
                        }
                }else if (commandName == "read.tree") { 
                        validateTreeFiles(); //checks the treefile and groupfile parameters
-               }else if (commandName == "deconvolute") {
-                       if (fastafile == "") { cout << "You must enter a fastafile with the deconvolute() command." << endl; return false; }
+               }else if (commandName == "unique.seqs") {
+                       if (fastafile == "") { cout << "You must enter a fastafile with the unique.seqs() command." << endl; return false; }
                        validateReadFiles();
                }
                
@@ -281,8 +281,8 @@ bool ErrorCheck::checkInput(string input) {
                }
                
                if ((commandName == "filter.seqs") || (commandName == "dist.seqs")) { 
-                       if ((fastafile == "") && (nexusfile == "") && (clustalfile == "") && (phylipfile == "")) {
-                                cout << "You must enter either a fasta, nexus, clustal, or phylip file before you can use the filter.seqs or dist.seqs command." << endl; return false; 
+                       if (fastafile == "") {
+                                cout << "You must enter either a fasta file before you can use the filter.seqs or dist.seqs command." << endl; return false; 
                        }
                        validateSeqsFiles();
                }
index 0848363be7cf4099cbb50cb58a3d11623eecc78f..1cc9abf08da58bad5497079d46185413e0c23ff4 100644 (file)
@@ -14,54 +14,100 @@ void FastaMap::readFastaFile(ifstream& in) {
        try {
                string name, sequence, line;
                sequence = "";
-       
-               in >> line;
-               name = line.substr(1, line.length());  //rips off '>'
-       
+               int c;
+               string temp;
+               
+               
                //read through file
-               while (!in.eof()) {
-                       in >> line;
+               while ((c = in.get()) != EOF) {
+                       name = ""; sequence = ""; 
+                       //is this a name
+                       if (c == '>') { 
+                               name = readName(in); 
+                               sequence = readSequence(in); 
+                       }else {  cout << "Error fasta in your file. Please correct." << endl; }
 
-                       if (line[0] != '>') {  //if it's a sequence line
-                               sequence += line;
-                       }
-                       else{
+                       //store info in map
                        //input sequence info into map
-                               seqmap[name] = sequence;  
-
-                               it = data.find(sequence);
-                               if (it == data.end()) {         //it's unique.
-                                       data[sequence].groupname = name;  //group name will be the name of the first duplicate sequence found.
-                                       data[sequence].groupnumber = 1;
-                                       data[sequence].names = name;
-                               }else { // its a duplicate.
-                                       data[sequence].names += "," + name;
-                                       data[sequence].groupnumber++;
-                               }
-                               name = (line.substr(1, (line.npos))); //The line you just read is a new name so rip off '>'
-                               sequence = "";
-                       }
+                       seqmap[name] = sequence;  
+                       it = data.find(sequence);
+                       if (it == data.end()) {         //it's unique.
+                               data[sequence].groupname = name;  //group name will be the name of the first duplicate sequence found.
+                               data[sequence].groupnumber = 1;
+                               data[sequence].names = name;
+                       }else { // its a duplicate.
+                               data[sequence].names += "," + name;
+                               data[sequence].groupnumber++;
+                       }       
                        
                        gobble(in);
                }
-               it = data.find(sequence);
-               if (it == data.end()) {         //it's unique.
-                       data[sequence].groupname = name;  //group name will be the name of the first duplicate sequence found.
-                       data[sequence].groupnumber = 1;
-                       data[sequence].names = name;
-               }else { // its a duplicate.
-                       data[sequence].names += "," + name;
-                       data[sequence].groupnumber++;
+                                       
+       }
+       catch(exception& e) {
+               cout << "Standard Error: " << e.what() << " has occurred in the FastaMap class Function readFastaFile. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+               exit(1);
+       }
+       catch(...) {
+               cout << "An unknown error has occurred in the FastaMap class function readFastaFile. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+               exit(1);
+       }
+}
+/*******************************************************************************/
+string FastaMap::readName(ifstream& in) {
+       try{
+               string name = "";
+               int c;
+               string temp;
+               
+               while ((c = in.get()) != EOF) {
+                       //if c is not a line return
+                       if (c != 10) {
+                               name += c;
+                       }else { break;  }
                }
+                       
+               return name;
+       }
+       catch(exception& e) {
+               cout << "Standard Error: " << e.what() << " has occurred in the FastaMap class Function readName. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+               exit(1);
+       }
+       catch(...) {
+               cout << "An unknown error has occurred in the FastaMap class function readName. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+               exit(1);
+       }
+}
+
+/*******************************************************************************/
+string FastaMap::readSequence(ifstream& in) {
+       try{
+               string sequence = "";
+               string line;
+               int pos, c;
                
+               while (!in.eof()) {
+                       //save position in file in case next line is a new name.
+                       pos = in.tellg();
+                       line = "";
+                       in >> line;                     
+                       //if you are at a new name
+                       if (line[0] == '>') {
+                               //put file pointer back since you are now at a new name
+                               in.seekg(pos, ios::beg);
+                               c = in.get();  //because you put it back to a newline char
+                               break;
+                       }else {  sequence += line;      }
+               }
                        
+               return sequence;
        }
        catch(exception& e) {
-               cout << "Standard Error: " << e.what() << " has occurred in the FastaMap class Function readFastaFile. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+               cout << "Standard Error: " << e.what() << " has occurred in the FastaMap class Function readSequence. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
                exit(1);
        }
        catch(...) {
-               cout << "An unknown error has occurred in the FastaMap class function readFastaFile. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+               cout << "An unknown error has occurred in the FastaMap class function readSequence. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
                exit(1);
        }
 }
@@ -124,7 +170,7 @@ void FastaMap::printNamesFile(ostream& out){ //prints data
 /*******************************************************************************/
 void FastaMap::printCondensedFasta(ostream& out){ //prints data
        try {
-               // two column file created with groupname and them list of identical sequence names
+               //creates a fasta file
                for (it = data.begin(); it != data.end(); it++) {
                        out << ">" << it->second.groupname << endl;
                        out << it->first << endl;
index 355a8df51786bdac9c229aed9d4233bd46d41c3e..6051874e3f6802cf0234945502749ad35f474e4f 100644 (file)
@@ -10,8 +10,6 @@
  *
  */
  
-using namespace std;
 #include "mothur.h"
 
 
@@ -47,6 +45,9 @@ private:
        map<string, string>  seqmap;  //name, sequence  -  uncondensed representation of file
        map<string, group>::iterator it;
        map<string, string>::iterator it2;
+       
+       string readName(ifstream&);
+       string readSequence(ifstream&);
 };
 
 #endif
index 74b53352a8a0d4d177635a9b4d52370030b06f45..d4db5464f162a36d9badb3da83390ed69ece7066 100644 (file)
@@ -16,7 +16,7 @@ ThreeColumnFile::~ThreeColumnFile(){
        inFile.close();
        outFile.close();
        remove(outName.c_str());
-};
+}
 
 /***********************************************************************/
 
@@ -71,7 +71,7 @@ void ThreeColumnFile::output(int nSeqs, vector<double> data){
                cout << "An unknown error has occurred in the ThreeColumnFile class function output. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
                exit(1);
        }
-};
+}
 
 /***********************************************************************/
 
@@ -111,7 +111,7 @@ ColumnFile::~ColumnFile(){
        inFile.close();
        outFile.close();
        remove(outName.c_str());
-};
+}
 
 /***********************************************************************/
 
@@ -183,7 +183,7 @@ void ColumnFile::output(vector<double> data){
                cout << "An unknown error has occurred in the ColumnFile class function output. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
                exit(1);
        }
-};
+}
 
 /***********************************************************************/
 
@@ -223,7 +223,7 @@ SharedThreeColumnFile::~SharedThreeColumnFile(){
        inFile.close();
        outFile.close();
        remove(outName.c_str());
-};
+}
 
 /***********************************************************************/
 
@@ -279,7 +279,7 @@ void SharedThreeColumnFile::output(int nSeqs, vector<double> data){
                cout << "An unknown error has occurred in the SharedThreeColumnFile class function output. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
                exit(1);
        }
-};
+}
 
 /***********************************************************************/
 
@@ -319,7 +319,7 @@ OneColumnFile::~OneColumnFile(){
        inFile.close();
        outFile.close();
        remove(outName.c_str());        
-};
+}
 
 /***********************************************************************/
 
@@ -374,7 +374,7 @@ void OneColumnFile::output(int nSeqs, vector<double> data){
                cout << "An unknown error has occurred in the OneColumnFile class function output. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
                exit(1);
        }       
-};
+}
 
 /***********************************************************************/
 
@@ -413,7 +413,7 @@ SharedOneColumnFile::~SharedOneColumnFile(){
        inFile.close();
        outFile.close();
        remove(outName.c_str());        
-};
+}
 
 /***********************************************************************/
 
@@ -477,7 +477,7 @@ void SharedOneColumnFile::output(int nSeqs, vector<double> data){
                cout << "An unknown error has occurred in the OneColumnFile class function output. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
                exit(1);
        }       
-};
+}
 
 /***********************************************************************/
 
index d7c4726e3f3d2b13786ebcf8bf6afa792b39fe52..359946c87eac9c394385d72bb27eb3fc3b6d9ff5 100644 (file)
@@ -4,8 +4,6 @@
 #include "mothur.h"
 #include "globaldata.hpp"
 
-using namespace std;
-
 /***********************************************************************/
 
 class FileOutput {
index 8864bb3c57d32052220013ebf88267f865ccdbd1..7330268a83ccd9b044f38fa28f58386132562e2d 100644 (file)
@@ -118,7 +118,6 @@ void FilterSeqsCommand::doSoft() {
 
 int FilterSeqsCommand::execute() {     
        try {
-               
                ifstream inFASTA;
                openInputFile(globaldata->getFastaFile(), inFASTA);
                
@@ -130,14 +129,8 @@ int FilterSeqsCommand::execute() {
                
                if(globaldata->getHard().compare("") != 0)      {       doHard();               }       //      has to be applied first!
                if(globaldata->getTrump().compare("") != 0)     {       doTrump();              }
-               if(isTrue(globaldata->getVertical()))           {       doVertical();   }
+               if(isTrue(globaldata->getVertical()) == true)           {       doVertical();   }
                if(globaldata->getSoft().compare("") != 0)      {       doSoft();               }
-
-               
-               
-               
-               
-               
                
                ofstream outfile;
                string filterFile = getRootName(globaldata->inputFileName) + "filter";
index b59d0a4b4cfa1ce7f7d86deb48b90515f5cc965a..6fe171a1ee7f3027377e0e02e6a78e2831a86a0b 100644 (file)
  */
 
 #include "command.hpp"
-#include "mothur.h"
 #include "globaldata.hpp"
 #include "readfasta.h"
 #include "readnexus.h"
 #include "readclustal.h"
 #include "readseqsphylip.h"
 
-using namespace std;
 
 class FilterSeqsCommand : public Command {
 
index 5912b6ccc0ea323bf905bd0e9f301631276c4490..95c472fd4f1951f5bbee064a764eb6016a2ed956 100644 (file)
@@ -14,7 +14,6 @@
 #include "globaldata.hpp"
 #include "progress.hpp"
 
-using namespace std;
 
 struct Names {
        string          seqName;
index 62641beab3e0603715ff4ff57c6a2d7326a22421..d7afc40b352229484d2f350f1ad190631a5ab7ed 100644 (file)
@@ -366,8 +366,8 @@ GlobalData::GlobalData() {
        //option definitions should go here...
        helpRequest = "";
        clear();
-       gListVector == NULL;            
-       gSparseMatrix == NULL;  
+       gListVector = NULL;             
+       gSparseMatrix = NULL;   
 }
 /*******************************************************/
 
@@ -404,7 +404,7 @@ void GlobalData::clear() {
        step                    =       "0.01";
        form                    =       "integral";
        sorted                  =       "T";  //F means don't sort, T means sort.
-       vertical        =   "";         
+       vertical        =   "F";                
        trump           =       "";             
        hard                    =   "";         
        soft            =   ""; 
index f97d98b311ff46f21d5479c15795eaa3e69fd892..11422e0184af39e2f5fc58c911c298c6f08241fb 100644 (file)
@@ -4,14 +4,10 @@
 #include "mothur.h"
 #include "groupmap.h"
 #include "treemap.h"
-
 #include "rabundvector.hpp"
 #include "sabundvector.hpp"
 #include "listvector.hpp"
 
-
-using namespace std;
-
 class ListVector;
 class SharedListVector;
 class SparseMatrix;
index 57d884bf5f17a1d00a524c52997dac751f47fe81..e3be6c31c83ceff26c027546f5fc8f2ebf572ce5 100644 (file)
@@ -17,7 +17,6 @@
  *
  */
 
-using namespace std;
 
 #include "alignmentcell.hpp"
 #include "overlap.hpp"
index 63fb4655da35529a694609dbb368094d9585a194..38addc92f41487c3b715c7c7cbb7f03443dda24a 100644 (file)
@@ -18,7 +18,7 @@
 }
 
 /************************************************************/
- GroupMap::~GroupMap(){};
+ GroupMap::~GroupMap(){}
 
 /************************************************************/
 void GroupMap::readMap() {
index 4bb9385cdfdd23960481556afe31e0d485e9a7ec..3aceef1613205f41925e810ac35c979f225168db 100644 (file)
@@ -106,7 +106,7 @@ void HeatMap::getPic(RAbundVector* rabund) {
 void HeatMap::getPic(vector<SharedRAbundVector*> lookup) {
        try {
                //sort lookup so shared bins are on top
-               if (sorted == "T") {  sortSharedVectors(lookup);  }
+               if (isTrue(sorted) == true) {  sortSharedVectors(lookup);  }
                
                vector<vector<string> > scaleRelAbund;
                vector<float> maxRelAbund(lookup.size(), 0.0);          
@@ -301,7 +301,6 @@ void HeatMap::printLegend(int y, float maxbin) {
                        else if(scaler== "log2")        {       label = maxbin * log2(51*i) / log2(255);        }
                        else if(scaler== "linear")      {       label = maxbin * 51 * i / 255;                          }
                        else                                            {       label = maxbin * log10(51*i) / log10(255);      }
-                       file://localhost/Users/westcott/Desktop/c.amazon.fn.0.19.rep.fasta
                        label = int(label * 1000 + 0.5);
                        label /= 1000.0;
                        string text = toString(label, 3);
index 29b6b9af302cf24b079f153eb75f993e0e83be21..7c5b561c84ade9012c49171b4b9f0b0d765b9724 100644 (file)
--- a/heatmap.h
+++ b/heatmap.h
@@ -9,8 +9,6 @@
  *
  */
 
-using namespace std;
-
 #include "rabundvector.hpp"
 #include "sharedrabundvector.h"
 #include "datavector.hpp"
index 731d77eac343fe1fd34504bf7a7f9ddf6607542f..a572e7616f6263a43c48c0ce2d8a7fe87db0d644 100644 (file)
@@ -63,17 +63,17 @@ int HelpCommand::execute(){
                cout << "The cluster command should be in the following format: " << "\n";
                cout << "cluster(method=yourMethod, cutoff=yourCutoff, precision=yourPrecision) " << "\n";
                cout << "The acceptable cluster methods are furthest, nearest and average.  If no method is provided then furthest is assumed." << "\n" << "\n";
-       }else if (globaldata->helpRequest == "deconvolute") {
-               cout << "The deconvolute command reads a fastafile and creates a namesfile." << "\n";
+       }else if (globaldata->helpRequest == "unique.seqs") {
+               cout << "The unique.seqs command reads a fastafile and creates a namesfile." << "\n";
                cout << "It creates a file where the first column is the groupname and the second column is a list of sequence names who have the same sequence. " << "\n";
                cout << "If the sequence is unique the second column will just contain its name. " << "\n";
-               cout << "The deconvolute command parameter is fasta and it is required." << "\n";
-               cout << "The deconvolute command should be in the following format: " << "\n";
-               cout << "deconvolute(fasta=yourFastaFile) " << "\n";
+               cout << "The unique.seqs command parameter is fasta and it is required." << "\n";
+               cout << "The unique.seqs command should be in the following format: " << "\n";
+               cout << "unique.seqs(fasta=yourFastaFile) " << "\n";
        }else if (globaldata->helpRequest == "dist.seqs") {
                cout << "The dist.seqs command reads a file containing sequences and creates a distance file." << "\n";
-               cout << "The dist.seqs command parameters are fasta, phylip, clustal, nexus, calc, countends, cutoff and processors.  " << "\n";
-               cout << "You must use one of the following parameters for your filename: fasta, phylip, clustal or nexus. " << "\n";
+               cout << "The dist.seqs command parameters are fasta, calc, countends, cutoff and processors.  " << "\n";
+               cout << "The fasta parameter is required." << "\n";
                cout << "The calc parameter allows you to specify the method of calculating the distances.  Your options are: nogaps, onegap or eachgap. The default is onegap." << "\n";
                cout << "The countends parameter allows you to specify whether to include terminal gaps in distance.  Your options are: T or F. The default is T." << "\n";
                cout << "The cutoff parameter allows you to specify maximum distance to keep. The default is 1.0." << "\n";
@@ -85,7 +85,7 @@ int HelpCommand::execute(){
        }else if (globaldata->helpRequest == "align.seqs") {
                cout << "The align.seqs command reads a file containing sequences and creates an alignment file and a report file." << "\n";
                cout << "The align.seqs command parameters are fasta, candidate, search, ksize, align, match, mismatch, gapopen and gapextend.  " << "\n";
-               cout << "The template parameter is also required." << "\n";
+               cout << "The fasta and candidate parameters are required." << "\n";
                cout << "The search parameter allows you to specify the method to find most similar template.  Your options are: suffix, kmer and blast. The default is kmer." << "\n";
                cout << "The align parameter allows you to specify the alignment method to use.  Your options are: gotoh, needleman, blast and noalign. The default is needleman." << "\n";
                cout << "The ksize parameter allows you to specify the kmer size for finding most similar template to candidate.  The default is 7." << "\n";
@@ -309,6 +309,18 @@ int HelpCommand::execute(){
                cout << "The bin.seqs command outputs a .fasta file for each distance you specify appending the OTU number to each name." << "\n";
                cout << "If you provide a groupfile, then it also appends the sequences group to the name." << "\n";
                cout << "Note: No spaces between parameter labels (i.e. fasta), '=' and parameters (i.e.yourFastaFile)." << "\n" << "\n";
+       }else if (globaldata->helpRequest == "filter.seqs") { 
+               cout << "The filter.seqs command reads a file containing sequences and creates a .filter and .filter.fasta file." << "\n";
+               cout << "The filter.seqs command parameters are fasta, trump, soft, hard and vertical.  " << "\n";
+               cout << "The fasta parameter is required." << "\n";
+               cout << "The trump parameter .... The default is ...." << "\n";
+               cout << "The soft parameter .... The default is ...." << "\n";
+               cout << "The hard parameter .... The default is ...." << "\n";
+               cout << "The vertical parameter .... The default is ...." << "\n";
+               cout << "The filter.seqs command should be in the following format: " << "\n";
+               cout << "filter.seqs(fasta=yourFastaFile, trump=yourTrump, soft=yourSoft, hard=yourHard, vertical=yourVertical) " << "\n";
+               cout << "Example filter.seqs(fasta=abrecovery.fasta, trump=..., soft=..., hard=..., vertical=...)." << "\n";
+               cout << "Note: No spaces between parameter labels (i.e. fasta), '=' and parameters (i.e.yourFasta)." << "\n" << "\n";
        }else if (globaldata->helpRequest == "get.oturep") { 
                cout << "The get.oturep command can only be executed after a successful read.dist command." << "\n";
                cout << "The get.oturep command parameters are list, fasta, name, group, line and label.  The fasta and list parameters are required, and you may not use line and label at the same time." << "\n";
index f21daec045d67d9bf710ee6dce5e26ab018e1d51..e9deb9d202c1935c222e4f392f85f3f2781d81ca 100644 (file)
@@ -8,8 +8,6 @@
 #include "listvector.hpp"
 
 
-using namespace std;
-
 class InputData {
        
 public:
index dcb6475161ce6f29f89d746fa1581ca7cab380c4..b3bf02247df2c6c047aea8a30293876c2f715cc7 100644 (file)
--- a/kmer.cpp
+++ b/kmer.cpp
@@ -7,9 +7,6 @@
  *
  */
 
-using namespace std;
-
-
 #include "kmer.hpp"
 
 /**************************************************************************************************/
index 9652ac472fe38e14bff9707afdaba95526c35bff..572acdae5d0da9b7d51b7df94cecf8680771dc57 100644 (file)
@@ -22,9 +22,6 @@
 
  */
 
-using namespace std;
-
-
 #include "sequence.hpp"
 #include "kmer.hpp"
 #include "database.hpp"
index 18bfadef5497316b27721a4d740c526cc3eec83a..07c1ba5ceb732c52ce825419c8173f1746e10435 100644 (file)
@@ -14,7 +14,6 @@
 #include "fullmatrix.h"
 #include "libshuff.h"
 
-using namespace std;
 
 class GlobalData;
 
index 205fe607eadaf8c15a9e93e3c10b8ecda62629a7..4b21d5f40fbda188902c85380a8509554e419de8 100644 (file)
@@ -7,8 +7,6 @@
  *
  */
 
-using namespace std;
-
 
 #include "sabundvector.hpp"
 #include "rabundvector.hpp"
@@ -18,11 +16,11 @@ using namespace std;
 
 /***********************************************************************/
 
-ListVector::ListVector() : DataVector(), maxRank(0), numBins(0), numSeqs(0){};
+ListVector::ListVector() : DataVector(), maxRank(0), numBins(0), numSeqs(0){}
 
 /***********************************************************************/
 
-ListVector::ListVector(int n): DataVector(), data(n, "") , maxRank(0), numBins(0), numSeqs(0){};
+ListVector::ListVector(int n): DataVector(), data(n, "") , maxRank(0), numBins(0), numSeqs(0){}
 
 /***********************************************************************/
 
index add60fa22f5c9a95137b651cf694dd6f27132ad7..8d0e507a8f35bc7d9ee8664765194c546d736c1b 100644 (file)
@@ -11,8 +11,6 @@
 #include "engine.hpp"
 #include "globaldata.hpp"
 
-using namespace std;
-
 /**************************************************************************************************/
 
 GlobalData* GlobalData::_uniqueInstance = 0;
index f07f343b05d91148c64ebccc79b7d165bf51c8f7..9c9e23cf5a7a09279af66848fe1b1e3d972d8055 100644 (file)
--- a/mothur.h
+++ b/mothur.h
@@ -40,6 +40,15 @@ using namespace std;
 #include <cmath>
 #include <math.h>
 #include <algorithm>
+#include <ctime>
+
+#ifdef _WIN32
+       #define exp(x) (exp((double) x))
+       #define sqrt(x) (sqrt((double) x))
+       #define log10(x) (log10((double) x))
+       #define log2(x) (log10(x)/log10(2))
+#endif
+
 
 typedef unsigned long long ull;
 
@@ -139,6 +148,13 @@ inline void gobble(istream& f){
        f.putback(d);
        
 }
+/***********************************************************************/
+
+inline bool isTrue(string f){
+       
+       if ((f == "TRUE") || (f == "T") || (f == "true") || (f == "t")) {       return true;    }
+       else {  return false;  }
+}
 
 /***********************************************************************/
 
index cd9ef4e0381a0a8ec384482b26d1966bb3388763..21703e43fa965b4d8a6cc9dedf055c2ea406466e 100644 (file)
@@ -1,4 +1,4 @@
-using namespace std;
+
 
 #include "nameassignment.hpp"
 
index 77b772bfcd130ea0f30d6e3b572fd55a20604239..93299cceac3518abb2b89418af9ce739af3d407a 100644 (file)
@@ -1,8 +1,6 @@
 #ifndef NAMEASSIGNMENT_HPP
 #define NAMEASSIGNMENT_HPP
 
-using namespace std;
-
 #include "mothur.h"
 #include "listvector.hpp"
 
index 0fae6ab41463234fccc84034a3e2e98f75eac539..2d3db22b08c66de9798128292dfe7be149bdc50f 100644 (file)
--- a/nast.cpp
+++ b/nast.cpp
@@ -15,8 +15,6 @@
  *
  */
 
-using namespace std;
-
 #include "sequence.hpp"
 #include "alignment.hpp"
 #include "nast.hpp"
index 799793ece4dda8567d1dcb5a9865a70c9dd45f3e..0f361f1dc1401848e4a39fc15cd3def8a3f37a2d 100644 (file)
@@ -7,8 +7,6 @@
  *
  */
 
-using namespace std;
-
 #include "sequence.hpp"
 #include "nast.hpp"
 #include "alignment.hpp"
index 424b0bbf1d9c3da79739c71efa6676c67b87abf5..be75efdd92714e673e9921215e89875eeafd0f3e 100644 (file)
@@ -13,8 +13,6 @@
 
 #include "mothur.h"
 
-using namespace std;
-
 /******************************************************************************************************************/
 
 class NastReport {
index 8f5d4649013e003e11cec9110586783c488028d5..effe0d310d99958cd5e97a09b494353d902e548c 100644 (file)
@@ -17,8 +17,6 @@
  *
  */
 
-using namespace std;
-
 #include "alignmentcell.hpp"
 #include "alignment.hpp"
 #include "overlap.hpp"
index bd9817a536ee03293cca26ca15bf32d71a35110d..2e520b3cef5cfa4e3d13aaf22dadf671921ba6a6 100644 (file)
@@ -9,7 +9,6 @@
  *  Copyright 2009Schloss Lab UMASS Amherst. All rights reserved.
  *
  */
-using namespace std;
 
 #include "mothur.h"
 
index 616ef0d49817bfa739dc438dcc3464ea4e58c756..457a176b8089e5638d41f98de0797756255fd8a6 100644 (file)
@@ -4,7 +4,6 @@
 
 #include "collectdisplay.h"
 
-using namespace std;
 
 /***********************************************************************/
 
index ccbfa666bac044cd6eeaa639719938d571bad2ea..e3062059acef0678300a8642f7432a34d7410879 100644 (file)
@@ -7,8 +7,6 @@
  *
  */
 
-using namespace std;
-
 #include "ordervector.hpp"
 
 
@@ -18,7 +16,7 @@ OrderVector::OrderVector() : DataVector() {}
 
 /***********************************************************************/
 
-//OrderVector::OrderVector(int ns) : DataVector(), data(ns, -1) {};
+//OrderVector::OrderVector(int ns) : DataVector(), data(ns, -1) {}
 
 /***********************************************************************/
 
index 9645e7a748ce72417f8c8bcbd272ac38dde1aca4..e30b51d243ac776fc36720321e53e6b72702237e 100644 (file)
@@ -12,7 +12,6 @@
  *     issues at the 5' end of the alignment seem to take care of themselves in the traceback.
  *
  */
-using namespace std;
 
 #include "alignmentcell.hpp"
 #include "overlap.hpp"
index 26d392e86acd94654ec3a5ec6351770e4efb995f..603506f666e022a5b314aa73ca1e9817abfa85a4 100644 (file)
@@ -16,7 +16,6 @@
 #include "sharedutilities.h"
 #include "fileoutput.h"
 
-using namespace std;
 
 class GlobalData;
 
index a01ae71fb413031260df2202e3aa56cf6ccbc812..65c01b934ada20c9a3a294ce2351d515d0eafe5f 100644 (file)
@@ -10,8 +10,6 @@
 
 #include "progress.hpp"
 
-using namespace std;
-
 const int totalTicks = 50;
 const char marker = '|';
 
index a2ae7d121729d34292e0b88a86d09a2e628a7cdd..fba393ebb6315c31aceb45fdc049eb39382a63fb 100644 (file)
@@ -3,8 +3,6 @@
 
 #include "mothur.h"
 
-using namespace std;
-
 class Progress {
        
 public:
index 1613f0a16c3c868680a637b405e546abb2031932..471c7e26fa587f5e18dd8a903a31c30c6efc0192 100644 (file)
@@ -6,7 +6,6 @@
  *  Copyright 2008 Patrick D. Schloss. All rights reserved.
  *
  */
-using namespace std;
  
 #include "rabundvector.hpp"
 #include "sabundvector.hpp"
@@ -16,15 +15,15 @@ using namespace std;
 
 /***********************************************************************/
 
-RAbundVector::RAbundVector() : DataVector(), maxRank(0), numBins(0), numSeqs(0) {};
+RAbundVector::RAbundVector() : DataVector(), maxRank(0), numBins(0), numSeqs(0) {}
 
 /***********************************************************************/
 
-RAbundVector::RAbundVector(int n) : DataVector(), data(n,0) , maxRank(0), numBins(0), numSeqs(0) {};
+RAbundVector::RAbundVector(int n) : DataVector(), data(n,0) , maxRank(0), numBins(0), numSeqs(0) {}
 
 /***********************************************************************/
 
-//RAbundVector::RAbundVector(const RAbundVector& rav) : DataVector(rav), data(rav.data), (rav.label),  (rav.maxRank), (rav.numBins), (rav.numSeqs){};
+//RAbundVector::RAbundVector(const RAbundVector& rav) : DataVector(rav), data(rav.data), (rav.label),  (rav.maxRank), (rav.numBins), (rav.numSeqs){}
 
 
 /***********************************************************************/
index 3d50b2612f9c9cc8df9de5b48e5e55e260806fc6..61362c78515b1ebaf3e0b006782960bfb33ebb91 100644 (file)
@@ -66,7 +66,7 @@ void RareDisplay::update(SAbundVector* rank){
                cout << "An unknown error has occurred in the RareDisplay class function update. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
                exit(1);
        }
-};
+}
 
 /***********************************************************************/
 void RareDisplay::update(vector<SharedRAbundVector*> shared, int numSeqs, int numGroupComb) {
@@ -99,7 +99,7 @@ void RareDisplay::update(vector<SharedRAbundVector*> shared, int numSeqs, int nu
                cout << "An unknown error has occurred in the RareDisplay class function update. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
                exit(1);
        }
-};
+}
 
 /***********************************************************************/
 
index b7711d2952861086b0efc27e049159073db4ac31..c9067060820eece4446921011634c1515c44b812 100644 (file)
@@ -6,9 +6,6 @@
 #include "fileoutput.h"
 #include "display.h"
 
-
-using namespace std;
-
 /***********************************************************************/
 
 class RareDisplay : public Display {
index 6eed91214905f3e8f50b89043c45ea8203b2b808..aff5cb63effc7e806a368d3bd08545d2301bd0ba 100644 (file)
@@ -1,8 +1,6 @@
 #ifndef RAREFACT_H
 #define RAREFACT_H
 
-using namespace std;
-
 #include "rarefactioncurvedata.h"
 #include "raredisplay.h"
 #include "ordervector.hpp"
index fad613bc9127161a41db59ae623977c503963655..ecbdbfd5052c568808a1030bc5c004d68dca17e2 100644 (file)
@@ -6,8 +6,6 @@
 #include "display.h"
 #include "observable.h"
 
-using namespace std;
-
 /***********************************************************************/
 
 class RarefactionCurveData : public Observable {
index 547112c0791c6e65de957187ef8bdfe1a06ad3ef..cedcaa74099f7252920a7034d4f7ebc3bd354c16 100644 (file)
@@ -9,7 +9,6 @@
  *  Copyright 2009 Schloss Lab UMASS Amherst. All rights reserved.
  *
  */
-using namespace std;
 
 #include "readseqs.h"
 #include "globaldata.hpp"
index e1f22ce228bbb729ce24a75a10d507f243d2179c..fcac6bd276406119fd35415ba56f491b62958a3c 100644 (file)
 #include <fstream>
 
 /*******************************************************************************/
-ReadFasta::ReadFasta(string file) : ReadSeqs(file) {
-       try {
-       }
-       catch(exception& e) {
-               cout << "Standard Error: " << e.what() << " has occurred in the ReadTree class Function ReadTree. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
-               exit(1);
-       }
-       catch(...) {
-               cout << "An unknown error has occurred in the ReadTree class function ReadTree. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
-               exit(1);
-       }               
-}
+ReadFasta::ReadFasta(string file) : ReadSeqs(file) {}
 /*******************************************************************************/
 ReadFasta::~ReadFasta(){
        //for(int i = 0; i < sequencedb.getNumSeqs(); i++)
@@ -31,7 +20,8 @@ ReadFasta::~ReadFasta(){
 }
 /*******************************************************************************/
 void ReadFasta::read() {
-       string name = "";
+       try {
+       /*string name = "";
        string sequence = "";
        string temp;
        int count = 0;
@@ -61,12 +51,104 @@ void ReadFasta::read() {
                        
        }
        Sequence newSequence(name, sequence);
-       sequencedb.add(newSequence);
+       sequencedb.add(newSequence); */
+
+               string name, sequence, line;
+               sequence = "";
+               int c;
+               string temp;
+               
+               
+               //read through file
+               while ((c = filehandle.get()) != EOF) {
+                       name = ""; sequence = ""; 
+                       //is this a name
+                       if (c == '>') { 
+                               name = readName(filehandle); 
+                               sequence = readSequence(filehandle); 
+                       }else {  cout << "Error fasta in your file. Please correct." << endl; }
 
-       filehandle.close();
+                       //input sequence info into sequencedb
+                       Sequence newSequence(name, sequence);
+                       sequencedb.add(newSequence);
+                       
+                       //takes care of white space
+                       gobble(filehandle);
+               }
+
+               filehandle.close();
+       }
+       catch(exception& e) {
+               cout << "Standard Error: " << e.what() << " has occurred in the ReadFasta class Function read. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+               exit(1);
+       }
+       catch(...) {
+               cout << "An unknown error has occurred in the ReadFasta class function read. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+               exit(1);
+       }
 }
 
 /*********************************************************************************/
 SequenceDB* ReadFasta::getDB() {
        return &sequencedb;
 }
+/*******************************************************************************/
+string ReadFasta::readName(ifstream& in) {
+       try{
+               string name = "";
+               int c;
+               string temp;
+               
+               while ((c = in.get()) != EOF) {
+                       //if c is not a line return
+                       if (c != 10) {
+                               name += c;
+                       }else { break;  }
+               }
+                       
+               return name;
+       }
+       catch(exception& e) {
+               cout << "Standard Error: " << e.what() << " has occurred in the ReadFasta class Function readName. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+               exit(1);
+       }
+       catch(...) {
+               cout << "An unknown error has occurred in the ReadFasta class function readName. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+               exit(1);
+       }
+}
+
+/*******************************************************************************/
+string ReadFasta::readSequence(ifstream& in) {
+       try{
+               string sequence = "";
+               string line;
+               int pos, c;
+               
+               while (!in.eof()) {
+                       //save position in file in case next line is a new name.
+                       pos = in.tellg();
+                       line = "";
+                       in >> line;                     
+                       //if you are at a new name
+                       if (line[0] == '>') {
+                               //put file pointer back since you are now at a new name
+                               in.seekg(pos, ios::beg);
+                               c = in.get();  //because you put it back to a newline char
+                               break;
+                       }else {  sequence += line;      }
+               }
+                       
+               return sequence;
+       }
+       catch(exception& e) {
+               cout << "Standard Error: " << e.what() << " has occurred in the ReadFasta class Function readSequence. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+               exit(1);
+       }
+       catch(...) {
+               cout << "An unknown error has occurred in the ReadFasta class function readSequence. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+               exit(1);
+       }
+}
+/*******************************************************************************/
+
index 11cdab0d3a321720e31a110c8a9d9ab206efa0b3..a8e398b0df1d5e8a424d5aabc008862bea147d26 100644 (file)
@@ -10,8 +10,6 @@
  *
  */
 
-using namespace std;
-
 #include "readseqs.h"
 #include "globaldata.hpp"
 #include "sequencedb.h"
@@ -25,7 +23,11 @@ class ReadFasta : public ReadSeqs {
                ReadFasta(string);
                ~ReadFasta();
                void read();
-               SequenceDB* getDB();            
+               SequenceDB* getDB();
+       private:
+               string readName(ifstream&);
+               string readSequence(ifstream&);
+
 };
 
 #endif
\ No newline at end of file
index 374b82004691af279ebcd3293110afd982fef534..7a0efbae820c1e7aa03f30d03694ac4a09f61a39 100644 (file)
@@ -9,7 +9,6 @@
  *  Copyright 2009 Schloss Lab UMASS Amherst. All rights reserved.
  *
  */
-using namespace std;
 
 #include "readseqs.h"
 #include "globaldata.hpp"
index 4d0e4005d48ed65b6a73bd28f3ab12c6a4f58268..ea216ec797b5f4e67a91f83ccb42b0b4073aa31c 100644 (file)
  *
  */
 
-using namespace std;
-
 #include "globaldata.hpp"
 #include "sequencedb.h"
-#include "utilities.hpp"
+//#include "utilities.hpp"
 
 /**********************************************************************************/
 
index a1e7a507a38bb51de629cfa5f2b8ae7208579d88..5e0826fda1d24a8d1b4a76f2fd2c537afe9adba9 100644 (file)
@@ -8,9 +8,6 @@
  */
 
 #include "readseqs.h"
-#include <iostream>
-#include <fstream>
-
 
 /*******************************************************************************/
 ReadSeqs::ReadSeqs(string file) {
@@ -20,11 +17,11 @@ ReadSeqs::ReadSeqs(string file) {
                globaldata = GlobalData::getInstance();
        }
        catch(exception& e) {
-               cout << "Standard Error: " << e.what() << " has occurred in the ReadTree class Function ReadTree. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+               cout << "Standard Error: " << e.what() << " has occurred in the ReadSeqs class Function ReadSeqs. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
                exit(1);
        }
        catch(...) {
-               cout << "An unknown error has occurred in the ReadTree class function ReadTree. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+               cout << "An unknown error has occurred in the ReadSeqs class function ReadSeqs. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
                exit(1);
        }               
 }
index bba8017b80a22a69c267279ee7c07937d45feafd..1aefcc63375c1202b425fff1143c54bf105109bf 100644 (file)
@@ -10,8 +10,6 @@
  *
  */
 
-using namespace std;
-
 #include "globaldata.hpp"
 #include "sequencedb.h"
 #include "mothur.h"
index fbb99c9b0d44daddf431e1fc11be168bdcc69393..72c7d9058585a3d6ee54ad3b30255d5fd28f7d99 100644 (file)
@@ -31,18 +31,7 @@ bool ReadPhylip::isSeq(string seq) {
 }
 
 /*******************************************************************************/
-ReadPhylip::ReadPhylip(string file) : ReadSeqs(file) {
-       try {
-       }
-       catch(exception& e) {
-               cout << "Standard Error: " << e.what() << " has occurred in the ReadTree class Function ReadTree. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
-               exit(1);
-       }
-       catch(...) {
-               cout << "An unknown error has occurred in the ReadTree class function ReadTree. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
-               exit(1);
-       }               
-}
+ReadPhylip::ReadPhylip(string file) : ReadSeqs(file) { }
 /*******************************************************************************/
 ReadPhylip::~ReadPhylip(){
 //     for(int i = 0; i < sequencedb.getNumSeqs(); i++)
index be4168d7d7a14fb98254ca9d70826d860bebd08e..ae2693b6f588600432364914ae695fbd9095b38f 100644 (file)
@@ -9,7 +9,6 @@
  *  Copyright 2009 Schloss Lab UMASS Amherst. All rights reserved.
  *
  */
-using namespace std;
 
 #include "readseqs.h"
 #include "globaldata.hpp"
index 3df0e0a5f1312aaf3be2ee1f0c35bc5c93afb695..c8e866aa476695c45cbfded4652fa1d4aef24dbe 100644 (file)
@@ -9,8 +9,6 @@
  *
  */
 
-using namespace std;
-
 #include "mothur.h"
 #include "globaldata.hpp"
 #include "tree.h"
index 04476c7aba114f599826de57cce67e852c5f8df5..c1997d5d91bc3cbd8fffb240909aa3dae791f646 100644 (file)
@@ -6,18 +6,17 @@
  *  Copyright 2008 Patrick D. Schloss. All rights resesaved.
  *
  */
-using namespace std;
 
 #include "sabundvector.hpp"
 #include "calculator.h"
 
 /***********************************************************************/
 
-SAbundVector::SAbundVector() : DataVector(), maxRank(0), numBins(0), numSeqs(0){};
+SAbundVector::SAbundVector() : DataVector(), maxRank(0), numBins(0), numSeqs(0){}
 
 /***********************************************************************/
 
-SAbundVector::SAbundVector(int size) : DataVector(), data(size, 0), maxRank(0), numBins(0), numSeqs(0) {};
+SAbundVector::SAbundVector(int size) : DataVector(), data(size, 0), maxRank(0), numBins(0), numSeqs(0) {}
 
 /***********************************************************************/
 
index bd657aa20d41f3f1ae3d9f757ebd87c04de36270..769a35dd3a14c85a160ac81532b4d7aa3cd1914a 100644 (file)
@@ -1,8 +1,6 @@
 #ifndef SABUND_H
 #define SABUND_H
 
-using namespace std;
-
 #include "datavector.hpp"
 #include "rabundvector.hpp"
 #include "ordervector.hpp"
index 56c9d82f1625a2a9481a203b7b217a9bc3b66bc4..425b473d4e1e7204ff460a00220bacc023dd0333 100644 (file)
@@ -17,7 +17,6 @@
 #include "readclustal.h"
 #include "readseqsphylip.h"
 
-using namespace std;
 
 class ScreenSeqsCommand : public Command {
        
index 9b2be27ef8337e694484927e33298d8ec9841359..2334628d08b87e00a4823ebcbe4859cf872358b2 100644 (file)
@@ -18,7 +18,6 @@
 #include "readclustal.h"
 #include "readseqsphylip.h"
 
-using namespace std;
 
 class SeqSummaryCommand : public Command {
 public:
index 98aa7b01862c494018c710ec607f5132d8ce2db1..e997cc2872cba1e4deeeffc3d3c1c32009568fcf 100644 (file)
@@ -7,8 +7,6 @@
  *
  */
 
-using namespace std;
-
 #include "sequence.hpp"
 
 /***********************************************************************/
index 904e25aeb7a5b4d3476df576217d12820f95f358..ac9384bf156bf471cc35b3fe8d57f6ecf777e857 100644 (file)
@@ -13,7 +13,6 @@
  *     to set and get these values for the other classes where they are needed.  *
  *
  */
-using namespace std;
 
 #include "mothur.h"
 
index eb89454e0235117131194e61924a91f6487c4188..9ee88065be8976c7a38ed64fe44bc440db077799 100644 (file)
  */
 
 
-using namespace std;
+/* This class is a container to store the sequences. */
+
 
 #include "sequence.hpp"
 #include "calculator.h"
 
 
-
-
 class SequenceDB {
        
 public:
index a3f55d5215d5f4b722f069bf53c2501e419eaec4..06d558d2deebf3af2cda8fb7f2193a39b932d2f2 100644 (file)
--- a/shared.h
+++ b/shared.h
@@ -9,8 +9,6 @@
  *  Copyright 2008 Schloss Lab UMASS Amherst. All rights reserved.
  *
  */
-using namespace std;
 
 #include "mothur.h"
 #include "sharedrabundvector.h"
index 6db2d112d8050dfb436e5fda155c7f2c7741d8cd..c1e5ff4ec4c56a1f5eddad239a9b21f6e0deb72c 100644 (file)
@@ -12,7 +12,7 @@
 /***************************************************************************************
 
 ***************************************************************************************/
-double SharedJackknife::simpson(int abunds[], double numInd, int numBins){
+double SharedJackknife::simpson(vector<int> abunds, double numInd, int numBins){
        double denom = numInd*(numInd-1);
        double sum = 0;
        for(int i = 0; i < numBins; i++)
@@ -25,7 +25,7 @@ double SharedJackknife::simpson(int abunds[], double numInd, int numBins){
 
 double* SharedJackknife::jackknife(){          
        int numBins = groups.at(0)->getNumBins()-1;
-       int cArray[numBins];
+       vector<int> cArray(numBins);
        for(int i = 0; i < numBins; i++)
                cArray[i] = 0;
 
@@ -39,7 +39,7 @@ double* SharedJackknife::jackknife(){
 
        double baseD = 1/simpson(cArray, numInd, numBins);
        
-       double pseudoVals[numBins];
+       vector<double> pseudoVals(numBins);
        double jackknifeEstimate = 0;
        for(int i = 0; i < numGroups; i++) {
                for(int j = 0; j < numBins-1; j++) {
index bdec8f713f777f6df061038fae677676a609eb1a..a2488932e6c1fb2ae68b304df44b5feb994220a9 100644 (file)
@@ -30,7 +30,7 @@ private:
        int numGroups, callCount, count;
        bool currentCallDone;
        vector<SharedRAbundVector*> groups;
-       double simpson(int[], double, int);
+       double simpson(vector<int>, double, int);
        double* jackknife();
 };
 
index 2dc4502cd4523a3b679abcc3d3e3156ea60b0ab9..33d3692659fefde48883e83dd0c7dcaf3fbdb67e 100644 (file)
@@ -7,10 +7,6 @@
  *
  */
 
-
-using namespace std;
-
-
 #include "sabundvector.hpp"
 #include "rabundvector.hpp"
 #include "ordervector.hpp"
@@ -20,11 +16,11 @@ using namespace std;
 
 /***********************************************************************/
 
-SharedListVector::SharedListVector() : DataVector(), maxRank(0), numBins(0), numSeqs(0){};
+SharedListVector::SharedListVector() : DataVector(), maxRank(0), numBins(0), numSeqs(0){}
 
 /***********************************************************************/
 
-SharedListVector::SharedListVector(int n):     DataVector(), data(n, "") , maxRank(0), numBins(0), numSeqs(0){};
+SharedListVector::SharedListVector(int n):     DataVector(), data(n, "") , maxRank(0), numBins(0), numSeqs(0){}
 
 /***********************************************************************/
 SharedListVector::SharedListVector(ifstream& f) : DataVector(), maxRank(0), numBins(0), numSeqs(0) {
index 08692de4ca3fec388ff31407aeee1c0a4d04dd61..d0c97f9ab5a16655a381ffb3390dbb4cf94d420a 100644 (file)
@@ -7,9 +7,6 @@
  *
  */
 
-using namespace std;
-
-
 #include "sharedordervector.h"
 #include "sharedutilities.h"
 
index 30d655f7347c07fcb9a887ac5330959702e09382..d0a714cf98c8d0406fc5ebba751d4fe63d40ac31 100644 (file)
@@ -15,8 +15,6 @@
        the group it is in and the abundance is equal to the OTU number.  */
 
 
-using namespace std;
-
 #include "datavector.hpp"
 
 struct individual {
index ca24b91fdc9ffde552be61dbcd09730e32ec9aa5..94a65191eabe4a286481c3829f31a1ba0ed02c00 100644 (file)
@@ -7,9 +7,6 @@
  *
  */
 
-
-using namespace std;
-
 #include "sharedrabundvector.h" 
 #include "sabundvector.hpp"
 #include "ordervector.hpp"
@@ -18,7 +15,7 @@ using namespace std;
 
 /***********************************************************************/
 
-SharedRAbundVector::SharedRAbundVector() : DataVector(), maxRank(0), numBins(0), numSeqs(0) {};
+SharedRAbundVector::SharedRAbundVector() : DataVector(), maxRank(0), numBins(0), numSeqs(0) {}
 
 /***********************************************************************/
 
@@ -30,7 +27,7 @@ SharedRAbundVector::SharedRAbundVector(int n) : DataVector(), maxRank(0), numBin
                        newGuy.abundance = 0;
                        data.push_back(newGuy);
                }
-};
+}
 
 /***********************************************************************
 
index 0e86977e498a49255f037d2080ef5226a1c3bd6b..51058cf585fb511655a97d9b1a15d108dab99df5 100644 (file)
 #include "sharedsabundvector.h"
 #include "sabundvector.hpp"
 
-using namespace std;
-
 
 /***********************************************************************/
 
-SharedSAbundVector::SharedSAbundVector() : DataVector(), maxRank(0), numBins(0), numSeqs(0){};
+SharedSAbundVector::SharedSAbundVector() : DataVector(), maxRank(0), numBins(0), numSeqs(0){}
 
 /***********************************************************************/
 
@@ -27,7 +25,7 @@ SharedSAbundVector::SharedSAbundVector(int size) :    DataVector(), maxRank(0), num
                        newGuy.abundance = 0;
                        data.push_back(newGuy);
                }
-};
+}
 
 /***********************************************************************/
 
index 64b89835157090b3274303694fe59e7f079b34e4..29b374523bf975653ff3b8943f2d967685a4644b 100644 (file)
@@ -23,7 +23,6 @@
        An individual which knows the OTU from which it came, 
        the group it is in and its abundance.  */
 
-using namespace std;
 
 class SharedSAbundVector : public DataVector {
        
index 6f14147191a584aeca578592e8810c3e459652f6..e227a9d2207c0f280c9840965a22789b7fe413cf 100644 (file)
--- a/solow.cpp
+++ b/solow.cpp
@@ -33,7 +33,7 @@ EstOutput Solow::getValues(SAbundVector* rank){
                cout << "An unknown error has occurred in the Coverage class function getValues. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
                exit(1);
        }       
-};
+}
 
 
 /***********************************************************************/
index fc10d27e4193dfcce4ecde200416157876c9ad14..c4120f49d679ffc497ba72e7e0da8fc0fc22c00a 100644 (file)
@@ -2,13 +2,11 @@
 #include "sparsematrix.hpp"
 #include "listvector.hpp"
 
-using namespace std;
-
 typedef list<PCell>::iterator MatData;
 
 /***********************************************************************/
 
-SparseMatrix::SparseMatrix() : numNodes(0), minsIndex(0), smallDist(1e6){};
+SparseMatrix::SparseMatrix() : numNodes(0), minsIndex(0), smallDist(1e6){}
 
 /***********************************************************************/
 
index b4639f93fb3f025926cf1daef66a9187d6ab8fce..15f7753b65291f897103e5e7b75fe79a2d139b99 100644 (file)
@@ -15,8 +15,6 @@
  *
  */
 
-using namespace std;
-
 #include "database.hpp"
 #include "sequence.hpp"
 #include "suffixtree.hpp"
index 3d0b01d187fe938451056e0ff10621c5a4c941b4..15114cf9a103707b67486864fd0d8b40f96e95c7 100644 (file)
@@ -9,7 +9,7 @@
  *  Copyright 2008 Patrick D. Schloss. All rights reserved.
  *
  *     This is a child class of the Database abstract datatype.  The class is basically a database of suffix trees and an
- *     encapsulation of the method for finding the most similar tree to an inputted sequence.  the suffixForest objecct
+ *     encapsulation of the method for finding the most similar tree to an inputted sequence.  the suffixForest object
  *     is a vector of SuffixTrees, with each template sequence being represented by a different SuffixTree.  The class also
  *     provides a method to take an unaligned sequence and find the closest sequence in the suffixForest.  The search
  *     method is inspired by the article and Perl source code provided at http://www.ddj.com/web-development/184416093.  I 
index 79826ff47d045c5fba48f77b70efbef37bc9c17d..81346953d6de431b00b57dad5b8c3681a15e153e 100644 (file)
@@ -15,7 +15,6 @@
 
 #include "suffixnodes.hpp"
 
-using namespace std;
 
 //********************************************************************************************************************
 
index 863a3ae523787530c454aeda1ef6b4632fe9a34f..82d4be9f40ead561f2e50b84bbd43fbf7d8f7e9e 100644 (file)
@@ -18,8 +18,6 @@
 
 #include "mothur.h"
 
-using namespace std;
-
 //********************************************************************************************************************
 
 class SuffixNode {
index 56ce6ed91829c5d2783e4c42f9c4f7b388340bca..492460d4dd68f4f025504b58acbc80fad09b09b7 100644 (file)
@@ -26,7 +26,6 @@
 #include "suffixnodes.hpp"
 #include "suffixtree.hpp"
 
-using namespace std;
 
 //********************************************************************************************************************
 
index 387d4bdca798f423d4d86a123c5a552321412048..28b6fd10772f12c5c712705fb22b414a79b4cb32 100644 (file)
@@ -27,8 +27,6 @@
 
 #include "mothur.h"
 
-using namespace std;
-
 class SuffixNode;
 
 //********************************************************************************************************************
index 9afe0e405fe994de95008249bf6dc4ae7fbe7f1e..4620337d93b50a38303169b56e17ebf59dfe36b4 100644 (file)
@@ -6,8 +6,6 @@
 #include "display.h"
 #include "observable.h"
 
-using namespace std;
-
 /***********************************************************************/
 
 class SummaryData : public Observable {
diff --git a/tree.h b/tree.h
index 7fc383806c946d8f22efab62c648f19095313feb..4f77e50578bad8c234ae4711adf69a612175b088 100644 (file)
--- a/tree.h
+++ b/tree.h
@@ -10,8 +10,6 @@
  *
  */
 
-using namespace std;
-
 #include "treenode.h"
 #include "globaldata.hpp"
 
index cfd648e09386e81cb1dffacdd605f274700d765e..16663bf161afbb61c92722c27facdd8885a0dad5 100644 (file)
@@ -10,8 +10,6 @@
  *
  */
 
-using namespace std;
-
 #include "mothur.h"
 #include "tree.h"
 
index 8e3fd58b94cbf6e9c16e9b0335fb71cbf5cd68bb..ad8a2af17ac2b8fe954c3bff402f6d1bb20381db 100644 (file)
@@ -17,7 +17,7 @@
 }
 
 /************************************************************/
- TreeMap::~TreeMap(){};
+ TreeMap::~TreeMap(){}
 
 /************************************************************/
 void TreeMap::readMap() {
index df30cd3a32d5ebc47a54cadf8ea0a6b47c9122f0..d6163a2b1275f9816a576659019d178005042e6d 100644 (file)
@@ -10,8 +10,6 @@
  *
  */
 
-using namespace std;
-
 #include "mothur.h"
 
 /* This class represents a node on a tree. */
index e900af4f8b0cc434bf16fae2f15535779032f901..0a925385e3d6ef3f8621029038ebaafb1bfbec49 100644 (file)
@@ -17,8 +17,6 @@
 #include "fileoutput.h"
 
 
-using namespace std;
-
 class GlobalData;
 
 class UnifracUnweightedCommand : public Command {
index 5cd93a94c0dcf96547ee409d4ca641092309d2bc..491d3846f65ae135d458c947b3f4a7539a5acde8 100644 (file)
@@ -17,7 +17,6 @@
 #include "sharedutilities.h"
 #include "fileoutput.h"
 
-using namespace std;
 
 class GlobalData;
 
diff --git a/uvest.h b/uvest.h
index 4f86fedf4bad250b62f7b8a237143a049986482a..86b96fd43095017afaf2db453ff8523191652708 100644 (file)
--- a/uvest.h
+++ b/uvest.h
@@ -12,8 +12,6 @@
 /* This class implements the UVEst estimator on two groups. 
 It is used by sharedJAbund and SharedSorensonAbund. */
  
-using namespace std;
 
 #include "mothur.h"
 #include "sharedrabundvector.h"
index 15ff3116de0abb2049951a7d8d6c0e3c7f38de56..ff93c58ccc980684ae52f48b08cac9d380cf7a88 100644 (file)
@@ -9,7 +9,6 @@
  *  Copyright 2009 Schloss Lab UMASS Amherst. All rights reserved.
  *
  */
-using namespace std;
 
 #include "mothur.h"
 
index a4b17838a1422324dd6cca1420d53991b023a5bb..ec60b3b974ad832be1b71092bf3cfbdf9bf28e71 100644 (file)
@@ -20,7 +20,7 @@ ValidCommands::ValidCommands() {
                commands["bin.seqs"]                    = "bin.seqs"; 
                commands["get.oturep"]                  = "get.oturep";
                commands["cluster"]                             = "cluster"; 
-               commands["deconvolute"]                 = "deconvolute"; 
+               commands["unique.seqs"]                 = "unique.seqs"; 
                commands["dist.seqs"]                   = "dist.seqs";
                commands["dist.shared"]                 = "dist.shared";
                commands["collect.single"]              = "collect.single"; 
index e59316fca472b419734c0c1e65036b3d2b684b66..091281e9659afd113d9f8340d4bb1ae3dbd3e73d 100644 (file)
@@ -9,7 +9,6 @@
  *  Copyright 2009 Schloss Lab UMASS Amherst. All rights reserved.
  *
  */
-using namespace std;
 
 #include "mothur.h"
 
index cd3b05474e18fe4eb49c3173408f5b9f0b2daba7..5e401c1ecaa6fea67343d3ad57f3f9ec201eb5e9 100644 (file)
@@ -223,7 +223,7 @@ void ValidParameters::initCommandParameters() {
                commandParameters["cluster"] = addParameters(clusterArray, sizeof(clusterArray)/sizeof(string));
                
                string deconvoluteArray[] =  {"fasta"};
-               commandParameters["deconvolute"] = addParameters(deconvoluteArray, sizeof(deconvoluteArray)/sizeof(string));
+               commandParameters["unique.seqs"] = addParameters(deconvoluteArray, sizeof(deconvoluteArray)/sizeof(string));
                
                string collectsingleArray[] =  {"freq","line","label","calc","abund","size"};
                commandParameters["collect.single"] = addParameters(collectsingleArray, sizeof(collectsingleArray)/sizeof(string));
@@ -273,7 +273,7 @@ void ValidParameters::initCommandParameters() {
                string heatmapArray[] =  {"groups","line","label","sorted","scale"};
                commandParameters["heatmap"] = addParameters(heatmapArray, sizeof(heatmapArray)/sizeof(string));
                
-               string filterseqsArray[] =  {"fasta","phylip","clustal","nexus", "trump", "soft", "hard", "vertical"};
+               string filterseqsArray[] =  {"fasta", "trump", "soft", "hard", "vertical"};
                commandParameters["filter.seqs"] = addParameters(filterseqsArray, sizeof(filterseqsArray)/sizeof(string));
 
                string summaryseqsArray[] =  {"fasta","phylip","clustal","nexus"};
@@ -303,7 +303,7 @@ void ValidParameters::initCommandParameters() {
                string concensusArray[] =  {};
                commandParameters["concensus"] = addParameters(concensusArray, sizeof(concensusArray)/sizeof(string));
                
-               string distanceArray[] =  {"fasta","phylip","clustal","nexus", "calc", "countends", "cutoff", "processors"};
+               string distanceArray[] =  {"fasta", "calc", "countends", "cutoff", "processors"};
                commandParameters["dist.seqs"] = addParameters(distanceArray, sizeof(distanceArray)/sizeof(string));
                
                string AlignArray[] =  {"fasta", "candidate", "search", "ksize", "align", "match", "mismatch", "gapopen", "gapextend"};
index 30ba46105cc4fc0585283493878f2bab8931bffd..ff886efa6294f20e3ab53666a448afbe4db8ff07 100644 (file)
@@ -9,7 +9,6 @@
  *  Copyright 2009 Schloss Lab UMASS Amherst. All rights reserved.
  *
  */
-using namespace std;
 
 #include "mothur.h"
 
@@ -30,23 +29,6 @@ class ValidParameters {
                void initParameterRanges();
 
        private:
-               map<string, string> readdist;
-               map<string, string> readotu;
-               map<string, string> readtree;
-               map<string, string> cluster;
-               map<string, string> deconvolute;
-               map<string, string> parsimony;
-               map<string, string> collectsingle;
-               map<string, string> collectshared;
-               map<string, string> rarefactsingle;
-               map<string, string> rarefactshared;
-               map<string, string> summarysingle;
-               map<string, string> summaryshared;
-               map<string, string> unifracweighted;
-               map<string, string> unifracunweighted;
-               map<string, string> libshuff;
-               map<string, string> heatmap;
-               
                map<string, string>::iterator it;
                map<string, vector<string> > commandParameters;
                map<string, vector<string> > parameterRanges;
diff --git a/venn.h b/venn.h
index 35c1d1cbbe6d71663fa345bc97856c6194a6fda5..8a789c364ac9e6e25bb0bc0312994e4c0e319d34 100644 (file)
--- a/venn.h
+++ b/venn.h
@@ -9,8 +9,6 @@
  *
  */
 
-using namespace std;
-
 #include "sabundvector.hpp"
 #include "sharedrabundvector.h"
 #include "datavector.hpp"