]> git.donarmstrong.com Git - mothur.git/blobdiff - chimeracheckrdp.cpp
added set.dir command and modified commands to redirect input and output, removed...
[mothur.git] / chimeracheckrdp.cpp
index f9b2319a0dfc489c41d1634c2e4519e3db73bdc2..04c143fecc50207a682f033567372959bcb831be 100644 (file)
@@ -10,7 +10,7 @@
 #include "chimeracheckrdp.h"
                
 //***************************************************************************************************************
-ChimeraCheckRDP::ChimeraCheckRDP(string filename, string temp) {  fastafile = filename;  templateFile = temp;  }
+ChimeraCheckRDP::ChimeraCheckRDP(string filename, string temp, string o) {  fastafile = filename;  templateFile = temp; outputDir = o;  }
 //***************************************************************************************************************
 
 ChimeraCheckRDP::~ChimeraCheckRDP() {
@@ -43,7 +43,7 @@ void ChimeraCheckRDP::print(ostream& out) {
                                        out << IS[i][k].score << '\t'; 
                                        //if (IS[i][k].score > chimeraCutoff) {  isChimeric[i] = true;   lastChimericWindowFound = k;           }                       
                                }
-                               
+                               out << endl;
                                //if (isChimeric[i]) { 
                                        //mothurOut(querySeqs[i]->getName() + "\tIS: " + toString(IS[i][lastChimericWindowFound].score) + "\tbreakpoint: " + toString(IS[i][lastChimericWindowFound].midpoint) + "\tleft parent: " + IS[i][lastChimericWindowFound].leftParent + "\tright parent: " + IS[i][lastChimericWindowFound].rightParent); mothurOutEndLine();
                                        //out << endl << "chimera: YES" << endl;
@@ -65,6 +65,7 @@ void ChimeraCheckRDP::print(ostream& out) {
                                }
                }
                
+               mothurOut("This method does not determine if a sequence is chimeric, but allows you to make that determination based on the IS values."); mothurOutEndLine();
        }
        catch(exception& e) {
                errorOut(e, "ChimeraCheckRDP", "print");
@@ -73,7 +74,7 @@ void ChimeraCheckRDP::print(ostream& out) {
 }
 
 //***************************************************************************************************************
-void ChimeraCheckRDP::getChimeras() {
+int ChimeraCheckRDP::getChimeras() {
        try {
                
                //read in query sequences and subject sequences
@@ -134,7 +135,7 @@ void ChimeraCheckRDP::getChimeras() {
                //free memory
                for (int i = 0; i < lines.size(); i++)                                  {       delete lines[i];        }
        
-                       
+               return 0;
        }
        catch(exception& e) {
                errorOut(e, "ChimeraCheckRDP", "getChimeras");
@@ -337,7 +338,7 @@ void ChimeraCheckRDP::getCutoff() {
 void ChimeraCheckRDP::makeSVGpic(vector<sim> info, int query) {
        try{
                
-               string file = querySeqs[query]->getName() + ".chimeracheck.svg";
+               string file = outputDir + querySeqs[query]->getName() + ".chimeracheck.svg";
                ofstream outsvg;
                openOutputFile(file, outsvg);