8 * Created by westcott on 2/25/10.
9 * Copyright 2010 Schloss Lab. All rights reserved.
16 /***********************************************/
21 static MothurOut* getInstance();
22 void setFileName(string);
24 void mothurOut(string); //writes to cout and the logfile
25 void mothurOutEndLine(); //writes to cout and the logfile
26 void mothurOut(string, ofstream&); //writes to the ofstream, cout and the logfile
27 void mothurOutEndLine(ofstream&); //writes to the ofstream, cout and the logfile
28 void mothurOutJustToLog(string);
29 void errorOut(exception&, string, string);
31 string getDefaultPath() { return defaultPath; }
32 void setDefaultPath(string);
33 string getOutputDir() { return outputDir; }
34 void setOutputDir(string);
36 string getReleaseDate() { return releaseDate; }
37 void setReleaseDate(string r) { releaseDate = r; }
38 string getVersion() { return version; }
39 void setVersion(string r) { version = r; }
40 vector<string> Groups;
41 vector<string> Treenames;
42 map<string, string> names;
43 vector<string> namesOfGroups;
44 string saveNextLabel, argv;
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);
103 bool executing, runParse, jumble, gui;
105 //current files - if you add a new type you must edit optionParser->getParameters, get.current command and mothurOut->printCurrentFiles/clearCurrentFiles.
106 string getPhylipFile() { return phylipfile; }
107 string getColumnFile() { return columnfile; }
108 string getListFile() { return listfile; }
109 string getRabundFile() { return rabundfile; }
110 string getSabundFile() { return sabundfile; }
111 string getNameFile() { return namefile; }
112 string getGroupFile() { return groupfile; }
113 string getOrderFile() { return orderfile; }
114 string getOrderGroupFile() { return ordergroupfile; }
115 string getTreeFile() { return treefile; }
116 string getSharedFile() { return sharedfile; }
117 string getRelAbundFile() { return relabundfile; }
118 string getDesignFile() { return designfile; }
119 string getFastaFile() { return fastafile; }
120 string getSFFFile() { return sfffile; }
121 string getQualFile() { return qualfile; }
122 string getOligosFile() { return oligosfile; }
123 string getAccnosFile() { return accnosfile; }
124 string getTaxonomyFile() { return taxonomyfile; }
125 string getFlowFile() { return flowfile; }
126 string getProcessors() { return processors; }
128 void setListFile(string f) { listfile = getFullPathName(f); }
129 void setTreeFile(string f) { treefile = getFullPathName(f); }
130 void setGroupFile(string f) { groupfile = getFullPathName(f); }
131 void setPhylipFile(string f) { phylipfile = getFullPathName(f); }
132 void setColumnFile(string f) { columnfile = getFullPathName(f); }
133 void setNameFile(string f) { namefile = getFullPathName(f); }
134 void setRabundFile(string f) { rabundfile = getFullPathName(f); }
135 void setSabundFile(string f) { sabundfile = getFullPathName(f); }
136 void setSharedFile(string f) { sharedfile = getFullPathName(f); }
137 void setRelAbundFile(string f) { relabundfile = getFullPathName(f); }
138 void setOrderFile(string f) { orderfile = getFullPathName(f); }
139 void setOrderGroupFile(string f) { ordergroupfile = getFullPathName(f); }
140 void setDesignFile(string f) { designfile = getFullPathName(f); }
141 void setFastaFile(string f) { fastafile = getFullPathName(f); }
142 void setSFFFile(string f) { sfffile = getFullPathName(f); }
143 void setQualFile(string f) { qualfile = getFullPathName(f); }
144 void setOligosFile(string f) { oligosfile = getFullPathName(f); }
145 void setAccnosFile(string f) { accnosfile = getFullPathName(f); }
146 void setTaxonomyFile(string f) { taxonomyfile = getFullPathName(f); }
147 void setFlowFile(string f) { flowfile = getFullPathName(f); }
148 void setProcessors(string p) { processors = p; }
150 void printCurrentFiles();
151 bool hasCurrentFiles();
152 void clearCurrentFiles();
155 static MothurOut* _uniqueInstance;
156 MothurOut( const MothurOut& ); // Disable copy constructor
157 void operator=( const MothurOut& ); // Disable assignment operator
159 control_pressed = false; defaultPath="";
186 string defaultPath, outputDir;
187 string releaseDate, version;
189 string accnosfile, phylipfile, columnfile, listfile, rabundfile, sabundfile, namefile, groupfile, designfile, taxonomyfile;
190 string orderfile, treefile, sharedfile, ordergroupfile, relabundfile, fastafile, qualfile, sfffile, oligosfile, processors, flowfile;
195 int mem_usage(double&, double&);
198 /***********************************************/