X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;ds=sidebyside;f=seqerrorcommand.cpp;h=f1b9cd8103a2d5f9c8836f657411359b0845785c;hb=260ae19c36cb11a53ddc5a75b5e507f8dd8b31d6;hp=82af49ed27f5e6dffbe52e50d413439c3983c270;hpb=d84bb41d7dadcfa2c67ce5edb9b94060e5659fa7;p=mothur.git diff --git a/seqerrorcommand.cpp b/seqerrorcommand.cpp index 82af49e..f1b9cd8 100644 --- a/seqerrorcommand.cpp +++ b/seqerrorcommand.cpp @@ -48,7 +48,7 @@ SeqErrorCommand::SeqErrorCommand(string option) { it = parameters.find("query"); //user has given a template file if(it != parameters.end()){ - path = hasPath(it->second); + path = m->hasPath(it->second); //if the user has not given a path then, add inputdir. else leave path alone. if (path == "") { parameters["query"] = inputDir + it->second; } } @@ -56,7 +56,7 @@ SeqErrorCommand::SeqErrorCommand(string option) { it = parameters.find("reference"); //user has given a template file if(it != parameters.end()){ - path = hasPath(it->second); + path = m->hasPath(it->second); //if the user has not given a path then, add inputdir. else leave path alone. if (path == "") { parameters["reference"] = inputDir + it->second; } } @@ -64,7 +64,7 @@ SeqErrorCommand::SeqErrorCommand(string option) { it = parameters.find("name"); //user has given a template file if(it != parameters.end()){ - path = hasPath(it->second); + path = m->hasPath(it->second); //if the user has not given a path then, add inputdir. else leave path alone. if (path == "") { parameters["name"] = inputDir + it->second; } } @@ -87,7 +87,7 @@ SeqErrorCommand::SeqErrorCommand(string option) { outputDir = validParameter.validFile(parameters, "outputdir", false); if (outputDir == "not found"){ outputDir = ""; - outputDir += hasPath(queryFileName); //if user entered a file with a path then preserve it + outputDir += m->hasPath(queryFileName); //if user entered a file with a path then preserve it } //check for optional parameter and set defaults @@ -96,7 +96,7 @@ SeqErrorCommand::SeqErrorCommand(string option) { convert(temp, threshold); errorFileName = queryFileName.substr(0,queryFileName.find_last_of('.')) + ".errors"; - openOutputFile(errorFileName, errorFile); + m->openOutputFile(errorFileName, errorFile); printErrorHeader(); } } @@ -140,7 +140,7 @@ int SeqErrorCommand::execute(){ if(namesFileName != ""){ weights = getWeights(); } ifstream queryFile; - openInputFile(queryFileName, queryFile); + m->openInputFile(queryFileName, queryFile); int totalBases = 0; int totalMatches = 0; @@ -194,7 +194,7 @@ int SeqErrorCommand::execute(){ string errorCountFileName = queryFileName.substr(0,queryFileName.find_last_of('.')) + ".count"; ofstream errorCountFile; - openOutputFile(errorCountFileName, errorCountFile); + m->openOutputFile(errorCountFileName, errorCountFile); m->mothurOut("Overall error rate:\t" + toString((double)(totalBases - totalMatches) / (double)totalBases) + "\n\n"); m->mothurOut("Errors\tSequences\n"); @@ -220,7 +220,7 @@ void SeqErrorCommand::getReferences(){ try { ifstream referenceFile; - openInputFile(referenceFileName, referenceFile); + m->openInputFile(referenceFileName, referenceFile); while(referenceFile){ Sequence currentSeq(referenceFile); @@ -231,7 +231,7 @@ void SeqErrorCommand::getReferences(){ currentSeq.removeAmbigBases(); } referenceSeqs.push_back(currentSeq); - gobble(referenceFile); + m->gobble(referenceFile); } numRefs = referenceSeqs.size(); @@ -335,7 +335,7 @@ Compare SeqErrorCommand::getErrors(Sequence query, Sequence reference){ map SeqErrorCommand::getWeights(){ ifstream nameFile; - openInputFile(namesFileName, nameFile); + m->openInputFile(namesFileName, nameFile); string seqName; string redundantSeqs; @@ -343,8 +343,8 @@ map SeqErrorCommand::getWeights(){ while(nameFile){ nameFile >> seqName >> redundantSeqs; - nameCountMap[seqName] = getNumNames(redundantSeqs); - gobble(nameFile); + nameCountMap[seqName] = m->getNumNames(redundantSeqs); + m->gobble(nameFile); } return nameCountMap; }