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

Go to the SVN repository for this file.

1 /* $Id: Packed_seqint.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_PACKED_SEQINT_HPP
38 #define OBJECTS_SEQLOC_PACKED_SEQINT_HPP
39 
40 
41 // generated includes
44 #include <util/range.hpp>
45 
46 
47 // generated classes
48 
50 
51 BEGIN_objects_SCOPE // namespace ncbi::objects::
52 
53 class CSeq_id;
54 
55 
57 {
59 public:
60  typedef CSeq_id TId;
62  typedef vector< CRange<TSeqPos> > TRanges;
63 
64  // constructor
65  CPacked_seqint(void);
66  CPacked_seqint(TId& id, const TRanges& ivals,
67  TStrand strand = eNa_strand_unknown);
68 
69  // destructor
70  ~CPacked_seqint(void);
71 
72  // get the length of the pieces
73  TSeqPos GetLength(void) const;
74 
75  // check start or stop end of location for e_Lim fuzz
76  bool IsPartialStart(ESeqLocExtremes ext) const;
77  bool IsPartialStop (ESeqLocExtremes ext) const;
78 
79  // set / remove e_Lim fuzz on start or stop end
80  void SetPartialStart(bool val, ESeqLocExtremes ext);
81  void SetPartialStop (bool val, ESeqLocExtremes ext);
82 
83  /// check if parts of the seq-loc are missing
84  bool IsTruncatedStart(ESeqLocExtremes ext) const;
85  bool IsTruncatedStop (ESeqLocExtremes ext) const;
86 
87  /// set / remove e_Lim fuzz on start or stop
88  /// (tl/tr - indicating removed parts of the seq-loc)
89  void SetTruncatedStart(bool val, ESeqLocExtremes ext);
90  void SetTruncatedStop (bool val, ESeqLocExtremes ext);
91 
92  /// for convenience
93  void AddInterval(const CSeq_interval& ival);
94  void AddInterval(const CSeq_id& id, TSeqPos from, TSeqPos to,
95  TStrand strand = eNa_strand_unknown);
96  void AddIntervals(const CPacked_seqint& ivals);
97  void AddIntervals(const Tdata& ivals);
98 
99  bool IsSetStrand(EIsSetStrand flag = eIsSetStrand_Any) const;
100  ENa_strand GetStrand(void) const;
101  bool IsReverseStrand(void) const;
102  TSeqPos GetStart(ESeqLocExtremes ext) const;
103  TSeqPos GetStop (ESeqLocExtremes ext) const;
104 
105  const CSeq_interval* GetStartInt(ESeqLocExtremes ext) const;
106  const CSeq_interval* GetStopInt (ESeqLocExtremes ext) const;
107  CSeq_interval* SetStartInt(ESeqLocExtremes ext);
108  CSeq_interval* SetStopInt (ESeqLocExtremes ext);
109 
110  /// Set the strand for all of the location's ranges.
111  void SetStrand(ENa_strand strand);
112  /// Reset the strand to 'not set'
113  void ResetStrand(void);
114 
115  /// Flip the strand (e.g. plus to minus)
116  void FlipStrand(void);
117 
118 private:
119  // Prihibit copy constructor & assignment operator
122 };
123 
124 
125 
126 /////////////////// CPacked_seqint inline methods
127 
128 // constructor
129 inline
131 {
132 }
133 
134 inline
136 {
137  return IsReverse(GetStrand());
138 }
139 
140 /////////////////// end of CPacked_seqint inline methods
141 
142 
143 END_objects_SCOPE // namespace ncbi::objects::
144 
146 
147 #endif // OBJECTS_SEQLOC_PACKED_SEQINT_HPP
bool IsReverse(ENa_strand s)
Definition: Na_strand.hpp:75
ESeqLocExtremes
Used to determine the meaning of a location's Start/Stop positions.
Definition: Na_strand.hpp:61
EIsSetStrand
Flag used by IsSetStrand() to switch between any/all modes.
Definition: Na_strand.hpp:51
@ eIsSetStrand_Any
Check if any part has strand.
Definition: Na_strand.hpp:52
Data storage class.
CPacked_seqint_Base –.
CPacked_seqint(const CPacked_seqint &)
CPacked_seqint_Base Tparent
ENa_strand TStrand
bool IsReverseStrand(void) const
vector< CRange< TSeqPos > > TRanges
ENa_strand GetStrand(void) const
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.
ENa_strand GetStrand(const CSeq_loc &loc, CScope *scope=0)
Returns eNa_strand_unknown if multiple Bioseqs in loc Returns eNa_strand_other if multiple strands in...
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
CPacked_seqint_Base & operator=(const CPacked_seqint_Base &)
list< CRef< CSeq_interval > > Tdata
ENa_strand
strand of nucleic acid
Definition: Na_strand_.hpp:64
@ eNa_strand_unknown
Definition: Na_strand_.hpp:65
void AddInterval(TRangeVec &intervals, TSeqPos from, TSeqPos to, bool from_fuzz=false, bool to_fuzz=false)
Definition: orf.cpp:102
Modified on Fri Sep 20 14:58:10 2024 by modify_doxy.py rev. 669887