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 vector<unsigned long int> setFilePosEachLine(string, int&);
48 vector<unsigned long int> setFilePosFasta(string, int&);
49 string sortFile(string, string);
50 void appendFiles(string, string);
51 int renameFile(string, string); //oldname, newname
52 string getFullPathName(string);
53 string hasPath(string);
54 string getExtension(string);
55 string getPathName(string);
56 string getSimpleName(string);
57 string getRootName(string);
59 int openOutputFile(string, ofstream&);
60 int openOutputFileAppend(string, ofstream&);
61 int openInputFile(string, ifstream&);
62 int openInputFile(string, ifstream&, string); //no error given
63 string getline(ifstream&);
64 string getline(istringstream&);
65 void gobble(istream&);
66 void gobble(istringstream&);
67 map<string, int> readNames(string);
68 int readNames(string, vector<seqPriorityNode>&, map<string, string>&);
71 bool checkReleaseVersion(ifstream&, string);
72 bool anyLabelsToProcess(string, set<string>&, string);
73 bool inUsersGroups(vector<string>, vector<string>);
74 bool inUsersGroups(string, vector<string>);
75 void getNumSeqs(ifstream&, int&);
76 int getNumSeqs(ifstream&);
77 int getNumNames(string);
79 bool isContainingOnlyDigits(string);
83 void splitAtEquals(string&, string&);
84 void splitAtComma(string&, string&);
85 void splitAtComma(string&, vector<string>&);
86 void splitAtDash(string&, set<int>&);
87 void splitAtDash(string&, set<string>&);
88 void splitAtDash(string&, vector<string>&);
89 void splitAtChar(string&, vector<string>&, char);
92 int factorial(int num);
93 vector<vector<double> > binomial(int);
94 float ceilDist(float, int);
95 float roundDist(float, int);
96 unsigned int fromBase36(string);
99 bool executing, runParse, jumble, gui;
101 //current files - if you add a new type you must edit optionParser->getParameters, get.current command and mothurOut->printCurrentFiles/clearCurrentFiles.
102 string getPhylipFile() { return phylipfile; }
103 string getColumnFile() { return columnfile; }
104 string getListFile() { return listfile; }
105 string getRabundFile() { return rabundfile; }
106 string getSabundFile() { return sabundfile; }
107 string getNameFile() { return namefile; }
108 string getGroupFile() { return groupfile; }
109 string getOrderFile() { return orderfile; }
110 string getOrderGroupFile() { return ordergroupfile; }
111 string getTreeFile() { return treefile; }
112 string getSharedFile() { return sharedfile; }
113 string getRelAbundFile() { return relabundfile; }
114 string getDesignFile() { return designfile; }
115 string getFastaFile() { return fastafile; }
116 string getSFFFile() { return sfffile; }
117 string getQualFile() { return qualfile; }
118 string getOligosFile() { return oligosfile; }
119 string getAccnosFile() { return accnosfile; }
120 string getTaxonomyFile() { return taxonomyfile; }
121 string getFlowFile() { return flowfile; }
122 string getProcessors() { return processors; }
124 void setListFile(string f) { listfile = getFullPathName(f); }
125 void setTreeFile(string f) { treefile = getFullPathName(f); }
126 void setGroupFile(string f) { groupfile = getFullPathName(f); }
127 void setPhylipFile(string f) { phylipfile = getFullPathName(f); }
128 void setColumnFile(string f) { columnfile = getFullPathName(f); }
129 void setNameFile(string f) { namefile = getFullPathName(f); }
130 void setRabundFile(string f) { rabundfile = getFullPathName(f); }
131 void setSabundFile(string f) { sabundfile = getFullPathName(f); }
132 void setSharedFile(string f) { sharedfile = getFullPathName(f); }
133 void setRelAbundFile(string f) { relabundfile = getFullPathName(f); }
134 void setOrderFile(string f) { orderfile = getFullPathName(f); }
135 void setOrderGroupFile(string f) { ordergroupfile = getFullPathName(f); }
136 void setDesignFile(string f) { designfile = getFullPathName(f); }
137 void setFastaFile(string f) { fastafile = getFullPathName(f); }
138 void setSFFFile(string f) { sfffile = getFullPathName(f); }
139 void setQualFile(string f) { qualfile = getFullPathName(f); }
140 void setOligosFile(string f) { oligosfile = getFullPathName(f); }
141 void setAccnosFile(string f) { accnosfile = getFullPathName(f); }
142 void setTaxonomyFile(string f) { taxonomyfile = getFullPathName(f); }
143 void setFlowFile(string f) { flowfile = getFullPathName(f); }
144 void setProcessors(string p) { processors = p; }
146 void printCurrentFiles();
147 bool hasCurrentFiles();
148 void clearCurrentFiles();
151 static MothurOut* _uniqueInstance;
152 MothurOut( const MothurOut& ); // Disable copy constructor
153 void operator=( const MothurOut& ); // Disable assignment operator
155 control_pressed = false; defaultPath="";
182 string defaultPath, outputDir;
183 string releaseDate, version;
185 string accnosfile, phylipfile, columnfile, listfile, rabundfile, sabundfile, namefile, groupfile, designfile, taxonomyfile;
186 string orderfile, treefile, sharedfile, ordergroupfile, relabundfile, fastafile, qualfile, sfffile, oligosfile, processors, flowfile;
191 int mem_usage(double&, double&);
194 /***********************************************/