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

Go to the SVN repository for this file.

1 /* $Id: Seq_loc_mix.hpp 53956 2012-04-27 17:47:52Z 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_LOC_MIX_HPP
38 #define OBJECTS_SEQLOC_SEQ_LOC_MIX_HPP
39 
40 // generated includes
42 
44 
45 // generated classes
46 
48 
49 BEGIN_objects_SCOPE // namespace ncbi::objects::
50 
51 class CSeq_id;
52 
53 
55 {
57 public:
58  // constructor
59  CSeq_loc_mix(void);
60  // destructor
61  ~CSeq_loc_mix(void);
62 
63  //
64  // See related function in util/sequence.hpp:
65  //
66  // TSeqPos GetLength(const CSeq_loc_mix&, CScope*)
67  //
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  // Add a Seq-loc to the mix.
87  // NB: This is just a structural change, no guarantees as to the biological
88  // validity of the data are made.
89  // See sequence::MergeLocations(..) for context aware function.
90  void AddSeqLoc(const CSeq_loc& other);
91  void AddSeqLoc(CSeq_loc& other);
92  // convenience function; automatically optimizes down points
93  void AddInterval(const CSeq_id& id, TSeqPos from, TSeqPos to,
95 
96  bool IsSetStrand(EIsSetStrand flag = eIsSetStrand_Any) const;
97  ENa_strand GetStrand(void) const;
98  bool IsReverseStrand(void) const;
99  TSeqPos GetStart(ESeqLocExtremes ext) const;
100  TSeqPos GetStop (ESeqLocExtremes ext) const;
101 
102  // GetStartLoc/GetStopLoc set of methods is valid only for non-empty
103  // mix location.
106  eNullSegSkip
107  };
108  const CSeq_loc* GetFirstLoc(ENullSegType null_seg = eNullSegAllow) const;
109  const CSeq_loc* GetLastLoc (ENullSegType null_seg = eNullSegAllow) const;
110  CSeq_loc* SetFirstLoc(ENullSegType null_seg = eNullSegAllow);
111  CSeq_loc* SetLastLoc (ENullSegType null_seg = eNullSegAllow);
112  const CSeq_loc* GetStartLoc(ESeqLocExtremes ext,
113  ENullSegType null_seg = eNullSegAllow) const;
114  const CSeq_loc* GetStopLoc (ESeqLocExtremes ext,
115  ENullSegType null_seg = eNullSegAllow) const;
116  CSeq_loc* SetStartLoc(ESeqLocExtremes ext,
117  ENullSegType null_seg = eNullSegAllow);
118  CSeq_loc* SetStopLoc (ESeqLocExtremes ext,
119  ENullSegType null_seg = eNullSegAllow);
120 
121  /// Set the strand for all of the location's ranges.
122  void SetStrand(ENa_strand strand);
123 
124  /// Reset the strand to 'not set'
125  void ResetStrand(void);
126 
127  /// Flip the strand (e.g. plus to minus)
128  void FlipStrand(void);
129 
130 private:
131  // Prohibit copy constructor & assignment operator
134 
135 };
136 
137 
138 
139 /////////////////// CSeq_loc_mix inline methods
140 
141 inline
143 {
144  return IsReverse(GetStrand());
145 }
146 
147 /////////////////// end of CSeq_loc_mix inline methods
148 
149 
150 END_objects_SCOPE // namespace ncbi::objects::
151 
153 
154 #endif // OBJECTS_SEQLOC_SEQ_LOC_MIX_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.
this will hold anything
bool IsReverseStrand(void) const
ENa_strand GetStrand(void) const
CSeq_loc_mix(const CSeq_loc_mix &)
CSeq_loc_mix_Base Tparent
Definition: Seq_loc_mix.hpp:56
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.
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
ENa_strand
strand of nucleic acid
Definition: Na_strand_.hpp:64
CSeq_loc_mix_Base & operator=(const CSeq_loc_mix_Base &)
@ 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 Mon May 13 04:35:42 2024 by modify_doxy.py rev. 669887