45 {
"assembly",
"Genome Assembly" },
47 {
"nucleotide",
"Nucleotide" },
48 {
"protein",
"Protein" },
54 {
"genomeprj_genome",
"Chromosomes" },
55 {
"genomeprj_nucleotide",
"Contigs" },
56 {
"genomeprj_nucleotide_mrna",
"mRNAs" },
57 {
"genomeprj_nucleotide_wgs",
"Whole Genome Shotgun sequences" },
58 {
"genomeprj_organella",
"Organelles" },
59 {
"genomeprj_protein",
"Proteins" },
77 *
str +=
"Entrez DocumentSummary Record";
85 *
str +=
"Entrez Record";
94 itDesc = xmlNode->
GetNode().
find(
"AssemblyDescription");
149 names.push_back(it->first);
156 name_pairs.push_back(
TNamePair(it->first, it->second));
164 return (it == sc_EntrezDbMap.end()) ?
kEmptyStr : it->second;
171 if (iter->second == visible_name) {
198 LOG_POST(
Error <<
"CEntrezDB::Query(): error executing search Entrez query: " << terms <<
": " << e.
GetMsg());
209 ecli.
Summary(db_name, uids, docsums,
"2.0");
212 LOG_POST(
Error <<
"CEntrezDB::Query(): error executing summary Entrez query: " << terms <<
": " << e.
GetMsg());
223 annot->
SetData().SetIds().push_back(
id);
226 string title(
"Query: ");
228 title +=
", database: ";
232 title +=
" sequence";
233 if (ds_set.
size() != 1) {
262 vector<TEntrezId> uids;
272 ecli.
Fetch(
"gene", uids, asnGene,
"asn.1");
276 LOG_POST(
Error <<
"CEntrezDB::CreateGene_Gene(): error fetching ID " << uid <<
": " << e.
GetMsg());
288 vector<TEntrezId> uids;
303 if (uids.size() % 5 == 4 || iter == ds_set.
end()) {
307 ecli.
Fetch(
"gene", uids, asnGene,
"asn.1");
324 gene_set->Set().push_back(egene);
334 catch (
const std::exception& e) {
342 while (iter != ds_set.
end());
343 if ( gene_set && gene_set->IsSet() && !gene_set->Get().size() ) {
static CRef< objects::CEntrezgene > CreateGene_Gene(const xml::node &ds)
static void GetDbNames(vector< string > &names)
static TGi GetUidAttr(const xml::node &ds)
static string GetDbName(const string &visible_name)
static string GetVisibleName(const string &db_name)
static CRef< objects::CSeq_id > CreateId_Nuc_Prot(const xml::node &ds)
static CRef< objects::CEntrezgene_Set > CreateGeneSet_Gene(const xml::node_set &ds_set)
pair< string, string > TNamePair
static void Query(const string &db_name, const string &terms, size_t &total_uids, xml::document &docsums, size_t max_return=0)
static CRef< objects::CSeq_annot > CreateAnnot_Nuc_Prot(const string &query_str, const xml::node_set &ds_set)
void Fetch(const string &db, const vector< objects::CSeq_id_Handle > &uids, CNcbiOstream &ostr, const string &retmode="xml")
void SetMaxReturn(int ret_max)
void Summary(const string &db, const vector< objects::CSeq_id_Handle > &uids, xml::document &docsums, const string &version="")
void SetNameDesc(const string &name)
void SetCreateDate(const CTime &dt)
class CStaticArrayMap<> is an array adaptor that provides an STLish interface to statically-defined a...
TBase::const_iterator const_iterator
void GetLabel(const CObject &obj, string *str, CLabel::ELabelType type, objects::CScope *scope) const
const xml::node & GetNode() const
const char * get_value(void) const
Get the value of this attribute.
Const Iterator class for accessing attribute pairs.
iterator end(void)
Get an iterator that points one past the the last attribute.
The xml::document class is used to hold the XML tree and various bits of information about it.
The xml::node::const_iterator provides a way to access children nodes similar to a standard C++ conta...
The xml::node_set::const_iterator class is used to iterate over nodes in a node set.
The xml::node_set class is used to store xpath query result set.
iterator begin()
Get an iterator that points to the beginning of the xpath query result node set.
size_t size() const
Get the number of nodes in the xpath query result node set.
iterator end()
Get an iterator that points one past the last node in the xpath query result node set.
The xml::node class is used to hold information about one XML node.
attributes::iterator find_attribute(const char *name, const ns *nspace=NULL)
Search for a node attribute.
iterator end(void)
Get an iterator that points one past the last child for this node.
iterator find(const char *name, const ns *nspace=NULL)
Find the first child node that has the given name and namespace.
const char * get_content(void) const
Get the content for this text node.
xml::attributes & get_attributes(void)
Get the list of attributes.
static const struct name_t names[]
CStaticPairArrayMap< const char *, const char *, PNocase_CStr > TEntrezDbMap
static const TPair sc_Pairs[]
DEFINE_STATIC_ARRAY_MAP(TEntrezDbMap, sc_EntrezDbMap, sc_Dbs)
CStaticPairArrayMap< const char *, const char *, PNocase_CStr > TGenomeLinkMap
SStaticPair< const char *, const char * > TPair
static const TPair sc_Dbs[]
SStrictId_Entrez::TId TEntrezId
TEntrezId type for entrez ids which require the same strictness as TGi.
#define GI_FROM(T, value)
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
#define LOG_POST(message)
This macro is deprecated and it's strongly recomended to move in all projects (except tests) to macro...
void Error(CExceptionArgs_Base &args)
const string & GetMsg(void) const
Get message string.
virtual const char * what(void) const noexcept
Standard report (includes full backlog).
static void ESearchQuery(const string &db, const string &term, TEntrezIds &uids, size_t &count, const int ret_max, const string &xpath="//IdList/Id/text()")
Queries esearch.fcgi and returns a vector of uids/seq-ids (seq-ids preferred for future compatibility...
vector< TEntrezId > TEntrezIds
static string CreateIdStr(const vector< T > &uids)
Convert a list of ids into a comma-delimited string.
static void RegisterLabelHandler(const string &type, ILabelHandler &handler)
static bool HasHandler(const CTypeInfo &type)
#define MSerial_AsnText
I/O stream manipulators –.
void Reset(void)
Reset reference object.
int64_t Int8
8-byte (64-bit) signed integer
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
static string SizetToString(size_t value, TNumToStringFlags flags=0, int base=10)
Convert size_t to string.
static Int8 StringToInt8(const CTempString str, TStringToNumFlags flags=0, int base=10)
Convert string to Int8.
@ fWithCommas
Use commas as thousands separator.
@ eCurrent
Use current time. See also CCurrentTime.
void SetData(TData &value)
Assign a value to Data data member.
Defines: CTimeFormat - storage class for time format.
static const char * str(char *buf, int n)
Template structure SStaticPair is simlified replacement of STL pair<> Main reason of introducing this...