try {
if (abort == true) { return 0; }
-
+
//prepare filename
string outputName = outputDir + m->getRootName(m->getSimpleName(inputFile)) + "tre";
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());
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;
+ }
}
/* Read an alignment in FASTA format */
alignment =
NJ_read_fasta(nj_args);
-
+
if(!alignment) {
return(NULL);
}
* From proteins, we may want to allow users to specify
* a substitution matrix (feature)
*/
+
dmat =
NJ_compute_dmat(nj_args,
alignment);
if(!dmat) {
fprintf(stderr, "Clearcut: Error computing distance matrix\n");
}
-
+
/* now free the memory associated with the alignment */
NJ_free_alignment(alignment);
/* 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);
fprintf(stderr, "Clearcut: Invalid distance correction model.\n");
return(NULL);
}
-
+
return(dmat);
}
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;
ifstream in;
m->openInputFile(fastafile, in);
string name;
-
+
while(!in.eof()){
if (m->control_pressed) { in.close(); return 0; }
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}