From: westcott Date: Thu, 9 Sep 2010 15:10:01 +0000 (+0000) Subject: done testing 1.13.0 X-Git-Url: https://git.donarmstrong.com/?p=mothur.git;a=commitdiff_plain;h=43921e55e68146936cf72f65fbc92553bc05977b done testing 1.13.0 --- diff --git a/clearcutcommand.cpp b/clearcutcommand.cpp index 5903946..1a7ab1f 100644 --- a/clearcutcommand.cpp +++ b/clearcutcommand.cpp @@ -174,7 +174,7 @@ int ClearcutCommand::execute() { try { if (abort == true) { return 0; } - + //prepare filename string outputName = outputDir + m->getRootName(m->getSimpleName(inputFile)) + "tre"; @@ -201,25 +201,14 @@ int ClearcutCommand::execute() { if (shuffle) { char* temp = new char[9]; strcpy(temp, "--shuffle"); cPara.push_back(temp); } if (neighbor) { char* temp = new char[10]; strcpy(temp, "--neighbor"); cPara.push_back(temp); } - string tempIn = ""; - #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) - tempIn += "--in=" + inputFile; - #else - tempIn += "--in=\"" + inputFile + "\""; - #endif - + string tempIn = "--in=" + inputFile; char* tempI = new char[tempIn.length()]; strcpy(tempI, tempIn.c_str()); cPara.push_back(tempI); if (stdoutWanted) { char* temp = new char[8]; strcpy(temp, "--stdout"); cPara.push_back(temp); } else{ - string tempOut = ""; - #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) - tempOut += "--out=" + outputName; - #else - tempOut += "--out=\"" + outputName + "\""; - #endif + string tempOut = "--out=" + outputName; char* temp = new char[tempOut.length()]; strcpy(temp, tempOut.c_str()); diff --git a/distancecommand.cpp b/distancecommand.cpp index b3f0a2d..8bdd7cd 100644 --- a/distancecommand.cpp +++ b/distancecommand.cpp @@ -422,6 +422,13 @@ int DistanceCommand::execute(){ remove(outputFile.c_str()); outputFile = column; } + + if (outputDir != "") { + string newOutputName = outputDir + m->getSimpleName(outputFile); + rename(outputFile.c_str(), newOutputName.c_str()); + remove(outputFile.c_str()); + outputFile = newOutputName; + } } diff --git a/distclearcut.cpp b/distclearcut.cpp index a4ac777..cf69649 100644 --- a/distclearcut.cpp +++ b/distclearcut.cpp @@ -78,7 +78,7 @@ NJ_build_distance_matrix(NJ_ARGS *nj_args) { /* Read an alignment in FASTA format */ alignment = NJ_read_fasta(nj_args); - + if(!alignment) { return(NULL); } @@ -91,6 +91,7 @@ NJ_build_distance_matrix(NJ_ARGS *nj_args) { * From proteins, we may want to allow users to specify * a substitution matrix (feature) */ + dmat = NJ_compute_dmat(nj_args, alignment); @@ -100,7 +101,7 @@ NJ_build_distance_matrix(NJ_ARGS *nj_args) { if(!dmat) { fprintf(stderr, "Clearcut: Error computing distance matrix\n"); } - + /* now free the memory associated with the alignment */ NJ_free_alignment(alignment); @@ -156,6 +157,7 @@ NJ_compute_dmat(NJ_ARGS *nj_args, /* allocate val matrix in dmat */ dmat->val = (float *)calloc(dmat->ntaxa*dmat->ntaxa, sizeof(float)); + if(!dmat->val) { fprintf(stderr, "Clearcut: Memory allocation error in NJ_compute_dmat()\n"); return(NULL); @@ -209,7 +211,7 @@ NJ_compute_dmat(NJ_ARGS *nj_args, fprintf(stderr, "Clearcut: Invalid distance correction model.\n"); return(NULL); } - + return(dmat); } diff --git a/dmat.cpp b/dmat.cpp index 1d00cff..64fd67e 100644 --- a/dmat.cpp +++ b/dmat.cpp @@ -465,7 +465,7 @@ NJ_parse_distance_matrix(NJ_ARGS *nj_args) { fp = stdin; } else { fp = fopen(nj_args->infilename, "r"); - if(!fp) { + if(fp==NULL) { fprintf(stderr, "Clearcut: Could not open distance matrix: %s\n", nj_args->infilename); perror("Clearcut"); goto XIT_BAD; diff --git a/listseqscommand.cpp b/listseqscommand.cpp index a3f88cf..d85d5be 100644 --- a/listseqscommand.cpp +++ b/listseqscommand.cpp @@ -208,7 +208,7 @@ int ListSeqsCommand::readFasta(){ ifstream in; m->openInputFile(fastafile, in); string name; - + while(!in.eof()){ if (m->control_pressed) { in.close(); return 0; } diff --git a/makefile b/makefile index ffee66e..278a3ad 100644 --- a/makefile +++ b/makefile @@ -13,9 +13,9 @@ CXXFLAGS += -O3 -MOTHUR_FILES = "\"../Release\"" +MOTHUR_FILES = "\"Enter_your_default_path_here\"" -RELEASE_DATE = "\"8/30/2010\"" +RELEASE_DATE = "\"9/9/2010\"" VERSION = "\"1.13.0\"" CXXFLAGS += -DRELEASE_DATE=${RELEASE_DATE} -DVERSION=${VERSION}