129 rval =
"Not Splice Consensus";
132 rval =
"EC Number Format";
138 rval =
"EC Number Value";
141 rval =
"EC Number Problem";
144 rval =
"Bad Specific-host Values";
147 rval =
"Bad Institution Codes";
151 rval =
"LatLonCountry Errors";
166 switch (
error.GetErrIndex()) {
208 string msg =
error.GetMsg();
209 if (
NStr::Find(msg,
"(AG) not found") != string::npos) {
212 else if (
NStr::Find(msg,
"(GT) not found") != string::npos) {
214 }
else if (
NStr::Find(msg,
"(AT-AC) found instead of (GT-AG)") != string::npos) {
215 rval =
"(AT-AC) instead of (GT-AG)";
216 }
else if (
NStr::Find(msg,
"(GC-AG) found instead of (GT-AG)") != string::npos) {
217 rval =
"(GC-AG) instead of (GT-AG)";
223 size_t position_pos =
NStr::Find(msg,
"ending at position ");
224 size_t other_clue =
NStr::Find(msg,
"and before exon");
225 if (position_pos == string::npos || other_clue == string::npos) {
227 if (position_pos != string::npos) {
228 string pos_str = msg.substr(position_pos);
230 if (sscanf(pos_str.c_str(),
"position %ld of ", &pos) == 1) {
233 if (seq_pos != string::npos) {
234 rval = pos_str.substr(seq_pos + 4) +
"\t" + rval;
239 string pos_str = msg.substr(position_pos);
241 if (sscanf(pos_str.c_str(),
"ending at position %ld and before exon starting at position %ld of ", &pos1, &pos2) == 2) {
244 if (seq_pos != string::npos) {
245 rval = pos_str.substr(seq_pos + 4) +
"\t" + rval;
250 string obj_desc =
error.GetObjDesc();
251 size_t type_pos =
NStr::Find(obj_desc,
"FEATURE: ");
252 if (type_pos != string::npos) {
253 obj_desc = obj_desc.substr(type_pos + 9);
255 if (space_pos != string::npos) {
256 obj_desc = obj_desc.substr(0, space_pos);
260 rval = obj_desc +
"\t" + rval;
269 if (type_pos != string::npos) {
277 if (type_pos != string::npos) {
278 str =
str.substr(0, type_pos);
285 string obj_desc =
error.GetObjDesc();
287 obj_desc =
error.GetObj_content();
290 if (
error.IsSetLocation()) {
291 obj_desc +=
"\t" +
error.GetLocation();
293 if (
error.IsSetLocus_tag()) {
294 obj_desc +=
"\t" +
error.GetLocus_tag();
295 }
else if (
error.IsSetObject() &&
error.GetObject().GetThisTypeInfo() == CSeq_feat:: GetTypeInfo()) {
309 if (close_pos != string::npos) {
310 obj_desc = obj_desc.substr(0, close_pos);
314 string rval =
error.GetAccession() +
":" + obj_desc;
329 if (
error.GetObject().GetThisTypeInfo() != CSeq_feat::GetTypeInfo()) {
340 if ((*it)->IsSetQual() &&
347 ec_numbers += (*it)->GetVal();
363 ec_numbers =
"Blank EC number";
379 rval =
error.GetAccnver() +
"\t" + ec_numbers +
"\t" + locus_tag +
"\t" + prot_name;
392 if ((*it)->IsSetSubtype() &&
394 (*it)->IsSetSubname() &&
399 rval += (*it)->GetSubname();
411 const string kAlternateName =
"Specific host value is alternate name: ";
413 spec_host =
error.GetMsg().substr(kAlternateName.length());
414 }
else if (
error.GetObject().GetThisTypeInfo() == CSeqdesc::GetTypeInfo()) {
419 }
else if (
error.GetObject().GetThisTypeInfo() == CSeq_feat::GetTypeInfo()) {
427 rval =
error.GetAccession() +
"\t" + spec_host;
442 if ((*it)->IsSetSubtype() &&
446 (*it)->IsSetSubname() &&
448 size_t pos =
NStr::Find((*it)->GetSubname(),
":");
449 if (pos != string::npos) {
450 string code = (*it)->GetSubname().substr(0, pos);
470 if (
error.GetObject().GetThisTypeInfo() == CSeqdesc::GetTypeInfo()) {
476 else if (
error.GetObject().GetThisTypeInfo() == CSeq_feat::GetTypeInfo()) {
484 rval =
error.GetAccession() +
"\t" + codes;
495 if (err_code == vit->GetErrIndex()) {
501 rval += this_val +
"\n";
521 rval += this_val +
"\n";
531 string rval =
error.GetAccession() +
":" +
error.GetMsg();
538 vector<CValidErrItem::TErrIndex> list;
541 list.push_back(vit->GetErrIndex());
543 sort(list.begin(), list.end());
544 list.erase(unique(list.begin(), list.end()), list.end());
557 list.push_back(this_val);
563 ITERATE(vector<CValidErrItem::TErrIndex>, it, codes) {
567 list.push_back(this_val);
579 if (object_id.
IsId()) {
581 }
else if (object_id.
IsStr()) {
582 feature_id = object_id.
GetStr();
626 if (pos != string::npos &&
str.c_str()[pos + 1] != 0 &&
str.c_str()[pos + 1] !=
' ') {
627 str =
str.substr(0, pos + 1) +
" " +
str.substr(pos + 1);
630 if (pos != string::npos &&
str.c_str()[pos + 1] != 0 &&
str.c_str()[pos + 1] !=
' ') {
631 str =
str.substr(0, pos + 1) +
" " +
str.substr(pos + 1);
645 org.
GetDb().front()->GetLabel(&content);
669 tlabel +=
prefix + (**it).GetQual();
671 if (!(**it).GetVal().empty()) {
672 tlabel +=
"=" + (**it).GetVal();
679 if (tlabel.empty()) {
742 it->GetProt().GetLabel(&content);
765 string content_label;
769 content_label =
"Cit: ";
779 string tmp =
"[" +
key +
"]";
781 content_label =
key + content_label.substr(
tmp.length());
789 content_label =
"tRNA: ";
800 content_label =
"mat_peptide: " + content_label.substr(6);
803 content_label =
"sig_peptide: " + content_label.substr(6);
806 content_label =
"trans_peptide: " + content_label.substr(6);
817 return content_label;
825 if (!suppress_context && scope) {
826 bool find_failed =
false;
846 }
catch (
const std::exception&) {
857 }
catch (
const std::exception&) {
871 if (suppress_context) {
879 if (loc_label.size() > 800) {
880 loc_label.replace(797,
NPOS,
"...");
882 if (!loc_label.empty()) {
897 if (suppress_context) {
905 if (loc_label.size() > 800) {
906 loc_label.replace(795,
NPOS,
"...");
917 string desc =
"FEATURE: ";
919 desc += content_label;
924 desc +=
" <" + feature_id +
"> ";
930 desc +=
" [" + loc_label +
"]";
936 desc += bioseq_label;
942 desc += product_label;
953 switch (ds.
Which()) {
964 content =
"Modifier: " + content.substr(8);
970 content =
"molInfo: " + content.substr(10);
976 content =
"comment: ";
980 content =
"UserObj: ";
992 string first = content.substr(0, 1);
994 content =
first + content.substr(1);
996 if (colon_pos != string::npos) {
997 size_t dash_pos =
NStr::Find(content.substr(0, colon_pos),
"-");
998 if (dash_pos != string::npos) {
999 string after_dash = content.substr(dash_pos + 1, 1);
1001 content = content.substr(0, dash_pos) + after_dash + content.substr(dash_pos + 2);
1005 content =
"BioSrc:" + content.substr(10);
1007 content =
"Modifier:" + content.substr(6);
1009 content =
"EMBL:" + content.substr(5);
1011 content =
"PIR:" + content.substr(4);
1019 string desc(
"DESCRIPTOR: ");
1059 suppress_context = suppress_context || !isSetClass;
1069 string str =
"BIOSEQ-SET: ";
1070 if (!suppress_context) {
1072 const string&
context = tv->FindName(setClass,
true);
1078 str +=
"(No Bioseqs)";
1082 string temporary(accession);
1092 string label =
"Unknown object";
1137 for (
auto code : suppressedCodes) {
1147 for (
auto code : suppressedCodes) {
1163 for (
auto code : suppressedCodes) {
1173 for (
auto code : suppressedCodes) {
1183 for (
auto it : errors.
SetErrs()) {
1184 if (it->IsSetLocus_tag()) {
1187 if (it->IsSetObjectType() &&
1189 it->IsSetObject() &&
1190 it->GetObject().GetThisTypeInfo() == CSeq_feat::GetTypeInfo()) {
1210 if (
g &&
g->IsSetLocus_tag()) {
1211 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_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
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
bool IsSetClass(void) const
Check if a value has been assigned to Class data member.
TClass GetClass(void) const
Get the Class member data.
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 struct ncbi::grid::netcache::search::fields::KEY key
static const char * suffix[]
static const char * prefix[]
int g(Seg_Gsm *spe, Seq_Mtf *psm, Thd_Gsm *tdg)
static CS_CONTEXT * context