NCBI C++ ToolKit
alignment_quality_score.hpp
Go to the documentation of this file.

Go to the SVN repository for this file.

1 #ifndef GUI_WIDGETS_SEQ_GRAPHIC___ALIGNMENT_QUALITY_SCORE__HPP
2 #define GUI_WIDGETS_SEQ_GRAPHIC___ALIGNMENT_QUALITY_SCORE__HPP
3 
4 /* $Id: alignment_quality_score.hpp 26795 2012-11-07 21:43:01Z wuliangs $
5  * ===========================================================================
6  *
7  * PUBLIC DOMAIN NOTICE
8  * National Center for Biotechnology Information
9  *
10  * This software/database is a "United States Government Work" under the
11  * terms of the United States Copyright Act. It was written as part of
12  * the author's official duties as a United States Government employee and
13  * thus cannot be copyrighted. This software/database is freely available
14  * to the public for use. The National Library of Medicine and the U.S.
15  * Government have not placed any restriction on its use or reproduction.
16  *
17  * Although all reasonable efforts have been taken to ensure the accuracy
18  * and reliability of the software and data, the NLM and the U.S.
19  * Government do not and cannot warrant the performance or results that
20  * may be obtained by using this software or data. The NLM and the U.S.
21  * Government disclaim all warranties, express or implied, including
22  * warranties of performance, merchantability or fitness for any particular
23  * purpose.
24  *
25  * Please cite the author in any work or product based on this material.
26  *
27  * ===========================================================================
28  *
29  * Authors: Liangshou Wu
30  *
31  * File Description:
32  *
33  */
34 
35 
39 
41 
42 
44  : public CObject
45  , public ISGAlnScore
46 {
47 public:
48  typedef unsigned char TScore;
50 
51 private:
52  class CAlnInfo : public CObject
53  {
54  public:
56  const objects::CSeq_align& aln,
57  objects::CScope& scope)
58  : m_Anchor(anchor)
59  , m_Align(&aln)
60  , m_Scope(&scope)
61  {}
62 
66  };
67 
69  {
70  public:
72  : m_ScoreColl(score_coll)
73  , m_Iter(score_coll.begin())
74  , m_IterEnd(score_coll.end())
75  {}
76 
77  virtual operator bool(void) const
78  { return m_Iter != m_IterEnd; }
79 
81  { ++m_Iter; return *this; }
82 
84  {
86  return *this;
87  }
88 
89  virtual TSeqPos GetFrom() const
90  { return m_Iter->GetFrom(); }
91 
92  virtual TSeqPos GetTo() const
93  { return m_Iter->GetTo(); }
94 
95  virtual float GetAttr() const
96  { return (float)m_Iter->GetAttr(); }
97 
98  private:
100  CSGAlnQualityScore::TScoreColl::const_iterator m_Iter;
101  CSGAlnQualityScore::TScoreColl::const_iterator m_IterEnd;
102  };
103 
104 public:
106  const objects::CSeq_align& aln,
107  objects::CScope& scope)
108  : m_AlnInfo(new CAlnInfo(anchor, aln, scope))
109  {}
110 
111  /// @name ISGAlnScore interface implementation
112  /// @{
113  virtual void CalculateScores();
114  virtual bool HasScores() const;
115  virtual IAlnScoreIterator* GetScoreIterator(int row) const;
116  virtual CRgbaColor GetColorForScore(float score, IScoringMethod::EColorType type) const;
117  virtual int GetSupportedColorTypes() const;
118  virtual bool IsAverageable() const;
119  virtual bool IsCacheable() const;
120  virtual const string& GetScoringMethod() const;
121  /// @}
122 
123  static const string& GetScoreName();
124 
125 private:
127 
128 private:
131 };
132 
133 
135 
136 /* @} */
137 
138 #endif // GUI_WIDGETS_SEQ_GRAPHIC___ALIGNMENT_QUALITY_SCORE__HPP
CObject –.
Definition: ncbiobj.hpp:180
class CRgbaColor provides a simple abstraction for managing colors.
Definition: rgba_color.hpp:58
CConstRef< objects::CSeq_align > m_Align
CAlnInfo(IAlnExplorer::TNumrow anchor, const objects::CSeq_align &aln, objects::CScope &scope)
virtual IAlnScoreIterator & operator++(void)
CSGAlnQualityScore::TScoreColl::const_iterator m_IterEnd
CQualityScoreIterator(const CSGAlnQualityScore::TScoreColl &score_coll)
const CSGAlnQualityScore::TScoreColl & m_ScoreColl
CSGAlnQualityScore::TScoreColl::const_iterator m_Iter
virtual IAlnScoreIterator & MoveTo(TSeqPos pos)
CSGAlnQualityScore(IAlnExplorer::TNumrow anchor, const objects::CSeq_align &aln, objects::CScope &scope)
virtual const string & GetScoringMethod() const
virtual IAlnScoreIterator * GetScoreIterator(int row) const
void x_RetrieveQualityMap(IAlnExplorer::TNumrow row, bool remap)
virtual int GetSupportedColorTypes() const
virtual bool IsCacheable() const
static const string & GetScoreName()
virtual bool IsAverageable() const
virtual bool HasScores() const
CAttrRangeCollection< TScore, TSeqPos > TScoreColl
virtual CRgbaColor GetColorForScore(float score, IScoringMethod::EColorType type) const
virtual void CalculateScores()
CAlignOhterScore.
#define bool
Definition: bool.h:34
unsigned int TSeqPos
Type for sequence locations and lengths.
Definition: ncbimisc.hpp:875
const_iterator find(position_type pos) const
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
#define row(bind, expected)
Definition: string_bind.c:73
Definition: type.c:6
Modified on Fri Sep 20 14:57:08 2024 by modify_doxy.py rev. 669887