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

Go to the SVN repository for this file.

1 /* $Id: PDB_seq_id.hpp 88994 2020-02-10 19:22:25Z lanczyck $
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  * 'seqloc.asn'.
35  */
36 
37 #ifndef OBJECTS_SEQLOC_PDB_SEQ_ID_HPP
38 #define OBJECTS_SEQLOC_PDB_SEQ_ID_HPP
39 
40 
41 // generated includes
43 
44 // generated classes
45 
47 
48 BEGIN_objects_SCOPE // namespace ncbi::objects::
49 
51 {
53 public:
54  // constructor
55  CPDB_seq_id(void);
56  // destructor
57  ~CPDB_seq_id(void);
58 
59  // comaprison function
60  bool Match(const CPDB_seq_id& psip2) const;
61  int Compare(const CPDB_seq_id& psip2) const;
62 
63  // format a FASTA style string
64  ostream& AsFastaString(ostream& s) const;
65 
66 
67  // Reset both chain and chain-id.
68  void ResetChainIdentifiers(void);
69 
70  // Sets both 'chain' and 'chain-id'.
71  void SetChainIdentifiers(TChain chainIdentifier);
72 
73  // Sets 'chain' and 'chain-id' to the same value, when possible.
74  // When chainIdentifier is not a single-character, 'chain' is reset to avoid internal inconsistency.
75  // If chainIdentifier is empty, or both 'chain' and 'chain-id' are reset.
76  // If chainIdentifier contains only whitespace:
77  // length == 1: both fields set to ' ' (this is a valid 'chain' value)
78  // length > 1: both 'chain' and 'chain-id' are reset (an invalid 'chain_id' value)
79  void SetChainIdentifiers(const TChain_id& chainIdentifier);
80 
81 
82  // How to define the effective chain identifier when neither 'chain' nor 'chain-id' has been set.
84  eBothUnset_Chain, // a single space ('chain's default value)
85  eBothUnset_ChainId // empty string ('chain-id' does not have a default)
86  };
87 
88  // Return the effective chain identifier string defined as:
89  //
90  // i) 'chain-id', when set;
91  // ii) 'chain', when set;
92  // iii) when neither are set, as per 'bothUnsetPriority'.
93  //
94  // NB: When both 'chain' and 'chain-id' are set there is no guarantee they are consistent.
95  // See also: IsChainConflict
96  string GetEffectiveChain_id(EBothUnsetPriority bothUnsetPriority = eBothUnset_ChainId) const;
97 
98 
99  // "Legacy" encoding represents a lowercase character as the corresponding uppercase character, doubled.
100  // E.g., in GenPept pages chain = 65 = 'a' would be displayed as "AA".
102  eConflictMode_default, // conflicts detected by string comparisons
103  eConflictMode_legacy // ignore conflicts due purely to legacy encoding
104  };
105 
106  // True iff both 'chain' and 'chain-id' are set and the values aren't equivalent according to the
107  // specified conflict mode.
108  // eConflictMode_default : chain = 65 = 'a' and chain-id = "AA" are not equivalent.
109  // eConflictMode_legacy : chain = 65 = 'a' and chain-id = "AA" are considered equivalent.
110  //
111  // Note: eConflictMode_legacy does not require that a lowercase chain value be encoded.
112  bool IsChainConflict(EConflictMode encodingMode = eConflictMode_default) const;
113 
114 
115 private:
116  // Prohibit copy constructor & assignment operator
119 
120 };
121 
122 
123 
124 /////////////////// CPDB_seq_id inline methods
125 
126 // constructor
127 inline
129 {
130 }
131 
132 
133 /////////////////// end of CPDB_seq_id inline methods
134 
135 
136 END_objects_SCOPE // namespace ncbi::objects::
137 
139 
140 
141 #endif // OBJECTS_SEQLOC_PDB_SEQ_ID_HPP
142 /* Original file checksum: lines: 85, chars: 2258, CRC32: 8edce8b4 */
Data storage class.
CPDB_seq_id_Base –.
Definition: PDB_seq_id_.hpp:79
CPDB_seq_id(const CPDB_seq_id &)
CPDB_seq_id_Base Tparent
Definition: PDB_seq_id.hpp:52
@ eConflictMode_default
Definition: PDB_seq_id.hpp:102
CPDB_seq_id(void)
Definition: PDB_seq_id.hpp:128
sequence::ECompare Compare(const CSeq_loc &loc1, const CSeq_loc &loc2, CScope *scope)
Returns the sequence::ECompare containment relationship between CSeq_locs.
#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_SEQLOC_EXPORT
Definition: ncbi_export.h:776
CPDB_seq_id_Base & operator=(const CPDB_seq_id_Base &)
Modified on Sat May 18 11:34:59 2024 by modify_doxy.py rev. 669887