halapi
hierarchichalalignmentformatapi
 All Classes Namespaces Functions Pages
halSegment.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 _HALSEGMENT_H
8 #define _HALSEGMENT_H
9 
10 #include <string>
11 #include <vector>
12 #include <set>
13 #include "halDefs.h"
14 
15 namespace hal {
16 
21 class Segment
22 {
23 public:
24 
30  virtual void setArrayIndex(Genome* genome, hal_index_t arrayIndex) = 0;
31 
37  virtual void setArrayIndex(const Genome* genome, hal_index_t arrayIndex)
38  const = 0;
39 
41  virtual const Genome* getGenome() const = 0;
42 
44  virtual Genome* getGenome() = 0;
45 
47  virtual const Sequence* getSequence() const = 0;
48 
50  virtual Sequence* getSequence() = 0;
51 
59  virtual hal_index_t getStartPosition() const = 0;
60 
63  virtual hal_index_t getEndPosition() const = 0;
64 
66  virtual hal_size_t getLength() const = 0;
67 
70  virtual void getString(std::string& outString) const = 0;
71 
75  virtual void setCoordinates(hal_index_t startPos, hal_size_t length) = 0;
76 
78  virtual hal_index_t getArrayIndex() const = 0;
79 
82  virtual bool leftOf(hal_index_t genomePos) const = 0;
83 
86  virtual bool rightOf(hal_index_t genomePos) const = 0;
87 
90  virtual bool overlaps(hal_index_t genomePos) const = 0;
91 
94  virtual bool isFirst() const = 0;
95 
98  virtual bool isLast() const = 0;
99 
104  virtual bool isMissingData(double nThreshold) const = 0;
105 
109  virtual bool isTop() const = 0;
110 
128  virtual hal_size_t getMappedSegments(
129  std::set<MappedSegmentConstPtr>& outSegments,
130  const Genome* tgtGenome,
131  const std::set<const Genome*>* genomesOnPath = NULL,
132  bool doDupes = true,
133  hal_size_t minLength = 0) const = 0;
134 
136  virtual void print(std::ostream& os) const = 0;
137 
138 protected:
139  friend class counted_ptr<Segment>;
140  friend class counted_ptr<const Segment>;
141  virtual ~Segment() = 0;
142 };
143 
144 inline Segment::~Segment() {}
145 
146 inline std::ostream& operator<<(std::ostream& os, const Segment& s)
147 {
148  s.print(os);
149  return os;
150 }
151 
152 
153 }
154 #endif
virtual hal_index_t getArrayIndex() const =0
Definition: halSegment.h:21
Definition: halGenome.h:24
virtual bool rightOf(hal_index_t genomePos) const =0
virtual hal_index_t getEndPosition() const =0
virtual const Sequence * getSequence() const =0
virtual bool leftOf(hal_index_t genomePos) const =0
virtual bool isFirst() const =0
virtual bool isTop() const =0
virtual void setArrayIndex(Genome *genome, hal_index_t arrayIndex)=0
virtual bool isLast() const =0
virtual hal_size_t getMappedSegments(std::set< MappedSegmentConstPtr > &outSegments, const Genome *tgtGenome, const std::set< const Genome * > *genomesOnPath=NULL, bool doDupes=true, hal_size_t minLength=0) const =0
virtual void getString(std::string &outString) const =0
virtual void setCoordinates(hal_index_t startPos, hal_size_t length)=0
virtual const Genome * getGenome() const =0
virtual bool isMissingData(double nThreshold) const =0
virtual hal_index_t getStartPosition() const =0
virtual void print(std::ostream &os) const =0
Definition: halSequence.h:20
virtual bool overlaps(hal_index_t genomePos) const =0
virtual hal_size_t getLength() const =0