]> git.donarmstrong.com Git - mothur.git/blob - chimeraseqscommand.h
added list.seqs command
[mothur.git] / chimeraseqscommand.h
1 #ifndef CHIMERACOMMAND_H
2 #define CHIMERACOMMAND_H
3
4 /*
5  *  chimeraseqscommand.h
6  *  Mothur
7  *
8  *  Created by Sarah Westcott on 6/29/09.
9  *  Copyright 2009 Schloss Lab UMASS Amherst. All rights reserved.
10  *
11  */
12
13 #include "mothur.h"
14 #include "command.hpp"
15 #include "filterseqscommand.h"
16 #include "sequence.hpp"
17 #include "sparsematrix.hpp"
18 #include "dist.h"
19
20 typedef list<PCell>::iterator MatData;
21 typedef map<int, float> SeqMap;  //maps sequence to all distance for that seqeunce
22
23 struct Preference {
24                 string name;
25                 vector<string> leftParent; //keep the name of closest left associated with the two scores
26                 vector<string> rightParent; //keep the name of closest right associated with the two scores
27                 vector<float> score;  //so you can keep last score and calc this score and keep whichever is bigger.
28                 vector<float> closestLeft;  //keep the closest left associated with the two scores
29                 vector<float> closestRight; //keep the closest right associated with the two scores
30                 int midpoint;
31
32 };
33
34
35
36 /***********************************************************/
37
38 class ChimeraSeqsCommand : public Command {
39 public:
40         ChimeraSeqsCommand(string);
41         ~ChimeraSeqsCommand();
42         int execute();
43         void help();
44         
45                 
46 private:
47         
48         Dist* distCalculator;
49         bool abort;
50         string method, fastafile;
51         bool filter, correction;
52         int processors, midpoint, averageLeft, averageRight, window, iters, increment;
53         FilterSeqsCommand* filterSeqs;
54         ListVector* list;
55         vector<Sequence> seqs;
56         vector<Preference> pref;
57         
58         void readSeqs();
59         void generatePreferences(vector<SeqMap>, vector<SeqMap>, int);
60         int createSparseMatrix(int, int, SparseMatrix*, vector<Sequence>);
61         
62
63 };
64
65 /***********************************************************/
66
67 #endif
68