]> git.donarmstrong.com Git - mothur.git/blobdiff - sharedrabundvector.h
added the Calculators Thomas made in the fall. Added parameter and command error...
[mothur.git] / sharedrabundvector.h
index 6f8d630c4fdfe490e9a32912089608bb7892482c..92f71cdd75eca67df59f1f5cc548e61fe162b41e 100644 (file)
@@ -1,8 +1,8 @@
-#ifndef SHAREDVECTOR_H
-#define SHAREDVECTOR_H
+#ifndef SHAREDRABUNDVECTOR_H
+#define SHAREDRABUNDVECTOR_H
 
 /*
- *  sharedvector.h
+ *  sharedrabundvector.h
  *  Dotur
  *
  *  Created by Sarah Westcott on 12/5/08.
  *
  */
 
-#include <Carbon/Carbon.h>
 #include "datavector.hpp"
 #include "sharedordervector.h"
+#include "sharedsabundvector.h"
+#include "rabundvector.hpp"
 
+/* This class is a child to datavector.  It represents OTU information at a certain distance. 
+       It is similiar to an rabundvector 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.  */
 
 
 
@@ -24,19 +30,25 @@ public:
        SharedRAbundVector(int);
        //SharedRAbundVector(string, vector<int>);
        SharedRAbundVector(const SharedRAbundVector& bv) : DataVector(bv), data(bv.data), maxRank(bv.maxRank), numBins(bv.numBins), numSeqs(bv.numSeqs){};
-//     SharedRAbundVector(ifstream&);
+    //SharedRAbundVector(ifstream&);
        ~SharedRAbundVector();
 
        int getNumBins();               
        int getNumSeqs();                                                       
        int getMaxRank();
        string getGroup();
-       void setGroup(string);                                                  
+       void setGroup(string);
+       int getGroupIndex();
+       void setGroupIndex(int);                                                                
 
-       void set(int, int, string);     
+       void set(int, int, string);                     //OTU, abundance, groupname
+       void setData(vector <individual>);
        individual get(int);
+       vector <individual> getData();
        int getAbundance(int);
-       void push_back(int, int, string);
+       int numNZ();
+       void sortD();  //Sorts the data in descending order.
+       void push_back(int, int, string);  //abundance, OTU, groupname
        void pop_back();
        void resize(int);
        int size();
@@ -45,17 +57,21 @@ public:
        
        void print(ostream&);
                
-       SharedRAbundVector getSharedRAbundVector();
+       RAbundVector getRAbundVector();
+       RAbundVector getRAbundVector2();
        SAbundVector getSAbundVector();
        OrderVector getOrderVector(map<string,int>*);
        SharedOrderVector getSharedOrderVector();
+       SharedSAbundVector getSharedSAbundVector();
+       SharedRAbundVector getSharedRAbundVector();
        
 private:
        vector<individual>  data; 
        int maxRank;
        int numBins;
        int numSeqs;
-       string group;   
+       string group;
+       int index;      
 };