60 const size_t& dim =
GetDim();
63 "CStd_seg::CheckNumRows():"
64 " loc.size is inconsistent with dim");
68 "CStd_seg::CheckNumRows():"
69 " ids.size is inconsistent with dim");
82 return (*i)->GetInt().GetFrom();
88 if (row < 0 || row >=
GetDim()) {
90 "CStd_seg::GetSeqStart():"
91 " Invalid row number");
94 "CStd_seg::GetSeqStart():"
95 " loc.size is inconsistent with dim");
105 return (*i)->GetInt().GetTo();
111 if (row < 0 || row >=
GetDim()) {
113 "CStd_seg::GetSeqStop():"
114 " Invalid row number");
117 "CStd_seg::GetSeqStop():"
118 " loc.size is inconsistent with dim");
139 "CStd_seg::SwapRows():"
140 " Invalid row number");
159 if (row < 0 || row >=
GetDim()) {
161 "CStd_seg::GetSeqRange():"
162 " Invalid row number");
165 "CStd_seg::GetSeqRange():"
166 " loc.size is inconsistent with dim");
178 switch (src_loc.Which()) {
184 "Negative offset greater than seq position");
187 src_loc.SetInt().SetFrom() +=
offset;
188 src_loc.SetInt().SetTo() +=
offset;
195 "Negative offset greater than seq position");
198 src_loc.SetPnt().SetPoint() +=
offset;
204 "CStd_seg::OffsetRow only supports pnt and int source seq-locs");
211 const CSeq_loc& dst_loc,
215 switch (dst_loc.Which()) {
222 "CStd_seg::RemapToLoc only supports int target seq-locs");
225 if (row < 0 || row >=
GetDim()) {
227 "CStd_seg::RemapToLoc():"
228 " Invalid row number");
239 const CSeq_id* single_src_id = 0;
240 src_loc.CheckId(single_src_id);
243 const CSeq_id* single_dst_id = 0;
244 dst_loc.CheckId(single_dst_id);
247 if ( !single_src_id->
Equals(*single_dst_id) ||
250 "CStd_seg::RemapToLoc target seq-loc id does not equal row's id.");
256 string errstr(
"CStd_seg::RemapToLoc():"
257 " Target Seq-loc is not long enough to"
258 " cover the Std-seg's seq-loc!"
259 " Maximum row seq pos is ");
261 errstr +=
". The total seq-loc len is only ";
263 errstr +=
", it should be at least ";
265 errstr +=
" (= max seq pos + 1).";
270 switch (src_loc.Which()) {
272 src_loc.SetInt().SetFrom() += dst_int.
GetFrom();
273 src_loc.SetInt().SetTo() += dst_int.
GetFrom();
274 if ( !ignore_strand ) {
275 src_loc.SetInt().SetStrand(dst_loc.GetInt().GetStrand());
279 src_loc.SetPnt().SetPoint() += dst_int.
GetFrom();
280 if ( !ignore_strand ) {
281 src_loc.SetPnt().SetStrand(dst_loc.GetInt().GetStrand());
288 "CStd_seg::RemapToLoc only supports pnt and int source seq-locs");
297 "Invalid row number in CreateRowSeq_interval(): " +
@ eExtreme_Positional
numerical value
void Validate(bool full_test=false) const
void SwapRows(TDim row1, TDim row2)
Swap two rows (changing *order*, not content)
TSignedSeqPos GetSeqStop(TDim row) const
TDim CheckNumRows(void) const
TSignedSeqPos GetSeqStart(TDim row) const
void RemapToLoc(TDim row, const CSeq_loc &dst_loc, bool ignore_strand=false)
CRef< CSeq_loc > CreateRowSeq_loc(TDim row) const
CRange< TSignedSeqPos > GetSeqRange(TDim row) const
void OffsetRow(TDim row, TSignedSeqPos offset)
Offset row's coords.
void swap(ncbi::pair_base_member< T1, T2 > &pair1, ncbi::pair_base_member< T1, T2 > &pair2) noexcept
unsigned int TSeqPos
Type for sequence locations and lengths.
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
int TSignedSeqPos
Type for signed sequence position.
const TSeqPos kInvalidSeqPos
Define special value for invalid sequence position.
#define NCBI_THROW(exception_class, err_code, message)
Generic macro to throw an exception, given the exception class, error code and message string.
virtual bool Equals(const CSerialObject &object, ESerialRecursionMode how=eRecursive) const
Check if both objects contain the same values.
virtual void Assign(const CSerialObject &source, ESerialRecursionMode how=eRecursive)
Override Assign() to incorporate cache invalidation.
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
static string IntToString(int value, TNumToStringFlags flags=0, int base=10)
Convert int to string.
TIds & SetIds(void)
Assign a value to Ids data member.
vector< CRef< CSeq_loc > > TLoc
const TLoc & GetLoc(void) const
Get the Loc member data.
const TIds & GetIds(void) const
Get the Ids member data.
TLoc & SetLoc(void)
Assign a value to Loc data member.
bool IsSetIds(void) const
Check if a value has been assigned to Ids data member.
TDim GetDim(void) const
Get the Dim member data.
TFrom GetFrom(void) const
Get the From member data.
TTo GetTo(void) const
Get the To member data.
@ e_Empty
to NULL one Seq-id in a collection
const struct ncbi::grid::netcache::search::fields::SIZE size
#define row(bind, expected)