]> git.donarmstrong.com Git - mothur.git/blob - seqnoise.h
fixes while testing 1.33.0
[mothur.git] / seqnoise.h
1 #ifndef SEQNOISE
2 #define SEQNOISE
3
4
5
6 /*
7  *  mySeqNoise.h
8  *  
9  *
10  *  Created by Pat Schloss on 8/31/11.
11  *  Copyright 2011 Patrick D. Schloss. All rights reserved.
12  *
13  */
14
15 /*****************************************************************************************************************************/
16 /*****************************************************************************************************************************/
17 /* NOTE: Order matters in this class.  If you are going to use it, make sure your files have the sequences in the same order. */
18 /*****************************************************************************************************************************/
19 /*****************************************************************************************************************************/
20
21
22 #include "mothurout.h"
23 /**************************************************************************************************/
24
25 struct freqData {
26         
27         freqData(int i, int freq) : frequency(freq), index(i){  }
28         
29         bool operator<( freqData const& rhs ) const {
30                 return frequency < rhs.frequency; 
31         }
32         
33         int frequency;
34         int index;
35         
36 };
37 /**************************************************************************************************/
38
39 class seqNoise {
40 public:
41         seqNoise() { m = MothurOut::getInstance();  }
42         ~seqNoise(){}
43         
44         int getSequenceData(string, vector<string>&);
45         int addSeq(string, vector<string>&); 
46         int getRedundantNames(string, vector<string>&, vector<string>&, vector<int>&);
47         int addRedundantName(string, string, vector<string>&, vector<string>&, vector<int>&);
48     int getDistanceData(string, vector<double>&);
49         int getListData(string, double, vector<int>&, vector<int>&, vector<vector<int> >&);
50         int updateOTUCountData(vector<int>, vector<vector<int> >, vector<vector<int> >, vector<int>&, vector<int>&, vector<int>&);
51         double calcNewWeights(vector<double>&,vector<int>,vector<int>,vector<int>,vector<int>,vector<int>,vector<double>);
52         int calcCentroids(vector<int>,vector<int>,vector<int>&,vector<int>&,vector<int>,vector<double>,vector<int>,vector<int>,vector<double>);
53         int checkCentroids(vector<double>&, vector<int>);
54         int setUpOTUData(vector<int>&, vector<double>&, vector<int>, vector<double>, vector<int>, vector<int>, vector<int>);
55         int finishOTUData(vector<int>, vector<int>&, vector<int>&, vector<int>&, vector<int>&, vector<vector<int> >&, vector<vector<int> >&, vector<double>&);
56         int writeOutput(string, string, string, vector<int>, vector<int>, vector<int>, vector<string>, vector<string>, vector<string>, vector<int>, vector<double>&);
57
58
59 private:
60         MothurOut* m;
61         
62         int getLastMatch(char, vector<vector<char> >&, int, int, vector<int>&, vector<int>&);
63         int countDiffs(vector<int>, vector<int>);
64         vector<int> convertSeq(string);
65         string degapSeq(string);
66         
67 };
68
69 /**************************************************************************************************/
70 #endif
71