8 * Created by westcott on 2/25/10.
9 * Copyright 2010 Schloss Lab. All rights reserved.
15 /***********************************************/
20 static MothurOut* getInstance();
21 void setFileName(string);
23 void mothurOut(string); //writes to cout and the logfile
24 void mothurOutEndLine(); //writes to cout and the logfile
25 void mothurOut(string, ofstream&); //writes to the ofstream, cout and the logfile
26 void mothurOutEndLine(ofstream&); //writes to the ofstream, cout and the logfile
27 void mothurOutJustToLog(string);
28 void errorOut(exception&, string, string);
30 string getDefaultPath() { return defaultPath; }
31 void setDefaultPath(string);
32 string getOutputDir() { return outputDir; }
33 void setOutputDir(string);
35 string getReleaseDate() { return releaseDate; }
36 void setReleaseDate(string r) { releaseDate = r; }
37 string getVersion() { return version; }
38 void setVersion(string r) { version = r; }
39 vector<string> Groups;
40 vector<string> Treenames;
41 map<string, string> names;
42 vector<string> namesOfGroups;
43 string saveNextLabel, argv, sharedHeaderMode;
46 //functions from mothur.h
48 vector<unsigned long int> divideFile(string, int&);
49 int divideFile(string, int&, vector<string>&);
50 vector<unsigned long int> setFilePosEachLine(string, int&);
51 vector<unsigned long int> setFilePosFasta(string, int&);
52 string sortFile(string, string);
53 void appendFiles(string, string);
54 int renameFile(string, string); //oldname, newname
55 string getFullPathName(string);
56 string hasPath(string);
57 string getExtension(string);
58 string getPathName(string);
59 string getSimpleName(string);
60 string getRootName(string);
62 int openOutputFile(string, ofstream&);
63 int openOutputFileAppend(string, ofstream&);
64 int openInputFile(string, ifstream&);
65 int openInputFile(string, ifstream&, string); //no error given
66 string getline(ifstream&);
67 string getline(istringstream&);
68 void gobble(istream&);
69 void gobble(istringstream&);
70 map<string, int> readNames(string);
71 int readNames(string, map<string, string>&);
72 int readNames(string, vector<seqPriorityNode>&, map<string, string>&);
75 bool checkReleaseVersion(ifstream&, string);
76 bool anyLabelsToProcess(string, set<string>&, string);
77 bool inUsersGroups(vector<string>, vector<string>);
78 bool inUsersGroups(string, vector<string>);
79 void getNumSeqs(ifstream&, int&);
80 int getNumSeqs(ifstream&);
81 int getNumNames(string);
83 bool isContainingOnlyDigits(string);
87 void splitAtEquals(string&, string&);
88 void splitAtComma(string&, string&);
89 void splitAtComma(string&, vector<string>&);
90 void splitAtDash(string&, set<int>&);
91 void splitAtDash(string&, set<string>&);
92 void splitAtDash(string&, vector<string>&);
93 void splitAtChar(string&, vector<string>&, char);
96 int factorial(int num);
97 vector<vector<double> > binomial(int);
98 float ceilDist(float, int);
99 float roundDist(float, int);
100 unsigned int fromBase36(string);
101 int getRandomIndex(int); //highest
104 bool executing, runParse, jumble, gui;
106 //current files - if you add a new type you must edit optionParser->getParameters, get.current command and mothurOut->printCurrentFiles/clearCurrentFiles.
107 string getPhylipFile() { return phylipfile; }
108 string getColumnFile() { return columnfile; }
109 string getListFile() { return listfile; }
110 string getRabundFile() { return rabundfile; }
111 string getSabundFile() { return sabundfile; }
112 string getNameFile() { return namefile; }
113 string getGroupFile() { return groupfile; }
114 string getOrderFile() { return orderfile; }
115 string getOrderGroupFile() { return ordergroupfile; }
116 string getTreeFile() { return treefile; }
117 string getSharedFile() { return sharedfile; }
118 string getRelAbundFile() { return relabundfile; }
119 string getDesignFile() { return designfile; }
120 string getFastaFile() { return fastafile; }
121 string getSFFFile() { return sfffile; }
122 string getQualFile() { return qualfile; }
123 string getOligosFile() { return oligosfile; }
124 string getAccnosFile() { return accnosfile; }
125 string getTaxonomyFile() { return taxonomyfile; }
126 string getFlowFile() { return flowfile; }
127 string getProcessors() { return processors; }
129 void setListFile(string f) { listfile = getFullPathName(f); }
130 void setTreeFile(string f) { treefile = getFullPathName(f); }
131 void setGroupFile(string f) { groupfile = getFullPathName(f); }
132 void setPhylipFile(string f) { phylipfile = getFullPathName(f); }
133 void setColumnFile(string f) { columnfile = getFullPathName(f); }
134 void setNameFile(string f) { namefile = getFullPathName(f); }
135 void setRabundFile(string f) { rabundfile = getFullPathName(f); }
136 void setSabundFile(string f) { sabundfile = getFullPathName(f); }
137 void setSharedFile(string f) { sharedfile = getFullPathName(f); }
138 void setRelAbundFile(string f) { relabundfile = getFullPathName(f); }
139 void setOrderFile(string f) { orderfile = getFullPathName(f); }
140 void setOrderGroupFile(string f) { ordergroupfile = getFullPathName(f); }
141 void setDesignFile(string f) { designfile = getFullPathName(f); }
142 void setFastaFile(string f) { fastafile = getFullPathName(f); }
143 void setSFFFile(string f) { sfffile = getFullPathName(f); }
144 void setQualFile(string f) { qualfile = getFullPathName(f); }
145 void setOligosFile(string f) { oligosfile = getFullPathName(f); }
146 void setAccnosFile(string f) { accnosfile = getFullPathName(f); }
147 void setTaxonomyFile(string f) { taxonomyfile = getFullPathName(f); }
148 void setFlowFile(string f) { flowfile = getFullPathName(f); }
149 void setProcessors(string p) { processors = p; }
151 void printCurrentFiles();
152 bool hasCurrentFiles();
153 void clearCurrentFiles();
156 static MothurOut* _uniqueInstance;
157 MothurOut( const MothurOut& ); // Disable copy constructor
158 void operator=( const MothurOut& ); // Disable assignment operator
160 control_pressed = false; defaultPath="";
183 printedHeaders = false;
184 sharedHeaderMode = "";
189 string defaultPath, outputDir;
190 string releaseDate, version;
192 string accnosfile, phylipfile, columnfile, listfile, rabundfile, sabundfile, namefile, groupfile, designfile, taxonomyfile;
193 string orderfile, treefile, sharedfile, ordergroupfile, relabundfile, fastafile, qualfile, sfffile, oligosfile, processors, flowfile;
198 int mem_usage(double&, double&);
201 /***********************************************/