X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=secondarystructurecommand.cpp;h=24142e0cf4aa6174a8006f1e0a7a85c82f10ab24;hb=e339f9008daa7d37c9a9034829565620a6abe783;hp=fec93e6e9f5f94414a392a1220b86153999b1f9d;hpb=ca9ac1d80c62f57270b0dcd49410ebe08a8aecd6;p=mothur.git diff --git a/secondarystructurecommand.cpp b/secondarystructurecommand.cpp index fec93e6..24142e0 100644 --- a/secondarystructurecommand.cpp +++ b/secondarystructurecommand.cpp @@ -36,7 +36,7 @@ string AlignCheckCommand::getHelpString(){ helpString += "The align.check command parameters are fasta and map, both are required.\n"; helpString += "The align.check command should be in the following format: align.check(fasta=yourFasta, map=yourMap).\n"; helpString += "Example align.check(map=silva.ss.map, fasta=amazon.fasta).\n"; - helpString += "Note: No spaces between parameter labels (i.e. fasta), '=' and parameters (i.e.yourFasta).\n\n"; + helpString += "Note: No spaces between parameter labels (i.e. fasta), '=' and parameters (i.e.yourFasta).\n"; return helpString; } catch(exception& e) { @@ -66,6 +66,7 @@ AlignCheckCommand::AlignCheckCommand(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 myArray = setParameters(); @@ -121,23 +122,28 @@ 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(); } else { m->mothurOut("You have no current fastafile and the fasta parameter is required."); m->mothurOutEndLine(); abort = true; } - } + }else { m->setFastaFile(fastafile); } namefile = validParameter.validFile(parameters, "name", true); if (namefile == "not open") { namefile = ""; abort = true; } else if (namefile == "not found") { namefile = ""; } + else { m->setNameFile(namefile); } //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"){ outputDir = ""; outputDir += m->hasPath(fastafile); //if user entered a file with a path then preserve it } - + + if ((namefile == "") && (fastafile != "")){ + vector files; files.push_back(fastafile); + parser.getNameFile(files); + } } } @@ -181,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() != "") { @@ -218,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()); @@ -236,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();