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, map<string, string>&);
70 int readNames(string, vector<seqPriorityNode>&, map<string, string>&);
73 bool checkReleaseVersion(ifstream&, string);
74 bool anyLabelsToProcess(string, set<string>&, string);
75 bool inUsersGroups(vector<string>, vector<string>);
76 bool inUsersGroups(string, vector<string>);
77 void getNumSeqs(ifstream&, int&);
78 int getNumSeqs(ifstream&);
79 int getNumNames(string);
81 bool isContainingOnlyDigits(string);
85 void splitAtEquals(string&, string&);
86 void splitAtComma(string&, string&);
87 void splitAtComma(string&, vector<string>&);
88 void splitAtDash(string&, set<int>&);
89 void splitAtDash(string&, set<string>&);
90 void splitAtDash(string&, vector<string>&);
91 void splitAtChar(string&, vector<string>&, char);
94 int factorial(int num);
95 vector<vector<double> > binomial(int);
96 float ceilDist(float, int);
97 float roundDist(float, int);
98 unsigned int fromBase36(string);
101 bool executing, runParse, jumble, gui;
103 //current files - if you add a new type you must edit optionParser->getParameters, get.current command and mothurOut->printCurrentFiles/clearCurrentFiles.
104 string getPhylipFile() { return phylipfile; }
105 string getColumnFile() { return columnfile; }
106 string getListFile() { return listfile; }
107 string getRabundFile() { return rabundfile; }
108 string getSabundFile() { return sabundfile; }
109 string getNameFile() { return namefile; }
110 string getGroupFile() { return groupfile; }
111 string getOrderFile() { return orderfile; }
112 string getOrderGroupFile() { return ordergroupfile; }
113 string getTreeFile() { return treefile; }
114 string getSharedFile() { return sharedfile; }
115 string getRelAbundFile() { return relabundfile; }
116 string getDesignFile() { return designfile; }
117 string getFastaFile() { return fastafile; }
118 string getSFFFile() { return sfffile; }
119 string getQualFile() { return qualfile; }
120 string getOligosFile() { return oligosfile; }
121 string getAccnosFile() { return accnosfile; }
122 string getTaxonomyFile() { return taxonomyfile; }
123 string getFlowFile() { return flowfile; }
124 string getProcessors() { return processors; }
126 void setListFile(string f) { listfile = getFullPathName(f); }
127 void setTreeFile(string f) { treefile = getFullPathName(f); }
128 void setGroupFile(string f) { groupfile = getFullPathName(f); }
129 void setPhylipFile(string f) { phylipfile = getFullPathName(f); }
130 void setColumnFile(string f) { columnfile = getFullPathName(f); }
131 void setNameFile(string f) { namefile = getFullPathName(f); }
132 void setRabundFile(string f) { rabundfile = getFullPathName(f); }
133 void setSabundFile(string f) { sabundfile = getFullPathName(f); }
134 void setSharedFile(string f) { sharedfile = getFullPathName(f); }
135 void setRelAbundFile(string f) { relabundfile = getFullPathName(f); }
136 void setOrderFile(string f) { orderfile = getFullPathName(f); }
137 void setOrderGroupFile(string f) { ordergroupfile = getFullPathName(f); }
138 void setDesignFile(string f) { designfile = getFullPathName(f); }
139 void setFastaFile(string f) { fastafile = getFullPathName(f); }
140 void setSFFFile(string f) { sfffile = getFullPathName(f); }
141 void setQualFile(string f) { qualfile = getFullPathName(f); }
142 void setOligosFile(string f) { oligosfile = getFullPathName(f); }
143 void setAccnosFile(string f) { accnosfile = getFullPathName(f); }
144 void setTaxonomyFile(string f) { taxonomyfile = getFullPathName(f); }
145 void setFlowFile(string f) { flowfile = getFullPathName(f); }
146 void setProcessors(string p) { processors = p; }
148 void printCurrentFiles();
149 bool hasCurrentFiles();
150 void clearCurrentFiles();
153 static MothurOut* _uniqueInstance;
154 MothurOut( const MothurOut& ); // Disable copy constructor
155 void operator=( const MothurOut& ); // Disable assignment operator
157 control_pressed = false; defaultPath="";
184 string defaultPath, outputDir;
185 string releaseDate, version;
187 string accnosfile, phylipfile, columnfile, listfile, rabundfile, sabundfile, namefile, groupfile, designfile, taxonomyfile;
188 string orderfile, treefile, sharedfile, ordergroupfile, relabundfile, fastafile, qualfile, sfffile, oligosfile, processors, flowfile;
193 int mem_usage(double&, double&);
196 /***********************************************/