NCBI C++ ToolKit
validerror_format.cpp
Go to the documentation of this file.

Go to the SVN repository for this file.

1 /* $Id: validerror_format.cpp 102695 2024-06-26 20:06:50Z kans $
2  * ===========================================================================
3  *
4  * PUBLIC DOMAIN NOTICE
5  * National Center for Biotechnology Information
6  *
7  * This software/database is a "United States Government Work" under the
8  * terms of the United States Copyright Act. It was written as part of
9  * the author's official duties as a United States Government employee and
10  * thus cannot be copyrighted. This software/database is freely available
11  * to the public for use. The National Library of Medicine and the U.S.
12  * Government have not placed any restriction on its use or reproduction.
13  *
14  * Although all reasonable efforts have been taken to ensure the accuracy
15  * and reliability of the software and data, the NLM and the U.S.
16  * Government do not and cannot warrant the performance or results that
17  * may be obtained by using this software or data. The NLM and the U.S.
18  * Government disclaim all warranties, express or implied, including
19  * warranties of performance, merchantability or fitness for any particular
20  * purpose.
21  *
22  * Please cite the author in any work or product based on this material.
23  *
24  * ===========================================================================
25  *
26  * Author: Jonathan Kans, Clifford Clausen, Aaron Ucko.......
27  *
28  * File Description:
29  * Validates CSeq_entries and CSeq_submits
30  *
31  */
32 #include <ncbi_pch.hpp>
33 #include <corelib/ncbistd.hpp>
34 #include <serial/serialbase.hpp>
38 #include <objects/seq/Bioseq.hpp>
39 #include <objects/seq/Pubdesc.hpp>
40 #include <objects/seq/Seqdesc.hpp>
48 #include <objmgr/util/sequence.hpp>
52 #include <util/static_map.hpp>
53 
54 
55 
58 BEGIN_SCOPE(validator)
59 USING_SCOPE(sequence);
60 
61 
62 // *********************** CValidErrorFormat implementation **********************
63 
64 
65 //LCOV_EXCL_START
66 //used by Genome Workbench to create submitter report,
67 //not used by asnvalidate
69  m_ObjMgr(&objmgr)
70 {
71 }
72 
73 
75 {
76 }
77 
78 
80 {
82 
83  switch(err_code) {
91  break;
94  break;
100  break;
103  break;
106  break;
109  break;
114  break;
115  default:
116  break;
117  }
118  return rval;
119 }
120 
121 
123 {
124  string rval;
125  switch(err_code) {
130  rval = "Not Splice Consensus";
131  break;
133  rval = "EC Number Format";
134  break;
139  rval = "EC Number Value";
140  break;
142  rval = "EC Number Problem";
143  break;
145  rval = "Bad Specific-host Values";
146  break;
148  rval = "Bad Institution Codes";
149  break;
151  rval = "LatLonCountry Errors";
152  break;
154  rval = "LatLonGeoLocName Errors";
155  break;
157  {
158  bool use_geo_loc_name = CSubSource::NCBI_UseGeoLocNameForCountry();
159  if (use_geo_loc_name) {
160  rval = "LatLonGeoLocName Errors";
161  } else {
162  rval = "LatLonCountry Errors";
163  }
164  }
165  break;
166  default:
167  rval = CValidErrItem::ConvertErrCode(err_code);
168  break;
169  }
170 
171  return rval;
172 }
173 
174 
176 {
177  string rval;
178 
179  switch (error.GetErrIndex()) {
187  break;
195  break;
198  break;
201  break;
206  break;
207  default:
209  break;
210  }
211 
212  return rval;
213 }
214 
215 
217 {
218  string rval;
219  if (!error.IsSetMsg() || NStr::IsBlank(error.GetMsg())) {
220  return rval;
221  }
222  string msg = error.GetMsg();
223  if (NStr::Find(msg, "(AG) not found") != string::npos) {
224  rval = "AG";
225  }
226  else if (NStr::Find(msg, "(GT) not found") != string::npos) {
227  rval = "GT";
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)";
232  }
233  if (NStr::IsBlank(rval)) {
234  return rval;
235  }
236 
237  size_t position_pos = NStr::Find(msg, "ending at position ");
238  size_t other_clue = NStr::Find(msg, "and before exon");
239  if (position_pos == string::npos || other_clue == string::npos) {
240  position_pos = NStr::Find(msg, "position ");
241  if (position_pos != string::npos) {
242  string pos_str = msg.substr(position_pos);
243  long int pos;
244  if (sscanf(pos_str.c_str(), "position %ld of ", &pos) == 1) {
245  rval += " at " + NStr::NumericToString(pos);
246  size_t seq_pos = NStr::Find(pos_str, " of ");
247  if (seq_pos != string::npos) {
248  rval = pos_str.substr(seq_pos + 4) + "\t" + rval;
249  }
250  }
251  }
252  } else {
253  string pos_str = msg.substr(position_pos);
254  long int pos1, pos2;
255  if (sscanf(pos_str.c_str(), "ending at position %ld and before exon starting at position %ld of ", &pos1, &pos2) == 2) {
256  rval += " at " + NStr::NumericToString(pos1) + ", " + NStr::NumericToString(pos2);
257  size_t seq_pos = NStr::Find(pos_str, " of ");
258  if (seq_pos != string::npos) {
259  rval = pos_str.substr(seq_pos + 4) + "\t" + rval;
260  }
261  }
262  }
263 
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);
268  size_t space_pos = NStr::Find(obj_desc, ":");
269  if (space_pos != string::npos) {
270  obj_desc = obj_desc.substr(0, space_pos);
271  }
272  }
273 
274  rval = obj_desc + "\t" + rval;
275 
276  return rval;
277 }
278 
279 
280 void RemovePrefix(string& str, const string& prefix)
281 {
282  size_t type_pos = NStr::Find(str, prefix);
283  if (type_pos != string::npos) {
284  str = str.substr(type_pos + prefix.length());
285  }
286 }
287 
288 void RemoveSuffix(string& str, const string& suffix)
289 {
290  size_t type_pos = NStr::Find(str, suffix);
291  if (type_pos != string::npos) {
292  str = str.substr(0, type_pos);
293  }
294 }
295 
296 
298 {
299  string obj_desc = error.GetObjDesc();
300  if (NStr::StartsWith(obj_desc, "FEATURE") && error.IsSetObj_content()) {
301  obj_desc = error.GetObj_content();
302  NStr::ReplaceInPlace(obj_desc, ":", "\t", 0, 1);
303  // Add feature location part of label
304  if (error.IsSetLocation()) {
305  obj_desc += "\t" + error.GetLocation();
306  }
307  if (error.IsSetLocus_tag()) {
308  obj_desc += "\t" + error.GetLocus_tag();
309  } else if (error.IsSetObject() && error.GetObject().GetThisTypeInfo() == CSeq_feat:: GetTypeInfo()) {
310  const CSeq_feat* sf = static_cast<const CSeq_feat*>(&(error.GetObject()));
311  if (sf) {
312  obj_desc += "\t" + x_GetLocusTag(*sf, scope);
313  }
314  }
315  } else {
316  RemovePrefix(obj_desc, "DESCRIPTOR: ");
317  RemovePrefix(obj_desc, "BioSrc: ");
318  RemoveSuffix(obj_desc, " BIOSEQ: ");
319  RemoveSuffix(obj_desc, " BIOSEQ-SET: ");
320 
321  NStr::ReplaceInPlace(obj_desc, ":", "\t", 0, 1);
322  size_t close_pos = NStr::Find(obj_desc, "]");
323  if (close_pos != string::npos) {
324  obj_desc = obj_desc.substr(0, close_pos);
325  NStr::ReplaceInPlace(obj_desc, "[", "\t");
326  }
327  }
328  string rval = error.GetAccession() + ":" + obj_desc;
329 
330  return rval;
331 }
332 
333 
335 {
336  string rval;
337  string ec_numbers;
338  string prot_name;
339  string locus_tag;
340 
341  // want: accession number for sequence, ec numbers, locus tag, protein name
342 
343  if (error.GetObject().GetThisTypeInfo() != CSeq_feat::GetTypeInfo()) {
344  return rval;
345  }
346  const CSeq_feat* feat = static_cast<const CSeq_feat*>(&(error.GetObject()));
347  if (!feat) {
348  return rval;
349  }
350 
351  // look for EC number in quals
352  if (feat->IsSetQual()) {
353  ITERATE(CSeq_feat::TQual, it, feat->GetQual()) {
354  if ((*it)->IsSetQual() &&
355  NStr::EqualNocase((*it)->GetQual(), "EC_number") &&
356  (*it)->IsSetVal() &&
357  !NStr::IsBlank((*it)->GetVal())) {
358  if (!NStr::IsBlank(ec_numbers)) {
359  ec_numbers += ";";
360  }
361  ec_numbers += (*it)->GetVal();
362  }
363  }
364  }
365  // look for EC number in prot-ref
366  if (feat->IsSetData() && feat->GetData().IsProt() &&
367  feat->GetData().GetProt().IsSetEc()) {
368  ITERATE(CProt_ref::TEc, it, feat->GetData().GetProt().GetEc()) {
369  if (!NStr::IsBlank(ec_numbers)) {
370  ec_numbers += ";";
371  }
372  ec_numbers += *it;
373  }
374  }
375 
376  if (NStr::IsBlank(ec_numbers)) {
377  ec_numbers = "Blank EC number";
378  }
379 
380  // look for protein name
381  if (feat->IsSetData() && feat->GetData().IsProt() &&
382  feat->GetData().GetProt().IsSetName() &&
383  !feat->GetData().GetProt().GetName().empty()) {
384  prot_name = feat->GetData().GetProt().GetName().front();
385  }
386 
387  // get locus tag
389  if (gene && gene->GetData().GetGene().IsSetLocus_tag()) {
390  locus_tag = gene->GetData().GetGene().GetLocus_tag();
391  }
392 
393  rval = error.GetAccnver() + "\t" + ec_numbers + "\t" + locus_tag + "\t" + prot_name;
394  return rval;
395 }
396 
397 
399 {
400  string rval;
401 
402  if (biosrc.IsSetOrg() &&
403  biosrc.GetOrg().IsSetOrgname() &&
404  biosrc.GetOrg().GetOrgname().IsSetMod()) {
405  ITERATE(COrgName::TMod, it, biosrc.GetOrg().GetOrgname().GetMod()) {
406  if ((*it)->IsSetSubtype() &&
407  (*it)->GetSubtype() == COrgMod::eSubtype_nat_host &&
408  (*it)->IsSetSubname() &&
409  !NStr::IsBlank((*it)->GetSubname())) {
410  if (!NStr::IsBlank(rval)) {
411  rval += ";";
412  }
413  rval += (*it)->GetSubname();
414  }
415  }
416  }
417  return rval;
418 }
419 
420 
422 {
423  string rval;
424  string spec_host;
425  const string kAlternateName = "Specific host value is alternate name: ";
426  if (NStr::StartsWith(error.GetMsg(), kAlternateName)) {
427  spec_host = error.GetMsg().substr(kAlternateName.length());
428  } else if (error.GetObject().GetThisTypeInfo() == CSeqdesc::GetTypeInfo()) {
429  const CSeqdesc* desc = static_cast<const CSeqdesc *>(&(error.GetObject()));
430  if (desc && desc->IsSource()) {
431  spec_host = s_GetSpecificHostFromBioSource(desc->GetSource());
432  }
433  } else if (error.GetObject().GetThisTypeInfo() == CSeq_feat::GetTypeInfo()) {
434  const CSeq_feat* feat = static_cast<const CSeq_feat *>(&(error.GetObject()));
435  if (feat && feat->IsSetData() && feat->GetData().IsBiosrc()) {
436  spec_host = s_GetSpecificHostFromBioSource(feat->GetData().GetBiosrc());
437  }
438  }
439 
440  if (!NStr::IsBlank(spec_host)) {
441  rval = error.GetAccession() + "\t" + spec_host;
442  }
443 
444  return rval;
445 }
446 
447 
449 {
450  string rval;
451 
452  if (biosrc.IsSetOrg() &&
453  biosrc.GetOrg().IsSetOrgname() &&
454  biosrc.GetOrg().GetOrgname().IsSetMod()) {
455  ITERATE(COrgName::TMod, it, biosrc.GetOrg().GetOrgname().GetMod()) {
456  if ((*it)->IsSetSubtype() &&
457  ((*it)->GetSubtype() == COrgMod::eSubtype_bio_material ||
458  (*it)->GetSubtype() == COrgMod::eSubtype_culture_collection ||
459  (*it)->GetSubtype() == COrgMod::eSubtype_specimen_voucher) &&
460  (*it)->IsSetSubname() &&
461  !NStr::IsBlank((*it)->GetSubname())) {
462  size_t pos = NStr::Find((*it)->GetSubname(), ":");
463  if (pos != string::npos) {
464  string code = (*it)->GetSubname().substr(0, pos);
465  if (!NStr::IsBlank(code)) {
466  if (!NStr::IsBlank(rval)) {
467  rval += ";";
468  }
469  rval += code;
470  }
471  }
472  }
473  }
474  }
475  return rval;
476 }
477 
478 
480 {
481  string rval;
482 
483  string codes;
484  if (error.GetObject().GetThisTypeInfo() == CSeqdesc::GetTypeInfo()) {
485  const CSeqdesc* desc = static_cast<const CSeqdesc *>(&(error.GetObject()));
486  if (desc && desc->IsSource()) {
487  codes = s_GetInstCodeFromBioSource(desc->GetSource());
488  }
489  }
490  else if (error.GetObject().GetThisTypeInfo() == CSeq_feat::GetTypeInfo()) {
491  const CSeq_feat* feat = static_cast<const CSeq_feat *>(&(error.GetObject()));
492  if (feat && feat->IsSetData() && feat->GetData().IsBiosrc()) {
493  codes = s_GetInstCodeFromBioSource(feat->GetData().GetBiosrc());
494  }
495  }
496 
497  if (!NStr::IsBlank(codes)) {
498  rval = error.GetAccession() + "\t" + codes;
499  }
500 
501  return rval;
502 }
503 
504 
506 {
507  string rval;
508  for ( CValidError_CI vit(errors); vit; ++vit) {
509  if (err_code == vit->GetErrIndex()) {
510  string this_val = FormatForSubmitterReport(*vit, scope);
511  if (!NStr::IsBlank(this_val)) {
512  if (NStr::IsBlank(rval)) {
513  rval += GetSubmitterFormatErrorGroupTitle(err_code) + "\n";
514  }
515  rval += this_val + "\n";
516  }
517  }
518  }
519  return rval;
520 }
521 
522 
524  (const CValidError& errors, CScope& scope, ESubmitterFormatErrorGroup grp) const
525 {
526  string rval;
527  for ( CValidError_CI vit(errors); vit; ++vit) {
528  CValidErrItem::TErrIndex err_code = vit->GetErrIndex();
529  if (GetSubmitterFormatErrorGroup(err_code) == grp) {
530  string this_val = FormatForSubmitterReport(*vit, scope);
531  if (!NStr::IsBlank(this_val)) {
532  if (NStr::IsBlank(rval)) {
533  rval += GetSubmitterFormatErrorGroupTitle(err_code) + "\n";
534  }
535  rval += this_val + "\n";
536  }
537  }
538  }
539  return rval;
540 }
541 
542 
544 {
545  string rval = error.GetAccession() + ":" + error.GetMsg();
546  return rval;
547 }
548 
549 
550 vector<CValidErrItem::TErrIndex> CValidErrorFormat::GetListOfErrorCodes(const CValidError& errors) const
551 {
552  vector<CValidErrItem::TErrIndex> list;
553 
554  for (CValidError_CI vit(errors); vit; ++vit) {
555  list.push_back(vit->GetErrIndex());
556  }
557  sort(list.begin(), list.end());
558  list.erase(unique(list.begin(), list.end()), list.end());
559  return list;
560 }
561 
562 
563 vector<string> CValidErrorFormat::FormatCompleteSubmitterReport(const CValidError& errors, CScope& scope) const
564 {
565  vector<string> list;
566 
567  // first, do special categories
569  string this_val = FormatCategoryForSubmitterReport(errors, scope, (ESubmitterFormatErrorGroup)t);
570  if (!NStr::IsBlank(this_val)) {
571  list.push_back(this_val);
572  }
573  }
574 
575  // now do errors not in special categories
576  vector<CValidErrItem::TErrIndex> codes = GetListOfErrorCodes(errors);
577  ITERATE(vector<CValidErrItem::TErrIndex>, it, codes) {
579  string this_val = FormatForSubmitterReport(errors, scope, *it);
580  if (!NStr::IsBlank(this_val)) {
581  list.push_back(this_val);
582  }
583  }
584  }
585  return list;
586 }
587 //LCOV_EXCL_STOP
588 
589 
590 static string s_GetFeatureIdLabel (const CObject_id& object_id)
591 {
592  string feature_id;
593  if (object_id.IsId()) {
594  feature_id = NStr::IntToString(object_id.GetId());
595  } else if (object_id.IsStr()) {
596  feature_id = object_id.GetStr();
597  }
598  return feature_id;
599 }
600 
601 
603 {
604  string feature_id;
605  if (feat_id.IsLocal()) {
606  feature_id = s_GetFeatureIdLabel(feat_id.GetLocal());
607  } else if (feat_id.IsGeneral()) {
608  if (feat_id.GetGeneral().IsSetDb()) {
609  feature_id += feat_id.GetGeneral().GetDb();
610  }
611  feature_id += ":";
612  if (feat_id.GetGeneral().IsSetTag()) {
613  feature_id += s_GetFeatureIdLabel (feat_id.GetGeneral().GetTag());
614  }
615  }
616  return feature_id;
617 }
618 
619 
621 {
622  string feature_id;
623  if (ft.IsSetId()) {
624  feature_id = CValidErrorFormat::GetFeatureIdLabel(ft.GetId());
625  } else if (ft.IsSetIds()) {
626  ITERATE(CSeq_feat::TIds, id_it, ft.GetIds()) {
627  feature_id = CValidErrorFormat::GetFeatureIdLabel((**id_it));
628  if (!NStr::IsBlank(feature_id)) {
629  break;
630  }
631  }
632  }
633  return feature_id;
634 }
635 
636 
637 static void s_FixBioseqLabelProblems (string& str)
638 {
639  size_t pos = NStr::Find(str, ",");
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);
642  }
643  pos = NStr::Find(str, "=");
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);
646  }
647 }
648 
649 
650 
651 static string s_GetOrgRefContentLabel (const COrg_ref& org)
652 {
653  string content;
654  if (org.IsSetTaxname()) {
655  content = org.GetTaxname();
656  } else if (org.IsSetCommon()) {
657  content = org.GetCommon();
658  } else if (org.IsSetDb() && !org.GetDb().empty()) {
659  org.GetDb().front()->GetLabel(&content);
660  }
661  return content;
662 }
663 
664 
665 static string s_GetBioSourceContentLabel (const CBioSource& bsrc)
666 {
667  string content;
668  if (bsrc.IsSetOrg()) {
669  content = s_GetOrgRefContentLabel(bsrc.GetOrg());
670  }
671  return content;
672 }
673 
674 
675 static string s_GetFeatureContentLabelExtras (const CSeq_feat& feat)
676 {
677  string tlabel;
678 
679  // Put Seq-feat qual into label
680  if (feat.IsSetQual()) {
681  string prefix("/");
682  ITERATE(CSeq_feat::TQual, it, feat.GetQual()) {
683  tlabel += prefix + (**it).GetQual();
684  prefix = " ";
685  if (!(**it).GetVal().empty()) {
686  tlabel += "=" + (**it).GetVal();
687  }
688  }
689  }
690 
691  // Put Seq-feat comment into label
692  if (feat.IsSetComment()) {
693  if (tlabel.empty()) {
694  tlabel = feat.GetComment();
695  } else {
696  tlabel += "; " + feat.GetComment();
697  }
698  }
699  return tlabel;
700 }
701 
702 
703 static string s_GetCdregionContentLabel (const CSeq_feat& feat, CRef<CScope> scope)
704 {
705  string content;
706 
707  // Check that feature data is Cdregion
708  if (!feat.GetData().IsCdregion()) {
709  return content;
710  }
711 
712  const CGene_ref* gref = nullptr;
713  const CProt_ref* pref = nullptr;
714 
715  // Look for CProt_ref object to create a label from
716  if (feat.IsSetXref()) {
717  ITERATE ( CSeq_feat::TXref, it, feat.GetXref()) {
718  const CSeqFeatXref& xref = **it;
719  if ( !xref.IsSetData() ) {
720  continue;
721  }
722 
723  switch (xref.GetData().Which()) {
725  pref = &xref.GetData().GetProt();
726  break;
728  gref = &xref.GetData().GetGene();
729  break;
730  default:
731  break;
732  }
733  }
734  }
735 
736  // Try and create a label from a CProt_ref in CSeqFeatXref in feature
737  if (pref) {
738  pref->GetLabel(&content);
739  return content;
740  }
741 
742  // Try and create a label from a CProt_ref in the feat product and
743  // return if found
744  if (feat.IsSetProduct() && scope) {
745  try {
746  const CSeq_id& id = GetId(feat.GetProduct(), scope);
747  CBioseq_Handle hnd = scope->GetBioseqHandle(id);
748  if (hnd) {
749  const CBioseq& seq = *hnd.GetCompleteBioseq();
750 
751  // Now look for a CProt_ref feature in seq and
752  // if found call GetLabel() on the CProt_ref
754  for (;it; ++it) {
755  if (it->IsProt()) {
756  it->GetProt().GetLabel(&content);
757  return content;
758  }
759  }
760  }
761  } catch (CObjmgrUtilException&) {}
762  }
763 
764  // Try and create a label from a CGene_ref in CSeqFeatXref in feature
765  if (gref) {
766  gref->GetLabel(&content);
767  }
768 
769  if (NStr::IsBlank(content)) {
770  content = s_GetFeatureContentLabelExtras(feat);
771  }
772 
773  return content;
774 }
775 
776 
778 {
779  string content_label;
780 
781  switch (feat.GetData().Which()) {
782  case CSeqFeatData::e_Pub:
783  content_label = "Cit: ";
784  feat.GetData().GetPub().GetPub().GetLabel(&content_label);
785  break;
787  content_label = "Src: " + s_GetBioSourceContentLabel (feat.GetData().GetBiosrc());
788  break;
789  case CSeqFeatData::e_Imp: {
790  feature::GetLabel(feat, &content_label, feature::fFGL_Both, scope);
791  if (feat.GetData().GetImp().IsSetKey()) {
792  string key = feat.GetData().GetImp().GetKey();
793  string tmp = "[" + key + "]";
794  if (NStr::StartsWith(content_label, tmp)) {
795  content_label = key + content_label.substr(tmp.length());
796  }
797  }
798  } break;
799  case CSeqFeatData::e_Rna:
800  feature::GetLabel(feat, &content_label, feature::fFGL_Both, scope);
802  && NStr::Equal(content_label, "tRNA: tRNA")) {
803  content_label = "tRNA: ";
804  }
805  break;
807  content_label = "CDS: " + s_GetCdregionContentLabel(feat, scope);
808  break;
810  feature::GetLabel(feat, &content_label, feature::fFGL_Both, scope);
811  if (feat.GetData().GetProt().IsSetProcessed()) {
812  switch (feat.GetData().GetProt().GetProcessed()) {
814  content_label = "mat_peptide: " + content_label.substr(6);
815  break;
817  content_label = "sig_peptide: " + content_label.substr(6);
818  break;
820  content_label = "trans_peptide: " + content_label.substr(6);
821  break;
822  default:
823  break;
824  }
825  }
826  break;
827  default:
828  feature::GetLabel(feat, &content_label, feature::fFGL_Both, scope);
829  break;
830  }
831  return content_label;
832 }
833 
834 
835 string CValidErrorFormat::GetFeatureBioseqLabel(const CSeq_feat& ft, CRef<CScope> scope, bool suppress_context)
836 {
837  string desc;
838  // Append label for bioseq of feature location
839  if (!suppress_context && scope) {
840  bool find_failed = false;
841  try {
842  CBioseq_Handle hnd;
843  try {
844  hnd = scope->GetBioseqHandle(ft.GetLocation());
845  } catch (CException&) {
846  CSeq_loc_CI li(ft.GetLocation());
847  while (li && !hnd) {
848  hnd = scope->GetBioseqHandle(li.GetSeq_id());
849  ++li;
850  }
851  }
852  if (hnd) {
854  }
855  } catch (CObjMgrException& ex) {
857  find_failed = true;
858  }
859  } catch (const CException&) {
860  } catch (const std::exception&) {
861  };
862  if (find_failed) {
863  try {
864  CSeq_loc_CI li(ft.GetLocation());
865  CBioseq_Handle hnd = scope->GetBioseqHandle(li.GetSeq_id());
866  if (hnd) {
868  }
869 
870  } catch (const CException&) {
871  } catch (const std::exception&) {
872  };
873  }
874  }
875  return desc;
876 }
877 
878 
879 string CValidErrorFormat::GetFeatureProductLocLabel(const CSeq_feat& ft, CRef<CScope> scope, bool suppress_context)
880 {
881  string desc;
882  // Append label for product of feature
883  if (ft.IsSetProduct() && scope) {
884  string loc_label;
885  if (suppress_context) {
886  CSeq_loc loc;
887  loc.Assign(ft.GetProduct());
888  ChangeSeqLocId(&loc, false, scope);
889  loc_label = GetValidatorLocationLabel(loc, *scope);
890  } else {
891  loc_label = GetValidatorLocationLabel(ft.GetProduct(), *scope);
892  }
893  if (loc_label.size() > 800) {
894  loc_label.replace(797, NPOS, "...");
895  }
896  if (!loc_label.empty()) {
897  desc += "[";
898  desc += loc_label;
899  desc += "]";
900  }
901  }
902  return desc;
903 }
904 
905 
906 string CValidErrorFormat::GetFeatureLocationLabel(const CSeq_feat& ft, CRef<CScope> scope, bool suppress_context)
907 {
908  string loc_label;
909  // Add feature location part of label
910  if (ft.IsSetLocation() && scope) {
911  if (suppress_context) {
912  CSeq_loc loc;
913  loc.Assign(ft.GetLocation());
914  ChangeSeqLocId(&loc, false, scope);
915  loc_label = GetValidatorLocationLabel(loc, *scope);
916  } else {
917  loc_label = GetValidatorLocationLabel(ft.GetLocation(), *scope);
918  }
919  if (loc_label.size() > 800) {
920  loc_label.replace(795, NPOS, "...");
921  }
922  }
923  return loc_label;
924 }
925 
926 //LCOV_EXCL_START
927 //not used
928 string CValidErrorFormat::GetFeatureLabel(const CSeq_feat& ft, CRef<CScope> scope, bool suppress_context)
929 {
930  // Add feature part of label
931  string desc = "FEATURE: ";
932  string content_label = CValidErrorFormat::GetFeatureContentLabel(ft, scope);
933  desc += content_label;
934 
935  // Add feature ID part of label (if present)
936  string feature_id = GetFeatureIdLabel(ft);
937  if (!NStr::IsBlank(feature_id)) {
938  desc += " <" + feature_id + "> ";
939  }
940 
941  // Add feature location part of label
942  string loc_label = GetFeatureLocationLabel(ft, scope, suppress_context);
943  if (!NStr::IsBlank(loc_label)) {
944  desc += " [" + loc_label + "]";
945  }
946 
947  // Append label for bioseq of feature location
948  string bioseq_label = GetFeatureBioseqLabel(ft, scope, suppress_context);
949  if (!NStr::IsBlank(bioseq_label)) {
950  desc += bioseq_label;
951  }
952 
953  // Append label for product of feature
954  string product_label = GetFeatureProductLocLabel(ft, scope, suppress_context);
955  if (!NStr::IsBlank(product_label)) {
956  desc += product_label;
957  }
958  return desc;
959 }
960 //LCOV_EXCL_STOP
961 
962 
964 {
965  string content;
966 
967  switch (ds.Which()) {
968  case CSeqdesc::e_Pub:
969  content = "Pub: ";
970  ds.GetPub().GetPub().GetLabel(&content);
971  break;
972  case CSeqdesc::e_Source:
973  content = "BioSource: " + s_GetBioSourceContentLabel(ds.GetSource());
974  break;
975  case CSeqdesc::e_Modif:
976  ds.GetLabel(&content, CSeqdesc::eBoth);
977  if (NStr::StartsWith(content, "modif: ,")) {
978  content = "Modifier: " + content.substr(8);
979  }
980  break;
981  case CSeqdesc::e_Molinfo:
982  ds.GetLabel(&content, CSeqdesc::eBoth);
983  if (NStr::StartsWith(content, "molinfo: ,")) {
984  content = "molInfo: " + content.substr(10);
985  }
986  break;
987  case CSeqdesc::e_Comment:
988  ds.GetLabel(&content, CSeqdesc::eBoth);
989  if (NStr::StartsWith(content, "comment: ") && NStr::IsBlank(content.substr(9))) {
990  content = "comment: ";
991  }
992  break;
993  case CSeqdesc::e_User:
994  content = "UserObj: ";
995  if (ds.GetUser().IsSetClass()) {
996  content += ds.GetUser().GetClass();
997  } else if (ds.GetUser().IsSetType() && ds.GetUser().GetType().IsStr()) {
998  content += ds.GetUser().GetType().GetStr();
999  }
1000  break;
1001  default:
1002  ds.GetLabel(&content, CSeqdesc::eBoth);
1003  break;
1004  }
1005  // fix descriptor type names
1006  string first = content.substr(0, 1);
1008  content = first + content.substr(1);
1009  size_t colon_pos = NStr::Find(content, ":");
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);
1014  NStr::ToUpper (after_dash);
1015  content = content.substr(0, dash_pos) + after_dash + content.substr(dash_pos + 2);
1016  }
1017  }
1018  if (NStr::StartsWith(content, "BioSource:")) {
1019  content = "BioSrc:" + content.substr(10);
1020  } else if (NStr::StartsWith(content, "Modif:")) {
1021  content = "Modifier:" + content.substr(6);
1022  } else if (NStr::StartsWith(content, "Embl:")) {
1023  content = "EMBL:" + content.substr(5);
1024  } else if (NStr::StartsWith(content, "Pir:")) {
1025  content = "PIR:" + content.substr(4);
1026  }
1027  return content;
1028 }
1029 
1030 
1031 string CValidErrorFormat::GetDescriptorLabel(const CSeqdesc& ds, const CSeq_entry& ctx, CRef<CScope> scope, bool suppress_context)
1032 {
1033  string desc("DESCRIPTOR: ");
1034 
1035  string content = CValidErrorFormat::GetDescriptorContent (ds);
1036 
1037  desc += content;
1038 
1039  desc += " ";
1040  if (ctx.IsSeq()) {
1041  AppendBioseqLabel(desc, ctx.GetSeq(), suppress_context);
1042  } else {
1043  desc += CValidErrorFormat::GetBioseqSetLabel(ctx.GetSet(), scope, suppress_context);
1044  }
1045  return desc;
1046 }
1047 
1048 
1050 {
1051  string desc;
1052 
1054  desc += " [";
1055  string bc_label;
1056  bc->GetLabel(&bc_label, CBioseq::eBoth);
1057  s_FixBioseqLabelProblems(bc_label);
1058  desc += bc_label;
1059  desc += "]";
1060  return desc;
1061 }
1062 
1063 
1064 string CValidErrorFormat::GetBioseqSetLabel(const CBioseq_set& st, CRef<CScope> /*dummy*/, bool suppress_context)
1065 {
1066  return GetBioseqSetLabel(st, suppress_context);
1067 }
1068 
1069 
1070 string CValidErrorFormat::GetBioseqSetLabel(const CBioseq_set& st, bool suppress_context)
1071 {
1072  const auto isSetClass = st.IsSetClass();
1073  suppress_context = suppress_context || !isSetClass;
1074 
1075  int version = 0;
1076  const string& accession = GetAccessionFromBioseqSet(st, &version);
1077  return GetBioseqSetLabel(accession, isSetClass ? st.GetClass() : CBioseq_set::eClass_not_set, suppress_context);
1078 }
1079 
1080 
1081 string CValidErrorFormat::GetBioseqSetLabel(const string& accession, CBioseq_set::EClass setClass, bool suppress_context)
1082 {
1083  string str = "BIOSEQ-SET: ";
1084  if (!suppress_context) {
1085  const auto* tv = CBioseq_set::ENUM_METHOD_NAME(EClass)();
1086  const string& context = tv->FindName(setClass, true);
1087  str += context;
1088  str += ": ";
1089  }
1090 
1091  if(NStr::IsBlank(accession)) {
1092  str += "(No Bioseqs)";
1093  return str;
1094  }
1095 
1096  string temporary(accession); // create modifiable copy of accession
1097  s_FixBioseqLabelProblems(temporary);
1098  str += temporary;
1099  return str;
1100 }
1101 
1102 //LCOV_EXCL_START
1103 //not used
1104 string CValidErrorFormat::GetObjectLabel(const CObject& obj, const CSeq_entry& ctx, CRef<CScope> scope, bool suppress_context)
1105 {
1106  string label = "Unknown object";
1107 
1108  const CSeq_feat* ft = dynamic_cast<const CSeq_feat*>(&obj);
1109  const CSeqdesc* ds = dynamic_cast<const CSeqdesc*>(&obj);
1110  const CBioseq* b = dynamic_cast<const CBioseq*>(&obj);
1111  const CBioseq_set* set = dynamic_cast<const CBioseq_set*>(&obj);
1112 
1113  if (ft) {
1114  label = GetFeatureLabel(*ft, scope, suppress_context);
1115  } else if (ds) {
1116  label = GetDescriptorLabel(*ds, ctx, scope, suppress_context);
1117  } else if (b) {
1118  label = GetBioseqLabel(scope->GetBioseqHandle(*b));
1119  } else if (set) {
1120  label = GetBioseqSetLabel(*set, suppress_context);
1121  }
1122  return label;
1123 }
1124 //LCOV_EXCL_STOP
1125 
1126 
1127 static const string kSuppressFieldLabel = "Suppress";
1128 
1129 static bool s_IsSuppressField (const CUser_field& field)
1130 {
1131  if (field.IsSetLabel() &&
1132  field.GetLabel().IsStr() &&
1134  return true;
1135  } else {
1136  return false;
1137  }
1138 }
1139 
1140 
1142 {
1143  CValidErrorSuppress::AddSuppression(user, error_code);
1144 }
1145 
1146 
1148 {
1149  CValidErrorSuppress::TCodes suppressedCodes;
1150  CValidErrorSuppress::SetSuppressedCodes(user, suppressedCodes);
1151  for (auto code : suppressedCodes) {
1152  errors.SuppressError(code);
1153  }
1154 }
1155 
1156 
1158 {
1159  CValidErrorSuppress::TCodes suppressedCodes;
1160  CValidErrorSuppress::SetSuppressedCodes(se, suppressedCodes);
1161  for (auto code : suppressedCodes) {
1162  errors.SuppressError(code);
1163  }
1164 }
1165 
1166 
1168 {
1169  SetSuppressionRules(*(se.GetCompleteSeq_entry()), errors);
1170 }
1171 
1172 
1174 {
1175  CValidErrorSuppress::TCodes suppressedCodes;
1176  CValidErrorSuppress::SetSuppressedCodes(ss, suppressedCodes);
1177  for (auto code : suppressedCodes) {
1178  errors.SuppressError(code);
1179  }
1180 }
1181 
1182 
1184 {
1185  CValidErrorSuppress::TCodes suppressedCodes;
1186  CValidErrorSuppress::SetSuppressedCodes(seq, suppressedCodes);
1187  for (auto code : suppressedCodes) {
1188  errors.SuppressError(code);
1189  }
1190 }
1191 
1192 
1193 //LCOV_EXCL_START
1194 //not used by asnvalidate but may be useful for other clients of validator library
1196 {
1197  for (auto it : errors.SetErrs()) {
1198  if (it->IsSetLocus_tag()) {
1199  continue;
1200  }
1201  if (it->IsSetObjectType() &&
1202  it->GetObjectType() == CValidErrItem::eObjectType_seqfeat &&
1203  it->IsSetObject() &&
1204  it->GetObject().GetThisTypeInfo() == CSeq_feat::GetTypeInfo()) {
1205  const CSeq_feat* sf = static_cast<const CSeq_feat *>(&(it->GetObject()));
1206  if (sf && sf->IsSetData()) {
1207  it->SetLocus_tag(x_GetLocusTag(*sf, scope));
1208  }
1209  }
1210  }
1211 }
1212 
1213 
1214 const string& CValidErrorFormat::x_GetLocusTag(const CSeq_feat& sf, CScope& scope)
1215 {
1216  const string* rval = &kEmptyStr;
1217 
1218  if (sf.GetData().IsGene()) {
1219  if (sf.GetData().GetGene().IsSetLocus_tag()) {
1220  rval = &sf.GetData().GetGene().GetLocus_tag();
1221  }
1222  } else {
1223  const CGene_ref* g = sf.GetGeneXref();
1224  if (g && g->IsSetLocus_tag()) {
1225  rval = &g->GetLocus_tag();
1226  } else {
1228  if (gene && gene->GetData().GetGene().IsSetLocus_tag()) {
1229  rval = &gene->GetData().GetGene().GetLocus_tag();
1230  }
1231  }
1232  }
1233  return *rval;
1234 }
1235 //LCOV_EXCL_STOP
1236 
1237 
1238 END_SCOPE(validator)
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
CBioseq_Handle –.
@ eBoth
Definition: Bioseq.hpp:104
void GetLabel(string *label, ELabelType type, bool worst=false) const
Definition: Bioseq.cpp:202
CFeat_id –.
Definition: Feat_id.hpp:66
void GetLabel(string *label) const
Definition: Gene_ref.cpp:57
Base class for all object manager exceptions.
CObjectManager –.
CObject –.
Definition: ncbiobj.hpp:180
Exceptions for objmgr/util library.
void GetLabel(string *label) const
Definition: Prot_ref.cpp:62
bool GetLabel(string *label, TLabelFlags flags=0, ELabelVersion version=eLabel_DefaultVersion) const override
Append a label to "label" based on content.
Definition: Pub_equiv.cpp:56
CScope –.
Definition: scope.hpp:92
ESubtype GetSubtype(void) const
CSeqFeatXref –.
Definition: SeqFeatXref.hpp:66
CSeq_entry_Handle –.
Definition: Seq_entry.hpp:56
namespace ncbi::objects::
Definition: Seq_feat.hpp:58
const CGene_ref * GetGeneXref(void) const
See related function in util/feature.hpp.
Definition: Seq_feat.cpp:181
Seq-loc iterator class – iterates all intervals from a seq-loc in the correct order.
Definition: Seq_loc.hpp:453
void GetLabel(string *const label, ELabelType label_type) const
Definition: Seqdesc.cpp:134
static bool NCBI_UseGeoLocNameForCountry(void)
Definition: SubSource.cpp:92
Template class for iteration on objects of class C (non-medifiable version)
Definition: iterator.hpp:767
static const string & ConvertErrCode(unsigned int)
string x_FormatBadSpecificHostForSubmitterReport(const CValidErrItem &error) const
static void AddSuppression(CUser_object &user, CValidErrItem::TErrIndex err_code)
string FormatCategoryForSubmitterReport(const CValidError &errors, CScope &scope, ESubmitterFormatErrorGroup grp) const
string x_FormatBadInstCodeForSubmitterReport(const CValidErrItem &error) const
ESubmitterFormatErrorGroup GetSubmitterFormatErrorGroup(CValidErrItem::TErrIndex err_code) const
static string GetFeatureBioseqLabel(const CSeq_feat &ft, CRef< CScope > scope, bool suppress_context)
static string GetDescriptorContent(const CSeqdesc &ds)
static string GetFeatureLocationLabel(const CSeq_feat &ft, CRef< CScope > scope, bool suppress_context)
static string GetFeatureProductLocLabel(const CSeq_feat &ft, CRef< CScope > scope, bool suppress_context)
static string GetDescriptorLabel(const CSeqdesc &ds, const CSeq_entry &ctx, CRef< CScope > scope, bool suppress_context)
string x_FormatConsensusSpliceForSubmitterReport(const CValidErrItem &error) const
string x_FormatLatLonCountryForSubmitterReport(const CValidErrItem &error) const
string GetSubmitterFormatErrorGroupTitle(CValidErrItem::TErrIndex err_code) const
vector< string > FormatCompleteSubmitterReport(const CValidError &errors, CScope &scope) const
static void SetSuppressionRules(const CUser_object &user, CValidError &errors)
vector< CValidErrItem::TErrIndex > GetListOfErrorCodes(const CValidError &errors) const
static string GetFeatureContentLabel(const CSeq_feat &feat, CRef< CScope > scope)
static string GetObjectLabel(const CObject &obj, const CSeq_entry &ctx, CRef< CScope > scope, bool suppress_context)
string x_FormatECNumberForSubmitterReport(const CValidErrItem &error, CScope &scope) const
static const string & x_GetLocusTag(const CSeq_feat &sf, CScope &scope)
static string GetFeatureLabel(const CSeq_feat &ft, CRef< CScope > scope, bool suppress_context)
static void AddLocusTags(CValidError &errors, CScope &scope)
static string GetFeatureIdLabel(const CSeq_feat &ft)
string FormatForSubmitterReport(const CValidErrItem &error, CScope &scope) const
static string GetBioseqLabel(CBioseq_Handle bh)
static string GetBioseqSetLabel(const CBioseq_set &st, CRef< CScope > scope, bool suppress_context)
string x_FormatGenericForSubmitterReport(const CValidErrItem &error, CScope &scope) const
static void AddSuppression(CUser_object &user, TErrCode errCode)
static void SetSuppressedCodes(const CUser_object &user, TCodes &errCodes)
void SuppressError(unsigned int ec)
Definition: ValidError.cpp:157
Definition: set.hpp:45
Include a standard set of the NCBI C++ Toolkit most basic headers.
CS_CONTEXT * ctx
Definition: t0006.c:12
static DLIST_TYPE *DLIST_NAME() first(DLIST_LIST_TYPE *list)
Definition: dlist.tmpl.h:46
static const char * str(char *buf, int n)
Definition: stats.c:84
static char tmp[3200]
Definition: utf8.c:42
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
Definition: ncbimisc.hpp:815
TErrCode GetErrCode(void) const
Get error code.
Definition: ncbiexpt.cpp:453
#define ENUM_METHOD_NAME(EnumName)
Definition: serialbase.hpp:994
string GetLabel(const CSeq_id &id)
virtual void Assign(const CSerialObject &source, ESerialRecursionMode how=eRecursive)
Override Assign() to incorporate cache invalidation.
Definition: Seq_loc.cpp:337
const CSeq_id & GetSeq_id(void) const
Get seq_id of the current location.
Definition: Seq_loc.hpp:1028
CConstBeginInfo ConstBegin(const C &obj)
Get starting point of non-modifiable object hierarchy.
Definition: iterator.hpp:1012
@ fFGL_Both
Definition: feature.hpp:74
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.
Definition: sequence.cpp:1529
CBioseq_Handle GetBioseqHandle(const CSeq_id &id)
Get bioseq handle by seq-id.
Definition: scope.cpp:95
@ 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.
Definition: ncbistl.hpp:103
#define END_SCOPE(ns)
End the previously defined scope.
Definition: ncbistl.hpp:75
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
#define BEGIN_SCOPE(ns)
Define a new scope.
Definition: ncbistl.hpp:72
#define kEmptyStr
Definition: ncbistr.hpp:123
static bool IsBlank(const CTempString str, SIZE_TYPE pos=0)
Check if a string is blank (has no text).
Definition: ncbistr.cpp:106
#define NPOS
Definition: ncbistr.hpp:133
static string IntToString(int value, TNumToStringFlags flags=0, int base=10)
Convert int to string.
Definition: ncbistr.hpp:5078
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.
Definition: ncbistr.cpp:2882
static bool StartsWith(const CTempString str, const CTempString start, ECase use_case=eCase)
Check if a string starts with a specified prefix value.
Definition: ncbistr.hpp:5406
static bool EqualNocase(const CTempString s1, SIZE_TYPE pos, SIZE_TYPE n, const char *s2)
Case-insensitive equality of a substring with another string.
Definition: ncbistr.hpp:5347
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.
Definition: ncbistr.hpp:673
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.
Definition: ncbistr.hpp:5378
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.
Definition: ncbistr.cpp:3396
static string & ToUpper(string &str)
Convert string to upper case – string& version.
Definition: ncbistr.cpp:424
static const char label[]
bool IsSetOrg(void) const
Check if a value has been assigned to Org data member.
Definition: BioSource_.hpp:497
const TOrg & GetOrg(void) const
Get the Org member data.
Definition: BioSource_.hpp:509
bool IsSetLocus_tag(void) const
systematic gene name (e.g., MI0001, ORF0069) Check if a value has been assigned to Locus_tag data mem...
Definition: Gene_ref_.hpp:781
const TLocus_tag & GetLocus_tag(void) const
Get the Locus_tag member data.
Definition: Gene_ref_.hpp:793
bool IsStr(void) const
Check if variant Str is selected.
Definition: Object_id_.hpp:291
bool IsSetDb(void) const
name of database or system Check if a value has been assigned to Db data member.
Definition: Dbtag_.hpp:208
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.
Definition: Dbtag_.hpp:267
bool IsId(void) const
Check if variant Id is selected.
Definition: Object_id_.hpp:264
bool IsSetTag(void) const
appropriate tag Check if a value has been assigned to Tag data member.
Definition: Dbtag_.hpp:255
const TDb & GetDb(void) const
Get the Db member data.
Definition: Dbtag_.hpp:220
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.
Definition: Object_id_.hpp:297
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.
Definition: Object_id_.hpp:270
const TMod & GetMod(void) const
Get the Mod member data.
Definition: OrgName_.hpp:839
bool IsSetDb(void) const
ids in taxonomic or culture dbases Check if a value has been assigned to Db data member.
Definition: Org_ref_.hpp:479
bool IsSetCommon(void) const
common name Check if a value has been assigned to Common data member.
Definition: Org_ref_.hpp:407
const TTaxname & GetTaxname(void) const
Get the Taxname member data.
Definition: Org_ref_.hpp:372
const TCommon & GetCommon(void) const
Get the Common member data.
Definition: Org_ref_.hpp:419
const TDb & GetDb(void) const
Get the Db member data.
Definition: Org_ref_.hpp:491
bool IsSetMod(void) const
Check if a value has been assigned to Mod data member.
Definition: OrgName_.hpp:827
list< CRef< COrgMod > > TMod
Definition: OrgName_.hpp:332
bool IsSetOrgname(void) const
Check if a value has been assigned to Orgname data member.
Definition: Org_ref_.hpp:529
bool IsSetTaxname(void) const
preferred formal name Check if a value has been assigned to Taxname data member.
Definition: Org_ref_.hpp:360
const TOrgname & GetOrgname(void) const
Get the Orgname member data.
Definition: Org_ref_.hpp:541
@ eSubtype_nat_host
natural host of this specimen
Definition: OrgMod_.hpp:104
@ eSubtype_specimen_voucher
Definition: OrgMod_.hpp:106
@ eSubtype_bio_material
Definition: OrgMod_.hpp:119
@ eSubtype_culture_collection
Definition: OrgMod_.hpp:118
const TName & GetName(void) const
Get the Name member data.
Definition: Prot_ref_.hpp:378
bool IsSetEc(void) const
E.C.
Definition: Prot_ref_.hpp:438
list< string > TEc
Definition: Prot_ref_.hpp:110
TProcessed GetProcessed(void) const
Get the Processed member data.
Definition: Prot_ref_.hpp:538
bool IsSetProcessed(void) const
Check if a value has been assigned to Processed data member.
Definition: Prot_ref_.hpp:513
bool IsSetName(void) const
protein name Check if a value has been assigned to Name data member.
Definition: Prot_ref_.hpp:366
const TEc & GetEc(void) const
Get the Ec member data.
Definition: Prot_ref_.hpp:450
@ eProcessed_signal_peptide
Definition: Prot_ref_.hpp:99
@ eProcessed_transit_peptide
Definition: Prot_ref_.hpp:100
const TKey & GetKey(void) const
Get the Key member data.
Definition: Imp_feat_.hpp:259
bool IsSetComment(void) const
Check if a value has been assigned to Comment data member.
Definition: Seq_feat_.hpp:1037
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.
Definition: Seq_feat_.hpp:913
bool IsSetQual(void) const
qualifiers Check if a value has been assigned to Qual data member.
Definition: Seq_feat_.hpp:1135
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.
Definition: Seq_feat_.hpp:1452
bool IsCdregion(void) const
Check if variant Cdregion is selected.
const TQual & GetQual(void) const
Get the Qual member data.
Definition: Seq_feat_.hpp:1147
bool IsSetKey(void) const
Check if a value has been assigned to Key data member.
Definition: Imp_feat_.hpp:247
const TId & GetId(void) const
Get the Id member data.
Definition: Seq_feat_.hpp:904
const TLocal & GetLocal(void) const
Get the variant data.
Definition: Feat_id_.cpp:134
bool IsSetXref(void) const
cite other relevant features Check if a value has been assigned to Xref data member.
Definition: Seq_feat_.hpp:1296
const TLocation & GetLocation(void) const
Get the Location member data.
Definition: Seq_feat_.hpp:1117
bool IsLocal(void) const
Check if variant Local is selected.
Definition: Feat_id_.hpp:353
bool IsGene(void) const
Check if variant Gene is selected.
const TData & GetData(void) const
Get the Data member data.
Definition: Seq_feat_.hpp:925
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.
Definition: Feat_id_.cpp:156
list< CRef< CFeat_id > > TIds
Definition: Seq_feat_.hpp:126
bool IsSetIds(void) const
set of Ids; will replace 'id' field Check if a value has been assigned to Ids data member.
Definition: Seq_feat_.hpp:1440
const TBiosrc & GetBiosrc(void) const
Get the variant data.
bool IsSetId(void) const
Check if a value has been assigned to Id data member.
Definition: Seq_feat_.hpp:892
const TProduct & GetProduct(void) const
Get the Product member data.
Definition: Seq_feat_.hpp:1096
const TComment & GetComment(void) const
Get the Comment member data.
Definition: Seq_feat_.hpp:1049
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.
Definition: Seq_feat_.hpp:1308
vector< CRef< CSeqFeatXref > > TXref
Definition: Seq_feat_.hpp:122
vector< CRef< CGb_qual > > TQual
Definition: Seq_feat_.hpp:117
bool IsGeneral(void) const
Check if variant General is selected.
Definition: Feat_id_.hpp:359
bool IsSetProduct(void) const
product of process Check if a value has been assigned to Product data member.
Definition: Seq_feat_.hpp:1084
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.
Definition: Seq_feat_.hpp:1105
@ e_Pub
publication applies to this seq
const TUser & GetUser(void) const
Get the variant data.
Definition: Seqdesc_.cpp:384
const TSource & GetSource(void) const
Get the variant data.
Definition: Seqdesc_.cpp:566
const TPub & GetPub(void) const
Get the variant data.
Definition: Seqdesc_.cpp:356
bool IsSource(void) const
Check if variant Source is selected.
Definition: Seqdesc_.hpp:1190
E_Choice Which(void) const
Which variant is currently selected.
Definition: Seqdesc_.hpp:903
const TPub & GetPub(void) const
Get the Pub member data.
Definition: Pubdesc_.hpp:605
@ e_User
user defined object
Definition: Seqdesc_.hpp:124
@ e_Pub
a reference to the publication
Definition: Seqdesc_.hpp:122
@ e_Comment
a more extensive comment
Definition: Seqdesc_.hpp:117
@ e_Molinfo
info on the molecule and techniques
Definition: Seqdesc_.hpp:134
@ e_Modif
modifiers
Definition: Seqdesc_.hpp:112
@ e_Source
source of materials, includes Org-ref
Definition: Seqdesc_.hpp:133
unsigned int TErrIndex
TErrs & SetErrs(void)
Assign a value to Errs data member.
constexpr auto sort(_Init &&init)
const string version
version string
Definition: variables.hpp:66
const struct ncbi::grid::netcache::search::fields::KEY key
EIPRangeType t
Definition: ncbi_localip.c:101
The Object manager core.
void AppendBioseqLabel(string &str, const CBioseq &sq, bool supress_context)
Definition: utilities.cpp:1064
string GetAccessionFromBioseqSet(const CBioseq_set &bsst, int *version)
Definition: utilities.cpp:433
string GetValidatorLocationLabel(const CSeq_loc &loc, CScope &scope)
Definition: utilities.cpp:958
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)
Definition: inftrees.h:24
int g(Seg_Gsm *spe, Seq_Mtf *psm, Thd_Gsm *tdg)
Definition: thrddgri.c:44
static string s_GetFeatureIdLabel(const CObject_id &object_id)
string s_GetInstCodeFromBioSource(const CBioSource &biosrc)
static void s_FixBioseqLabelProblems(string &str)
static const string kSuppressFieldLabel
static bool s_IsSuppressField(const CUser_field &field)
void RemoveSuffix(string &str, const string &suffix)
void RemovePrefix(string &str, const string &prefix)
static string s_GetOrgRefContentLabel(const COrg_ref &org)
string s_GetSpecificHostFromBioSource(const CBioSource &biosrc)
static string s_GetFeatureContentLabelExtras(const CSeq_feat &feat)
static string s_GetCdregionContentLabel(const CSeq_feat &feat, CRef< CScope > scope)
static string s_GetBioSourceContentLabel(const CBioSource &bsrc)
USING_SCOPE(sequence)
ESubmitterFormatErrorGroup
@ eSubmitterFormatErrorGroup_BadInstitutionCode
@ eSubmitterFormatErrorGroup_BadEcNumberValue
@ eSubmitterFormatErrorGroup_ConsensusSplice
@ eSubmitterFormatErrorGroup_BadEcNumberProblem
@ eSubmitterFormatErrorGroup_BadEcNumberFormat
@ eSubmitterFormatErrorGroup_Default
@ eSubmitterFormatErrorGroup_LatLonCountry
@ eSubmitterFormatErrorGroup_BadSpecificHost
static CS_CONTEXT * context
Definition: will_convert.c:21
Modified on Fri Sep 20 14:58:21 2024 by modify_doxy.py rev. 669887