File: classify.h

package info (click to toggle)
mothur 1.48.5-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 13,684 kB
  • sloc: cpp: 161,854; makefile: 122; sh: 31
file content (62 lines) | stat: -rwxr-xr-x 1,473 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#ifndef CLASSIFY_H
#define CLASSIFY_H

/*
 *  classify.h
 *  Mothur
 *
 *  Created by westcott on 11/3/09.
 *  Copyright 2009 Schloss Lab. All rights reserved.
 *
 */


/* This class is a parent to bayesian, knn.  */

#include "mothur.h"
#include "searchdatabase.hpp"
#include "phylotree.h"

class Sequence;

/**************************************************************************************************/

class Classify {

public:
	Classify();
	virtual ~Classify(){};
    
	virtual string getTaxonomy(Sequence*, string&, bool&) = 0;
    int getMaxLevel() { return maxLevel; }
	
	virtual void setDistName(string s) {} //for knn, so if distance method is selected with knn you can create the smallest distance file in the right place.
    
	
protected:
    
	map<string, string> taxonomy;  //name maps to taxonomy
	map<string, int>::iterator itTax;
	map<string, string>::iterator it;
    SearchDatabase* database;
	PhyloTree* phyloTree;
	
	string taxFile, templateFile;
	vector<string> names;
	int threadID, numLevels, numTaxa, maxLevel;
	bool flip, shortcuts;
    MothurOut* m;
	
	int readTaxonomy(string);
	vector<string> parseTax(string);
    double getLogExpSum(vector<double>, int&);
    bool checkReleaseDate(vector<ifstream*>&, string);
    virtual void generateDatabaseAndNames(string, string, string, int, float, float, float, float, string);

	
};

/**************************************************************************************************/

#endif