]> git.donarmstrong.com Git - mothur.git/blobdiff - ccode.cpp
added name option to read.tree for use in unifrac and parimony commands
[mothur.git] / ccode.cpp
index 0a9214ef39e16b99b31694fb2bff53e9e25fdc80..c474d7a0ad7cb54729f809cf9921ed234f48d5db 100644 (file)
--- a/ccode.cpp
+++ b/ccode.cpp
@@ -13,7 +13,7 @@
 
 
 //***************************************************************************************************************
-Ccode::Ccode(string filename, string temp) {  fastafile = filename;  templateFile = temp;  }
+Ccode::Ccode(string filename, string temp, string o) {  fastafile = filename;  templateFile = temp;  outputDir = o; }
 //***************************************************************************************************************
 
 Ccode::~Ccode() {
@@ -32,7 +32,7 @@ void Ccode::print(ostream& out) {
                
                mothurOutEndLine();
                
-               string mapInfo = getRootName(fastafile) + "mapinfo";
+               string mapInfo = outputDir + getRootName(getSimpleName(fastafile)) + "mapinfo";
                ofstream out2;
                openOutputFile(mapInfo, out2);
                
@@ -128,7 +128,7 @@ void Ccode::print(ostream& out) {
 }
 
 //***************************************************************************************************************
-void Ccode::getChimeras() {
+int Ccode::getChimeras() {
        try {
                
                //read in query sequences and subject sequences
@@ -139,6 +139,8 @@ void Ccode::getChimeras() {
                
                int numSeqs = querySeqs.size();
                
+               if (unaligned) { mothurOut("Your sequences need to be aligned when you use the bellerophon ccode."); mothurOutEndLine(); return 1;  }
+               
                closest.resize(numSeqs);
                
                refCombo.resize(numSeqs, 0);
@@ -297,7 +299,8 @@ void Ccode::getChimeras() {
                for (int i = 0; i < lines.size(); i++)                                  {       delete lines[i];                                }
                delete distCalc;
                delete decalc;
-                       
+               
+               return 0;
        }
        catch(exception& e) {
                errorOut(e, "Ccode", "getChimeras");