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);
25 void mothurOutEndLine();
26 void mothurOutJustToLog(string);
27 void errorOut(exception&, string, string);
29 string getDefaultPath() { return defaultPath; }
30 void setDefaultPath(string);
31 string getOutputDir() { return outputDir; }
32 void setOutputDir(string);
34 string getReleaseDate() { return releaseDate; }
35 void setReleaseDate(string r) { releaseDate = r; }
36 string getVersion() { return version; }
37 void setVersion(string r) { version = r; }
38 vector<string> Groups;
39 vector<string> Treenames;
40 map<string, string> names;
41 vector<string> namesOfGroups;
42 string saveNextLabel, argv;
44 //functions from mothur.h
46 vector<unsigned long int> divideFile(string, int&);
47 int divideFile(string, int&, vector<string>&);
48 vector<unsigned long int> setFilePosEachLine(string, int&);
49 vector<unsigned long int> setFilePosFasta(string, int&);
50 string sortFile(string, string);
51 void appendFiles(string, string);
52 int renameFile(string, string); //oldname, newname
53 string getFullPathName(string);
54 string hasPath(string);
55 string getExtension(string);
56 string getPathName(string);
57 string getSimpleName(string);
58 string getRootName(string);
60 int openOutputFile(string, ofstream&);
61 int openOutputFileAppend(string, ofstream&);
62 int openInputFile(string, ifstream&);
63 int openInputFile(string, ifstream&, string); //no error given
64 string getline(ifstream&);
65 string getline(istringstream&);
66 void gobble(istream&);
67 void gobble(istringstream&);
68 map<string, int> readNames(string);
69 int readNames(string, vector<seqPriorityNode>&, map<string, string>&);
72 bool checkReleaseVersion(ifstream&, string);
73 bool anyLabelsToProcess(string, set<string>&, string);
74 bool inUsersGroups(vector<string>, vector<string>);
75 bool inUsersGroups(string, vector<string>);
76 void getNumSeqs(ifstream&, int&);
77 int getNumSeqs(ifstream&);
78 int getNumNames(string);
80 bool isContainingOnlyDigits(string);
84 void splitAtEquals(string&, string&);
85 void splitAtComma(string&, string&);
86 void splitAtComma(string&, vector<string>&);
87 void splitAtDash(string&, set<int>&);
88 void splitAtDash(string&, set<string>&);
89 void splitAtDash(string&, vector<string>&);
90 void splitAtChar(string&, vector<string>&, char);
93 int factorial(int num);
94 vector<vector<double> > binomial(int);
95 float ceilDist(float, int);
96 float roundDist(float, int);
97 unsigned int fromBase36(string);
100 bool executing, runParse, jumble, gui;
102 //current files - if you add a new type you must edit optionParser->getParameters, get.current command and mothurOut->printCurrentFiles/clearCurrentFiles.
103 string getPhylipFile() { return phylipfile; }
104 string getColumnFile() { return columnfile; }
105 string getListFile() { return listfile; }
106 string getRabundFile() { return rabundfile; }
107 string getSabundFile() { return sabundfile; }
108 string getNameFile() { return namefile; }
109 string getGroupFile() { return groupfile; }
110 string getOrderFile() { return orderfile; }
111 string getOrderGroupFile() { return ordergroupfile; }
112 string getTreeFile() { return treefile; }
113 string getSharedFile() { return sharedfile; }
114 string getRelAbundFile() { return relabundfile; }
115 string getDesignFile() { return designfile; }
116 string getFastaFile() { return fastafile; }
117 string getSFFFile() { return sfffile; }
118 string getQualFile() { return qualfile; }
119 string getOligosFile() { return oligosfile; }
120 string getAccnosFile() { return accnosfile; }
121 string getTaxonomyFile() { return taxonomyfile; }
122 string getFlowFile() { return flowfile; }
123 string getProcessors() { return processors; }
125 void setListFile(string f) { listfile = getFullPathName(f); }
126 void setTreeFile(string f) { treefile = getFullPathName(f); }
127 void setGroupFile(string f) { groupfile = getFullPathName(f); }
128 void setPhylipFile(string f) { phylipfile = getFullPathName(f); }
129 void setColumnFile(string f) { columnfile = getFullPathName(f); }
130 void setNameFile(string f) { namefile = getFullPathName(f); }
131 void setRabundFile(string f) { rabundfile = getFullPathName(f); }
132 void setSabundFile(string f) { sabundfile = getFullPathName(f); }
133 void setSharedFile(string f) { sharedfile = getFullPathName(f); }
134 void setRelAbundFile(string f) { relabundfile = getFullPathName(f); }
135 void setOrderFile(string f) { orderfile = getFullPathName(f); }
136 void setOrderGroupFile(string f) { ordergroupfile = getFullPathName(f); }
137 void setDesignFile(string f) { designfile = getFullPathName(f); }
138 void setFastaFile(string f) { fastafile = getFullPathName(f); }
139 void setSFFFile(string f) { sfffile = getFullPathName(f); }
140 void setQualFile(string f) { qualfile = getFullPathName(f); }
141 void setOligosFile(string f) { oligosfile = getFullPathName(f); }
142 void setAccnosFile(string f) { accnosfile = getFullPathName(f); }
143 void setTaxonomyFile(string f) { taxonomyfile = getFullPathName(f); }
144 void setFlowFile(string f) { flowfile = getFullPathName(f); }
145 void setProcessors(string p) { processors = p; }
147 void printCurrentFiles();
148 bool hasCurrentFiles();
149 void clearCurrentFiles();
152 static MothurOut* _uniqueInstance;
153 MothurOut( const MothurOut& ); // Disable copy constructor
154 void operator=( const MothurOut& ); // Disable assignment operator
156 control_pressed = false; defaultPath="";
183 string defaultPath, outputDir;
184 string releaseDate, version;
186 string accnosfile, phylipfile, columnfile, listfile, rabundfile, sabundfile, namefile, groupfile, designfile, taxonomyfile;
187 string orderfile, treefile, sharedfile, ordergroupfile, relabundfile, fastafile, qualfile, sfffile, oligosfile, processors, flowfile;
192 int mem_usage(double&, double&);
195 /***********************************************/