X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=matrixoutputcommand.cpp;h=d1cf54ba03216996b3335e030e6db7d80efd7222;hb=793f4d2406a7f6b56d174c13959244234ab30628;hp=adb145aecfd388a9eee5941e30d7bc31a8404358;hpb=f06fdb807822f8e06db003ed809c87250905cfc8;p=mothur.git diff --git a/matrixoutputcommand.cpp b/matrixoutputcommand.cpp index adb145a..d1cf54b 100644 --- a/matrixoutputcommand.cpp +++ b/matrixoutputcommand.cpp @@ -157,6 +157,7 @@ MatrixOutputCommand::MatrixOutputCommand(string option) { if (sharedfile != "") { m->mothurOut("Using " + sharedfile + " as input file for the shared parameter."); m->mothurOutEndLine(); } else { m->mothurOut("You have no current sharedfile and the shared parameter is required."); m->mothurOutEndLine(); abort = true; } }else if (sharedfile == "not open") { sharedfile = ""; abort = true; } + else { m->setSharedFile(sharedfile); } //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"){ @@ -180,12 +181,12 @@ MatrixOutputCommand::MatrixOutputCommand(string option) { if (groups == "not found") { groups = ""; } else { m->splitAtDash(groups, Groups); - m->Groups = Groups; + m->setGroups(Groups); } string temp = validParameter.validFile(parameters, "processors", false); if (temp == "not found"){ temp = m->getProcessors(); } m->setProcessors(temp); - convert(temp, processors); + m->mothurConvert(temp, processors); calc = validParameter.validFile(parameters, "calc", false); if (calc == "not found") { calc = "jclass-thetayc"; } @@ -329,12 +330,12 @@ int MatrixOutputCommand::execute(){ lines[i].end = int (sqrt(float(i+1)/float(processors)) * numGroups); } - if (m->control_pressed) { delete input; for (int i = 0; i < lookup.size(); i++) { delete lookup[i]; } m->Groups.clear(); return 0; } + if (m->control_pressed) { delete input; for (int i = 0; i < lookup.size(); i++) { delete lookup[i]; } m->clearGroups(); return 0; } //as long as you are not at the end of the file or done wih the lines you want while((lookup[0] != NULL) && ((allLines == 1) || (userLabels.size() != 0))) { - if (m->control_pressed) { outputTypes.clear(); delete input; for (int i = 0; i < lookup.size(); i++) { delete lookup[i]; } for (int i = 0; i < outputNames.size(); i++) { remove(outputNames[i].c_str()); } m->Groups.clear(); return 0; } + if (m->control_pressed) { outputTypes.clear(); delete input; for (int i = 0; i < lookup.size(); i++) { delete lookup[i]; } for (int i = 0; i < outputNames.size(); i++) { m->mothurRemove(outputNames[i]); } m->clearGroups(); return 0; } if(allLines == 1 || labels.count(lookup[0]->getLabel()) == 1){ m->mothurOut(lookup[0]->getLabel()); m->mothurOutEndLine(); @@ -367,7 +368,7 @@ int MatrixOutputCommand::execute(){ lookup = input->getSharedRAbundVectors(); } - if (m->control_pressed) { outputTypes.clear(); delete input; for (int i = 0; i < outputNames.size(); i++) { remove(outputNames[i].c_str()); } m->Groups.clear(); return 0; } + if (m->control_pressed) { outputTypes.clear(); delete input; for (int i = 0; i < outputNames.size(); i++) { m->mothurRemove(outputNames[i]); } m->clearGroups(); return 0; } //output error messages about any remaining user labels set::iterator it; @@ -382,7 +383,7 @@ int MatrixOutputCommand::execute(){ } } - if (m->control_pressed) { outputTypes.clear(); delete input; for (int i = 0; i < outputNames.size(); i++) { remove(outputNames[i].c_str()); } m->Groups.clear(); return 0; } + if (m->control_pressed) { outputTypes.clear(); delete input; for (int i = 0; i < outputNames.size(); i++) { m->mothurRemove(outputNames[i]); } m->clearGroups(); return 0; } //run last label if you need to if (needToRun == true) { @@ -394,10 +395,10 @@ int MatrixOutputCommand::execute(){ for (int i = 0; i < lookup.size(); i++) { delete lookup[i]; } } - if (m->control_pressed) { outputTypes.clear(); delete input; for (int i = 0; i < outputNames.size(); i++) { remove(outputNames[i].c_str()); } m->Groups.clear(); return 0; } + if (m->control_pressed) { outputTypes.clear(); delete input; for (int i = 0; i < outputNames.size(); i++) { m->mothurRemove(outputNames[i]); } m->clearGroups(); return 0; } //reset groups parameter - m->Groups.clear(); + m->clearGroups(); //set phylip file as new current phylipfile string current = ""; @@ -526,7 +527,7 @@ int MatrixOutputCommand::process(vector thisLookup){ } } intemp.close(); - remove(tempdistFileName.c_str()); + m->mothurRemove(tempdistFileName); } } @@ -597,7 +598,7 @@ int MatrixOutputCommand::driver(vector thisLookup, int star if (m->control_pressed) { return 1; } - seqDist temp(l, k, (1.0 - tempdata[0])); + seqDist temp(l, k, tempdata[0]); calcDists[i].push_back(temp); } }