halapi
hierarchichalalignmentformatapi
 All Classes Namespaces Functions Pages
halRearrangement.h
1 /*
2  * Copyright (C) 2012 by Glenn Hickey (hickey@soe.ucsc.edu)
3  *
4  * Released under the MIT license, see LICENSE.txt
5  */
6 
7 #ifndef _HALREARRANGEMENT_H
8 #define _HALREARRANGEMENT_H
9 
10 #include <vector>
11 #include <string>
12 #include "halDefs.h"
13 #include "halTopSegmentIterator.h"
14 
15 namespace hal {
16 
24 {
25 public:
26 
27  enum ID { Insertion = 0, Deletion, Duplication, Translocation,
28  Transposition, Inversion, Complex, Invalid, Gap,
29  Missing, Nothing};
30 
32  virtual ID getID() const = 0;
33 
36  virtual hal_size_t getLength() const = 0;
37 
40  virtual hal_size_t getNumContainedGaps() const = 0;
41 
45  virtual hal_size_t getNumContainedGapBases() const = 0;
46 
48  virtual TopSegmentIteratorConstPtr getLeftBreakpoint() const = 0;
49 
51  virtual TopSegmentIteratorConstPtr getRightBreakpoint() const = 0;
52 
56  virtual bool identifyFromLeftBreakpoint(TopSegmentIteratorConstPtr
57  topSegment) = 0;
58 
61  virtual bool identifyDeletionFromLeftBreakpoint(TopSegmentIteratorConstPtr
62  topSegment) = 0;
63 
67  virtual std::pair<hal_index_t, hal_index_t> getDeletedRange() const = 0;
68 
72  virtual bool identifyInsertionFromLeftBreakpoint(TopSegmentIteratorConstPtr
73  topSegment) = 0;
74 
78  virtual std::pair<hal_index_t, hal_index_t> getInsertedRange() const = 0;
79 
83  virtual std::pair<hal_index_t, hal_index_t> getDuplicatedRange() const = 0;
84 
86  virtual bool identifyNext() = 0;
87 
90  virtual hal_size_t getGapLengthThreshold() const = 0;
91 
94  virtual void setGapLengthThreshold(hal_size_t threshold) = 0;
95 
100  virtual void setAtomic(bool atomic) = 0;
101 
102  /* Get the atomic behaviour */
103  virtual bool getAtomic() const = 0;
104 
105  /* Set the threshold for missing data (N's) in a rearranged segment
106  * @param nThreshold Value between 0 and 1. If the number of N's
107  * in the rearranged segment / segment length > nThreshold, then
108  * the rearrangement is termed "missing data". */
109  virtual void setNThreshold(double nThreshold) = 0;
110 
111  /* Get the threshold for missing data (N's) in a rearranged segment
112  * If the number of N's
113  * in the rearranged segment / segment length > nThreshold, then
114  * the rearrangement is termed "missing data". */
115  virtual double getNThreshold() const = 0;
116 
117 protected:
118  friend class counted_ptr<Rearrangement>;
119  friend class counted_ptr<const Rearrangement>;
121  virtual ~Rearrangement() = 0;
122 };
123 
125 
126 }
127 #endif
virtual bool identifyFromLeftBreakpoint(TopSegmentIteratorConstPtr topSegment)=0
virtual void setAtomic(bool atomic)=0
virtual bool identifyDeletionFromLeftBreakpoint(TopSegmentIteratorConstPtr topSegment)=0
virtual std::pair< hal_index_t, hal_index_t > getDeletedRange() const =0
virtual bool identifyNext()=0
virtual void setGapLengthThreshold(hal_size_t threshold)=0
virtual std::pair< hal_index_t, hal_index_t > getInsertedRange() const =0
virtual hal_size_t getNumContainedGaps() const =0
virtual ~Rearrangement()=0
Definition: halRearrangement.h:124
virtual std::pair< hal_index_t, hal_index_t > getDuplicatedRange() const =0
virtual hal_size_t getNumContainedGapBases() const =0
virtual hal_size_t getGapLengthThreshold() const =0
Definition: halRearrangement.h:23
virtual bool identifyInsertionFromLeftBreakpoint(TopSegmentIteratorConstPtr topSegment)=0
virtual TopSegmentIteratorConstPtr getLeftBreakpoint() const =0
virtual TopSegmentIteratorConstPtr getRightBreakpoint() const =0
virtual hal_size_t getLength() const =0
virtual ID getID() const =0