1 #ifndef OBJMGR_SCOPE__HPP
2 #define OBJMGR_SCOPE__HPP
100 kPriority_Default = -1,
101 kPriority_NotSet = -1
133 EGetBioseqFlag get_flag);
136 EGetBioseqFlag get_flag);
141 EGetBioseqFlag get_flag);
143 typedef vector<CSeq_id_Handle>
TIds;
158 eMissing_Default = eMissing_Throw
167 EMissing action = eMissing_Default);
174 EMissing action = eMissing_Default);
176 EMissing action = eMissing_Default);
178 EMissing action = eMissing_Default);
180 EMissing action = eMissing_Default);
182 EMissing action = eMissing_Default);
184 EMissing action = eMissing_Default);
187 EMissing action = eMissing_Default);
189 EMissing action = eMissing_Default);
191 EMissing action = eMissing_Default);
193 EMissing action = eMissing_Default);
195 EMissing action = eMissing_Default);
234 void AddDefaults(
TPriority pri = kPriority_Default);
238 void AddDataLoader(
const string& loader_name,
253 void AddScope(
CScope& scope,
261 eExist_Default = eExist_Throw
269 TPriority pri = kPriority_Default,
270 EExist action = eExist_Default);
277 TPriority pri = kPriority_Default,
278 EExist action = eExist_Throw);
289 TPriority pri = kPriority_Default,
290 EExist action = eExist_Throw);
298 TPriority pri = kPriority_Default,
299 EExist action = eExist_Throw);
305 TPriority pri = kPriority_Default,
306 EExist action = eExist_Throw);
314 TPriority pri = kPriority_Default,
315 EExist action = eExist_Throw);
322 TPriority pri = kPriority_Default,
323 EExist action = eExist_Throw);
328 TPriority pri = kPriority_Default);
352 void ResetHistory(EActionIfLocked action = eKeepIfLocked);
354 void ResetDataAndHistory(
void);
359 void ResetDataAndHistory(ERemoveDataLoaders remove_data_loaders);
366 EActionIfLocked action = eKeepIfLocked);
372 EActionIfLocked action = eKeepIfLocked);
380 void RemoveFromHistory(
const CSeq_id& seq_id);
384 void RemoveDataLoader(
const string& loader_name,
385 EActionIfLocked action = eThrowIfLocked);
389 void RemoveTopLevelSeqEntry(
const CTSE_Handle& entry);
417 fForceLoad = (1 << 0),
423 fThrowOnMissingSequence = (1 << 1),
429 fThrowOnMissingData = (1 << 2),
435 fThrowOnMissing = fThrowOnMissingSequence|fThrowOnMissingData,
438 fDoNotRecalculate = (1 << 3)
444 eNoForceLabelLoad = eNoForceLoad,
445 eForceLabelLoad = eForceLoad
449 bool Exists(
const CSeq_id&
id);
471 static TGi x_GetGi(
const TIds& ids);
497 TGetFlags
flags = 0);
499 TGetFlags
flags = 0);
650 void UpdateAnnotIndex(
void);
660 static bool GetDefaultKeepExternalAnnotsForEdit();
670 static void SetDefaultKeepExternalAnnotsForEdit(
bool keep =
true);
680 bool GetKeepExternalAnnotsForEdit()
const;
690 void SetKeepExternalAnnotsForEdit(
bool keep =
true);
User-defined methods of the data storage class.
pair< string, int > GetAccVer(const CAlignModel &a, CScope &scope)
CBioseq_set_EditHandle –.
namespace ncbi::objects::
unsigned int TSeqPos
Type for sequence locations and lengths.
SStrictId_Tax::TId TTaxId
Taxon id type.
string GetLabel(const CSeq_id &id)
bool IsSameBioseq(const CSeq_id &id1, const CSeq_id &id2, CScope *scope, CScope::EGetBioseqFlag get_flag=CScope::eGetBioseq_All)
Determines if two CSeq_ids represent the same CBioseq.
TTaxId GetTaxId(const CBioseq_Handle &handle)
return the tax-id associated with a given sequence.
void GetAccVers(TSeq_id_Handles *results, const TSeq_id_Handles &idhs, TGetFlags flags=0)
EForceLabelLoad
obsolete enum
TSequenceHashes GetSequenceHashes(const TSeq_id_Handles &idhs, TGetFlags flags=0)
vector< TTaxId > TTaxIds
Get taxonomy ids of sequences Return -1 for sequences that aren't found Return 0 for sequences that d...
vector< TSeqPos > TSequenceLengths
Get lengths of sequences Return kInvalidSeqPos for sequences that aren't found.
CScope & operator=(const CScope &)
void GetSequenceLengths(TSequenceLengths *results, const TSeq_id_Handles &idhs, TGetFlags flags=0)
CSeq_entry_Handle GetSeq_entryHandle(CDataLoader *loader, const TBlobId &blob_id, EMissing action=eMissing_Default)
Get Seq-entry handle by its blob-id, with possible loading.
CScope_Impl & GetImpl(void)
CBioseq_set_EditHandle GetBioseq_setEditHandle(const CBioseq_set &seqset)
TSequenceStates GetSequenceStates(const TSeq_id_Handles &idhs, TGetFlags flags=0)
EExist
AddXxx() control values.
void GetSequenceHashes(TSequenceHashes *results, const TSeq_id_Handles &idhs, TGetFlags flags=0)
void GetGis(TGIs *results, const TSeq_id_Handles &idhs, TGetFlags flags=0)
TSeq_id_Handles GetAccVers(const TSeq_id_Handles &idhs, TGetFlags flags=0)
Get accession.version Seq-id Returns null CSeq_id_Handles for sequences that aren't found or don't ha...
CBioseq_Handle GetBioseqHandle(const CSeq_id &id)
Get bioseq handle by seq-id.
vector< string > TLabels
Get short descriptions of sequences, usually "accession.version" Returns empty strings for sequences ...
vector< TGi > TGIs
Get GI of a sequence Returns ZERO_GI for sequence that aren't found or don't have GI.
TSequenceTypes GetSequenceTypes(const TSeq_id_Handles &idhs, TGetFlags flags=0)
EGetFlags
Flags to control behavior of various meta-data getters fForceLoad instructs scope to ignore already l...
CSeq_feat_Handle GetSeq_featHandle(const CSeq_feat &feat, EMissing action=eMissing_Default)
FParserFlags
Parser options.
vector< CBioseq_Handle::TBioseqStateFlags > TSequenceStates
Get GenBank states of sequences Return (fState_not_found|fState_no_data) for sequences that aren't fo...
vector< TSequenceHash > TSequenceHashes
Get data hashes of sequences Return 0 for sequences that aren't found or they don't have hash Note: 0...
vector< CBioseq_Handle > TBioseqHandles
CBioseq_set_Handle GetBioseq_setHandle(const CBioseq_set &seqset, EMissing action=eMissing_Default)
int TSequenceHash
Get sequence data hash value Return 0 if sequence is not found or if its hash is not known Note: 0 ca...
CSeq_annot_Handle GetSeq_annotHandle(const CSeq_annot &annot, EMissing action=eMissing_Default)
TGIs GetGis(const TSeq_id_Handles &idhs, TGetFlags flags=0)
vector< CTSE_Handle > TCDD_Entries
Get CDD annotations for all ids.
void RemoveTopLevelSeqEntry(const CTSE_Handle &entry)
Revoke TSE previously added using AddTopLevelSeqEntry() or AddBioseq().
TLabels GetLabels(const TSeq_id_Handles &idhs, TGetFlags flags=0)
void GetTaxIds(TTaxIds *results, const TSeq_id_Handles &idhs, TGetFlags flags=0)
CSeq_entry_EditHandle GetSeq_entryEditHandle(const CSeq_entry &entry)
vector< CSeq_inst::TMol > TSequenceTypes
Get molecular types of sequences (protein/dna/rna) Return CSeq_inst::eMol_not_set for sequences that ...
void GetSequenceTypes(TSequenceTypes *results, const TSeq_id_Handles &idhs, TGetFlags flags=0)
TBulkIds GetBulkIds(const TSeq_id_Handles &idhs, TGetFlags flags=0)
void GetSequenceStates(TSequenceStates *results, const TSeq_id_Handles &idhs, TGetFlags flags=0)
ERemoveDataLoaders
Clear all information in the scope including data loaders.
TSequenceLengths GetSequenceLengths(const TSeq_id_Handles &idhs, TGetFlags flags=0)
TTaxIds GetTaxIds(const TSeq_id_Handles &idhs, TGetFlags flags=0)
EForceLoad
EForceLoad flag instruct scope to ignore already loaded information and always request data loader fo...
int TPriority
priority type and special value for added objects
void GetBulkIds(TBulkIds *results, const TSeq_id_Handles &idhs, TGetFlags flags=0)
vector< CSeq_id_Handle > TIds
CRef< CScope_Impl > m_Impl
void GetLabels(TLabels *results, const TSeq_id_Handles &idhs, TGetFlags flags=0)
vector< TIds > TBulkIds
Get all ids of sequences Returns empty ids if the sequence is not found.
vector< CSeq_entry_Handle > TTSE_Handles
CRef< CScope > m_HeapScope
CBioseq_EditHandle GetObjectEditHandle(const CBioseq &bioseq)
CSeq_annot_EditHandle GetSeq_annotEditHandle(const CSeq_annot &annot)
EMissing
GetXxxHandle control values.
CBioseq_EditHandle GetBioseqEditHandle(const CBioseq &bioseq)
Get edit handle for the specified object Throw an exception if object is not found,...
CBioseq_Handle GetObjectHandle(const CBioseq &bioseq, EMissing action=eMissing_Default)
vector< CSeq_id_Handle > TSeq_id_Handles
Bulk retrieval methods Common argument typedef - vector of requested ids.
@ eGetBioseq_Resolved
Search only in already resolved ids.
@ eGetBioseq_Loaded
Search in all loaded TSEs in the scope.
const CTSE_Handle & GetTSE_Handle(void) const
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define END_SCOPE(ns)
End the previously defined scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
#define BEGIN_SCOPE(ns)
Define a new scope.
#define NCBI_XOBJMGR_EXPORT
EMol
molecule class in living organism
Portable reference counted smart and weak pointers using CWeakRef, CRef, CObject and CObjectEx.
static bool GetIds(const T &d, set< string > &labels, const string name="", bool detect=false, bool found=false)
Uint4 GetSequenceType(const CBioseq_Handle &bsh)
Return a (corrected) set of flags identifying the sequence type.