From b9553248b33ebd169c6aee375c1cc1a9dda61848 Mon Sep 17 00:00:00 2001 From: westcott Date: Wed, 27 Jul 2011 14:54:16 +0000 Subject: [PATCH] 1.21.0 --- chimerapintailcommand.cpp | 1 - makefile | 5 +++++ mothurfisher.cpp | 17 +++++++++-------- mothurfisher.h | 2 +- mothurout.cpp | 2 +- myutils.cpp | 23 ++++++++++++----------- pintail.cpp | 8 ++++---- 7 files changed, 32 insertions(+), 26 deletions(-) diff --git a/chimerapintailcommand.cpp b/chimerapintailcommand.cpp index 01a905f..33ac69a 100644 --- a/chimerapintailcommand.cpp +++ b/chimerapintailcommand.cpp @@ -392,7 +392,6 @@ int ChimeraPintailCommand::execute(){ } } } - chimera = new Pintail(fastaFileNames[s], templatefile, filter, processors, maskfile, consfile, quanfile, window, increment, outputDir); if (outputDir == "") { outputDir = m->hasPath(fastaFileNames[s]); }//if user entered a file with a path then preserve it diff --git a/makefile b/makefile index aa69ce1..0f7d098 100644 --- a/makefile +++ b/makefile @@ -28,6 +28,11 @@ ifeq ($(strip $(64BIT_VERSION)),yes) #if you are a mac user use the following line TARGET_ARCH += -arch x86_64 + #if you using cygwin to build Windows the following line + #CXX = x86_64-w64-mingw32-g++ + #CC = x86_64-w64-mingw32-g++ + #TARGET_ARCH += -m64 + #if you are a linux user use the following line #CXXFLAGS += -mtune=native -march=native -m64 diff --git a/mothurfisher.cpp b/mothurfisher.cpp index 6f705b9..7acefb2 100644 --- a/mothurfisher.cpp +++ b/mothurfisher.cpp @@ -90,11 +90,12 @@ double MothurFisher::hyper_323(double n11, double n1_, double n_1, double n){ } } /***********************************************************/ -double MothurFisher::hyper(double n11){ +double MothurFisher::myhyper(double n11){ try { - return(hyper0(n11,0,0,0)); + double hyper0Result = hyper0(n11,0,0,0); + return hyper0Result; }catch(exception& e) { - m->errorOut(e, "MothurFisher", "hyper"); + m->errorOut(e, "MothurFisher", "myhyper"); exit(1); } } @@ -150,21 +151,21 @@ double MothurFisher::exact(double n11, double n1_, double n_1, double n){ } prob=hyper0(n11,n1_,n_1,n); sleft=0; - p=hyper(min); + p=myhyper(min); for(i=min+1; p<0.99999999*prob; i++) { sleft += p; - p=hyper(i); + p=myhyper(i); } i--; if(p<1.00000001*prob) sleft += p; else i--; sright=0; - p=hyper(max); + p=myhyper(max); for(j=max-1; p<0.99999999*prob; j--) { sright += p; - p=hyper(j); + p=myhyper(j); } j++; if(p<1.00000001*prob) sright += p; @@ -182,7 +183,7 @@ double MothurFisher::exact(double n11, double n1_, double n_1, double n){ return prob; }catch(exception& e) { - m->errorOut(e, "MothurFisher", "hyper0"); + m->errorOut(e, "MothurFisher", "exact"); exit(1); } } diff --git a/mothurfisher.h b/mothurfisher.h index 88557d4..2742f97 100644 --- a/mothurfisher.h +++ b/mothurfisher.h @@ -29,7 +29,7 @@ private: double lnfact(double); double lnbico(double, double); double hyper_323(double, double, double, double); - double hyper(double); + double myhyper(double); double hyper0(double, double, double, double); double exact(double, double, double, double); }; diff --git a/mothurout.cpp b/mothurout.cpp index 367f5d1..cdde507 100644 --- a/mothurout.cpp +++ b/mothurout.cpp @@ -902,7 +902,7 @@ int MothurOut::renameFile(string oldName, string newName){ string command = "mv " + oldName + " " + newName; system(command.c_str()); #else - m->mothurRemove(newName); + mothurRemove(newName); int renameOk = rename(oldName.c_str(), newName.c_str()); #endif return 0; diff --git a/myutils.cpp b/myutils.cpp index 786316e..78bf543 100755 --- a/myutils.cpp +++ b/myutils.cpp @@ -143,22 +143,22 @@ bool myisatty(int fd) #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) #else -#ifdef BIT_VERSION -#include -int fseeko(FILE *stream, off_t offset, int whence) - { - off_t FilePos = _fseeki64(stream, offset, whence); - return (FilePos == -1L) ? -1 : 0; - } -#define ftello(fm) (off_t) _ftelli64(fm) -#else +//#ifdef BIT_VERSION +//#include +//int fseeko(FILE *stream, off_t offset, int whence) +//// { +// off_t FilePos = _fseeki64(stream, offset, whence); +// return (FilePos == -1L) ? -1 : 0; +// } +//#define ftello(fm) (off_t) _ftelli64(fm) +//#else int fseeko(FILE *stream, off_t offset, int whence) { off_t FilePos = fseek(stream, offset, whence); return (FilePos == -1L) ? -1 : 0; } #define ftello(fm) (off_t) ftell(fm) -#endif +//#endif #endif void LogStdioFileState(FILE *f) @@ -513,7 +513,8 @@ off_t GetStdioFilePos(FILE *f) off_t GetStdioFileSize(FILE *f) { off_t CurrentPos = GetStdioFilePos(f); - int Ok = fseeko(f, 0, SEEK_END); + off_t zeroPos = 0; + int Ok = fseeko(f, zeroPos, SEEK_END); if (Ok < 0) Die("fseek in GetFileSize"); diff --git a/pintail.cpp b/pintail.cpp index f6e7aa5..af64c25 100644 --- a/pintail.cpp +++ b/pintail.cpp @@ -170,13 +170,13 @@ int Pintail::doPrep() { string noOutliers, outliers; if ((!filter) && (seqMask == "")) { - noOutliers = templateFileName + "pintail.quan"; + noOutliers = m->getRootName(m->getSimpleName(templateFileName)) + "pintail.quan"; }else if ((!filter) && (seqMask != "")) { - noOutliers =templateFileName + "pintail.masked.quan"; + noOutliers =m->getRootName(m->getSimpleName(templateFileName)) + "pintail.masked.quan"; }else if ((filter) && (seqMask != "")) { - noOutliers = templateFileName + "pintail.filtered." + m->getSimpleName(m->getRootName(fastafile)) + "masked.quan"; + noOutliers = m->getRootName(m->getSimpleName(templateFileName)) + "pintail.filtered." + m->getSimpleName(m->getRootName(fastafile)) + "masked.quan"; }else if ((filter) && (seqMask == "")) { - noOutliers = templateFileName + "pintail.filtered." + m->getSimpleName(m->getRootName(fastafile)) + "quan"; + noOutliers = m->getRootName(m->getSimpleName(templateFileName)) + "pintail.filtered." + m->getSimpleName(m->getRootName(fastafile)) + "quan"; } decalc->removeObviousOutliers(quantilesMembers, templateSeqs.size()); -- 2.39.2