84 string PrepareUrl(
bool use_dev_server,
const string &args)
86 string host = use_dev_server ?
"dev-api-int.ncbi.nlm.nih.gov" :
"api-int.ncbi.nlm.nih.gov";
87 string path =
"/biosample/fetch/";
88 string url =
"https://" + host + path +
"?" + args;
98 if (it != cache->
end())
104 string args =
"accession=" + accession +
"&format=asn1raw";
106 unique_ptr<CObjectIStream> in_stream;
111 *in_stream >> *response;
117 (*cache)[accession] = response;
122 static unsigned int suffix(1);
125 ofstream ostr(filename);
174 while (it != item.
end()) {
189 if (it != cache->
end())
196 string args =
"accession=" + accession;
199 document response(http_stream, &errors);
203 return status.second;
208 while (it != root.
end())
220 (*cache)[accession] = status;
227 string args =
"id=" + list +
"&bulk=true";
230 document response(http_stream, &errors);
235 while (it != root.
end())
239 status[response.first] = response.second;
250 list +=
"," + it->first;
283 return "ToBeCurated";
331 edit::CDBLinkField dblink_field(edit::CDBLinkField::eDBLinkFieldType_BioSample);
332 vector<CConstRef<CObject> > objs = dblink_field.GetObjects(bh);
334 vector<string> new_ids = dblink_field.GetVals(**it);
335 ITERATE(vector<string>, s, new_ids) {
349 vector<string> new_ids =
GetDBLinkIDs(*desc_ci,
"BioProject");
350 ITERATE(vector<string>, s, new_ids) {
361 stream <<
"#sample\tattribute";
363 stream <<
"\tSequenceID";
365 stream <<
"\told_value\tnew_value" << endl;
373 if (blank_sample && blank_src) {
377 stream << m_BiosampleID <<
"\t";
378 if (use_geo_loc_name && m_FieldName ==
"country") {
379 stream <<
"geo_loc_name" <<
"\t";
381 stream << m_FieldName <<
"\t";
384 stream << m_SequenceID <<
"\t";
386 stream << (blank_sample ?
"[[add]]" : m_SampleVal) <<
"\t";
387 stream << (blank_src ?
"[[delete]]" : m_SrcVal) << endl;
393 auto formattedValue = (
value +
string(width,
' ')).substr(0, width);
394 ostr << formattedValue;
400 size_t valueWidth)
const
403 auto newValue = GetSampleVal();
404 auto oldValue = GetSrcVal();
406 if (oldValue.empty() && !newValue.empty()) {
407 newValue =
string(
"[[add]] ") + newValue;
409 if (!oldValue.empty() && newValue.empty()) {
410 oldValue =
string(
"[[delete]] ") + oldValue;
425 stream << m_FieldName;
429 stream << m_SequenceID <<
"\t";
430 stream << (blank_sample ?
"" : m_SampleVal) <<
"\t";
431 stream << m_SrcVal <<
"\t";
457 int cmp = CompareAllButSequenceID(other);
473 string name1 = f1->GetLabel();
474 string name2 = f2->GetLabel();
490 fields.insert(fields.end(), src_fields.begin(), src_fields.end());
494 if (fields.size() < 2) {
499 TStructuredCommentTableColumnList::iterator f_prev = fields.begin();
500 TStructuredCommentTableColumnList::iterator f_next = f_prev;
502 while (f_next != fields.end()) {
503 if (
NStr::Equal((*f_prev)->GetLabel(), (*f_next)->GetLabel())) {
504 f_next = fields.erase(f_next);
522 rval.push_back(diff);
547 vector<CConstRef<CUser_object> > src_list;
549 src_list.push_back(s1);
551 src_list.push_back(s2);
556 if (
NStr::Equal((*it)->GetLabel(),
"StructuredCommentPrefix")
557 ||
NStr::Equal((*it)->GetLabel(),
"StructuredCommentSuffix")) {
560 string src_val = (*it)->GetFromComment(src);
561 string sample_val = (*it)->GetFromComment(sample);
565 rval.push_back(diff);
577 vector<CConstRef<CUser_object> > src_list;
579 src_list.push_back(src);
582 src_list.push_back(sample);
590 src_val = (*it)->GetFromComment(*src);
592 string sample_val =
"";
594 (*it)->GetFromComment(*sample);
598 rval.push_back(diff);
613 bool printed_header =
false;
616 string src_val = (*it)->GetSrcVal();
619 if (!printed_header) {
620 *
log <<
"Conflict found for " << (*it)->GetSequenceId() <<
" for " << (*it)->GetBioSample() << endl;
621 printed_header =
true;
623 *
log <<
"\t" << (*it)->GetFieldName() <<
": BioSource contains \"" << src_val <<
"\", BioSample contains \"" << (*it)->GetSampleVal() <<
"\"" << endl;
664 if ((*cit)->IsSetHeader() && (*cit)->GetHeader().IsSetTitle()
665 &&
NStr::Equal ((*cit)->GetHeader().GetTitle(), column_name)) {
676 while (
column->SetData().SetString().size() < row + 1) {
677 column->SetData().SetString().push_back (
"");
688 if ((*cit)->IsSetHeader() && (*cit)->GetHeader().IsSetTitle()
697 new_col->SetHeader().SetTitle(column_name);
699 table.SetColumns().push_back(new_col);
708 if (
column.IsSetData() &&
column.GetData().IsString() &&
column.GetData().GetString().size() > row) {
719 if ((*cit)->IsSetHeader() && (*cit)->GetHeader().IsSetTitle()
735 if ((*it)->IsSub()) {
752 bool include_comments,
const string& expected_prefix)
755 if (biosample_ids.size() > 0 && !with_id) {
757 string msg =
GetBestBioseqLabel(bh) +
" already has Biosample ID " + biosample_ids[0];
769 while (pub_desc_ci && !
s_IsCitSub(*pub_desc_ci)) {
773 if (!src_desc_ci && !comm_desc_ci && bioproject_ids.size() == 0 && !pub_desc_ci) {
778 size_t row =
table.GetNum_rows();
781 if (bioproject_ids.size() > 0) {
782 string val = bioproject_ids[0];
783 for (
size_t i = 1;
i < bioproject_ids.size();
i++) {
785 val += bioproject_ids[
i];
792 if ((*it)->IsSub() && (*it)->GetSub().IsSetAuthors() && (*it)->GetSub().GetAuthors().IsSetAffil()) {
793 const CAffil& affil = (*it)->GetSub().GetAuthors().GetAffil();
801 }
else if (affil.
IsStr()) {
817 if (include_comments) {
818 while (comm_desc_ci) {
822 string label = (*it)->GetLabel();
831 if (with_id && biosample_ids.size() > 0) {
834 int num_rows = (
int)row + 1;
835 table.SetNum_rows(num_rows);
858 if (biosample_ids.size() == 0) {
860 biosample_ids.push_back(biosample_accession);
864 ITERATE(vector<string>, it, biosample_ids) {
873 biosample_ids.clear();
874 biosample_ids.push_back(biosample_accession);
886 vector<CRef <CSeq_id> > id_list;
893 id_list.push_back(ic);
899 id->GetLabel(&
label);
908 const string& biosample_accession,
909 size_t& num_processed,
910 vector<string>& unprocessed_ids,
912 bool compare_structured_comments,
913 const string& expected_prefix,
920 vector<string> user_labels;
921 vector<CConstRef<CUser_object> > user_objs;
922 while (comm_desc_ci) {
927 user_labels.push_back(
prefix);
928 user_objs.push_back(obj);
942 string msg =
GetBestBioseqLabel(bh) +
" has conflicting BioSample Accession " + biosample_ids[0];
946 if (biosample_ids.size() == 0) {
953 ITERATE(vector<string>,
id, biosample_ids) {
957 if ((*it)->IsSource()) {
963 diffs.insert(diffs.end(), these_diffs.begin(), these_diffs.end());
966 if (compare_structured_comments) {
970 vector<string>::iterator sit = user_labels.begin();
971 vector<CConstRef<CUser_object> >::iterator uit = user_objs.begin();
972 while (sit != user_labels.end() && uit != user_objs.end()) {
975 diffs.insert(diffs.end(), these_diffs.begin(), these_diffs.end());
986 diffs.insert(diffs.end(), these_diffs.begin(), these_diffs.end());
993 unprocessed_ids.push_back(*
id);
1008 string country =
"";
1011 bool add_address =
false;
1018 if (affil && affil->IsStd()) {
1059 address->
insert(
node(
"Street", street.c_str()));
1062 address->
insert(
node(
"Country", country.c_str()));
1082 if ((*it)->IsSetSubtype() && (*it)->IsSetName()) {
1084 string attribute_name =
"";
1086 attribute_name =
"subsrc_note";
1091 string val = (*it)->GetName();
1108 if ((*it)->IsSetSubtype() && (*it)->IsSetSubname()) {
1109 string attribute_name =
"";
1111 attribute_name =
"orgmod_note";
1132 string label = (*it)->GetLabel();
1137 string val = (*it)->GetFromComment(usr);
1141 while (
a != sample_attrs.
end() && !found) {
1144 bool name_match =
false;
1145 while (at !=
a->get_attributes().end() && !name_match) {
1170 list<string> sbm_info;
1171 if (affil.
IsStd()) {
1180 }
else if (affil.
IsStr()) {
1181 sbm_info.push_back(affil.
GetStr());
1191 const string& id_prefix,
1193 const string& bioproject_accession,
1194 const string& default_owner,
1195 const string& hup_date,
1196 const string& comment,
1197 bool first_seq_only,
1198 bool report_structured_comments,
1199 const string& expected_prefix)
1202 if (biosample_ids.size() > 0) {
1204 string msg =
GetBestBioseqLabel(bh) +
" already has BioSample ID " + biosample_ids[0];
1208 if (bioproject_ids.size() > 0) {
1211 ITERATE(vector<string>, it, bioproject_ids) {
1220 " has conflicting BioProject ID " + bioproject_ids[0];
1223 bioproject_ids.clear();
1224 bioproject_ids.push_back(bioproject_accession);
1227 bioproject_ids.push_back(bioproject_accession);
1238 while (pub_desc_ci){
1241 if ((*it)->IsSub() && (*it)->GetSub().IsSetAuthors()) {
1242 auth_list = &((*it)->GetSub().GetAuthors());
1244 }
else if ((*it)->IsGen() && (*it)->GetGen().IsSetAuthors()) {
1245 auth_list = &((*it)->GetGen().GetAuthors());
1252 if (!src_desc_ci && !comm_desc_ci && bioproject_ids.size() == 0) {
1266 string title =
"Auto generated from GenBank Accession " + sequence_id;
1267 description->
insert(
node(
"Comment", title.c_str()));
1280 attrs.
insert(
"role",
"owner");
1281 attrs.
insert(
"type",
"institute");
1284 node owner(
"Owner");
1286 string owner_str =
"";
1291 owner_str = default_owner;
1294 organization->
insert(
node(
"Name", owner_str.c_str()));
1295 owner.
insert(
node(
"Name", owner_str.c_str()));
1302 description->
insert(hup);
1316 string sample_id = sequence_id;
1318 if (first_seq_only) {
1319 sample_id = id_prefix;
1321 sample_id = id_prefix +
":" + sequence_id;
1324 node_iter = ids->
insert(
node(
"SPUID", sample_id.c_str()));
1330 descr->
insert(
node(
"Description", comment.c_str()));
1337 if (bioproject_ids.size() > 0) {
1338 node links(
"BioProject");
1339 ITERATE(vector<string>, it, bioproject_ids) {
1340 if (! it->empty()) {
1341 node_iter = links.
insert(
node(
"PrimaryId", it->c_str()));
1348 sample->
insert(
node(
"Package",
"Generic.1.0"));
1350 node sample_attrs(
"Attributes");
1356 if (report_structured_comments) {
1357 while (comm_desc_ci) {
1366 sample->
insert(sample_attrs);
1368 node_iter = identifier->
insert(
node(
"SPUID", sample_id.c_str()));
1373 if (report_stream) {
1374 *report_stream << doc << endl;
1376 string path = sequence_id;
1381 path = path +
".xml";
1387 *xml_out << doc << endl;
1401 for (
auto pSampleDesc: bioSample.
Get()) {
1402 const CSeqdesc& sampleDesc = *pSampleDesc;
1407 "biosample",
"descriptors", bioSource, sampleDesc.
GetSource());
1408 diffs.insert(diffs.end(), these_diffs.begin(), these_diffs.end());
1417 const string& filename,
1424 ostr << asnText << object;
1432 const string& existingBiosampleAcc,
1440 existingBiosampleAcc,
false,
nullptr);
1442 bool assigned =
false;
1443 for (
auto pExistingDesc: pExistingBiosampleDescrs->
Get()) {
1444 CSeqdesc& existingDesc = *pExistingDesc;
1451 "submitted",
"curated", newBioSource, existingSource);
1452 if (!diffs.empty()) {
1454 proposedNewBiosource.
Assign(existingSource);
1462 return !diffs.empty();
1472 if (existingBiosource.
IsSetOrg()) {
1473 const auto& existingOrg = existingBiosource.
GetOrg();
1474 if (existingOrg.IsSetTaxname()) {
1476 newBiosource.
SetOrg().SetTaxname(existingOrg.GetTaxname());
1479 auto existingTaxId = existingOrg.GetTaxId();
1482 newBiosource.
SetOrg().SetTaxId(existingTaxId);
1488 auto& newOrgs = newBiosource.
SetOrg().SetOrgname().SetMod();
1489 for (
const auto& pExistingMod: existingOrgs) {
1490 auto existingSubtype = pExistingMod->GetSubtype();
1491 auto existingSubname = pExistingMod->GetSubname();
1492 bool alreadyThere =
false;
1493 for (
const auto& pNewMod: newOrgs) {
1494 auto newSubtype = pNewMod->GetSubtype();
1495 if ( newSubtype == existingSubtype) {
1496 alreadyThere =
true;
1504 newOrgs.push_back(pNewMod);
1509 const auto& existingSubtypes = existingBiosource.
GetSubtype();
1510 for (
const auto& pExistingSubSource: existingSubtypes) {
1511 if (!pExistingSubSource->CanGetName()) {
1514 auto existingSubtype = pExistingSubSource->GetSubtype();
1518 if (newBiosource.
HasSubtype(existingSubtype)) {
1522 pNewSubsource->
Assign(*pExistingSubSource);
1523 newBiosource.
SetSubtype().push_back(pNewSubsource);
1533 const string& fieldName)
1536 for (
const auto pDiff: diffs) {
1537 if (pDiff->GetFieldName() == fieldName) {
1552 if (existingBiosource.
IsSetOrg()) {
1553 const auto& existingOrg = existingBiosource.
GetOrg();
1556 if (fromDiff && !fromDiff->GetSrcVal().empty()) {
1557 newBiosource.
SetOrg().SetTaxname(existingOrg.GetTaxname());
1562 auto existingTaxId = existingOrg.GetTaxId();
1564 newBiosource.
SetOrg().SetTaxId(existingTaxId);
1571 auto& newOrgs = newBiosource.
SetOrg().SetOrgname().SetMod();
1572 for (
const auto& pExistingMod: existingOrgs) {
1573 auto existingSubtype = pExistingMod->GetSubtype();
1576 if (fromDiff && !fromDiff->GetSrcVal().empty()) {
1578 newOrgs.push_back(pNewMod);
1584 const auto& existingSubtypes = existingBiosource.
GetSubtype();
1585 auto& newSubtypes = newBiosource.
SetSubtype();
1586 for (
const auto& pExistingSubSource: existingSubtypes) {
1587 if (!pExistingSubSource->CanGetName()) {
1590 auto existingSubtype = pExistingSubSource->GetSubtype();
1593 if (pFromDiff && !pFromDiff->GetSrcVal().empty()) {
1595 new CSubSource(existingSubtype, pFromDiff->GetSrcVal()));
1596 newSubtypes.push_back(pNewSubsource);
1616 ostr <<
string(keyWidth + 2 * valueWidth,
'-') <<
"\n";
1618 for (
auto diff: diffList) {
1619 diff->PrettyPrint(ostr, keyWidth, valueWidth);
vector< CRef< CFieldDiff > > TFieldDiffList
User-defined methods of the data storage class.
User-defined methods of the data storage class.
bool s_ShouldIgnoreStructuredCommentFieldDiff(const string &label, const string &src_val, const string &sample_val)
bool UpdateBiosourceFromBiosample(const CBioSource &existingBiosource, CBioSource &newBiosource)
void AddBioseqToTable(CBioseq_Handle bh, CSeq_table &table, bool with_id, bool include_comments, const string &expected_prefix)
string OwnerFromAffil(const CAffil &affil)
static const char * kAffilInst
string GetValueFromColumn(const CSeqTable_column &column, size_t row)
void AddBioSourceToAttributes(node &organism, node &sample_attrs, const CBioSource &src)
void HarmonizeAttributeName(string &attribute_name)
vector< string > GetDBLinkIDs(const CUser_object &user, const string &field_name)
bool s_IsReportableStructuredComment(const CSeqdesc &desc, const string &expected_prefix)
void s_AddSamplePair(node &sample_attrs, string attribute_name, string val)
bool ResolveSuppliedBioSampleAccession(const string &biosample_accession, vector< string > &biosample_ids)
EStatus GetBioSampleStatusFromNode(const node &item)
static const char * kSequenceID
static const char * kStructuredCommentPrefix
static const char * kStructuredCommentSuffix
vector< string > GetBioProjectIDs(CBioseq_Handle bh)
CRef< CSeqTable_column > FindSeqTableColumnByName(CRef< CSeq_table > values_table, string column_name)
void AddValueToTable(CSeq_table &table, string column_name, string value, size_t row)
static const char * kAffilDept
string PrepareUrl(bool use_dev_server, const string &args)
bool DoDiffsContainConflicts(const TBiosampleFieldDiffList &diffs, CNcbiOstream *log)
string GetBestBioseqLabel(CBioseq_Handle bsh)
static const char * kBioProject
TStatus ProcessBiosampleStatusNode(node &item)
CRef< CSeq_descr > GetBiosampleData(const string &accession, bool use_dev_server, TBioSamples *cache)
bool s_CompareStructuredCommentFields(CRef< CStructuredCommentTableColumnBase > f1, CRef< CStructuredCommentTableColumnBase > f2)
CConstRef< CBiosampleFieldDiff > sGetDiffByFieldName(const TBiosampleFieldDiffList &diffs, const string &fieldName)
void PrettyPrint(const TBiosampleFieldDiffList &diffList, CNcbiOstream &ostr, size_t keyWidth, size_t valueWidth)
TStructuredCommentTableColumnList GetAvailableFields(vector< CConstRef< CUser_object > > src)
static bool s_IsCitSub(const CSeqdesc &desc)
void AddStructuredCommentToAttributes(node &sample_attrs, const CUser_object &usr)
TBiosampleFieldDiffList GetBioseqDiffs(CBioseq_Handle bh, const string &biosample_accession, size_t &num_processed, vector< string > &unprocessed_ids, bool use_dev_server, bool compare_structured_comments, const string &expected_prefix, TBioSamples *cache)
void PrintBioseqXML(CBioseq_Handle bh, const string &id_prefix, CNcbiOstream *report_stream, const string &bioproject_accession, const string &default_owner, const string &hup_date, const string &comment, bool first_seq_only, bool report_structured_comments, const string &expected_prefix)
string GetBiosampleStatusName(EStatus status)
EStatus GetBiosampleStatus(const string &accession, bool use_dev_server, TStatuses *cache)
void sPrintField(const string &value, size_t width, CNcbiOstream &ostr)
void GenerateDiffListFromBioSource(const CSeq_descr &bioSample, const CBioSource &bioSource, TBiosampleFieldDiffList &diffs)
void AddContact(node::iterator &organization, CConstRef< CAuth_list > auth_list)
bool AttributeNamesAreEquivalent(string name1, string name2)
string GetValueFromTable(const CSeq_table &table, string column_name, size_t row)
void SaveSerialObject(const string &filename, const CSerialObject &object)
void AddValueToColumn(CRef< CSeqTable_column > column, string value, size_t row)
void ProcessBulkBioSample(TStatuses &status, string list, bool use_dev_server)
vector< string > GetBiosampleIDs(CBioseq_Handle bh)
TBiosampleFieldDiffList GetFieldDiffs(const string &sequence_id, const string &biosample_id, const CBioSource &src, const CBioSource &sample)
vector< CRef< CBiosampleFieldDiff > > TBiosampleFieldDiffList
map< string, CRef< CSeq_descr > >::iterator TBioSamplesIterator
pair< string, biosample_util::EStatus > TStatus
map< string, EStatus >::iterator TStatusesIterator
@Affil.hpp User-defined methods of the data storage class.
static bool ShouldIgnoreConflict(const string &label, string src_val, string sample_val, bool is_local_copy=false)
TNameValList GetNameValPairs() const
static bool IsStopWord(const string &value)
bool HasSubtype(CSubSource::TSubtype subtype) const
vector< TNameVal > TNameValList
bool IsSetTaxname(void) const
TFieldDiffList GetBiosampleDiffs(const CBioSource &biosample, bool is_local_copy=false) const
int Compare(const CBiosampleFieldDiff &other)
static void PrintHeader(ncbi::CNcbiOstream &stream, bool show_seq_id=true)
void PrettyPrint(ncbi::CNcbiOstream &stream, size_t keyWidth=20, size_t valueWidth=40) const
void Print(ncbi::CNcbiOstream &stream, bool show_seq_id=true) const
int CompareAllButSequenceID(const CBiosampleFieldDiff &other)
This stream exchanges data with an HTTP server located at the URL: http[s]://host[:port]/path[?...
@Name_std.hpp User-defined methods of the data storage class.
@OrgMod.hpp User-defined methods of the data storage class.
static string GetSubtypeName(TSubtype stype, EVocabulary vocabulary=eVocabulary_raw)
bool IsSetOrgMod(void) const
@Seq_descr.hpp User-defined methods of the data storage class.
Base class for all serializable objects.
static bool NCBI_UseGeoLocNameForCountry(void)
static string GetSubtypeName(CSubSource::TSubtype stype, EVocabulary vocabulary=eVocabulary_raw)
static bool NeedsNoText(const TSubtype &subtype)
const CUser_field & GetField(const string &str, const string &delim=".", NStr::ECase use_case=NStr::eCase) const
Access a named field in this user object.
container_type::iterator iterator
const_iterator begin() const
const_iterator end() const
const_iterator find(const key_type &key) const
const char * get_value(void) const
Get the value of this attribute.
const char * get_name(void) const
Get the name of this attribute.
Const Iterator class for accessing attribute pairs.
Iterator class for accessing attribute pairs.
The xml::attributes class is used to access all the attributes of one xml::node.
iterator begin(void)
Get an iterator that points to the first attribute.
iterator end(void)
Get an iterator that points one past the the last attribute.
void insert(const char *name, const char *value, const ns *nspace=NULL)
Add an attribute to the attributes list.
The xml::document class is used to hold the XML tree and various bits of information about it.
void set_encoding(const char *encoding)
Set the XML encoding string.
const node & get_root_node(void) const
Get a reference to the root node of this document.
void set_is_standalone(bool sa)
Set the standalone flag.
The xml::error_messages class is used to store all the error message which are collected while parsin...
The xml::node::iterator provides a way to access children nodes similar to a standard C++ container.
The xml::node class is used to hold information about one XML node.
const char * get_name(void) const
Get the name of this xml::node.
iterator end(void)
Get an iterator that points one past the last child for this node.
iterator begin(void)
Get an iterator that points to the beginning of this node's children.
iterator insert(const node &n)
Insert a new child node.
xml::attributes & get_attributes(void)
Get the list of attributes.
void Print(const CCompactSAMApplication::AlignInfo &ai)
Include a standard set of the NCBI C++ Toolkit most basic headers.
The NCBI C++ standard methods for dealing with std::string.
static DLIST_TYPE *DLIST_NAME() first(DLIST_LIST_TYPE *list)
static DLIST_TYPE *DLIST_NAME() last(DLIST_LIST_TYPE *list)
static DLIST_TYPE *DLIST_NAME() prev(DLIST_LIST_TYPE *list, DLIST_TYPE *item)
#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 NCBI_THROW(exception_class, err_code, message)
Generic macro to throw an exception, given the exception class, error code and message string.
virtual void Assign(const CSerialObject &source, ESerialRecursionMode how=eRecursive)
Set object to copy of another one.
static int BestRank(const CRef< CSeq_id > &id)
vector< CSeq_id_Handle > TId
const TId & GetId(void) const
TObjectType * GetPointer(void) const THROWS_NONE
Get pointer,.
void Reset(void)
Reset reference object.
#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.
IO_PREFIX::ofstream CNcbiOfstream
Portable alias for ofstream.
IO_PREFIX::ostream CNcbiOstream
Portable alias for ostream.
static int CompareNocase(const CTempString s1, SIZE_TYPE pos, SIZE_TYPE n, const char *s2)
Case-insensitive compare of a substring with another string.
static bool IsBlank(const CTempString str, SIZE_TYPE pos=0)
Check if a string is blank (has no text).
static string IntToString(int value, TNumToStringFlags flags=0, int base=10)
Convert int to string.
static string Join(const TContainer &arr, const CTempString &delim)
Join strings using the specified delimiter.
static int Compare(const CTempString s1, SIZE_TYPE pos, SIZE_TYPE n, const char *s2, ECase use_case=eCase)
Compare of a substring with another string.
static bool StartsWith(const CTempString str, const CTempString start, ECase use_case=eCase)
Check if a string starts with a specified prefix value.
static bool EqualNocase(const CTempString s1, SIZE_TYPE pos, SIZE_TYPE n, const char *s2)
Case-insensitive equality of a substring with another string.
static bool Equal(const CTempString s1, SIZE_TYPE pos, SIZE_TYPE n, const char *s2, ECase use_case=eCase)
Test for equality of a substring with another string.
static string & ReplaceInPlace(string &src, const string &search, const string &replace, SIZE_TYPE start_pos=0, SIZE_TYPE max_replace=0, SIZE_TYPE *num_replace=0)
Replace occurrences of a substring within a string.
static int CompareCase(const CTempString s1, SIZE_TYPE pos, SIZE_TYPE n, const char *s2)
Case-sensitive compare of a substring with another string.
@ eNocase
Case insensitive compare.
@ eCurrent
Use current time. See also CCurrentTime.
C::value_type FindBestChoice(const C &container, F score_func)
Find the best choice (lowest score) for values in a container.
static const char label[]
bool IsSetAffil(void) const
author affiliation Check if a value has been assigned to Affil data member.
const TAffil & GetAffil(void) const
Get the Affil member data.
bool IsSetStreet(void) const
street address, not ANSI Check if a value has been assigned to Street data member.
const TStr & GetStr(void) const
Get the variant data.
bool IsSetCity(void) const
Author Affiliation, City Check if a value has been assigned to City data member.
const TEmail & GetEmail(void) const
Get the Email member data.
bool IsSetEmail(void) const
Check if a value has been assigned to Email data member.
const TStreet & GetStreet(void) const
Get the Street member data.
const TAffil & GetAffil(void) const
Get the Affil member data.
const TSub & GetSub(void) const
Get the Sub member data.
bool IsStr(void) const
Check if variant Str is selected.
bool IsSetNames(void) const
Check if a value has been assigned to Names data member.
bool IsSetDiv(void) const
Author Affiliation, Division Check if a value has been assigned to Div data member.
const TCountry & GetCountry(void) const
Get the Country member data.
const TStd & GetStd(void) const
Get the variant data.
const TNames & GetNames(void) const
Get the Names member data.
const TStd & GetStd(void) const
Get the variant data.
bool IsStd(void) const
Check if variant Std is selected.
bool IsSetCountry(void) const
Author Affiliation, Country Check if a value has been assigned to Country data member.
const TCity & GetCity(void) const
Get the City member data.
bool IsSetAffil(void) const
Author Affiliation, Name Check if a value has been assigned to Affil data member.
const TDiv & GetDiv(void) const
Get the Div member data.
bool IsSetSub(void) const
Author Affiliation, County Sub Check if a value has been assigned to Sub data member.
bool IsStd(void) const
Check if variant Std is selected.
const TSubtype & GetSubtype(void) const
Get the Subtype member data.
bool IsSetOrg(void) const
Check if a value has been assigned to Org data member.
list< CRef< CSubSource > > TSubtype
bool IsSetSubtype(void) const
Check if a value has been assigned to Subtype data member.
const TOrg & GetOrg(void) const
Get the Org member data.
void SetOrg(TOrg &value)
Assign a value to Org data member.
TSubtype & SetSubtype(void)
Assign a value to Subtype data member.
bool IsStr(void) const
Check if variant Str is selected.
bool IsSetType(void) const
type of object within class Check if a value has been assigned to Type data member.
bool IsStrs(void) const
Check if variant Strs is selected.
const TStrs & GetStrs(void) const
Get the variant data.
const TData & GetData(void) const
Get the Data member data.
bool IsSetLast(void) const
Check if a value has been assigned to Last data member.
const TStr & GetStr(void) const
Get the variant data.
const TType & GetType(void) const
Get the Type member data.
const TFirst & GetFirst(void) const
Get the First member data.
const TLast & GetLast(void) const
Get the Last member data.
bool IsSetData(void) const
Check if a value has been assigned to Data data member.
vector< CStringUTF8 > TStrs
bool IsSetFirst(void) const
Check if a value has been assigned to First data member.
const TMod & GetMod(void) const
Get the Mod member data.
const TTaxname & GetTaxname(void) const
Get the Taxname member data.
list< CRef< COrgMod > > TMod
bool IsSetOrgname(void) const
Check if a value has been assigned to Orgname data member.
bool IsSetTaxname(void) const
preferred formal name Check if a value has been assigned to Taxname data member.
const TOrgname & GetOrgname(void) const
Get the Orgname member data.
@ eSubtype_other
ASN5: old-name (254) will be added to next spec.
list< CRef< CPub > > Tdata
const Tdata & Get(void) const
Get the member data.
const TColumns & GetColumns(void) const
Get the Columns member data.
vector< CRef< CSeqTable_column > > TColumns
bool IsGenbank(void) const
Check if variant Genbank is selected.
list< CRef< CSeqdesc > > Tdata
const TUser & GetUser(void) const
Get the variant data.
const TSource & GetSource(void) const
Get the variant data.
const TPub & GetPub(void) const
Get the variant data.
bool IsSource(void) const
Check if variant Source is selected.
const Tdata & Get(void) const
Get the member data.
bool IsPub(void) const
Check if variant Pub is selected.
bool IsSetPub(void) const
the citation(s) Check if a value has been assigned to Pub data member.
const TPub & GetPub(void) const
Get the Pub member data.
bool IsUser(void) const
Check if variant User is selected.
@ e_User
user defined object
@ e_Pub
a reference to the publication
@ e_Source
source of materials, includes Org-ref
unsigned int
A callback function used to compare two keys in a database.
<!DOCTYPE HTML >< html > n< header > n< title > PubSeq Gateway Help Page</title > n< style > n table
constexpr auto sort(_Init &&init)
constexpr bool empty(list< Ts... >) noexcept
static const char * suffix[]
static const char * prefix[]
static const char * column
vector< CRef< CStructuredCommentTableColumnBase > > TStructuredCommentTableColumnList
TStructuredCommentTableColumnList GetStructuredCommentFields(const CUser_object &src)