File: QualityValueVector.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 (62 lines) | stat: -rw-r--r-- 1,489 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
#ifndef _BLASR_QUALITY_VALUE_VECTOR_HPP_
#define _BLASR_QUALITY_VALUE_VECTOR_HPP_

#include <cstddef>
#include <cstdint>
#include <cstring>
#include <ostream>

#include <pbdata/Types.h>
#include <pbdata/qvs/QualityValue.hpp>
#include <pbdata/utils.hpp>

template <typename T_QV>
class QualityValueVector
{
public:
    T_QV *data;
    QVScale qvScale;

    T_QV &operator[](unsigned int pos) const;

    QualityValueVector();

    QualityProbability ToProbability(unsigned int pos);

    T_QV ToPhred(unsigned int pos);

    void Copy(const QualityValueVector<T_QV> &rhs, const DNALength length);

    void Copy(const std::string &rhs);

    void Free();

    void Allocate(unsigned int length);

    /// Fill data with value.
    void Fill(const T_QV &value);

    /// Fill this->data[thisStart...thisStart+fillLength] with
    /// rhs->data[rhsStart...rhsStart+fillLength]
    void Fill(const DNALength thisStart, const DNALength fillLength,
              const QualityValueVector<T_QV> &rhs, const DNALength rhsStart);

    bool Empty() const;

    void ShallowCopy(const QualityValueVector<T_QV> &ref, int pos, const DNALength &length);

    // Reset data pointer to NULL, don't free memory.
    // This should be paired with ShallowCopy.
    void ResetShallowData(void);

    std::string ToString(void);

    // Returns data length
    DNALength Length(void) const;

private:
    DNALength _length;
};

#include "QualityValueVectorImpl.hpp"
#endif  // _BLASR_QUALITY_VALUE_VECTOR_HPP_