]> git.donarmstrong.com Git - mothur.git/blobdiff - distancecommand.cpp
working on current change
[mothur.git] / distancecommand.cpp
index 1be3552ee3d5f637f2cf17edda02695375400809..4bdeaaeb5d9b388ac56fc2553f57dc10c0d598d9 100644 (file)
@@ -85,6 +85,7 @@ DistanceCommand::DistanceCommand(string option) {
                                
                //allow user to run help
                if(option == "help") { help(); abort = true; calledHelp = true; }
+               else if(option == "citation") { citation(); abort = true; calledHelp = true;}
                
                else {
                        vector<string> myArray = setParameters();
@@ -151,6 +152,7 @@ DistanceCommand::DistanceCommand(string option) {
                                m->openInputFile(fastafile, inFASTA);
                                alignDB = SequenceDB(inFASTA); 
                                inFASTA.close();
+                               m->setFastaFile(fastafile);
                        }
                        
                        oldfastafile = validParameter.validFile(parameters, "oldfasta", true);
@@ -160,6 +162,7 @@ DistanceCommand::DistanceCommand(string option) {
                        column = validParameter.validFile(parameters, "column", true);
                        if (column == "not found") { column = ""; }
                        else if (column == "not open") { abort = true; }        
+                       else { m->setColumnFile(column); }
                        
                        //if the user changes the output directory command factory will send this info to us in the output parameter 
                        outputDir = validParameter.validFile(parameters, "outputdir", false);           if (outputDir == "not found"){  
@@ -246,6 +249,8 @@ int DistanceCommand::execute(){
                int numSeqs = alignDB.getNumSeqs();
                cutoff += 0.005;
                
+               if (!alignDB.sameLength()) {  m->mothurOut("[ERROR]: your sequences are not the same length, aborting."); m->mothurOutEndLine(); return 0; }
+               
                string outputFile;
                                
                if (output == "lt") { //does the user want lower triangle phylip formatted file