39 #ifndef OBJECTS_SEQLOC_SEQ_LOC_HPP
40 #define OBJECTS_SEQLOC_SEQ_LOC_HPP
128 TRange GetTotalRange(
void)
const;
129 void InvalidateTotalRangeCache(
void)
const;
146 bool IsReverseStrand(
void)
const;
148 void FlipStrand(
void);
152 void ResetStrand(
void);
204 void InvalidateIdCache(
void)
const;
211 void InvalidateCache(
void)
const;
241 void PostRead(
void)
const;
245 fCompare_Default = 0,
281 void ChangeToMix(
void);
284 void ChangeToPackedInt(
void);
325 fStrand_Ignore = 1<<0,
326 fMerge_Contained = 1<<1,
327 fMerge_AbuttingOnly = 1<<2,
328 fMerge_Abutting = fMerge_AbuttingOnly | fMerge_Contained,
329 fMerge_OverlappingOnly = 1<<3,
330 fMerge_Overlapping = fMerge_OverlappingOnly | fMerge_Contained,
331 fMerge_All = fMerge_Abutting | fMerge_Overlapping,
332 fMerge_SingleRange = 1<<4,
334 fSortAndMerge_All = fSort | fMerge_All
376 TRange x_UpdateTotalRange(
void)
const;
377 TRange x_CalculateTotalRangeCheckId(
const CSeq_id*&
id)
const;
378 bool x_CheckId(
const CSeq_id*&
id,
bool may_throw =
true)
const;
380 bool may_throw =
true)
const;
381 void x_ChangeToMix(
const CSeq_loc& other);
383 void x_ChangeToPackedInt(
const CSeq_loc& other);
384 void x_ChangeToPackedPnt(
const CSeq_loc& other);
492 bool IsInBond(
void)
const;
494 bool IsBondA(
void)
const;
496 bool IsBondB(
void)
const;
500 pair<CSeq_loc_CI, CSeq_loc_CI> GetBondRange(
void)
const;
503 bool HasEquivSets(
void)
const;
505 bool IsInEquivSet(
void)
const;
507 size_t GetEquivSetsCount(
void)
const;
513 pair<CSeq_loc_CI, CSeq_loc_CI> GetEquivSetRange(
size_t level = 0)
const;
519 pair<CSeq_loc_CI, CSeq_loc_CI> GetEquivPartRange(
size_t level = 0)
const;
522 const CSeq_id& GetSeq_id(
void)
const;
526 TRange GetRange(
void)
const;
528 bool IsSetStrand(
void)
const;
542 const CSeq_loc& GetEmbeddingSeq_loc(
void)
const;
549 const CInt_fuzz* GetFuzzFrom(
void)
const;
557 bool IsPoint(
void)
const;
563 size_t GetSize(
void)
const;
566 size_t GetPos(
void)
const;
569 void SetPos(
size_t pos);
580 bool x_IsValid(
void)
const;
582 virtual const char* x_GetIteratorType(
void)
const;
583 void x_CheckValid(
const char* where)
const;
584 void x_ThrowNotValid(
const char* where)
const;
612 bool HasChanges(
void)
const;
615 CRef<CSeq_loc> MakeSeq_loc(EMakeType make_type = eMake_CompactType)
const;
682 return InsertInterval(
id,
TRange(from, to), strand);
691 return InsertInterval(
id,
TRange(from, to), strand);
728 void ResetStrand(
void);
733 void ResetFuzzFrom(
void);
737 void ResetFuzzTo(
void);
741 void ResetFuzz(
void);
750 pair<CSeq_loc_I, CSeq_loc_I> GetEquivSetRange(
size_t level = 0)
const;
756 pair<CSeq_loc_I, CSeq_loc_I> GetEquivPartRange(
size_t level = 0)
const;
808 void SetEquivMode(EEquivMode
mode);
814 SetEquivMode(eEquiv_new_equiv);
821 SetEquivMode(eEquiv_new_part);
828 SetEquivMode(eEquiv_none);
832 EEquivMode GetEquivMode(
void)
const;
853 void RemoveBond(
void);
857 void MakeBondA(
void);
861 void MakeBondAB(
void);
865 void MakeBondB(
void);
874 bool x_IsValidForInsert(
void)
const;
875 void x_CheckValidForInsert(
const char* where)
const;
876 virtual const char* x_GetIteratorType(
void)
const;
930 if ( my_id ==
NULL ) {
934 m_IdCache.store(my_id, memory_order_release);
966 #define DEFINE_NCBI_SEQ_LOC_SETTERS(x) \
968 void CSeq_loc::Set##x(T##x& v) \
971 Tparent::Set##x(v); \
975 CSeq_loc::T##x& CSeq_loc::Set##x(void) \
978 return Tparent::Set##x(); \
992 #undef DEFINE_NCBI_SEQ_LOC_SETTERS
bool IsReverse(ENa_strand s)
ESeqLocExtremes
Used to determine the meaning of a location's Start/Stop positions.
EIsSetStrand
Flag used by IsSetStrand() to switch between any/all modes.
@ eIsSetStrand_Any
Check if any part has strand.
bool operator!=(const _Ht_iterator< _Val, _Nonconst_traits< _Val >, _Key, _HF, _ExK, _EqK, _All > &__x, const _Ht_iterator< _Val, _Const_traits< _Val >, _Key, _HF, _ExK, _EqK, _All > &__y)
CLocalRange< TOffset > TRange
define for the fundamental building block of sequence ranges
vector< CRange< TSeqPos > > TRanges
Used as a helper for determining which pieces of a CSeq_loc to compare.
*** Sequence locations ********************************** *
Seq-loc iterator class – iterates all intervals from a seq-loc in the correct order.
Seq-loc iterator class – iterates all intervals from a seq-loc in the correct order.
Base class for all serializable objects.
Interface for getting bioseq length.
Interface for mapping IDs to the best synonym.
bool operator==(const CEquivRange &A, const CEquivRange &B)
bool Empty(const CNcbiOstrstream &src)
unsigned int TSeqPos
Type for sequence locations and lengths.
EErrCode
Error types that an application can generate.
virtual const char * GetErrCodeString(void) const
Get error code interpreted as text.
ESerialRecursionMode
How to assign and compare child sub-objects of serial objects.
#define NCBISER_HAVE_POST_READ(Class)
virtual void Assign(const CSerialObject &source, ESerialRecursionMode how=eRecursive)
Set object to copy of another one.
virtual void Assign(const CSerialObject &source, ESerialRecursionMode how=eRecursive)
Optimized implementation of CSerialObject::Assign, which is not so efficient.
static CSeq_id_Handle GetHandle(const CSeq_id &id)
Normal way of getting a handle, works for any seq-id.
string GetLabel(const CSeq_id &id)
void InvalidateIdCache(void) const
void Rewind(void)
Reset the iterator to the initial state.
DECLARE_OPERATOR_BOOL(x_IsValid())
void InvalidateCache(void) const
Combine invalidation of all cached values.
bool x_IsValid(void) const
CSeq_loc_CI & operator++(void)
ENa_strand GetStrand(void) const
Get the location's strand.
void x_CheckValidForInsert(const char *where) const
CRange< TSeqPos > TRange
See related functions in objmgr/util/seq_loc_util.hpp:
bool x_UpdateId(const CSeq_id *&total_id, const CSeq_id *id, bool may_throw=true) const
virtual ~ILengthGetter(void)
bool IsReverseStrand(void) const
Return true if all ranges have reverse strand.
EEmptyFlag
Options for empty locations processing.
void SetId(CSeq_id &id)
set the 'id' field in all parts of this location
atomic< TSeqPos > m_TotalRangeCacheFrom
size_t GetPos(void) const
Get iterator's position.
CSeq_loc_mix_Base::Tdata TLocations
void RemoveEquiv(size_t level=0)
Remove equiv set, all pieces that are part of the set will be preserved as independent pieces.
void StartNewEquiv(void)
Change equiv modification mode to add new equiv set for the next insert operation.
void x_CheckValid(const char *where) const
EMakeType
Options for creation modified locations Bond and equiv types are preserved if possible.
TRange GetTotalRange(void) const
EOpFlags
CSeq_loc operations.
CSeq_loc_CI const_iterator
Make CSeq_loc look like an STL container.
virtual CSeq_id_Handle GetBestSynonym(const CSeq_id &id)=0
CSeq_loc_I InsertEmpty(const CSeq_id &id)
Insert new element before the current one (.
void StopEquiv(void)
Change equiv modification mode to normal behavior that will only update existing equiv sets.
pair< CConstRef< CInt_fuzz >, CConstRef< CInt_fuzz > > m_Fuzz
bool IsSetStrand(void) const
Get strand.
CSeq_loc_I InsertInterval(const CSeq_id_Handle &id, TSeqPos from, TSeqPos to, ENa_strand strand=eNa_strand_unknown)
Insert new element before the current one (.
CSeq_id_Handle GetSeq_id_Handle(void) const
void SetSeq_id(const CSeq_id &id)
Set seq_id of the current location.
bool IsWhole(void) const
True if the current location is a whole sequence.
const CInt_fuzz * GetFuzzFrom(void) const
bool x_IsValidForInsert(void) const
CSeq_loc_I InsertInterval(const CSeq_id &id, TSeqPos from, TSeqPos to, ENa_strand strand=eNa_strand_unknown)
Insert new element before the current one (.
const CInt_fuzz * GetFuzzTo(void) const
const CSeq_loc_CI & operator*() const
CSeq_loc_I InsertInterval(const CSeq_id &id, const TRange &range, ENa_strand strand=eNa_strand_unknown)
Insert new element before the current one (.
CSeq_loc_I InsertPoint(const CSeq_id &id, TSeqPos pos, ENa_strand strand=eNa_strand_unknown)
Insert new element before the current one (.
bool CheckId(const CSeq_id *&id, bool may_throw=true) const
check that the 'id' field in all parts of the location is the same as the specifies id.
void MakeEquivPartBreak(size_t level=0)
Create equiv set with one part from current position to the position pointed by end_it argument exclu...
virtual ~ISynonymMapper(void)
void StartNewEquivPart(void)
Change equiv modification mode to add new equiv part for the next insert operation.
void MakeEquiv(const CSeq_loc_I &end_it)
Create equiv set with one part from current position to the position pointed by end_it argument exclu...
CPacked_seqint_Base::Tdata TIntervals
ECompareFlags
Flags for location comparison.
bool IsEmpty(void) const
True if the current location is empty.
CRef< CSeq_loc_CI_Impl > m_Impl
#define DEFINE_NCBI_SEQ_LOC_SETTERS(x)
CPacked_seqint::TRanges TRanges
const CSeq_id * GetId(void) const
Get the id of the location return NULL if has multiple ids or no id at all.
CPacked_seqpnt_Base::TPoints TPoints
atomic< const CSeq_id * > m_IdCache
virtual bool operator()(const CSeq_id *id) const =0
CSeq_id_Handle m_IdHandle
TRange GetRange(void) const
Get the range.
void InvalidateTotalRangeCache(void) const
virtual TSeqPos GetLength(const CSeq_id &id)=0
void x_ThrowNotValid(const char *where) const
const SSeq_loc_CI_RangeInfo & x_GetRangeInfo(void) const
EEquivMode
This enum defines a way equiv sets are expanded or created when one of Insert*() methods is called.
ENa_strand GetStrand(void) const
const CSeq_id & GetSeq_id(void) const
Get seq_id of the current location.
TRange x_UpdateTotalRange(void) const
void SetStrand(ENa_strand strand)
bool IsPoint(void) const
True if the current location is a single point.
CSeq_loc(void)
constructors
NCBI_EXCEPTION_DEFAULT(CSeqLocException, CException)
atomic< TSeqPos > m_TotalRangeCacheToOpen
CConstRef< CSeq_id > m_Id
void SetNull(void)
Override all setters to incorporate cache invalidation.
CConstRef< CSeq_loc > m_Loc
CSeq_loc_I InsertWhole(const CSeq_id &id)
Insert new element before the current one (.
CSeq_loc(const CSeq_loc &)
bool x_CheckId(const CSeq_id *&id, bool may_throw=true) const
@ eEquiv_new_part
New equiv part will be started with the inserted element.
@ eEquiv_new_equiv
A new equiv set will be created, even if the insertion point is already inside of an existing equiv,...
@ eEquiv_append
If the insertion point is just after any equiv part, including the last one in an equiv,...
@ eEquiv_none
By default no equiv sets are created or expanded except if insertion point is completely inside of an...
@ eMultipleId
Seq-loc on multiple ids when one id is required.
@ eNotSet
Seq-loc is not set.
@ eIncomatible
Seq-loc type is incompatible with operation.
@ eBadLocation
Seq-loc is incorrectly formed.
@ eOutOfRange
parameter is out of valid range
@ eBadIterator
Seq-loc iterator is in bad state.
@ eUnsupported
Seq-loc has data that is not supported yet.
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.
const CSeq_id & GetId(const CSeq_loc &loc, CScope *scope)
If all CSeq_ids embedded in CSeq_loc refer to the same CBioseq, returns the first CSeq_id found,...
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.
sequence::ECompare Compare(const CSeq_loc &loc1, const CSeq_loc &loc2, CScope *scope)
Returns the sequence::ECompare containment relationship between CSeq_locs.
TObjectType * GetPointer(void) THROWS_NONE
Get pointer,.
position_type GetLength(void) const
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
#define NCBI_SEQLOC_EXPORT
static const char label[]
TWhole & SetWhole(void)
Select the variant.
TEquiv & SetEquiv(void)
Select the variant.
bool IsEmpty(void) const
Check if variant Empty is selected.
list< CRef< CSeq_interval > > Tdata
ENa_strand
strand of nucleic acid
TFeat & SetFeat(void)
Select the variant.
void SetNull(void)
Select the variant.
TPacked_pnt & SetPacked_pnt(void)
Select the variant.
TMix & SetMix(void)
Select the variant.
list< CRef< CSeq_loc > > Tdata
TBond & SetBond(void)
Select the variant.
TPnt & SetPnt(void)
Select the variant.
TEmpty & SetEmpty(void)
Select the variant.
vector< TSeqPos > TPoints
CSeq_loc_Base & operator=(const CSeq_loc_Base &)
TInt & SetInt(void)
Select the variant.
bool IsWhole(void) const
Check if variant Whole is selected.
TPacked_int & SetPacked_int(void)
Select the variant.
void CheckId(const string &seqId, const vector< SLineInfo > &orderedIds, int idCount, int lineNum, bool firstBlock)
range(_Ty, _Ty) -> range< _Ty >
const CharType(& source)[N]
void Merge(wxMenu &menu_1, const wxMenu &menu_2)
merges all items form menu_2 into menu_1, preserving the structure if possible