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

Go to the SVN repository for this file.

1 /* $Id: Seq_interval.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 // standard includes
38 #include <ncbi_pch.hpp>
40 
41 // generated includes
43 
44 // generated classes
45 
47 
48 BEGIN_objects_SCOPE // namespace ncbi::objects::
49 
50 // destructor
52 {
53 }
54 
55 
57 {
58  return IsSetStrand() && IsReverse(GetStrand());
59 }
60 
61 
63 {
64  if (ext == eExtreme_Biological && x_IsMinusStrand()) {
65  if (IsSetFuzz_to()) {
66  const CInt_fuzz& ifp = GetFuzz_to();
67  if (ifp.IsLim() && ifp.GetLim() == CInt_fuzz::eLim_gt) {
68  return true;
69  }
70  }
71  } else {
72  if (IsSetFuzz_from()) {
73  const CInt_fuzz& ifp = GetFuzz_from();
74  if (ifp.IsLim() && ifp.GetLim() == CInt_fuzz::eLim_lt) {
75  return true;
76  }
77  }
78  }
79  return false;
80 }
81 
83 {
84  if (ext == eExtreme_Biological && x_IsMinusStrand()) {
85  if (IsSetFuzz_from()) {
86  const CInt_fuzz& ifp = GetFuzz_from();
87  if (ifp.IsLim() && ifp.GetLim() == CInt_fuzz::eLim_lt) {
88  return true;
89  }
90  }
91  } else {
92  if (IsSetFuzz_to()) {
93  const CInt_fuzz& ifp = GetFuzz_to();
94  if (ifp.IsLim() && ifp.GetLim() == CInt_fuzz::eLim_gt) {
95  return true;
96  }
97  }
98  }
99  return false;
100 }
101 
102 
103 // set / remove e_Lim fuzz on left (5') or right (3') end
105 {
106  if (val != IsPartialStart(ext)) {
107  if (val) {
108  if (ext == eExtreme_Biological && x_IsMinusStrand()) {
110  } else {
112  }
113  } else {
114  if (ext == eExtreme_Biological && x_IsMinusStrand()) {
115  ResetFuzz_to();
116  } else {
117  ResetFuzz_from();
118  }
119  }
120  }
121  _ASSERT(val == IsPartialStart(ext));
122 }
123 
124 
126 {
127  if (val != IsPartialStop(ext)) {
128  if (val) {
129  if (ext == eExtreme_Biological && x_IsMinusStrand()) {
131  } else {
133  }
134  } else {
135  if (ext == eExtreme_Biological && x_IsMinusStrand()) {
136  ResetFuzz_from();
137  } else {
138  ResetFuzz_to();
139  }
140  }
141  }
142  _ASSERT(val == IsPartialStop(ext));
143 }
144 
145 
147 {
148  if (ext == eExtreme_Biological && x_IsMinusStrand()) {
149  if (IsSetFuzz_to()) {
150  const CInt_fuzz& ifp = GetFuzz_to();
151  if (ifp.IsLim() && ifp.GetLim() == CInt_fuzz::eLim_tr) {
152  return true;
153  }
154  }
155  } else {
156  if (IsSetFuzz_from()) {
157  const CInt_fuzz& ifp = GetFuzz_from();
158  if (ifp.IsLim() && ifp.GetLim() == CInt_fuzz::eLim_tl) {
159  return true;
160  }
161  }
162  }
163  return false;
164 }
165 
166 
168 {
169  if (ext == eExtreme_Biological && x_IsMinusStrand()) {
170  if (IsSetFuzz_from()) {
171  const CInt_fuzz& ifp = GetFuzz_from();
172  if (ifp.IsLim() && ifp.GetLim() == CInt_fuzz::eLim_tl) {
173  return true;
174  }
175  }
176  } else {
177  if (IsSetFuzz_to()) {
178  const CInt_fuzz& ifp = GetFuzz_to();
179  if (ifp.IsLim() && ifp.GetLim() == CInt_fuzz::eLim_tr) {
180  return true;
181  }
182  }
183  }
184  return false;
185 }
186 
187 
189 {
190  if (val != IsTruncatedStart(ext)) {
191  if (val) {
192  if (ext == eExtreme_Biological && x_IsMinusStrand()) {
194  } else {
196  }
197  } else {
198  if (ext == eExtreme_Biological && x_IsMinusStrand()) {
199  ResetFuzz_to();
200  } else {
201  ResetFuzz_from();
202  }
203  }
204  }
205  _ASSERT(val == IsTruncatedStart(ext));
206 }
207 
208 
210 {
211  if (val != IsTruncatedStop(ext)) {
212  if (val) {
213  if (ext == eExtreme_Biological && x_IsMinusStrand()) {
215  } else {
217  }
218  } else {
219  if (ext == eExtreme_Biological && x_IsMinusStrand()) {
220  ResetFuzz_from();
221  } else {
222  ResetFuzz_to();
223  }
224  }
225  }
226  _ASSERT(val == IsTruncatedStop(ext));
227 }
228 
229 
231 {
232  return ext == eExtreme_Biological && x_IsMinusStrand()?
233  GetTo(): GetFrom();
234 }
235 
236 
238 {
239  return ext == eExtreme_Biological && x_IsMinusStrand()?
240  GetFrom(): GetTo();
241 }
242 
243 
245 {
246  if (IsSetStrand()) {
248  } else {
250  }
251 }
252 
253 
254 END_objects_SCOPE // namespace ncbi::objects::
255 
257 
258 /* Original file checksum: lines: 61, chars: 1895, CRC32: 81b5bfaa */
bool IsReverse(ENa_strand s)
Definition: Na_strand.hpp:75
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_Biological
5' and 3'
Definition: Na_strand.hpp:62
bool IsTruncatedStop(ESeqLocExtremes ext) const
bool IsPartialStop(ESeqLocExtremes ext) const
void SetTruncatedStart(bool val, ESeqLocExtremes ext)
set / remove e_Lim fuzz on start or stop (tl/tr - indicating removed parts of the seq-loc)
TSeqPos GetStart(ESeqLocExtremes ext) const
bool x_IsMinusStrand(void) const
bool IsPartialStart(ESeqLocExtremes ext) const
~CSeq_interval(void)
bool IsTruncatedStart(ESeqLocExtremes ext) const
check if parts of the seq-loc are missing
TSeqPos GetStop(ESeqLocExtremes ext) const
void SetTruncatedStop(bool val, ESeqLocExtremes ext)
void SetPartialStart(bool val, ESeqLocExtremes ext)
void SetPartialStop(bool val, ESeqLocExtremes ext)
void FlipStrand(void)
unsigned int TSeqPos
Type for sequence locations and lengths.
Definition: ncbimisc.hpp:875
#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
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
const TFuzz_from & GetFuzz_from(void) const
Get the Fuzz_from member data.
void ResetFuzz_to(void)
Reset Fuzz_to data member.
TFuzz_from & SetFuzz_from(void)
Assign a value to Fuzz_from data member.
const TFuzz_to & GetFuzz_to(void) const
Get the Fuzz_to member data.
TFrom GetFrom(void) const
Get the From member data.
TFuzz_to & SetFuzz_to(void)
Assign a value to Fuzz_to data member.
TStrand & SetStrand(void)
Assign a value to Strand data member.
void ResetFuzz_from(void)
Reset Fuzz_from data member.
bool IsSetStrand(void) const
Check if a value has been assigned to Strand data member.
bool IsSetFuzz_to(void) const
Check if a value has been assigned to Fuzz_to data member.
TStrand GetStrand(void) const
Get the Strand member data.
TTo GetTo(void) const
Get the To member data.
bool IsSetFuzz_from(void) const
Check if a value has been assigned to Fuzz_from data member.
@ eNa_strand_minus
Definition: Na_strand_.hpp:67
#define _ASSERT
Modified on Wed May 22 11:33:23 2024 by modify_doxy.py rev. 669887