]> git.donarmstrong.com Git - mothur.git/blob - shhhercommand.h
dba4d68917e9027edc8d8888de82b2e6938e9256
[mothur.git] / shhhercommand.h
1 #ifndef SHHHER_H
2 #define SHHHER_H
3
4 /*
5  *  shhher.h
6  *  Mothur
7  *
8  *  Created by Pat Schloss on 12/27/10.
9  *  Copyright 2010 Schloss Lab. All rights reserved.
10  *
11  */
12
13 #include "mothur.h"
14 #include "command.hpp"
15
16
17 class ShhherCommand : public Command {
18         
19 public:
20         ShhherCommand(string);
21         ShhherCommand();
22         ~ShhherCommand() {}
23         
24         vector<string> setParameters();
25         string getCommandName()                 { return "shhh.seqs";   }
26         string getCommandCategory()             { return "Hidden";              }
27         string getHelpString(); 
28         string getCitation() { return "no citation"; }
29         
30         int execute(); 
31         void help() { m->mothurOut(getHelpString()); }          
32 private:
33         
34         int abort;
35         
36         string outputDir, flowFileName, flowFilesFileName, lookupFileName, compositeFASTAFileName;
37
38         int processors, maxIters;
39         float cutoff, sigma, minDelta;
40         string flowOrder;
41         
42         vector<int> nSeqsBreaks;
43         vector<int> nOTUsBreaks;
44         vector<double> singleLookUp;
45         vector<double> jointLookUp;
46         
47         vector<string> seqNameVector;
48         vector<int> lengths;
49         vector<short> flowDataIntI;
50         vector<double> flowDataPrI;
51         map<string, int> nameMap;
52         vector<int> otuData;
53         vector<int> cumNumSeqs;
54         vector<int> nSeqsPerOTU;
55         vector<vector<int> > aaP;       //tMaster->aanP:        each row is a different otu / each col contains the sequence indices
56         vector<vector<int> > aaI;       //tMaster->aanI:        that are in each otu - can't differentiate between aaP and aaI 
57         vector<int> seqNumber;          //tMaster->anP:         the sequence id number sorted by OTU
58         vector<int> seqIndex;           //tMaster->anI;         the index that corresponds to seqNumber
59         vector<double> dist;            //adDist - distance of sequences to centroids
60         vector<short> change;           //did the centroid sequence change? 0 = no; 1 = yes
61         vector<int> centroids;          //the representative flowgram for each cluster m
62         vector<double> weight;
63         vector<double> singleTau;       //tMaster->adTau:       1-D Tau vector (1xnumSeqs)
64         vector<short> uniqueFlowgrams;
65         vector<int> uniqueCount;
66         vector<int> mapSeqToUnique;
67         vector<int> mapUniqueToSeq;
68         vector<int> uniqueLengths;
69         
70         int numSeqs, numUniques, numOTUs, numFlowCells;
71         
72         void getSingleLookUp();
73         void getJointLookUp();
74         void getFlowData();
75         void getUniques();
76         double getProbIntensity(int);
77         float calcPairwiseDist(int, int);
78         void flowDistParentFork(string, int, int);
79         
80         string createDistFile(int);
81         string createNamesFile();
82         string cluster(string, string);
83         
84         void getOTUData(string);
85         void initPyroCluster();
86         void fill();
87         void calcCentroids();
88         void calcCentroidsDriver(int, int);
89         double getDistToCentroid(int, int, int);
90         double getNewWeights();
91         double getLikelihood();
92         void checkCentroids();
93         void calcNewDistances();
94         void calcNewDistancesParent(int, int);
95         void calcNewDistancesChild(int, int, vector<int>&, vector<int>&, vector<double>&);
96
97
98         void setOTUs();
99         void writeQualities(vector<int>);
100         void writeSequences(vector<int>);
101         void writeNames(vector<int>);
102         void writeGroups();
103         void writeClusters(vector<int>);
104
105         
106 #ifdef USE_MPI
107         string flowDistMPI(int, int);
108         void calcNewDistancesChildMPI(int, int, vector<int>&);
109
110         int pid, ncpus; 
111 #endif
112         
113 };
114
115
116 #endif
117