]> git.donarmstrong.com Git - mothur.git/blobdiff - fileoutput.h
added log10 and log2 scalers for heatmap
[mothur.git] / fileoutput.h
index b7837d2277ed89d17b54d52ea180ac095856ba34..7e9d8d26144be2150d75358e67da2a72a6dafb32 100644 (file)
@@ -1,11 +1,7 @@
 #ifndef FILEOUTPUT_H
 #define FILEOUTPUT_H
 
-#include <iostream>
-#include <fstream>
-#include <iomanip>
-#include <vector>
-#include "utilities.hpp"
+#include "mothur.h"
 #include "globaldata.hpp"
 
 using namespace std;
@@ -21,6 +17,12 @@ public:
        virtual void initFile(string) = 0;
        virtual void resetFile() = 0;
        virtual string getFileName() = 0;
+       virtual void initFile(string, vector<string>) = 0;
+       virtual void output(vector<double>) = 0;
+
+protected:
+       GlobalData* globaldata;
+       int renameOk;
 
 };     
        
@@ -35,6 +37,10 @@ public:
        void output(int, vector<double>);
        void resetFile();
        string getFileName()    { return inName;        };
+       
+       void initFile(string, vector<string>) {};
+       void output(vector<double>) {};
+
 private:
        string inName;
        string outName;
@@ -55,6 +61,10 @@ public:
        void initFile(string);
        void resetFile();
        string getFileName()    { return inName;        };
+       
+       void initFile(string, vector<string>) {};
+       void output(vector<double>) {};
+
 
 private:
        string outName;
@@ -75,6 +85,10 @@ public:
        void initFile(string);
        void resetFile();
        string getFileName()    { return inName;        };
+       
+       void initFile(string, vector<string>) {};
+       void output(vector<double>) {};
+
 
 private:
        string outName;
@@ -96,6 +110,11 @@ public:
        void output(int, vector<double>);
        void resetFile();
        string getFileName()    { return inName;        };
+       
+       
+       void initFile(string, vector<string>) {};
+       void output(vector<double>) {};
+
 private:
        string inName, groupLabel;
        string outName;
@@ -104,7 +123,30 @@ private:
        int counter, numGroup;
 };
 
+/***********************************************************************/
 
+class ThreeColumnFile2 : public FileOutput {
+       
+public:
+       ThreeColumnFile2(string n) : FileOutput(), inName(n), counter(0), outName(getPathName(n) + ".temp." + getSimpleName(n)) { globaldata = GlobalData::getInstance(); };
+       ~ThreeColumnFile2();
+       
+       //to make compatible with parent class
+       void output(int, vector<double>){};
+       void initFile(string){};
+       
+       void initFile(string, vector<string>);
+       void output(vector<double>);
+       void resetFile();
+       string getFileName()    { return inName;        };
+private:
+       string inName;
+       string outName;
+       ifstream inFile;
+       ofstream outFile;
+       int counter;
+};
 
-#endif
+/***********************************************************************/
 
+#endif