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

Go to the SVN repository for this file.

1 /* $Id$
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  */
27 
28 /// @file Molecule_graph_.hpp
29 /// Data storage class.
30 ///
31 /// This file was generated by application DATATOOL
32 /// using the following specifications:
33 /// <a href="/IEB/ToolBox/CPP_DOC/lxr/source/src/objects/mmdb1/mmdb1.asn">mmdb1.asn</a>
34 /// and additional tune-up parameters:
35 /// <a href="/IEB/ToolBox/CPP_DOC/lxr/source/src/objects/mmdb1/mmdb1.def">mmdb1.def</a>
36 ///
37 /// ATTENTION:
38 /// Don't edit or commit this file into CVS as this file will
39 /// be overridden (by DATATOOL) without warning!
40 
41 #ifndef OBJECTS_MMDB1_MOLECULE_GRAPH_BASE_HPP
42 #define OBJECTS_MMDB1_MOLECULE_GRAPH_BASE_HPP
43 
44 // standard includes
45 #include <serial/serialbase.hpp>
46 
47 // generated includes
48 #include <list>
51 
53 
54 #ifndef BEGIN_objects_SCOPE
55 # define BEGIN_objects_SCOPE BEGIN_SCOPE(objects)
56 # define END_objects_SCOPE END_SCOPE(objects)
57 #endif
58 BEGIN_objects_SCOPE // namespace ncbi::objects::
59 
60 
61 // forward declarations
62 class CBiomol_descr;
64 class CResidue;
65 class CSeq_id;
66 
67 
68 // generated classes
69 
70 
71 /** @addtogroup dataspec_MMDB_Chemical_graph
72  *
73  * @{
74  */
75 
76 /////////////////////////////////////////////////////////////////////////////
77 /// A molecule chemical graph is defined by a sequence of residues. Nonpolymers
78 /// are described in the same way, but may contain only a single residue.
79 /// Biopolymer molecules are identified within PDB entries according to their
80 /// appearance on SEQRES records, which formally define a biopolymer as such.
81 /// Biopolymers are defined by the distinction between ATOM and HETATM
82 /// coordinate records only in cases where the chemical sequence from SEQRES
83 /// is in conflict with coordinate data. The PDB-assigned chain code appears as
84 /// the name within the molecule descriptions of the biopolymers.
85 /// Nonpolymer molecules from PDB correspond to individual HETEROGEN groups,
86 /// excluding any HETEROGEN groups which represent modified biopolymer residues.
87 /// These molecules are named according to the chain, residue type and residue
88 /// number fields as assigned by PDB. Any description appearing in the PDB HET
89 /// record appears as a pdb-comment within the molecule description.
90 /// Molecule types for PDB-derived molecule graphs are assigned by matching
91 /// residue and atom names against the PDB-documented standard types for protein,
92 /// DNA and RNA, and against residue codes commonly used to indicate solvent.
93 /// Classification is by "majority rule". If more than half of the residues in
94 /// a biopolymer are standard groups of one type, then the molecule is of that
95 /// type, and otherwise classified as "other". Note that this classification does
96 /// not preclude the presence of modified residues, but insists they constitute
97 /// less than half the biopolymer. Non-polymers are classified only as "solvent"
98 /// or "other".
99 /// Note that a molecule graph may also contain a set of cross references
100 /// to biopolymer sequence databases. All biopolymer molecules in MMDB contain
101 /// appropriate identifiers for the corresponding entry in the NCBI-Sequences
102 /// database, in particular the NCBI "gi" number, which may be used for sequence
103 /// retrieval. The Seq-id object type is defined in the NCBI molecular sequence
104 /// specification, and not repeated here.
105 ///
106 /// CMolecule_graph_Base --
107 ///
108 
110 {
112 public:
113  // constructor
114  CMolecule_graph_Base(void);
115  // destructor
116  virtual ~CMolecule_graph_Base(void);
117 
118  // type info
120 
121  // types
122  typedef CMolecule_id TId;
123  typedef list< CRef< CBiomol_descr > > TDescr;
124  typedef CSeq_id TSeq_id;
125  typedef list< CRef< CResidue > > TResidue_sequence;
126  typedef list< CRef< CInter_residue_bond > > TInter_residue_bonds;
128 
129  // member index
130  enum class E_memberIndex {
131  e__allMandatory = 0,
132  e_id,
133  e_descr,
134  e_seq_id,
135  e_residue_sequence,
136  e_inter_residue_bonds,
137  e_sid
138  };
140 
141  // getters
142  // setters
143 
144  /// Check if a value has been assigned to Id data member.
145  ///
146  /// Data member Id is mandatory;
147  /// its type is defined as 'typedef CMolecule_id TId'
148  /// @return
149  /// - true, if a value has been assigned.
150  /// - false, otherwise.
151  bool IsSetId(void) const;
152 
153  /// Check if it is safe to call GetId method.
154  ///
155  /// @return
156  /// - true, if the data member is getatable.
157  /// - false, otherwise.
158  bool CanGetId(void) const;
159 
160  /// Reset Id data member.
161  void ResetId(void);
162 
163  /// Get the Id member data.
164  ///
165  /// @return
166  /// Reference to the member data.
167  const TId& GetId(void) const;
168 
169  /// Assign a value to Id data member.
170  ///
171  /// @param value
172  /// Value to assign
173  void SetId(const TId& value);
174 
175  /// Assign a value to Id data member.
176  ///
177  /// @return
178  /// Reference to the data value.
179  TId& SetId(void);
180 
181  /// Check if a value has been assigned to Descr data member.
182  ///
183  /// Data member Descr is optional;
184  /// its type is defined as 'typedef list< CRef< CBiomol_descr > > TDescr'
185  /// @return
186  /// - true, if a value has been assigned.
187  /// - false, otherwise.
188  bool IsSetDescr(void) const;
189 
190  /// Check if it is safe to call GetDescr method.
191  ///
192  /// @return
193  /// - true, if the data member is getatable.
194  /// - false, otherwise.
195  bool CanGetDescr(void) const;
196 
197  /// Reset Descr data member.
198  void ResetDescr(void);
199 
200  /// Get the Descr member data.
201  ///
202  /// @return
203  /// Reference to the member data.
204  const TDescr& GetDescr(void) const;
205 
206  /// Assign a value to Descr data member.
207  ///
208  /// @return
209  /// Reference to the data value.
210  TDescr& SetDescr(void);
211 
212  /// Check if a value has been assigned to Seq_id data member.
213  ///
214  /// Data member Seq_id is optional;
215  /// its type is defined as 'typedef CSeq_id TSeq_id'
216  /// @return
217  /// - true, if a value has been assigned.
218  /// - false, otherwise.
219  bool IsSetSeq_id(void) const;
220 
221  /// Check if it is safe to call GetSeq_id method.
222  ///
223  /// @return
224  /// - true, if the data member is getatable.
225  /// - false, otherwise.
226  bool CanGetSeq_id(void) const;
227 
228  /// Reset Seq_id data member.
229  void ResetSeq_id(void);
230 
231  /// Get the Seq_id member data.
232  ///
233  /// @return
234  /// Reference to the member data.
235  const TSeq_id& GetSeq_id(void) const;
236 
237  /// Assign a value to Seq_id data member.
238  ///
239  /// @param value
240  /// Reference to value.
241  void SetSeq_id(TSeq_id& value);
242 
243  /// Assign a value to Seq_id data member.
244  ///
245  /// @return
246  /// Reference to the data value.
247  TSeq_id& SetSeq_id(void);
248 
249  /// Check if a value has been assigned to Residue_sequence data member.
250  ///
251  /// Data member Residue_sequence is mandatory;
252  /// its type is defined as 'typedef list< CRef< CResidue > > TResidue_sequence'
253  /// @return
254  /// - true, if a value has been assigned.
255  /// - false, otherwise.
256  bool IsSetResidue_sequence(void) const;
257 
258  /// Check if it is safe to call GetResidue_sequence method.
259  ///
260  /// @return
261  /// - true, if the data member is getatable.
262  /// - false, otherwise.
263  bool CanGetResidue_sequence(void) const;
264 
265  /// Reset Residue_sequence data member.
266  void ResetResidue_sequence(void);
267 
268  /// Get the Residue_sequence member data.
269  ///
270  /// @return
271  /// Reference to the member data.
272  const TResidue_sequence& GetResidue_sequence(void) const;
273 
274  /// Assign a value to Residue_sequence data member.
275  ///
276  /// @return
277  /// Reference to the data value.
278  TResidue_sequence& SetResidue_sequence(void);
279 
280  /// Check if a value has been assigned to Inter_residue_bonds data member.
281  ///
282  /// Data member Inter_residue_bonds is optional;
283  /// its type is defined as 'typedef list< CRef< CInter_residue_bond > > TInter_residue_bonds'
284  /// @return
285  /// - true, if a value has been assigned.
286  /// - false, otherwise.
287  bool IsSetInter_residue_bonds(void) const;
288 
289  /// Check if it is safe to call GetInter_residue_bonds method.
290  ///
291  /// @return
292  /// - true, if the data member is getatable.
293  /// - false, otherwise.
294  bool CanGetInter_residue_bonds(void) const;
295 
296  /// Reset Inter_residue_bonds data member.
297  void ResetInter_residue_bonds(void);
298 
299  /// Get the Inter_residue_bonds member data.
300  ///
301  /// @return
302  /// Reference to the member data.
303  const TInter_residue_bonds& GetInter_residue_bonds(void) const;
304 
305  /// Assign a value to Inter_residue_bonds data member.
306  ///
307  /// @return
308  /// Reference to the data value.
309  TInter_residue_bonds& SetInter_residue_bonds(void);
310 
311  /// Check if a value has been assigned to Sid data member.
312  ///
313  /// Data member Sid is optional;
314  /// its type is defined as 'typedef CPCSubstance_id TSid'
315  /// @return
316  /// - true, if a value has been assigned.
317  /// - false, otherwise.
318  bool IsSetSid(void) const;
319 
320  /// Check if it is safe to call GetSid method.
321  ///
322  /// @return
323  /// - true, if the data member is getatable.
324  /// - false, otherwise.
325  bool CanGetSid(void) const;
326 
327  /// Reset Sid data member.
328  void ResetSid(void);
329 
330  /// Get the Sid member data.
331  ///
332  /// @return
333  /// Reference to the member data.
334  const TSid& GetSid(void) const;
335 
336  /// Assign a value to Sid data member.
337  ///
338  /// @param value
339  /// Value to assign
340  void SetSid(const TSid& value);
341 
342  /// Assign a value to Sid data member.
343  ///
344  /// @return
345  /// Reference to the data value.
346  TSid& SetSid(void);
347 
348  /// Reset the whole object
349  virtual void Reset(void);
350 
351 
352 private:
353  // Prohibit copy constructor and assignment operator
356 
357  // data
358  Uint4 m_set_State[1];
360  list< CRef< CBiomol_descr > > m_Descr;
362  list< CRef< CResidue > > m_Residue_sequence;
363  list< CRef< CInter_residue_bond > > m_Inter_residue_bonds;
365 };
366 
367 /* @} */
368 
369 
370 
371 
372 
373 ///////////////////////////////////////////////////////////
374 ///////////////////// inline methods //////////////////////
375 ///////////////////////////////////////////////////////////
376 inline
378 {
379  return ((m_set_State[0] & 0x3) != 0);
380 }
381 
382 inline
384 {
385  return IsSetId();
386 }
387 
388 inline
390 {
391  m_Id = CMolecule_id(0);
392  m_set_State[0] &= ~0x3;
393 }
394 
395 inline
397 {
398  if (!CanGetId()) {
399  ThrowUnassigned(0);
400  }
401  return m_Id;
402 }
403 
404 inline
406 {
407  m_Id = value;
408  m_set_State[0] |= 0x3;
409 }
410 
411 inline
413 {
414  m_set_State[0] |= 0x1;
415  return m_Id;
416 }
417 
418 inline
420 {
421  return ((m_set_State[0] & 0xc) != 0);
422 }
423 
424 inline
426 {
427  return true;
428 }
429 
430 inline
432 {
433  return m_Descr;
434 }
435 
436 inline
438 {
439  m_set_State[0] |= 0x4;
440  return m_Descr;
441 }
442 
443 inline
445 {
446  return m_Seq_id.NotEmpty();
447 }
448 
449 inline
451 {
452  return IsSetSeq_id();
453 }
454 
455 inline
457 {
458  if (!CanGetSeq_id()) {
459  ThrowUnassigned(2);
460  }
461  return (*m_Seq_id);
462 }
463 
464 inline
466 {
467  return ((m_set_State[0] & 0xc0) != 0);
468 }
469 
470 inline
472 {
473  return true;
474 }
475 
476 inline
478 {
479  return m_Residue_sequence;
480 }
481 
482 inline
484 {
485  m_set_State[0] |= 0x40;
486  return m_Residue_sequence;
487 }
488 
489 inline
491 {
492  return ((m_set_State[0] & 0x300) != 0);
493 }
494 
495 inline
497 {
498  return true;
499 }
500 
501 inline
503 {
504  return m_Inter_residue_bonds;
505 }
506 
507 inline
509 {
510  m_set_State[0] |= 0x100;
511  return m_Inter_residue_bonds;
512 }
513 
514 inline
516 {
517  return ((m_set_State[0] & 0xc00) != 0);
518 }
519 
520 inline
522 {
523  return IsSetSid();
524 }
525 
526 inline
528 {
529  m_Sid = CPCSubstance_id(0);
530  m_set_State[0] &= ~0xc00;
531 }
532 
533 inline
535 {
536  if (!CanGetSid()) {
537  ThrowUnassigned(5);
538  }
539  return m_Sid;
540 }
541 
542 inline
544 {
545  m_Sid = value;
546  m_set_State[0] |= 0xc00;
547 }
548 
549 inline
551 {
552  m_set_State[0] |= 0x400;
553  return m_Sid;
554 }
555 
556 ///////////////////////////////////////////////////////////
557 ////////////////// end of inline methods //////////////////
558 ///////////////////////////////////////////////////////////
559 
560 
561 
562 
563 
564 END_objects_SCOPE // namespace ncbi::objects::
565 
567 
568 
569 #endif // OBJECTS_MMDB1_MOLECULE_GRAPH_BASE_HPP
User-defined methods of the data storage class.
User-defined methods of the data storage class.
CBiomol_descr –.
CInter_residue_bond –.
A molecule chemical graph is defined by a sequence of residues.
CMolecule_id –.
Definition: Molecule_id.hpp:66
CPCSubstance_id –.
CRef –.
Definition: ncbiobj.hpp:618
CResidue –.
Definition: Residue.hpp:66
Base class for all serializable objects.
Definition: serialbase.hpp:150
void ThrowUnassigned(TMemberIndex index) const
const CSeq_id & GetId(const CSeq_loc &loc, CScope *scope)
If all CSeq_ids embedded in CSeq_loc refer to the same CBioseq, returns the first CSeq_id found,...
uint32_t Uint4
4-byte (32-bit) unsigned integer
Definition: ncbitype.h:103
#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_MMDB1_EXPORT
Definition: ncbi_export.h:624
bool IsSetInter_residue_bonds(void) const
Check if a value has been assigned to Inter_residue_bonds data member.
const TSid & GetSid(void) const
Get the Sid member data.
list< CRef< CResidue > > m_Residue_sequence
void ResetSid(void)
Reset Sid data member.
list< CRef< CBiomol_descr > > m_Descr
bool IsSetId(void) const
Check if a value has been assigned to Id data member.
CMolecule_graph_Base(const CMolecule_graph_Base &)
bool CanGetResidue_sequence(void) const
Check if it is safe to call GetResidue_sequence method.
Tparent::CMemberIndex< E_memberIndex, 7 > TmemberIndex
TId & SetId(void)
Assign a value to Id data member.
TInter_residue_bonds & SetInter_residue_bonds(void)
Assign a value to Inter_residue_bonds data member.
const TDescr & GetDescr(void) const
Get the Descr member data.
bool IsSetDescr(void) const
Check if a value has been assigned to Descr data member.
bool CanGetId(void) const
Check if it is safe to call GetId method.
list< CRef< CInter_residue_bond > > m_Inter_residue_bonds
bool CanGetInter_residue_bonds(void) const
Check if it is safe to call GetInter_residue_bonds method.
bool IsSetResidue_sequence(void) const
Check if a value has been assigned to Residue_sequence data member.
const TSeq_id & GetSeq_id(void) const
Get the Seq_id member data.
TResidue_sequence & SetResidue_sequence(void)
Assign a value to Residue_sequence data member.
bool CanGetSid(void) const
Check if it is safe to call GetSid method.
void ResetId(void)
Reset Id data member.
bool IsSetSid(void) const
Check if a value has been assigned to Sid data member.
const TInter_residue_bonds & GetInter_residue_bonds(void) const
Get the Inter_residue_bonds member data.
TSid & SetSid(void)
Assign a value to Sid data member.
bool CanGetSeq_id(void) const
Check if it is safe to call GetSeq_id method.
TDescr & SetDescr(void)
Assign a value to Descr data member.
list< CRef< CResidue > > TResidue_sequence
list< CRef< CBiomol_descr > > TDescr
const TId & GetId(void) const
Get the Id member data.
bool IsSetSeq_id(void) const
Check if a value has been assigned to Seq_id data member.
const TResidue_sequence & GetResidue_sequence(void) const
Get the Residue_sequence member data.
list< CRef< CInter_residue_bond > > TInter_residue_bonds
bool CanGetDescr(void) const
Check if it is safe to call GetDescr method.
CRef< TSeq_id > m_Seq_id
CMolecule_graph_Base & operator=(const CMolecule_graph_Base &)
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
Modified on Sun May 19 04:46:30 2024 by modify_doxy.py rev. 669887