]> git.donarmstrong.com Git - mothur.git/blob - nmdscommand.h
fixed trim.seqs bug with qtrim parameter and added num=1 special case to database...
[mothur.git] / nmdscommand.h
1 #ifndef NMDSCOMMAND_H
2 #define NMDSCOMMAND_H
3
4 /*
5  *  nmdscommand.h
6  *  mothur
7  *
8  *  Created by westcott on 1/11/11.
9  *  Copyright 2011 Schloss Lab. All rights reserved.
10  *
11  */
12
13 #include "command.hpp"
14 #include "linearalgebra.h"
15
16
17 /*  references used to make this command: "Nonmetric Multidimensional Scalling: A Numerical Method"
18  by J. B. Kruskal  Psychometrika - Vol 29, No. 2 June 1964 */
19
20 /*****************************************************************/
21 class NMDSCommand : public Command {
22         
23 public:
24         NMDSCommand(string);    
25         NMDSCommand();
26         ~NMDSCommand();
27         vector<string> getRequiredParameters();
28         vector<string> getValidParameters();
29         vector<string> getRequiredFiles();
30         map<string, vector<string> > getOutputFiles() { return outputTypes; }
31         int execute();  
32         void help();
33         
34 private:
35         
36         bool abort;
37         string phylipfile, outputDir, axesfile;
38         int dimension, maxIters;
39         double step, cutoff;
40         vector<string> outputNames;
41         map<string, vector<string> > outputTypes;
42         LinearAlgebra linearCalc;
43         
44         vector< vector<double> > generateStartingConfiguration(int); //pass in numNames, return axes
45         int normalizeConfiguration(vector< vector<double> >&, int);
46         vector<seqDist> satisfyMonotonicity(vector<seqDist>);
47         double calculateStress(vector<seqDist>&, vector<seqDist>&, double&);
48         vector< vector<double> > calculateStressGradientVector(vector<seqDist>&, vector<seqDist>&, double, double, vector< vector<double> >&);
49         double calculateMagnitude(vector< vector<double> >&);
50         double calculateStep(vector< vector<double> >&, vector< vector<double> >&, vector<double>&);
51         vector< vector<double> > calculateNewConfiguration(double, vector< vector<double> >&, vector< vector<double> >&);
52         vector< vector<double> > readAxes(vector<string>);
53         int output(string, string, vector< vector<double> >&, vector<double>&, vector<string>&);
54 };
55
56 /*****************************************************************/
57
58 #endif
59
60