130 rval =
"Not Splice Consensus";
133 rval =
"EC Number Format";
139 rval =
"EC Number Value";
142 rval =
"EC Number Problem";
145 rval =
"Bad Specific-host Values";
148 rval =
"Bad Institution Codes";
151 rval =
"LatLonCountry Errors";
154 rval =
"LatLonGeoLocName Errors";
159 if (use_geo_loc_name) {
160 rval =
"LatLonGeoLocName Errors";
162 rval =
"LatLonCountry Errors";
179 switch (
error.GetErrIndex()) {
226 else if (
NStr::Find(
msg,
"(GT) not found") != string::npos) {
228 }
else if (
NStr::Find(
msg,
"(AT-AC) found instead of (GT-AG)") != string::npos) {
229 rval =
"(AT-AC) instead of (GT-AG)";
230 }
else if (
NStr::Find(
msg,
"(GC-AG) found instead of (GT-AG)") != string::npos) {
231 rval =
"(GC-AG) instead of (GT-AG)";
237 size_t position_pos =
NStr::Find(
msg,
"ending at position ");
239 if (position_pos == string::npos || other_clue == string::npos) {
241 if (position_pos != string::npos) {
242 string pos_str =
msg.substr(position_pos);
244 if (sscanf(pos_str.c_str(),
"position %ld of ", &pos) == 1) {
247 if (seq_pos != string::npos) {
248 rval = pos_str.substr(seq_pos + 4) +
"\t" + rval;
253 string pos_str =
msg.substr(position_pos);
255 if (sscanf(pos_str.c_str(),
"ending at position %ld and before exon starting at position %ld of ", &pos1, &pos2) == 2) {
258 if (seq_pos != string::npos) {
259 rval = pos_str.substr(seq_pos + 4) +
"\t" + rval;
264 string obj_desc =
error.GetObjDesc();
265 size_t type_pos =
NStr::Find(obj_desc,
"FEATURE: ");
266 if (type_pos != string::npos) {
267 obj_desc = obj_desc.substr(type_pos + 9);
269 if (space_pos != string::npos) {
270 obj_desc = obj_desc.substr(0, space_pos);
274 rval = obj_desc +
"\t" + rval;
283 if (type_pos != string::npos) {
284 str =
str.substr(type_pos + prefix.length());
291 if (type_pos != string::npos) {
292 str =
str.substr(0, type_pos);
299 string obj_desc =
error.GetObjDesc();
301 obj_desc =
error.GetObj_content();
304 if (
error.IsSetLocation()) {
305 obj_desc +=
"\t" +
error.GetLocation();
307 if (
error.IsSetLocus_tag()) {
308 obj_desc +=
"\t" +
error.GetLocus_tag();
309 }
else if (
error.IsSetObject() &&
error.GetObject().GetThisTypeInfo() == CSeq_feat:: GetTypeInfo()) {
323 if (close_pos != string::npos) {
324 obj_desc = obj_desc.substr(0, close_pos);
328 string rval =
error.GetAccession() +
":" + obj_desc;
343 if (
error.GetObject().GetThisTypeInfo() != CSeq_feat::GetTypeInfo()) {
354 if ((*it)->IsSetQual() &&
361 ec_numbers += (*it)->GetVal();
377 ec_numbers =
"Blank EC number";
393 rval =
error.GetAccnver() +
"\t" + ec_numbers +
"\t" + locus_tag +
"\t" + prot_name;
406 if ((*it)->IsSetSubtype() &&
408 (*it)->IsSetSubname() &&
413 rval += (*it)->GetSubname();
425 const string kAlternateName =
"Specific host value is alternate name: ";
427 spec_host =
error.GetMsg().substr(kAlternateName.length());
428 }
else if (
error.GetObject().GetThisTypeInfo() == CSeqdesc::GetTypeInfo()) {
433 }
else if (
error.GetObject().GetThisTypeInfo() == CSeq_feat::GetTypeInfo()) {
441 rval =
error.GetAccession() +
"\t" + spec_host;
456 if ((*it)->IsSetSubtype() &&
460 (*it)->IsSetSubname() &&
462 size_t pos =
NStr::Find((*it)->GetSubname(),
":");
463 if (pos != string::npos) {
464 string code = (*it)->GetSubname().substr(0, pos);
484 if (
error.GetObject().GetThisTypeInfo() == CSeqdesc::GetTypeInfo()) {
490 else if (
error.GetObject().GetThisTypeInfo() == CSeq_feat::GetTypeInfo()) {
498 rval =
error.GetAccession() +
"\t" + codes;
509 if (err_code == vit->GetErrIndex()) {
515 rval += this_val +
"\n";
535 rval += this_val +
"\n";
545 string rval =
error.GetAccession() +
":" +
error.GetMsg();
552 vector<CValidErrItem::TErrIndex> list;
555 list.push_back(vit->GetErrIndex());
557 sort(list.begin(), list.end());
558 list.erase(unique(list.begin(), list.end()), list.end());
571 list.push_back(this_val);
577 ITERATE(vector<CValidErrItem::TErrIndex>, it, codes) {
581 list.push_back(this_val);
593 if (object_id.
IsId()) {
595 }
else if (object_id.
IsStr()) {
596 feature_id = object_id.
GetStr();
640 if (pos != string::npos &&
str.c_str()[pos + 1] != 0 &&
str.c_str()[pos + 1] !=
' ') {
641 str =
str.substr(0, pos + 1) +
" " +
str.substr(pos + 1);
644 if (pos != string::npos &&
str.c_str()[pos + 1] != 0 &&
str.c_str()[pos + 1] !=
' ') {
645 str =
str.substr(0, pos + 1) +
" " +
str.substr(pos + 1);
659 org.
GetDb().front()->GetLabel(&content);
683 tlabel += prefix + (**it).GetQual();
685 if (!(**it).GetVal().empty()) {
686 tlabel +=
"=" + (**it).GetVal();
693 if (tlabel.empty()) {
756 it->GetProt().GetLabel(&content);
779 string content_label;
783 content_label =
"Cit: ";
793 string tmp =
"[" +
key +
"]";
795 content_label =
key + content_label.substr(
tmp.length());
803 content_label =
"tRNA: ";
814 content_label =
"mat_peptide: " + content_label.substr(6);
817 content_label =
"sig_peptide: " + content_label.substr(6);
820 content_label =
"trans_peptide: " + content_label.substr(6);
831 return content_label;
839 if (!suppress_context && scope) {
840 bool find_failed =
false;
860 }
catch (
const std::exception&) {
871 }
catch (
const std::exception&) {
885 if (suppress_context) {
893 if (loc_label.size() > 800) {
894 loc_label.replace(797,
NPOS,
"...");
896 if (!loc_label.empty()) {
911 if (suppress_context) {
919 if (loc_label.size() > 800) {
920 loc_label.replace(795,
NPOS,
"...");
931 string desc =
"FEATURE: ";
933 desc += content_label;
938 desc +=
" <" + feature_id +
"> ";
944 desc +=
" [" + loc_label +
"]";
950 desc += bioseq_label;
956 desc += product_label;
967 switch (ds.
Which()) {
978 content =
"Modifier: " + content.substr(8);
984 content =
"molInfo: " + content.substr(10);
990 content =
"comment: ";
994 content =
"UserObj: ";
1006 string first = content.substr(0, 1);
1008 content =
first + content.substr(1);
1010 if (colon_pos != string::npos) {
1011 size_t dash_pos =
NStr::Find(content.substr(0, colon_pos),
"-");
1012 if (dash_pos != string::npos) {
1013 string after_dash = content.substr(dash_pos + 1, 1);
1015 content = content.substr(0, dash_pos) + after_dash + content.substr(dash_pos + 2);
1019 content =
"BioSrc:" + content.substr(10);
1021 content =
"Modifier:" + content.substr(6);
1023 content =
"EMBL:" + content.substr(5);
1025 content =
"PIR:" + content.substr(4);
1033 string desc(
"DESCRIPTOR: ");
1072 const auto isSetClass =
st.IsSetClass();
1073 suppress_context = suppress_context || !isSetClass;
1083 string str =
"BIOSEQ-SET: ";
1084 if (!suppress_context) {
1086 const string&
context = tv->FindName(setClass,
true);
1092 str +=
"(No Bioseqs)";
1096 string temporary(accession);
1106 string label =
"Unknown object";
1151 for (
auto code : suppressedCodes) {
1161 for (
auto code : suppressedCodes) {
1177 for (
auto code : suppressedCodes) {
1187 for (
auto code : suppressedCodes) {
1197 for (
auto it : errors.
SetErrs()) {
1198 if (it->IsSetLocus_tag()) {
1201 if (it->IsSetObjectType() &&
1203 it->IsSetObject() &&
1204 it->GetObject().GetThisTypeInfo() == CSeq_feat::GetTypeInfo()) {
1224 if (
g &&
g->IsSetLocus_tag()) {
1225 rval = &
g->GetLocus_tag();
User-defined methods of the data storage class.
User-defined methods of the data storage class.
@ eErr_SEQ_FEAT_NotSpliceConsensusAcceptor
@ eErr_SEQ_FEAT_EcNumberProblem
@ eErr_SEQ_FEAT_NotSpliceConsensusDonor
@ eErr_SEQ_DESCR_LatLonWater
@ eErr_SEQ_DESCR_LatLonCountry
@ eErr_SEQ_FEAT_NotSpliceConsensusAcceptorTerminalIntron
@ eErr_SEQ_FEAT_ReplacedEcNumber
@ eErr_SEQ_FEAT_NotSpliceConsensusDonorTerminalIntron
@ eErr_SEQ_FEAT_BadEcNumberValue
@ eErr_SEQ_DESCR_BadInstitutionCode
@ eErr_SEQ_FEAT_NotSpliceConsensus
@ eErr_SEQ_DESCR_LatLonGeoLocName
@ eErr_SEQ_FEAT_SplitEcNumber
@ eErr_SEQ_FEAT_RareSpliceConsensusDonor
@ eErr_SEQ_FEAT_DeletedEcNumber
@ eErr_SEQ_FEAT_BadEcNumberFormat
@ eErr_SEQ_DESCR_BadSpecificHost
void GetLabel(string *label, ELabelType type, bool worst=false) const
void GetLabel(string *label) const
Base class for all object manager exceptions.
Exceptions for objmgr/util library.
void GetLabel(string *label) const
bool GetLabel(string *label, TLabelFlags flags=0, ELabelVersion version=eLabel_DefaultVersion) const override
Append a label to "label" based on content.
ESubtype GetSubtype(void) const
namespace ncbi::objects::
const CGene_ref * GetGeneXref(void) const
See related function in util/feature.hpp.
Seq-loc iterator class – iterates all intervals from a seq-loc in the correct order.
void GetLabel(string *const label, ELabelType label_type) const
static bool NCBI_UseGeoLocNameForCountry(void)
Template class for iteration on objects of class C (non-medifiable version)
static const string & ConvertErrCode(unsigned int)
static void AddSuppression(CUser_object &user, TErrCode errCode)
static void SetSuppressedCodes(const CUser_object &user, TCodes &errCodes)
void SuppressError(unsigned int ec)
Include a standard set of the NCBI C++ Toolkit most basic headers.
static DLIST_TYPE *DLIST_NAME() first(DLIST_LIST_TYPE *list)
static const char * str(char *buf, int n)
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
TErrCode GetErrCode(void) const
Get error code.
#define ENUM_METHOD_NAME(EnumName)
string GetLabel(const CSeq_id &id)
virtual void Assign(const CSerialObject &source, ESerialRecursionMode how=eRecursive)
Override Assign() to incorporate cache invalidation.
const CSeq_id & GetSeq_id(void) const
Get seq_id of the current location.
CConstBeginInfo ConstBegin(const C &obj)
Get starting point of non-modifiable object hierarchy.
const CSeq_id & GetId(const CSeq_loc &loc, CScope *scope)
If all CSeq_ids embedded in CSeq_loc refer to the same CBioseq, returns the first CSeq_id found,...
void ChangeSeqLocId(CSeq_loc *loc, bool best, CScope *scope)
Change each of the CSeq_ids embedded in a CSeq_loc to the best or worst CSeq_id accoring to the value...
CConstRef< CSeq_feat > GetGeneForFeature(const CSeq_feat &feat, CScope &scope)
Finds gene for feature, but obeys SeqFeatXref directives.
CBioseq_Handle GetBioseqHandle(const CSeq_id &id)
Get bioseq handle by seq-id.
@ eFindFailed
The data requested can not be found.
CConstRef< CBioseq > GetCompleteBioseq(void) const
Get the complete bioseq.
TBioseqCore GetBioseqCore(void) const
Get bioseq core structure.
CConstRef< CSeq_entry > GetCompleteSeq_entry(void) const
Complete and get const reference to the seq-entry.
#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 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 SIZE_TYPE Find(const CTempString str, const CTempString pattern, ECase use_case=eCase, EDirection direction=eForwardSearch, SIZE_TYPE occurrence=0)
Find the pattern in the 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 enable_if< is_arithmetic< TNumeric >::value||is_convertible< TNumeric, Int8 >::value, string >::type NumericToString(TNumeric value, TNumToStringFlags flags=0, int base=10)
Convert numeric value to 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 string & ToUpper(string &str)
Convert string to upper case – string& version.
static const char label[]
bool IsSetOrg(void) const
Check if a value has been assigned to Org data member.
const TOrg & GetOrg(void) const
Get the Org member data.
bool IsSetLocus_tag(void) const
systematic gene name (e.g., MI0001, ORF0069) Check if a value has been assigned to Locus_tag data mem...
const TLocus_tag & GetLocus_tag(void) const
Get the Locus_tag member data.
bool IsStr(void) const
Check if variant Str is selected.
bool IsSetDb(void) const
name of database or system Check if a value has been assigned to Db data member.
bool IsSetType(void) const
type of object within class Check if a value has been assigned to Type data member.
const TTag & GetTag(void) const
Get the Tag member data.
bool IsId(void) const
Check if variant Id is selected.
bool IsSetTag(void) const
appropriate tag Check if a value has been assigned to Tag data member.
const TDb & GetDb(void) const
Get the Db member data.
bool IsSetClass(void) const
endeavor which designed this object Check if a value has been assigned to Class data member.
const TClass & GetClass(void) const
Get the Class member data.
bool IsSetLabel(void) const
field label Check if a value has been assigned to Label data member.
const TStr & GetStr(void) const
Get the variant data.
const TLabel & GetLabel(void) const
Get the Label member data.
const TType & GetType(void) const
Get the Type member data.
TId GetId(void) const
Get the variant data.
const TMod & GetMod(void) const
Get the Mod member data.
bool IsSetDb(void) const
ids in taxonomic or culture dbases Check if a value has been assigned to Db data member.
bool IsSetCommon(void) const
common name Check if a value has been assigned to Common data member.
const TTaxname & GetTaxname(void) const
Get the Taxname member data.
const TCommon & GetCommon(void) const
Get the Common member data.
const TDb & GetDb(void) const
Get the Db member data.
bool IsSetMod(void) const
Check if a value has been assigned to Mod data member.
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_nat_host
natural host of this specimen
@ eSubtype_specimen_voucher
@ eSubtype_culture_collection
const TName & GetName(void) const
Get the Name member data.
bool IsSetEc(void) const
E.C.
TProcessed GetProcessed(void) const
Get the Processed member data.
bool IsSetProcessed(void) const
Check if a value has been assigned to Processed data member.
bool IsSetName(void) const
protein name Check if a value has been assigned to Name data member.
const TEc & GetEc(void) const
Get the Ec member data.
@ eProcessed_signal_peptide
@ eProcessed_transit_peptide
const TKey & GetKey(void) const
Get the Key member data.
bool IsSetComment(void) const
Check if a value has been assigned to Comment data member.
const TData & GetData(void) const
Get the Data member data.
const TPub & GetPub(void) const
Get the variant data.
bool IsSetData(void) const
the specific data Check if a value has been assigned to Data data member.
bool IsSetQual(void) const
qualifiers Check if a value has been assigned to Qual data member.
E_Choice Which(void) const
Which variant is currently selected.
bool IsProt(void) const
Check if variant Prot is selected.
const TIds & GetIds(void) const
Get the Ids member data.
bool IsCdregion(void) const
Check if variant Cdregion is selected.
const TQual & GetQual(void) const
Get the Qual member data.
bool IsSetKey(void) const
Check if a value has been assigned to Key data member.
const TId & GetId(void) const
Get the Id member data.
const TLocal & GetLocal(void) const
Get the variant data.
bool IsSetXref(void) const
cite other relevant features Check if a value has been assigned to Xref data member.
const TLocation & GetLocation(void) const
Get the Location member data.
bool IsLocal(void) const
Check if variant Local is selected.
bool IsGene(void) const
Check if variant Gene is selected.
const TData & GetData(void) const
Get the Data member data.
bool IsSetData(void) const
the specific data Check if a value has been assigned to Data data member.
const TGeneral & GetGeneral(void) const
Get the variant data.
list< CRef< CFeat_id > > TIds
bool IsSetIds(void) const
set of Ids; will replace 'id' field Check if a value has been assigned to Ids data member.
const TBiosrc & GetBiosrc(void) const
Get the variant data.
bool IsSetId(void) const
Check if a value has been assigned to Id data member.
const TProduct & GetProduct(void) const
Get the Product member data.
const TComment & GetComment(void) const
Get the Comment member data.
bool IsBiosrc(void) const
Check if variant Biosrc is selected.
const TGene & GetGene(void) const
Get the variant data.
const TProt & GetProt(void) const
Get the variant data.
const TXref & GetXref(void) const
Get the Xref member data.
vector< CRef< CSeqFeatXref > > TXref
vector< CRef< CGb_qual > > TQual
bool IsGeneral(void) const
Check if variant General is selected.
bool IsSetProduct(void) const
product of process Check if a value has been assigned to Product data member.
const TImp & GetImp(void) const
Get the variant data.
bool IsSetLocation(void) const
feature made from Check if a value has been assigned to Location data member.
@ e_Pub
publication applies to this seq
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.
E_Choice Which(void) const
Which variant is currently selected.
const TPub & GetPub(void) const
Get the Pub member data.
@ e_User
user defined object
@ e_Pub
a reference to the publication
@ e_Comment
a more extensive comment
@ e_Molinfo
info on the molecule and techniques
@ e_Source
source of materials, includes Org-ref
TErrs & SetErrs(void)
Assign a value to Errs data member.
constexpr auto sort(_Init &&init)
const string version
version string
const struct ncbi::grid::netcache::search::fields::KEY key
static SLJIT_INLINE sljit_ins st(sljit_gpr r, sljit_s32 d, sljit_gpr x, sljit_gpr b)
static SLJIT_INLINE sljit_ins msg(sljit_gpr r, sljit_s32 d, sljit_gpr x, sljit_gpr b)
int g(Seg_Gsm *spe, Seq_Mtf *psm, Thd_Gsm *tdg)
static CS_CONTEXT * context