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

Go to the SVN repository for this file.

1 /* $Id: Dense_diag.hpp 68942 2015-09-18 13:33:56Z 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  */
27 
28 /// @file Dense_diag.hpp
29 /// User-defined methods of the data storage class.
30 ///
31 /// This file was originally generated by application DATATOOL
32 /// using the following specifications:
33 /// 'seqalign.asn'.
34 ///
35 /// New methods or data members can be added to it if needed.
36 /// See also: Dense_diag_.hpp
37 
38 
39 #ifndef OBJECTS_SEQALIGN_DENSE_DIAG_HPP
40 #define OBJECTS_SEQALIGN_DENSE_DIAG_HPP
41 
42 
43 // generated includes
45 
47 #include <util/range.hpp>
48 
49 // generated classes
50 
52 
53 BEGIN_objects_SCOPE // namespace ncbi::objects::
54 
55 class CSeq_interval;
56 
57 /////////////////////////////////////////////////////////////////////////////
59 {
61 public:
62  // constructor
63  CDense_diag(void);
64  // destructor
65  ~CDense_diag(void);
66 
67  /// Validators
68  TDim CheckNumRows(void) const;
69  void Validate () const;
70 
71  /// GetSeqRange
72  CRange<TSeqPos> GetSeqRange (TDim row) const;
73  TSeqPos GetSeqStart (TDim row) const;
74  TSeqPos GetSeqStop (TDim row) const;
75  ENa_strand GetSeqStrand(TDim row) const;
76 
77  /// Offset row's coords
78  void OffsetRow(TDim row, TSignedSeqPos offset);
79 
80  CRef<CSeq_interval> CreateRowSeq_interval(TDim row) const;
81 
82 private:
83  // Prohibit copy constructor and assignment operator
86 
87 };
88 
89 /////////////////// CDense_diag inline methods
90 
91 // constructor
92 inline
94 {
95 }
96 
97 
98 inline
100 {
101  if (row < 0 || row >= GetDim()) {
102  NCBI_THROW(CSeqalignException, eInvalidRowNumber,
103  "CDense_diag::GetSeqStart():"
104  " Invalid row number");
105  }
106  return GetStarts()[row];
107 }
108 
109 
110 inline
112 {
113  return GetSeqStart(row) + GetLen() - 1;
114 }
115 
116 
117 inline
119 {
120  return CRange<TSeqPos>(GetSeqStart(row), GetSeqStop(row));
121 }
122 
123 
124 inline
126 {
127  TDim dim = GetDim();
128  if (size_t(dim) != GetIds().size() || size_t(dim) != GetStarts().size()) {
129  NCBI_THROW(CSeqalignException, eInvalidAlignment,
130  "CDense_diag::CheckNumRows()"
131  " dim is not consistent with ids.size & starts.size");
132  }
133  return dim;
134 }
135 
136 
137 /////////////////// end of CDense_diag inline methods
138 
139 
140 END_objects_SCOPE // namespace ncbi::objects::
141 
143 
144 #endif // OBJECTS_SEQALIGN_DENSE_DIAG_HPP
145 /* Original file checksum: lines: 94, chars: 2608, CRC32: ba2ec5bc */
Data storage class.
for (multiway) diagonals
Definition: Dense_diag_.hpp:80
CDense_diag_Base Tparent
Definition: Dense_diag.hpp:60
TSeqPos GetSeqStart(TDim row) const
Definition: Dense_diag.hpp:99
TSeqPos GetSeqStop(TDim row) const
Definition: Dense_diag.hpp:111
TDim CheckNumRows(void) const
Validators.
Definition: Dense_diag.hpp:125
CRange< TSeqPos > GetSeqRange(TDim row) const
GetSeqRange.
Definition: Dense_diag.hpp:118
CDense_diag(void)
Definition: Dense_diag.hpp:93
CDense_diag(const CDense_diag &value)
CDense_diag & operator=(const CDense_diag &value)
char value[7]
Definition: config.c:431
unsigned int TSeqPos
Type for sequence locations and lengths.
Definition: ncbimisc.hpp:875
int TSignedSeqPos
Type for signed sequence position.
Definition: ncbimisc.hpp:887
#define NCBI_THROW(exception_class, err_code, message)
Generic macro to throw an exception, given the exception class, error code and message string.
Definition: ncbiexpt.hpp:704
#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_SEQALIGN_EXPORT
Definition: ncbi_export.h:744
TLen GetLen(void) const
Get the Len member data.
TDim GetDim(void) const
Get the Dim member data.
const TIds & GetIds(void) const
Get the Ids member data.
const TStarts & GetStarts(void) const
Get the Starts member data.
ENa_strand
strand of nucleic acid
Definition: Na_strand_.hpp:64
const struct ncbi::grid::netcache::search::fields::SIZE size
int offset
Definition: replacements.h:160
Modified on Thu Mar 28 17:07:53 2024 by modify_doxy.py rev. 669887