59 om.RegisterDataLoader(loader_maker, is_default, priority);
73 if (loader_name.empty())
125 "CDataLoader::GetRecords() is not implemented in subclass");
191 if ( !ret2.
empty() ) {
217 return processed_nas && processed_nas->
find(na) == processed_nas->
end();
224 if ( processed_nas ) {
225 processed_nas->
insert(na);
249 if (!tse_set2.
empty()) {
250 if (tse_set.
empty()) {
251 tse_set.
swap(tse_set2);
291 "CDataLoader::GetBlobById() is not implemented in subclass");
297 "CDataLoader::GetBlobIdFromString(str) is not implemented in subclass");
307 ids = bs_info->
GetId();
330 "CDataLoader::GetAccVer() sequence not found");
335 "CDataLoader::GetAccVer() sequence doesn't have accession");
374 "CDataLoader::GetGi() sequence not found");
379 "CDataLoader::GetGi() sequence doesn't have GI");
460 "CDataLoader::GetSequenceType() type not set");
466 "CDataLoader::GetSequenceType() sequence not found");
504 return (*it)->GetBlobState();
519 "CDataLoader::GetSequenceHash() sequence hash not set");
522 "CDataLoader::GetSequenceHash() sequence not found");
562 size_t count = ids.size();
563 _ASSERT(ids.size() == loaded.size());
564 _ASSERT(ids.size() == ret.size());
566 for (
size_t i = 0;
i < count; ++
i ) {
581 size_t count = ids.size();
582 _ASSERT(ids.size() == loaded.size());
583 _ASSERT(ids.size() == ret.size());
585 for (
size_t i = 0;
i < count; ++
i ) {
600 size_t count = ids.size();
601 _ASSERT(ids.size() == loaded.size());
602 _ASSERT(ids.size() == ret.size());
603 for (
size_t i = 0;
i < count; ++
i ) {
608 if ( !
label.empty() ) {
618 size_t count = ids.size();
619 _ASSERT(ids.size() == loaded.size());
620 _ASSERT(ids.size() == ret.size());
621 for (
size_t i = 0;
i < count; ++
i ) {
638 size_t count = ids.size();
639 _ASSERT(ids.size() == loaded.size());
640 _ASSERT(ids.size() == ret.size());
641 for (
size_t i = 0;
i < count; ++
i ) {
658 size_t count = ids.size();
659 _ASSERT(ids.size() == loaded.size());
660 _ASSERT(ids.size() == ret.size());
661 for (
size_t i = 0;
i < count; ++
i ) {
681 size_t count = ids.size();
682 _ASSERT(ids.size() == loaded.size());
683 _ASSERT(ids.size() == ret.size());
684 for (
size_t i = 0;
i < count; ++
i ) {
690 if (
state != kNotFound ) {
701 size_t count = ids.size();
702 _ASSERT(ids.size() == loaded.size());
703 _ASSERT(ids.size() == ret.size());
704 for (
size_t i = 0;
i < count; ++
i ) {
725 for (
size_t i = 0;
i < id_sets.size(); ++
i) {
726 for (
auto id : id_sets[
i]) {
730 bs_info = (*it)->FindMatchingBioseq(
id);
731 if (!bs_info)
continue;
734 if (id_locks.empty())
continue;
735 ret[
i] = *id_locks.begin();
739 if (loaded[
i])
break;
760 switch ( j->GetAnnotType() ) {
775 if ( cur !=
eCore && cur != ret ) {
814 if ( ret ==
eCore ) {
834 bool sequence =
false;
910 "CDataLoader::GetChunk() is not implemented in subclass");
961 return bytes*1e-7+0.001;
985 return typeid(*this).before(
typeid(id2));
990 return !(*
this <
id ||
id < *
this);
TInst_Mol GetInst_Mol(void) const
vector< CSeq_id_Handle > TId
TTaxId GetTaxId(void) const
const TId & GetId(void) const
TSeqPos GetBioseqLength(void) const
Blob state exceptions, used by GenBank loader.
Data loader exceptions, used by GenBank loader.
iterator_bool insert(const value_type &val)
iterator_bool insert(const value_type &val)
const_iterator begin() const
const_iterator find(const key_type &key) const
const_iterator end() const
unsigned int TSeqPos
Type for sequence locations and lengths.
#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.
SStrictId_Tax::TId TTaxId
Taxon id type.
const TSeqPos kInvalidSeqPos
Define special value for invalid sequence position.
TErrCode GetErrCode(void) const
Get error code.
#define NCBI_THROW(exception_class, err_code, message)
Generic macro to throw an exception, given the exception class, error code and message string.
string GetLabel(const CSeq_id &id)
virtual int GetSequenceState(const CSeq_id_Handle &idh)
Request for a state of a sequence.
virtual CObjectManager::TPriority GetDefaultPriority(void) const
virtual void GetSequenceHashes(const TIds &ids, TLoaded &loaded, TSequenceHashes &ret, THashKnown &known)
Bulk request for hashes of a set of sequences.
void SetName(const string &loader_name)
virtual TTSE_LockSet GetOrphanAnnotRecords(const CSeq_id_Handle &idh, const SAnnotSelector *sel)
old Get*AnnotRecords() methods
CRef< IEditSaver > TEditSaver
virtual SRequestDetails ChoiceToDetails(EChoice choice) const
void SetTargetDataSource(CDataSource &data_source)
Specify datasource to send loaded data to.
virtual ~CDataLoader(void)
vector< TSeqPos > TSequenceLengths
virtual int GetSequenceHash(const CSeq_id_Handle &idh)
Request for a sequence hash.
virtual EChoice DetailsToChoice(const SRequestDetails::TAnnotSet &annots) const
vector< CTSE_Lock > TCDD_Locks
vector< CSeq_id_Handle > TIds
virtual TTSE_LockSet GetOrphanAnnotRecordsNA(const CSeq_id_Handle &idh, const SAnnotSelector *sel, TProcessedNAs *processed_nas)
new Get*AnnotRecords() methods
TBlobState GetBlobState(void)
virtual TBlobId GetBlobIdFromString(const string &str) const
static void SetProcessedNA(const string &na, TProcessedNAs *processed_nas)
vector< bool > THashKnown
string GetName(void) const
CDataSource * GetDataSource(void) const
virtual TTSE_Lock ResolveConflict(const CSeq_id_Handle &id, const TTSE_LockSet &tse_set)
Resolve TSE conflict *select the best TSE from the set of dead TSEs.
virtual void GetTaxIds(const TIds &ids, TLoaded &loaded, TTaxIds &ret)
Bulk request for taxonomy ids of a set of sequences.
virtual bool CanGetBlobById(void) const
virtual TTSE_Lock GetBlobById(const TBlobId &blob_id)
virtual void GetIds(const CSeq_id_Handle &idh, TIds &ids)
Request for a list of all Seq-ids of a sequence.
EChoice
main blob is blob with sequence all other blobs are external and contain external annotations
TTSE_LockSet GetRecordsNoBlobState(const CSeq_id_Handle &idh, EChoice choice)
The same as GetRecords() but always returns empty TSE lock set instead of throwing CBlobStateExceptio...
virtual TGi GetGi(const CSeq_id_Handle &idh)
Request for a gi of a sequence.
static bool IsRequestedAnyNA(const SAnnotSelector *sel)
vector< CSeq_inst::TMol > TSequenceTypes
virtual TTSE_LockSet GetRecords(const CSeq_id_Handle &idh, EChoice choice)
Request from a datasource using handles and ranges instead of seq-loc The TSEs loaded in this call wi...
virtual TTSE_LockSet GetDetailedRecords(const CSeq_id_Handle &idh, const SRequestDetails &details)
Request from a datasource using handles and ranges instead of seq-loc The TSEs loaded in this call wi...
vector< vector< CSeq_id_Handle > > TSeqIdSets
static bool IsRequestedNA(const string &na, const SAnnotSelector *sel)
virtual bool operator==(const CBlobId &id) const
virtual TTaxId GetTaxId(const CSeq_id_Handle &idh)
Request for a taxonomy id of a sequence.
virtual string GetLabel(const CSeq_id_Handle &idh)
Request for a label string of a sequence.
bool SequenceExists(const CSeq_id_Handle &idh)
helper function to check if sequence exists, uses GetIds()
virtual double EstimateLoadSeconds(const CTSE_Chunk_Info &chunk, Uint4 bytes) const
virtual CSeq_id_Handle GetAccVer(const CSeq_id_Handle &idh)
Request for a accession.version Seq-id of a sequence.
static bool IsProcessedNA(const string &na, const TProcessedNAs *processed_nas)
virtual STypeFound GetSequenceTypeFound(const CSeq_id_Handle &idh)
static CSeq_id_Handle x_GetAccVer(const TIds &ids)
virtual void GetSequenceTypes(const TIds &ids, TLoaded &loaded, TSequenceTypes &ret)
Bulk request for types of a set of sequences.
virtual void GetCDDAnnots(const TSeqIdSets &id_sets, TLoaded &loaded, TCDD_Locks &ret)
virtual void GetBlobs(TTSE_LockSets &tse_sets)
virtual SAccVerFound GetAccVerFound(const CSeq_id_Handle &idh)
virtual Uint4 EstimateLoadBytes(const CTSE_Chunk_Info &chunk) const
virtual TSeqPos GetSequenceLength(const CSeq_id_Handle &idh)
Request for a length of a sequence.
vector< bool > TLoaded
Bulk loading interface for a small pieces of information per id.
virtual SHashFound GetSequenceHashFound(const CSeq_id_Handle &idh)
virtual SGiFound GetGiFound(const CSeq_id_Handle &idh)
virtual void GetSequenceLengths(const TIds &ids, TLoaded &loaded, TSequenceLengths &ret)
Bulk request for lengths of a set of sequences.
virtual TTSE_LockSet GetExternalAnnotRecords(const CSeq_id_Handle &idh, const SAnnotSelector *sel)
virtual void DropTSE(CRef< CTSE_Info > tse_info)
virtual void GetGis(const TIds &ids, TLoaded &loaded, TGis &ret)
Bulk request for gis of a set of sequences.
static TGi x_GetGi(const TIds &ids)
TAnnotBlobType m_AnnotBlobType
virtual TTSE_LockSet GetExternalAnnotRecordsNA(const CSeq_id_Handle &idh, const SAnnotSelector *sel, TProcessedNAs *processed_nas)
virtual void GetLabels(const TIds &ids, TLoaded &loaded, TLabels &ret)
Bulk request for label strings of a set of sequences.
virtual TBlobVersion GetBlobVersion(const TBlobId &id)
virtual void GetChunks(const TChunkSet &chunks)
virtual CSeq_inst::TMol GetSequenceType(const CSeq_id_Handle &idh)
Request for a type of a sequence Returns CSeq_inst::eMol_not_set if sequence is not known.
virtual bool GetTrackSplitSeq() const
virtual TEditSaver GetEditSaver() const
virtual unsigned GetDefaultBlobCacheSizeLimit() const
virtual void GetSequenceStates(const TIds &ids, TLoaded &loaded, TSequenceStates &ret)
Bulk request for states of a set of sequences.
virtual void GetAccVers(const TIds &ids, TLoaded &loaded, TIds &ret)
Bulk request for accession.version Seq-ids of a set of sequences.
virtual TTSE_LockSet GetExternalRecords(const CBioseq_Info &bioseq)
Request from a datasource set of blobs with external annotations.
vector< int > TSequenceStates
vector< int > TSequenceHashes
vector< TChunk > TChunkSet
virtual void GetChunk(TChunk chunk_info)
virtual TBlobId GetBlobId(const CSeq_id_Handle &idh)
CDataSource * m_DataSource
bool LessByTypeId(const CBlobId &id2) const
set< TTSE_Lock > TTSE_LockSet
@ kPriority_Loader
Default priority for main loaders.
@ eExtFeatures
external features
@ eExtAnnot
all external annotations
@ eExtAlign
external aligns
@ eAll
all blobs (main and external)
@ eOrphanAnnot
all external annotations if no Bioseq exists
@ eGraph
graph annotations from main blob
@ eCore
?only seq-entry core?
@ eAnnot
all annotations from main blob
@ eBioseq
main blob with complete bioseq
@ eAlign
aligns from main blob
@ eBioseqCore
main blob with bioseq core (no seqdata and annots)
@ eExtGraph
external graph annotations
@ eFeatures
features from main blob
SAnnotSelector & IncludeFeatSubtype(TFeatSubtype subtype)
Include feature subtype in the search.
bool IsIncludedAnyNamedAnnotAccession(void) const
check if any named annot accession is included in the search
bool IsIncludedNamedAnnotAccession(const string &acc) const
check if named annot accession is included in the search
SAnnotSelector & AddNamedAnnots(const CAnnotName &name)
Add named annot to set of annots names to look for.
uint32_t Uint4
4-byte (32-bit) unsigned integer
static TThisType GetWhole(void)
#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.
static void PtrToString(string &out_str, const void *ptr)
Convert pointer to string.
static const char label[]
EMol
molecule class in living organism
@ e_not_set
No variant selected.
@ eMol_not_set
> cdna = rna
CRef< objects::CObjectManager > om
Better replacement of GetAccVer(), this method should be defined in data loaders, GetAccVer() is left...
Better replacement of GetGi(), this method should be defined in data loaders, GetGi() is left for com...
Better replacement of GetSequenceHash(), this method should be defined in data loaders,...
Better replacement of GetSequenceType(), this method should be defined in data loaders,...