NCBI C++ ToolKit
Packed_seqpnt.cpp
Go to the documentation of this file.

Go to the SVN repository for this file.

1 /* $Id: Packed_seqpnt.cpp 62681 2014-04-29 13:46:53Z bollin $
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 // generated includes
38 #include <ncbi_pch.hpp>
40 //#include <objects/seqloc/Seq_id.hpp>
42 
43 // generated classes
44 
46 
47 BEGIN_objects_SCOPE // namespace ncbi::objects::
48 
49 // destructor
51 {
52 }
53 
54 
56 {
58  if ( IsSetStrand() ) {
59  strand = GetStrand();
60  }
61  return (strand == eNa_strand_minus) || (strand == eNa_strand_both_rev);
62 }
63 
64 
66 {
69 
70  return IsSetFuzz() && GetFuzz().IsLim() && GetFuzz().GetLim() == lim;
71 }
72 
74 {
77 
78  return IsSetFuzz() && GetFuzz().IsLim() && GetFuzz().GetLim() == lim;
79 }
80 
81 
82 // set / remove e_Lim fuzz on start or stop end
84 {
85  if (val == IsPartialStart(ext)) {
86  return;
87  }
88 
89  if (val) {
90  CInt_fuzz::TLim lim =
91  (ext == eExtreme_Biological && x_IsMinusStrand()) ?
93 
94  SetFuzz().SetLim(lim);
95  } else {
96  ResetFuzz();
97  }
98 }
99 
100 
102 {
103  if (val == IsPartialStop(ext)) {
104  return;
105  }
106 
107  if (val) {
108  CInt_fuzz::TLim lim =
109  (ext == eExtreme_Biological && x_IsMinusStrand()) ?
111 
112  SetFuzz().SetLim(lim);
113  } else {
114  ResetFuzz();
115  }
116 }
117 
118 
120 {
123 
124  return IsSetFuzz() && GetFuzz().IsLim() && GetFuzz().GetLim() == lim;
125 }
126 
128 {
131 
132  return IsSetFuzz() && GetFuzz().IsLim() && GetFuzz().GetLim() == lim;
133 }
134 
135 
137 {
138  if (val == IsTruncatedStart(ext)) {
139  return;
140  }
141 
142  if (val) {
143  CInt_fuzz::TLim lim =
144  (ext == eExtreme_Biological && x_IsMinusStrand()) ?
146 
147  SetFuzz().SetLim(lim);
148  } else {
149  ResetFuzz();
150  }
151 }
152 
153 
155 {
156  if (val == IsTruncatedStop(ext)) {
157  return;
158  }
159 
160  if (val) {
161  CInt_fuzz::TLim lim =
162  (ext == eExtreme_Biological && x_IsMinusStrand()) ?
164 
165  SetFuzz().SetLim(lim);
166  } else {
167  ResetFuzz();
168  }
169 }
170 
171 
173 {
174  if (!GetPoints().empty()) {
175  return (ext == eExtreme_Positional && x_IsMinusStrand()) ?
176  GetPoints().back() : GetPoints().front();
177  }
178  return kInvalidSeqPos;
179 }
180 
181 
183 {
184  if (!GetPoints().empty()) {
185  return (ext == eExtreme_Positional && x_IsMinusStrand()) ?
186  GetPoints().front() : GetPoints().back();
187  }
188  return kInvalidSeqPos;
189 }
190 
191 
193 {
194  if (IsSetStrand()) {
196  } else {
198  }
199 }
200 
201 
202 END_objects_SCOPE // namespace ncbi::objects::
203 
205 
206 /* Original file checksum: lines: 61, chars: 1898, CRC32: 2e3ddf82 */
ENa_strand Reverse(ENa_strand s)
Definition: Na_strand.hpp:90
ESeqLocExtremes
Used to determine the meaning of a location's Start/Stop positions.
Definition: Na_strand.hpp:61
@ eExtreme_Positional
numerical value
Definition: Na_strand.hpp:63
@ eExtreme_Biological
5' and 3'
Definition: Na_strand.hpp:62
bool IsTruncatedStop(ESeqLocExtremes ext) const
bool x_IsMinusStrand(void) const
void SetPartialStop(bool val, ESeqLocExtremes ext)
void SetPartialStart(bool val, ESeqLocExtremes ext)
void SetTruncatedStart(bool val, ESeqLocExtremes ext)
set / remove e_Lim fuzz on start or stop (tl/tr - indicating removed parts of the seq-loc)
bool IsPartialStop(ESeqLocExtremes ext) const
TSeqPos GetStop(ESeqLocExtremes ext) const
void FlipStrand(void)
bool IsPartialStart(ESeqLocExtremes ext) const
void SetTruncatedStop(bool val, ESeqLocExtremes ext)
bool IsTruncatedStart(ESeqLocExtremes ext) const
check if parts of the seq-loc are missing
TSeqPos GetStart(ESeqLocExtremes ext) const
unsigned int TSeqPos
Type for sequence locations and lengths.
Definition: ncbimisc.hpp:875
const TSeqPos kInvalidSeqPos
Define special value for invalid sequence position.
Definition: ncbimisc.hpp:878
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
bool IsLim(void) const
Check if variant Lim is selected.
Definition: Int_fuzz_.hpp:636
TLim GetLim(void) const
Get the variant data.
Definition: Int_fuzz_.hpp:642
ELim
some limit value
Definition: Int_fuzz_.hpp:209
TLim & SetLim(void)
Select the variant.
Definition: Int_fuzz_.hpp:649
@ eLim_gt
greater than
Definition: Int_fuzz_.hpp:211
@ eLim_lt
less than
Definition: Int_fuzz_.hpp:212
@ eLim_tl
space to left of position
Definition: Int_fuzz_.hpp:214
@ eLim_tr
space to right of position
Definition: Int_fuzz_.hpp:213
TFuzz & SetFuzz(void)
Assign a value to Fuzz data member.
ENa_strand
strand of nucleic acid
Definition: Na_strand_.hpp:64
TStrand GetStrand(void) const
Get the Strand member data.
TStrand & SetStrand(void)
Assign a value to Strand data member.
bool IsSetStrand(void) const
Check if a value has been assigned to Strand data member.
bool IsSetFuzz(void) const
Check if a value has been assigned to Fuzz data member.
void ResetFuzz(void)
Reset Fuzz data member.
const TPoints & GetPoints(void) const
Get the Points member data.
const TFuzz & GetFuzz(void) const
Get the Fuzz member data.
@ eNa_strand_minus
Definition: Na_strand_.hpp:67
@ eNa_strand_unknown
Definition: Na_strand_.hpp:65
@ eNa_strand_both_rev
in reverse orientation
Definition: Na_strand_.hpp:69
constexpr bool empty(list< Ts... >) noexcept
Modified on Tue Feb 27 05:50:41 2024 by modify_doxy.py rev. 669887