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

Go to the SVN repository for this file.

1 /* $Id: feature_context.hpp 93574 2021-04-30 16:19:19Z stakhovv $
2  * ===========================================================================
3  *
4  * PUBLIC DOMAIN NOTICE
5  * National Center for Biotechnology Information
6  *
7  * This software/database is a "United States Government Work" under the
8  * terms of the United States Copyright Act. It was written as part of
9  * the author's official duties as a United States Government employee and
10  * thus cannot be copyrighted. This software/database is freely available
11  * to the public for use. The National Library of Medicine and the U.S.
12  * Government have not placed any restriction on its use or reproduction.
13  *
14  * Although all reasonable efforts have been taken to ensure the accuracy
15  * and reliability of the software and data, the NLM and the U.S.
16  * Government do not and cannot warrant the performance or results that
17  * may be obtained by using this software or data. The NLM and the U.S.
18  * Government disclaim all warranties, express or implied, including
19  * warranties of performance, merchantability or fitness for any particular
20  * purpose.
21  *
22  * Please cite the author in any work or product based on this material.
23  *
24  * ===========================================================================
25  *
26  * Authors: Frank Ludwig
27  *
28  * File Description:
29  *
30  */
31 
32 #ifndef OBJTOOLS_WRITERS___FEATURE_CONTEXT__HPP
33 #define OBJTOOLS_WRITERS___FEATURE_CONTEXT__HPP
34 
35 #include <corelib/ncbistd.hpp>
36 #include <objmgr/bioseq_handle.hpp>
38 #include <objmgr/feat_ci.hpp>
39 
41 BEGIN_objects_SCOPE
42 
43 // ----------------------------------------------------------------------------
45 // ----------------------------------------------------------------------------
46 {
47 public:
49  {};
50 
52  const CFeat_CI& feat_iter,
55  m_ft(feat_iter), m_bsh(bsh), m_sah(sah),
56  m_bSequenceHasBioSource(false),
57  m_bSequenceIsGenomicRecord(false),
58  mShouldInheritPseudo(false)
59  {
60  xAssignSequenceHasBioSource();
61  xAssignSequenceIsGenomicRecord();
62  };
63 
64 
65  // Code duplication - this should just be a temporary measure
67  m_ft(other.m_ft),
68  m_bsh(other.m_bsh),
69  m_sah(other.m_sah),
70  m_bSequenceHasBioSource(false),
71  m_bSequenceIsGenomicRecord(false),
72  mShouldInheritPseudo(false)
73  {
74  xAssignSequenceHasBioSource();
75  xAssignSequenceIsGenomicRecord();
76  };
77 
78 
79  feature::CFeatTree& FeatTree() { return m_ft; };
80  CBioseq_Handle BioseqHandle() const { return m_bsh; };
81  CSeq_annot_Handle AnnotHandle() const { return m_sah; };
82 
83  CMappedFeat FindBestGeneParent(const CMappedFeat& mf);
84  bool IsSequenceGenomicRecord() const { return m_bSequenceIsGenomicRecord; };
85  bool HasSequenceBioSource() const { return m_bSequenceHasBioSource; };
86 
87  bool ShouldInheritPseudo() const { return mShouldInheritPseudo; };
88  void AssignShouldInheritPseudo(bool shouldInheritPseudo) {
89  mShouldInheritPseudo = shouldInheritPseudo;
90  };
91 
92 protected:
93  feature::CFeatTree m_ft;
94  CMappedFeat m_mfLastIn, m_mfLastOut;
100 
101  void xAssignSequenceHasBioSource();
102  void xAssignSequenceIsGenomicRecord();
103 
104 private:
105  // CGffFeatureContext(const CGffFeatureContext&);
107 };
108 
109 
110 END_objects_SCOPE
112 
113 #endif // OBJTOOLS_WRITERS___FEATURE_CONTEXT__HPP
CBioseq_Handle –.
CFeat_CI –.
Definition: feat_ci.hpp:64
CSeq_annot_Handle AnnotHandle() const
bool ShouldInheritPseudo() const
void AssignShouldInheritPseudo(bool shouldInheritPseudo)
CBioseq_Handle m_bsh
CSeq_annot_Handle m_sah
CGffFeatureContext(const CFeat_CI &feat_iter, CBioseq_Handle bsh=CBioseq_Handle(), CSeq_annot_Handle sah=CSeq_annot_Handle())
CGffFeatureContext & operator=(const CGffFeatureContext &)
CGffFeatureContext(const CGffFeatureContext &other)
feature::CFeatTree & FeatTree()
bool HasSequenceBioSource() const
CBioseq_Handle BioseqHandle() const
feature::CFeatTree m_ft
bool IsSequenceGenomicRecord() const
CMappedFeat –.
Definition: mapped_feat.hpp:59
CSeq_annot_Handle –.
Include a standard set of the NCBI C++ Toolkit most basic headers.
#define false
Definition: bool.h:36
#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 NCBI_XOBJWRITE_EXPORT
Definition: ncbi_export.h:1347
Modified on Wed Apr 17 13:09:38 2024 by modify_doxy.py rev. 669887