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