1 /* $Id: Seq_entry.hpp 613033 2020-07-31 13:02:51Z ucko $
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 * Author: .......
27 *
28 * File Description:
29 * .......
30 *
31 * Remark:
32 * This code was originally generated by application DATATOOL
33 * using specifications from the ASN data definition file
34 * 'seqset.asn'.
35 */
36
37 #ifndef OBJECTS_SEQSET_SEQ_ENTRY_HPP
38 #define OBJECTS_SEQSET_SEQ_ENTRY_HPP
39
40 // generated includes
41 #include <objects/seqset/Seq_entry_.hpp>
42
43 #include <list>
44
45 // generated classes
46
47 BEGIN_NCBI_SCOPE
48
49 BEGIN_objects_SCOPE // namespace ncbi::objects::
50
51 class CSeq_loc;
52 class CSeq_descr;
53 class CSeq_annot;
54
55 class NCBI_SEQSET_EXPORT CSeq_entry : public CSeq_entry_Base, public CSerialUserOp
56 {
57 typedef CSeq_entry_Base Tparent;
58 public:
59 // constructor
60 CSeq_entry(void);
61 // destructor
62 ~CSeq_entry(void);
63
64 // Manage Seq-entry tree structure
65 // recursive update of parent Seq-entries (will not change parent of this)
66 void Parentize(void);
67 // non-recursive update of direct childrent parents (will not change parent of this)
68 void ParentizeOneLevel(void);
69 // reset parent entry to NULL
70 void ResetParentEntry(void);
71 // Set parent entry
72 void SetParentEntry(CSeq_entry* entry);
73
74 // get parent of this.
75 // NULL means that either this is top level Seq-entry,
76 // or Parentize() was never called.
77 CSeq_entry* GetParentEntry(void) const;
78
79 // convenience functions to get descriptor chain from underlying Bioseq or Bioseq-set
80 bool IsSetDescr(void) const;
81 const CSeq_descr& GetDescr(void) const;
82 void SetDescr(CSeq_descr& value);
83 CSeq_descr& SetDescr(void);
84
85 // convenience functions to get annot list from underlying Bioseq or Bioseq-set
86 typedef list< CRef< CSeq_annot > > TAnnot;
87 bool IsSetAnnot(void) const;
88 const TAnnot& GetAnnot(void) const;
89 TAnnot& SetAnnot(void);
90
91 enum ELabelType {
92 eType,
93 eContent,
94 eBoth
95 };
96
97 // Append a label to label based on type or content of CSeq_entry
98 void GetLabel(string* label, ELabelType type) const;
99
100 // Assign modified local Seq-ids for sequences in case of conflict.
101 // New ids will be made by adding suffixes "_1", "_2", etc.
102 // Parentize() will be called for matching ids to Bioseqs.
103 // Not all types of ids can be reassigned -
104 // currently on local and general ids.
105 void ReassignConflictingIds(void);
106
107 protected:
108 // From CSerialUserOp
109 virtual void UserOp_Assign(const CSerialUserOp& source);
110 virtual bool UserOp_Equals(const CSerialUserOp& object) const;
111 private:
112 // Prohibit copy constructor and assignment operator
113 CSeq_entry(const CSeq_entry& value);
114 CSeq_entry& operator= (const CSeq_entry& value);
115
116 // Upper-level Seq-entry
117 CSeq_entry* m_ParentEntry;
118 };
119
120
121 /////////////////// CSeq_entry inline methods
122
123 // constructor
124 inline
CSeq_entry(void)125 CSeq_entry::CSeq_entry(void)
126 : m_ParentEntry(0)
127 {
128 }
129
130 inline
GetParentEntry(void) const131 CSeq_entry* CSeq_entry::GetParentEntry(void) const
132 {
133 return m_ParentEntry;
134 }
135
136 /////////////////// end of CSeq_entry inline methods
137
138
139 END_objects_SCOPE // namespace ncbi::objects::
140
141 END_NCBI_SCOPE
142
143 #endif // OBJECTS_SEQSET_SEQ_ENTRY_HPP
144 /* Original file checksum: lines: 85, chars: 2245, CRC32: 986b11b7 */
145