NCBI C++ ToolKit
|
Search Toolkit Book for CNAUtils
#include <gui/objutils/na_utils.hpp>
Public Types | |
enum | EEntrezDB { EEDB_Undef , EEDB_Nucleotide , EEDB_Protein , EEDB_All } |
eutils databases that can be used More... | |
enum | EMetaDataSource { EMetaDataSource_Undef , EMetaDataSource_Cache , EMetaDataSource_Mixed , EMetaDataSource_Eutils , EMetaDataSource_EmptyRequest , EMetaDataSource_EmptyAfterFilteringRequest } |
source of obtained NA metadata were internal caches hit, partially hit or totally missed during some cached operations More... | |
enum | EUidsSource { EUidsSource_Undef , EUidsSource_Cache , EUidsSource_Mixed , EUidsSource_Eutils , EUidsSource_EmptyRequest } |
typedef string | TNAA |
typedefs for NAA meta-data More... | |
typedef list< TNAA > | TNAAs |
typedef map< string, CRef< CAnnotMetaData > > | TNAMetaDataSet |
typedef CTrackInfo::TTrackInfoList | TTrackInfoList |
using | TEntrezIds = CSeqUtils::TEntrezIds |
typedef set< TGi > | TGis |
get all GIs for a given NA accession More... | |
Public Member Functions | |
CNAUtils () | |
Default ctor. More... | |
CNAUtils (const objects::CSeq_id &id) | |
Ctor with target sequence id. More... | |
CNAUtils (const objects::CSeq_id &id, objects::CScope &scope) | |
Ctor with target sequence id and a scope. More... | |
void | GetAllNAAs (TNAAs &naas, const string &context="") const |
Get a list of NAAs associated with the target sequence. More... | |
void | GetNAMetaData (TNAMetaDataSet &md_set, const string &na, bool filtering=false, EMetaDataSource *pMDSource=NULL, EUidsSource *pUidsSource=NULL, bool isGetLinks=true) const |
Get meta-data for a specific NA. More... | |
void | GetNAMetaData (TNAMetaDataSet &md_set, const TNAAs &naas, bool filtering=false, EMetaDataSource *pMDSource=NULL, EUidsSource *pUidsSource=NULL, bool isGetLinks=true) const |
Get meta-data for a list of NAAs. More... | |
void | GetAllNAMetaData (TNAMetaDataSet &md_set, const string &context="", ICanceled *canceledCallback=0) const |
Get meta-data for a given NAA associated with seq_id. More... | |
void | GetNATrackInfo (TTrackInfoList &track_info, const string &naa) const |
Do data track discovery for a given NA. More... | |
void | GetNATrackInfo (TTrackInfoList &track_info, const string &naa, const TNAMetaDataSet &md_set) const |
Do data track discovery for a given NA with meta-data. More... | |
void | GetNATrackInfo (TTrackInfoList &track_info, const TNAAs &naas) const |
Do data track discovery for a list of NAs. More... | |
void | GetNATrackInfo (TTrackInfoList &track_info, const TNAAs &naas, const TNAMetaDataSet &md_set) const |
Do data track discovery for a list of NAs with meta-data. More... | |
void | SetMaxNAs (int size) |
Static Public Member Functions | |
static void | GetAllGIs (const TNAA &naa, EEntrezDB eedb, TGis &gis, EUidsSource *pUidsSource=NULL) |
Private Types | |
typedef map< TNAA, TEntrezId > | TNAAtoUidCache |
caching of eutils-related data: x_GetNAId(): NAA string to its numeric uid More... | |
typedef map< TEntrezId, CRef< CAnnotMetaData > > | TEntrezIdtoMetaDataCache |
x_GetNAMetaData() NAA numeric uid to CAnnotMetaData More... | |
typedef map< string, TGis > | TEntrezIdtoGiCache |
x_GetAllGIs(): NA uid+dbfrom to GIs which are associated with this NA More... | |
Private Member Functions | |
void | x_Init () |
Initialize some internal states. More... | |
void | x_GetNAIds (TEntrezIds &uids, const string &context="") const |
Get all available NA uids w/wo a context. More... | |
void | x_GetAllNAIds (TEntrezIds &uids) const |
get all available NA uids for a given gi. More... | |
void | x_FilterNAIds (TEntrezIds &uids, EUidsSource *pUidsSource=NULL) const |
filter a given list of NA uids and keep only the ones that are related to a given gi (m_GI) More... | |
bool | x_NAIdMatchesGI (TEntrezId uid, EUidsSource *pUidsSource=NULL) const |
returns true if an uid is related to a given gi (m_GI) or GI is ZERO_GI More... | |
void | x_GetAllNAIdsWithContext (TEntrezIds &uids, const string &context) const |
get all available NA ids applied to a viewer context for a given gi. More... | |
void | x_GetNAAs (TNAAs &naas, const TEntrezIds &uids) const |
Retrieve NAAs for a list of NA uids. More... | |
void | x_GetAllGIs (TEntrezId uid, TGis &gis, EUidsSource *pUidsSource=NULL) const |
this uses m_SeqDB More... | |
void | x_GetNAMetaData (TNAMetaDataSet &md_set, const TEntrezIds &uids, bool isGetLinks, EMetaDataSource *pSource=NULL) const |
Retrieve NA meta data for a list of NA uids. More... | |
void | x_SearchNAIds (TEntrezIds &uids, const TNAAs &naas, bool filtering, EUidsSource *pUidsSource=NULL) const |
Search all NAAs for a given term. More... | |
void | x_ParseNAMetaData (CAnnotMetaData &data, const char *xml_str) const |
Parse the meta-data xml DocSum. More... | |
void | x_GetNAEntrezLinks (CAnnotMetaData &data) const |
Retrieve Entrez links for a given NA. More... | |
DECLARE_CLASS_STATIC_FAST_MUTEX (sm_NAAtoUidCacheMutex) | |
DECLARE_CLASS_STATIC_FAST_MUTEX (sm_UidtoMetaDataCacheMutex) | |
DECLARE_CLASS_STATIC_FAST_MUTEX (sm_UidtoGiCacheMutex) | |
Static Private Member Functions | |
static bool | x_GetNAId (TEntrezId &uid, const string &naa, EUidsSource *pUidsSource=NULL) |
get an id for a given NAA string returns false if no id is found More... | |
static void | x_GetAllGIs (TEntrezId uid, EEntrezDB eedb, TGis &gis, EUidsSource *pUidsSource=NULL, bool isIncremental=false) |
get all GIs for a given uid this needs a given database where to search for GIs More... | |
Private Attributes | |
CConstRef< objects::CSeq_id > | m_TargetSeq |
The target sequence associating with the NAAs. More... | |
CRef< objects::CScope > | m_Scope |
Scope helping resolve sequences and retrieve annotations. More... | |
objects::CBioseq_Handle | m_BioseqHandle |
Derived values which make sense only if m_TargetSeq is set. More... | |
objects::CSeq_id_Handle | m_SeqIdHandle |
sequence handles More... | |
TGi | m_Gi |
GI of m_TargetSeq; it may be ZERO_GI for one of two reasons: either a target seq is not given at all or it does not have a GI. More... | |
EEntrezDB | m_SeqDB {EEDB_Undef} |
Entrez db name for m_TargetSeq: nucleotide/protein or Undef if no TargetSeq is given. More... | |
int | m_MaxNAMeta |
maximal number of NAAs for retrieving meta-data. More... | |
Static Private Attributes | |
static TNAAtoUidCache | sm_NAAtoUidCache |
static TEntrezIdtoMetaDataCache | sm_UidtoMetaDataCache |
static TEntrezIdtoGiCache | sm_UidtoGiCache |
Definition at line 115 of file na_utils.hpp.