]> git.donarmstrong.com Git - mothur.git/blobdiff - secondarystructurecommand.cpp
added code to check path for uchime and catchall executables
[mothur.git] / secondarystructurecommand.cpp
index cc53ee0f02741cbe0fc6358a3a08cd56e891cd09..24142e0cf4aa6174a8006f1e0a7a85c82f10ab24 100644 (file)
@@ -122,7 +122,7 @@ AlignCheckCommand::AlignCheckCommand(string option)  {
                        else if (mapfile == "not found") {  mapfile = "";  m->mothurOut("You must provide an map file."); m->mothurOutEndLine(); abort = true; }        
                        
                        fastafile = validParameter.validFile(parameters, "fasta", true);
-                       if (fastafile == "not open") { abort = true; }
+                       if (fastafile == "not open") { fastafile = ""; abort = true; }
                        else if (fastafile == "not found") {                            
                                fastafile = m->getFastaFile(); 
                                if (fastafile != "") { m->mothurOut("Using " + fastafile + " as input file for the fasta parameter."); m->mothurOutEndLine(); }
@@ -139,7 +139,11 @@ AlignCheckCommand::AlignCheckCommand(string option)  {
                                outputDir = ""; 
                                outputDir += m->hasPath(fastafile); //if user entered a file with a path then preserve it       
                        }
-
+                       
+                       if ((namefile == "") && (fastafile != "")){
+                               vector<string> files; files.push_back(fastafile); 
+                               parser.getNameFile(files);
+                       }
                }
 
        }
@@ -183,7 +187,7 @@ int AlignCheckCommand::execute(){
                
                int count = 0;
                while(!in.eof()){
-                       if (m->control_pressed) { in.close(); out.close(); remove(outfile.c_str()); return 0; }
+                       if (m->control_pressed) { in.close(); out.close(); m->mothurRemove(outfile); return 0; }
                        
                        Sequence seq(in);  m->gobble(in);
                        if (seq.getName() != "") {
@@ -220,7 +224,7 @@ int AlignCheckCommand::execute(){
                in.close();
                out.close();
                
-               if (m->control_pressed) {  remove(outfile.c_str()); return 0; }
+               if (m->control_pressed) {  m->mothurRemove(outfile); return 0; }
                
                sort(pound.begin(), pound.end());
                sort(dash.begin(), dash.end());
@@ -238,7 +242,7 @@ int AlignCheckCommand::execute(){
                int ptile97_5   = int(size * 0.975);
                int ptile100    = size - 1;
                
-               if (m->control_pressed) {  remove(outfile.c_str()); return 0; }
+               if (m->control_pressed) {  m->mothurRemove(outfile); return 0; }
                
                m->mothurOutEndLine();
                m->mothurOut("\t\tPound\tDash\tPlus\tEqual\tLoop\tTilde\tTotal"); m->mothurOutEndLine();