File: HDFRegionTableReader.hpp

package info (click to toggle)
pbseqlib 5.3.4%2Bdfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 7,020 kB
  • sloc: cpp: 77,246; python: 331; sh: 103; makefile: 42
file content (58 lines) | stat: -rw-r--r-- 1,333 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
#ifndef _BLASR_HDF_REGION_TABLE_READER_HPP_
#define _BLASR_HDF_REGION_TABLE_READER_HPP_

#include <string>
#include <vector>

#include <H5Cpp.h>

#include <hdf/HDF2DArray.hpp>
#include <hdf/HDFArray.hpp>
#include <hdf/HDFAtom.hpp>
#include <hdf/HDFFile.hpp>
#include <pbdata/reads/RegionTable.hpp>

class HDFRegionTableReader
{
private:
    HDFFile regionTableFile;
    HDFGroup pulseDataGroup;
    HDF2DArray<int> regions;

    HDFAtom<std::vector<std::string> > regionTypes;
    HDFAtom<std::vector<std::string> > regionDescriptions;
    HDFAtom<std::vector<std::string> > regionSources;
    HDFAtom<std::vector<std::string> > columnNames;

    int curRow;

    bool isInitialized_;  // whether or not this reader is initialized.

    int nRows;

    bool fileContainsRegionTable;

public:
    HDFRegionTableReader(void)
        : curRow(0), isInitialized_(false), nRows(0), fileContainsRegionTable(false)
    {
    }

    int Initialize(std::string &regionTableFileName,
                   const H5::FileAccPropList &fileAccPropList = H5::FileAccPropList::DEFAULT);

    bool IsInitialized(void) const;

    bool HasRegionTable(void) const;

    void GetMinMaxHoleNumber(UInt &minHole, UInt &maxHole);

    void ReadTable(RegionTable &table);

    void Close();

private:
    int GetNext(RegionAnnotation &annotation);
};

#endif