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

Go to the SVN repository for this file.

1 /* $Id: Na_strand.hpp 41149 2009-02-24 16:54:29Z grichenk $
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: Aaron Ucko, NCBI
27  *
28  * File Description:
29  * Simple utilities for deducing directions
30  *
31  * Remark:
32  * This code was originally generated by application DATATOOL
33  * using specifications from the data definition file
34  * 'seqloc.asn'.
35  */
36 
37 #ifndef OBJECTS_SEQLOC_NA_STRAND_HPP
38 #define OBJECTS_SEQLOC_NA_STRAND_HPP
39 
40 
41 // generated includes
43 
44 // generated classes
45 
47 
48 BEGIN_objects_SCOPE // namespace ncbi::objects::
49 
50 /// Flag used by IsSetStrand() to switch between any/all modes.
52  eIsSetStrand_Any, ///< Check if any part has strand
53  eIsSetStrand_All ///< Check if all parts have strand
54 };
55 
56 /// Used to determine the meaning of a location's Start/Stop positions.
57 /// On the minus strand the numerical values are different than the
58 /// biological ones.
59 /// @sa
60 /// CSeq_loc::GetStart(), CSeq_loc::GetStop()
62  eExtreme_Biological, ///< 5' and 3'
63  eExtreme_Positional ///< numerical value
64 };
65 
66 
67 inline
69 {
70  return (s == eNa_strand_plus || s == eNa_strand_both);
71 }
72 
73 
74 inline
76 {
77  // treat unknown as forward
78  return (s == eNa_strand_minus || s == eNa_strand_both_rev);
79 }
80 
81 
82 inline
84 {
85  return IsReverse(a) == IsReverse(b);
86 }
87 
88 
89 inline
91 {
92  switch ( s ) {
93  case eNa_strand_unknown: // defaults to plus
94  case eNa_strand_plus:
95  return eNa_strand_minus;
96  case eNa_strand_minus:
97  return eNa_strand_plus;
98  case eNa_strand_both:
99  return eNa_strand_both_rev;
100  case eNa_strand_both_rev:
101  return eNa_strand_both;
102  default:
103  return s;
104  }
105 }
106 
107 
108 END_objects_SCOPE // namespace ncbi::objects::
109 
111 
112 #endif // OBJECTS_SEQLOC_NA_STRAND_HPP
113 /* Original file checksum: lines: 63, chars: 1928, CRC32: 1071d9d3 */
bool IsForward(ENa_strand s)
Definition: Na_strand.hpp:68
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_Positional
numerical value
Definition: Na_strand.hpp:63
@ eExtreme_Biological
5' and 3'
Definition: Na_strand.hpp:62
EIsSetStrand
Flag used by IsSetStrand() to switch between any/all modes.
Definition: Na_strand.hpp:51
@ eIsSetStrand_All
Check if all parts have strand.
Definition: Na_strand.hpp:53
@ eIsSetStrand_Any
Check if any part has strand.
Definition: Na_strand.hpp:52
bool SameOrientation(ENa_strand a, ENa_strand b)
Definition: Na_strand.hpp:83
Data storage class.
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
ENa_strand
strand of nucleic acid
Definition: Na_strand_.hpp:64
@ eNa_strand_plus
Definition: Na_strand_.hpp:66
@ 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
@ eNa_strand_both
in forward orientation
Definition: Na_strand_.hpp:68
unsigned int a
Definition: ncbi_localip.c:102
Modified on Wed Apr 17 13:08:42 2024 by modify_doxy.py rev. 669887