File: sharedsabundvector.h

package info (click to toggle)
mothur 1.33.3%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 11,248 kB
  • ctags: 12,231
  • sloc: cpp: 152,046; fortran: 665; makefile: 74; sh: 34
file content (69 lines) | stat: -rw-r--r-- 1,728 bytes parent folder | download | duplicates (3)
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
63
64
65
66
67
68
69
#ifndef SHAREDSABUND_H
#define SHAREDSABUND_H


/*
 *  sharedSharedSAbundVector.h
 *  Dotur
 *
 *  Created by Sarah Westcott on 12/10/08.
 *  Copyright 2008 Schloss Lab UMASS Amherst. All rights reserved.
 *
 */

#include "datavector.hpp"
#include "rabundvector.hpp"
#include "ordervector.hpp"
#include "sharedordervector.h"
#include "sharedrabundvector.h"

/* This class is a child to datavector.  It represents OTU information at a certain distance. 
	It is similiar to an sabundvector except each member of data knows which group it belongs to.
	Each member of the internal container "data" is a struct of type individual. 
	An individual which knows the OTU from which it came, 
	the group it is in and its abundance.  */


class SharedSAbundVector : public DataVector {
	
public:
	SharedSAbundVector();
	SharedSAbundVector(int);
	SharedSAbundVector(const SharedSAbundVector& rv) : DataVector(rv.label), data(rv.data), maxRank(rv.maxRank), numBins(rv.numBins), numSeqs(rv.numSeqs){};
	~SharedSAbundVector(){};

	int getNumBins();	
	int getNumSeqs();	
	int getMaxRank();	
	string getGroup();
	void setGroup(string);	
	
	void set(int, int, string);	 //OTU, abundance, group
	individual get(int);
	int getAbundance(int);
	void push_back(int, int, string);	//abundance, OTU, group
	void pop_back();
	void resize(int);
	int size();
	void clear();

	void print(ostream&);
		
	RAbundVector getRAbundVector();	
	SAbundVector getSAbundVector();
	OrderVector getOrderVector(map<string,int>*);
	SharedSAbundVector getSharedSAbundVector();
	SharedRAbundVector getSharedRAbundVector();
	SharedOrderVector getSharedOrderVector();
	
private:
	vector<individual> data;
	
	int maxRank;
	int numBins;
	int numSeqs;
	string group;
};

#endif