File: biom.hpp

package info (click to toggle)
mothur 1.48.5-1
  • links: PTS, VCS
  • area: main
  • in suites: forky
  • size: 13,684 kB
  • sloc: cpp: 161,854; makefile: 122; sh: 31
file content (68 lines) | stat: -rw-r--r-- 2,309 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
63
64
65
66
67
68
//
//  biom.hpp
//  Mothur
//
//  Created by Sarah Westcott on 10/26/20.
//  Copyright © 2020 Schloss Lab. All rights reserved.
//

#ifndef biom_hpp
#define biom_hpp

#include "utils.hpp"
#include "mothurout.h"
#include "sharedrabundfloatvectors.hpp"
#include "sharedrabundvectors.hpp"
#include "phylosummary.h"
#include "taxonomy.hpp"
#include "picrust.hpp"

//http://biom-format.org
//http://biom-format.org/documentation/format_versions/biom-1.0.html
//http://biom-format.org/documentation/format_versions/biom-2.1.html

/**************************************************************************************************/
class Biom {

public:
    Biom();
    Biom(string); //version
    
    virtual ~Biom();
    
    virtual void read(string) = 0;
    virtual void load(SharedRAbundVectors* s, vector<Taxonomy> c);
    virtual void load(SharedRAbundFloatVectors* s, vector<Taxonomy> c);
    virtual void fillHeading(string mv, string sfn) { mothurVersion = mv; sharedFileName = sfn; }
    
    virtual void print(string, vector<string>, Picrust*) { } //hdf5 print
    
    virtual string getVersion() { return version; }
    virtual string getMatrixElementType() { return matrixElementType; }
    
    virtual SharedRAbundVectors* getSharedRAbundVectors() { return shared; }
    virtual SharedRAbundFloatVectors* getSharedRAbundFloatVectors() { return sharedFloat; }
    
    //otu taxonomies
    virtual vector<Taxonomy> getConsTaxonomies() { return consTax; }
    
    //sample taxonomies
    virtual map<string, string> getGroupTaxonomies() {  return groupTaxonomies; }
    
protected:
    
    MothurOut* m;
    Utils util;
    string matrixFormat, tableType;     //examples: tableType = "OTU table", matrixFormat = "sparse" or "dense"
    string version, formatURL, label, matrixElementType; //version = simple or hdf5, set by child. matrixElementType = "int" or "float"
    string tableID, mothurVersion, sharedFileName;
    int maxLevel;
   
    SharedRAbundVectors* shared; //always created with read
    SharedRAbundFloatVectors* sharedFloat; //only created if the matrixElementType is float
    vector<Taxonomy> consTax;
    map<string, string> groupTaxonomies;
    
};
/**************************************************************************************************/
#endif /* biom_hpp */