File: BasicEndpoint.hpp

package info (click to toggle)
pbseqlib 5.3.5%2Bdfsg-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 7,020 kB
  • sloc: cpp: 77,250; python: 331; sh: 103; makefile: 41
file content (59 lines) | stat: -rw-r--r-- 1,601 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
#ifndef _BLASR_BASIC_ENDPOINT_HPP_
#define _BLASR_BASIC_ENDPOINT_HPP_

#include <pbdata/Types.h>
#include <alignment/algorithms/anchoring/Coordinate.hpp>

//
// An endpoint is one of the ends of a fragment, where
// a fragment is an exact match between two genomes.
// So, a fragment is a 2D object that has a position and length,
// and an endpoint is 1D, where it just has a position.
// A fragment may be associated with a score that is the score
// of the fragment in a maximum scoring chain.  When finding a
// maximum scoring chain using priority search trees, one must
// be able to set the score of a fragment when indexing solely
// a point.
//

enum WhichEnd
{
    Start,
    End
};
typedef UInt KeyType;

template <typename T_ScoredFragment>
class BasicEndpoint
{
private:
    Coordinate p;
    WhichEnd side;
    T_ScoredFragment* fragmentPtr;

public:
    class LessThan
    {
    public:
        int operator()(const BasicEndpoint<T_ScoredFragment>& lhs,
                       const BasicEndpoint<T_ScoredFragment>& rhs) const
        {
            return lhs.p < rhs.p;
        }
    };
    BasicEndpoint();
    WhichEnd GetSide();
    void FragmentPtrToStart(T_ScoredFragment* fragment);
    void FragmentPtrToEnd(T_ScoredFragment* fragment);
    int GetScore();
    int SetScore(int score);
    T_ScoredFragment* SetScoredReference(T_ScoredFragment* _fragmentPtr);
    int operator<(const BasicEndpoint& rhs) const;
    KeyType GetKey();
    T_ScoredFragment* GetFragmentPtr();
    void SetChainPrev(T_ScoredFragment* prevChainFragment);
};

#include "BasicEndpointImpl.hpp"

#endif