64 : m_OriginalAccNoVer(
false)
70 CScope& scope,
bool product)
71 : m_OriginalAccNoVer(
false)
73 Assign(obj_handle,
id, scope, product);
83 CScope& scope,
bool product)
126 : m_ProductDescr(
NULL)
150 : m_Original(original),
180 TIdDescrs::iterator it_id =
211 x_Add(obj_handle,
id, product);
216 const CSeq_id&
id,
bool product)
226 SRec rec(descr,
false, product);
234 const vector<CSeq_id_Handle>& handles = descr->
GetIdHandles();
235 for(
size_t i = 0;
i < handles.size();
i++ ) {
237 SRec rec(descr,
true, product);
249 unsigned int start = 0;
250 unsigned int stop = 0;
258 stop = total_r.
GetTo();
260 ERR_POST(
"Error on CObjectIndex::x_GetFeatureCode(): " << e.
GetMsg());
263 unsigned int res = start ^ ((start - stop) << 16);
266 unsigned int type = (
unsigned int)
data.GetSubtype();
275 ERR_POST(
"CObjectIndex::Add() - feature already in index");
286 product_descr =
x_Add(obj_handle, *
id,
true);
309 if(vcf_variant.
WeakMatch(*iter->first)) {
319 if(vcf_variant.
WeakMatch(*iter->first)) {
334 matching_vcf_variant->second = obj_handle;
341 const type_info&
info =
typeid(obj);
344 Add(obj_handle, *feature);
347 Add(obj_handle, *
id);
353 Add(obj_handle, *align);
356 Add(obj_handle, *vcf_variant);
358 ERR_POST(
"ObjectIndex::Add() - type not supported " <<
info.name());
365 bool removed =
false;
366 const type_info&
info =
typeid(obj);
372 removed =
Remove(*feature);
378 removed =
Remove(*vcf_variant);
380 ERR_POST(
"ObjectIndex::Remove() - type not supported " <<
info.name());
390 if(descr->
GetId()->Match(
id)) {
421 handles.push_back(idh);
424 for(
size_t i = 0;
i < handles.size();
i++ ) {
430 const SRec& rec = it->second;
445 pair<TCodeToFeatMap::iterator , TCodeToFeatMap::iterator> p =
451 bool found_match =
false;
453 if (&feat == &feature) {
499 const type_info&
info =
typeid(object);
522 const type_info&
info =
typeid(object);
543 const vector<CSeq_id_Handle>& handles = descr.
GetIdHandles();
548 for(
size_t i = 0;
i < handles.size();
i++ ) {
569 const vector<CSeq_id_Handle>& handles = descr.
GetIdHandles();
575 for(
size_t i = 0;
i < handles.size();
i++ ) {
589 bool at_least_one,
bool no_ver)
const
593 const SRec& rec = it->second;
596 if(at_least_one && (rec.
m_Original || no_ver)) {
612 const SRec& rec = it->second;
618 if(at_least_one && (rec.
m_Original || no_ver)) {
637 pair<TCodeToFeatMap::const_iterator , TCodeToFeatMap::const_iterator> p =
644 if(feat.
Equals(feature)) {
668 pair<TCodeToFeatMap::const_iterator , TCodeToFeatMap::const_iterator> p =
675 if(&feat == &feature || feat.
Equals(feature)) {
721 results.insert(matching_vcf_variant->second);
756 objects.push_back(TR(vcf_variant));
766 ids.push_back(descr->
GetId());
776 features.push_back(feat);
785 aligns.push_back(align);
@ eExtreme_Positional
numerical value
CConstRef< objects::CSeq_id > m_Id
void Clear(objects::CScope *scope)
TVcfVariantMap::iterator x_FindVcfVariant(const objects::CVcfVariant &vcf_variant)
void x_GetMatches(const CSeq_id_Descr &descr, const objects::CSeq_id_Handle &h, bool at_least_one, bool no_ver, TResults &results) const
bool x_HasMatches(const CSeq_id_Descr &descr, const objects::CSeq_id_Handle &h, bool at_least_one, bool no_ver) const
bool Remove(const CObject &obj)
map< CConstRef< objects::CVcfVariant >, ISelObjectHandle * > TVcfVariantMap
void x_RemoveFromIdMap(const CSeq_id_Descr *descr)
CSeq_id_Descr * x_Add(ISelObjectHandle *obj_handle, const objects::CSeq_id &id, bool product)
void x_Remove(const CSeq_id_Descr *descr)
void GetObjects(TConstObjects &objects) const
TVcfVariantMap m_VcfVariantMap
set< const ISelObjectHandle * > TResults
static TFeatCode x_GetFeatureCode(const objects::CSeq_feat &feature)
bool HasMatches(const CObject &object, objects::CScope &scope) const
void GetAligns(vector< const objects::CSeq_align * > &aligns) const
vector< CSeq_id_Descr * > TIdDescrs
void GetFeatures(vector< const objects::CSeq_feat * > &features) const
void Add(ISelObjectHandle *obj_handle, CObject &obj)
void GetOriginalIds(vector< const objects::CSeq_id * > &ids) const
CRef< objects::CScope > m_Scope
void GetMatches(const CObject &object, objects::CScope &scope, TResults &results) const
static bool sm_MatchByProduct
static EObjMatchPolicy sm_ObjMatchPolicy
static EIdMatchPolicy sm_IdMatchPolicy
CRef< ISelObjectHandle > m_ObjHandle
CSeq_feat_Descr()
CSeq_feat_Descr.
CConstRef< objects::CSeq_feat > m_Feat
void Assign(ISelObjectHandle *obj_handle, const objects::CSeq_feat &feat, CSeq_id_Descr *, objects::CScope &scope)
const CSeq_id_Descr * GetProductDescr() const
CSeq_id_Descr * m_ProductDescr
const CRef< ISelObjectHandle > GetObjectHandle() const
const objects::CSeq_feat & GetFeat() const
namespace ncbi::objects::
CSeq_id_Descr()
CSeq_id_Descr.
CConstRef< objects::CSeq_id > m_Id
bool HasOriginalAccNoVer() const
const objects::CSeq_id_Handle & GetAccNoVer() const
void Assign(ISelObjectHandle *obj_handle, const objects::CSeq_id &id, objects::CScope &scope, bool product=false)
const TIdHandleVector & GetIdHandles() const
CRef< ISelObjectHandle > m_ObjHandle
const objects::CSeq_id * GetId() const
TIdHandleVector m_IdHandles
objects::CSeq_id_Handle m_AccNoVer
container_type::const_iterator const_iterator
container_type::iterator iterator
const_iterator begin() const
const_iterator end() const
iterator_bool insert(const value_type &val)
const_iterator find(const key_type &key) const
const_iterator_pair equal_range(const key_type &key) const
container_type::const_iterator const_iterator
iterator insert(const value_type &val)
container_type::iterator iterator
container_type::value_type value_type
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
#define NON_CONST_ITERATE(Type, Var, Cont)
Non constant version of ITERATE macro.
#define ERR_POST(message)
Error posting with file, line number information but without error codes.
const string & GetMsg(void) const
Get message string.
bool WeakMatch(const CVcfVariant &right) const
vector< CConstRef< CObject > > TConstObjects
virtual bool Equals(const CSerialObject &object, ESerialRecursionMode how=eRecursive) const
Check if both objects contain the same values.
CConstRef< CSeq_id > GetSeqId(void) const
static CSeq_id_Handle GetHandle(const CSeq_id &id)
Normal way of getting a handle, works for any seq-id.
const CTextseq_id * GetTextseq_Id(void) const
Return embedded CTextseq_id, if any.
bool HaveMatchingHandles(void) const
TRange GetTotalRange(void) const
TSeqPos GetStart(ESeqLocExtremes ext) const
Return start and stop positions of the seq-loc.
const CSeq_id * GetId(void) const
Get the id of the location return NULL if has multiple ids or no id at all.
TSeqPos GetStop(ESeqLocExtremes ext) const
TIds GetIds(const CSeq_id &id, TGetFlags flags=0)
Get "native" bioseq ids without filtering and matching.
TObjectType * GetPointer(void) THROWS_NONE
Get pointer,.
void Reset(void)
Reset reference object.
void Reset(void)
Reset reference object.
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
TTo GetTo(void) const
Get the To member data.
TFrom GetFrom(void) const
Get the From member data.
const TLocation & GetLocation(void) const
Get the Location member data.
const TData & GetData(void) const
Get the Data member data.
const TProduct & GetProduct(void) const
Get the Product member data.
bool IsSetProduct(void) const
product of process Check if a value has been assigned to Product data member.
bool IsSetAccession(void) const
Check if a value has been assigned to Accession data member.
E_Choice Which(void) const
Which variant is currently selected.
bool IsSetRelease(void) const
Check if a value has been assigned to Release data member.
bool IsSetVersion(void) const
Check if a value has been assigned to Version data member.
bool IsSetName(void) const
Check if a value has been assigned to Name data member.
void Select(E_Choice index, EResetVariant reset=eDoResetVariant)
Select the requested variant if needed.
const TAccession & GetAccession(void) const
Get the Accession member data.
unsigned int
A callback function used to compare two keys in a database.
constexpr auto sort(_Init &&init)
const GenericPointer< typename T::ValueType > T2 value
bool IsAccessionNoVersion(const CSeq_id &seq_id)
const CConstRef< CSeq_id > GetAccession(const CSeq_id_Handle &id_handle)
SRec(CSeq_id_Descr *descr, bool original=true, bool product=false)
CObjectIndex.
const CSeq_id_Descr * GetIdDescr() const