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

Go to the SVN repository for this file.

1 /* $Id: Seq_interval.hpp 48838 2011-03-02 18:19:45Z vasilche $
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_SEQ_INTERVAL_HPP
38 #define OBJECTS_SEQLOC_SEQ_INTERVAL_HPP
39 
40 
41 // generated includes
43 
44 // generated classes
45 
47 
48 BEGIN_objects_SCOPE // namespace ncbi::objects::
49 
51 {
53 public:
54  // See also related function in util/sequence.hpp:
55  //
56  // bool IsValid(const CSeq_interval&, CScope*)
57  //
58 
59  // constructor
60  CSeq_interval(void);
61  CSeq_interval(TId& id, TFrom from, TTo to, TStrand strand = eNa_strand_unknown);
62 
63  // destructor
64  ~CSeq_interval(void);
65 
66  // Get the length of the interval
67  TSeqPos GetLength(void) const;
68 
69  // check start or stop end of location for e_Lim fuzz
70  bool IsPartialStart(ESeqLocExtremes ext) const;
71  bool IsPartialStop (ESeqLocExtremes ext) const;
72 
73  // set / remove e_Lim fuzz on start or stop end
74  void SetPartialStart(bool val, ESeqLocExtremes ext);
75  void SetPartialStop (bool val, ESeqLocExtremes ext);
76 
77  /// check if parts of the seq-loc are missing
78  bool IsTruncatedStart(ESeqLocExtremes ext) const;
79  bool IsTruncatedStop (ESeqLocExtremes ext) const;
80 
81  /// set / remove e_Lim fuzz on start or stop
82  /// (tl/tr - indicating removed parts of the seq-loc)
83  void SetTruncatedStart(bool val, ESeqLocExtremes ext);
84  void SetTruncatedStop (bool val, ESeqLocExtremes ext);
85 
86  TSeqPos GetStart(ESeqLocExtremes ext) const;
87  TSeqPos GetStop (ESeqLocExtremes ext) const;
88 
89  // Flip the strand (e.g. plus to minus)
90  void FlipStrand(void);
91 
92 private:
93  // Prohibit copy constructor & assignment operator
96 
97  bool x_IsMinusStrand(void) const;
98 };
99 
100 
101 
102 /////////////////// CSeq_interval inline methods
103 
104 // constructor
105 inline
107 {
108 }
109 
110 
111 inline
113 {
114  SetId(id);
115  SetFrom(from);
116  SetTo(to);
117  if ( strand != eNa_strand_unknown ) {
118  SetStrand(strand);
119  }
120 }
121 
122 
123 // length return
124 inline
126 {
127  return GetTo() >= GetFrom() ? ((GetTo() - GetFrom()) + 1) : 0;
128 }
129 
130 /////////////////// end of CSeq_interval inline methods
131 
132 
133 END_objects_SCOPE // namespace ncbi::objects::
134 
136 
137 
138 #endif // OBJECTS_SEQLOC_SEQ_INTERVAL_HPP
ESeqLocExtremes
Used to determine the meaning of a location's Start/Stop positions.
Definition: Na_strand.hpp:61
Data storage class.
CSeq_interval_Base –.
TSeqPos GetLength(void) const
CSeq_interval(const CSeq_interval &)
CSeq_interval_Base Tparent
unsigned int TSeqPos
Type for sequence locations and lengths.
Definition: ncbimisc.hpp:875
TSeqPos GetStop(const CSeq_loc &loc, CScope *scope, ESeqLocExtremes ext=eExtreme_Positional)
If only one CBioseq is represented by CSeq_loc, returns the position at the stop of the location.
TSeqPos GetLength(const CSeq_id &id, CScope *scope)
Get sequence length if scope not null, else return max possible TSeqPos.
TSeqPos GetStart(const CSeq_loc &loc, CScope *scope, ESeqLocExtremes ext=eExtreme_Positional)
If only one CBioseq is represented by CSeq_loc, returns the position at the start of the location.
#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
ENa_strand
strand of nucleic acid
Definition: Na_strand_.hpp:64
TFrom GetFrom(void) const
Get the From member data.
TStrand & SetStrand(void)
Assign a value to Strand data member.
TFrom & SetFrom(void)
Assign a value to From data member.
TId & SetId(void)
Assign a value to Id data member.
TTo GetTo(void) const
Get the To member data.
TTo & SetTo(void)
Assign a value to To data member.
CSeq_interval_Base & operator=(const CSeq_interval_Base &)
@ eNa_strand_unknown
Definition: Na_strand_.hpp:65
Modified on Fri Sep 20 14:58:05 2024 by modify_doxy.py rev. 669887