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 102322 2024-04-23 12:29:28Z foleyjp $
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;
113  break;
114  default:
115  break;
116  }
117  return rval;
118 }
119 
120 
122 {
123  string rval;
124  switch(err_code) {
129  rval = "Not Splice Consensus";
130  break;
132  rval = "EC Number Format";
133  break;
138  rval = "EC Number Value";
139  break;
141  rval = "EC Number Problem";
142  break;
144  rval = "Bad Specific-host Values";
145  break;
147  rval = "Bad Institution Codes";
148  break;
151  rval = "LatLonCountry Errors";
152  break;
153  default:
154  rval = CValidErrItem::ConvertErrCode(err_code);
155  break;
156  }
157 
158  return rval;
159 }
160 
161 
163 {
164  string rval;
165 
166  switch (error.GetErrIndex()) {
174  break;
182  break;
185  break;
188  break;
192  break;
193  default:
195  break;
196  }
197 
198  return rval;
199 }
200 
201 
203 {
204  string rval;
205  if (!error.IsSetMsg() || NStr::IsBlank(error.GetMsg())) {
206  return rval;
207  }
208  string msg = error.GetMsg();
209  if (NStr::Find(msg, "(AG) not found") != string::npos) {
210  rval = "AG";
211  }
212  else if (NStr::Find(msg, "(GT) not found") != string::npos) {
213  rval = "GT";
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)";
218  }
219  if (NStr::IsBlank(rval)) {
220  return rval;
221  }
222 
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) {
226  position_pos = NStr::Find(msg, "position ");
227  if (position_pos != string::npos) {
228  string pos_str = msg.substr(position_pos);
229  long int pos;
230  if (sscanf(pos_str.c_str(), "position %ld of ", &pos) == 1) {
231  rval += " at " + NStr::NumericToString(pos);
232  size_t seq_pos = NStr::Find(pos_str, " of ");
233  if (seq_pos != string::npos) {
234  rval = pos_str.substr(seq_pos + 4) + "\t" + rval;
235  }
236  }
237  }
238  } else {
239  string pos_str = msg.substr(position_pos);
240  long int pos1, pos2;
241  if (sscanf(pos_str.c_str(), "ending at position %ld and before exon starting at position %ld of ", &pos1, &pos2) == 2) {
242  rval += " at " + NStr::NumericToString(pos1) + ", " + NStr::NumericToString(pos2);
243  size_t seq_pos = NStr::Find(pos_str, " of ");
244  if (seq_pos != string::npos) {
245  rval = pos_str.substr(seq_pos + 4) + "\t" + rval;
246  }
247  }
248  }
249 
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);
254  size_t space_pos = NStr::Find(obj_desc, ":");
255  if (space_pos != string::npos) {
256  obj_desc = obj_desc.substr(0, space_pos);
257  }
258  }
259 
260  rval = obj_desc + "\t" + rval;
261 
262  return rval;
263 }
264 
265 
266 void RemovePrefix(string& str, const string& prefix)
267 {
268  size_t type_pos = NStr::Find(str, prefix);
269  if (type_pos != string::npos) {
270  str = str.substr(type_pos + prefix.length());
271  }
272 }
273 
274 void RemoveSuffix(string& str, const string& suffix)
275 {
276  size_t type_pos = NStr::Find(str, suffix);
277  if (type_pos != string::npos) {
278  str = str.substr(0, type_pos);
279  }
280 }
281 
282 
284 {
285  string obj_desc = error.GetObjDesc();
286  if (NStr::StartsWith(obj_desc, "FEATURE") && error.IsSetObj_content()) {
287  obj_desc = error.GetObj_content();
288  NStr::ReplaceInPlace(obj_desc, ":", "\t", 0, 1);
289  // Add feature location part of label
290  if (error.IsSetLocation()) {
291  obj_desc += "\t" + error.GetLocation();
292  }
293  if (error.IsSetLocus_tag()) {
294  obj_desc += "\t" + error.GetLocus_tag();
295  } else if (error.IsSetObject() && error.GetObject().GetThisTypeInfo() == CSeq_feat:: GetTypeInfo()) {
296  const CSeq_feat* sf = static_cast<const CSeq_feat*>(&(error.GetObject()));
297  if (sf) {
298  obj_desc += "\t" + x_GetLocusTag(*sf, scope);
299  }
300  }
301  } else {
302  RemovePrefix(obj_desc, "DESCRIPTOR: ");
303  RemovePrefix(obj_desc, "BioSrc: ");
304  RemoveSuffix(obj_desc, " BIOSEQ: ");
305  RemoveSuffix(obj_desc, " BIOSEQ-SET: ");
306 
307  NStr::ReplaceInPlace(obj_desc, ":", "\t", 0, 1);
308  size_t close_pos = NStr::Find(obj_desc, "]");
309  if (close_pos != string::npos) {
310  obj_desc = obj_desc.substr(0, close_pos);
311  NStr::ReplaceInPlace(obj_desc, "[", "\t");
312  }
313  }
314  string rval = error.GetAccession() + ":" + obj_desc;
315 
316  return rval;
317 }
318 
319 
321 {
322  string rval;
323  string ec_numbers;
324  string prot_name;
325  string locus_tag;
326 
327  // want: accession number for sequence, ec numbers, locus tag, protein name
328 
329  if (error.GetObject().GetThisTypeInfo() != CSeq_feat::GetTypeInfo()) {
330  return rval;
331  }
332  const CSeq_feat* feat = static_cast<const CSeq_feat*>(&(error.GetObject()));
333  if (!feat) {
334  return rval;
335  }
336 
337  // look for EC number in quals
338  if (feat->IsSetQual()) {
339  ITERATE(CSeq_feat::TQual, it, feat->GetQual()) {
340  if ((*it)->IsSetQual() &&
341  NStr::EqualNocase((*it)->GetQual(), "EC_number") &&
342  (*it)->IsSetVal() &&
343  !NStr::IsBlank((*it)->GetVal())) {
344  if (!NStr::IsBlank(ec_numbers)) {
345  ec_numbers += ";";
346  }
347  ec_numbers += (*it)->GetVal();
348  }
349  }
350  }
351  // look for EC number in prot-ref
352  if (feat->IsSetData() && feat->GetData().IsProt() &&
353  feat->GetData().GetProt().IsSetEc()) {
354  ITERATE(CProt_ref::TEc, it, feat->GetData().GetProt().GetEc()) {
355  if (!NStr::IsBlank(ec_numbers)) {
356  ec_numbers += ";";
357  }
358  ec_numbers += *it;
359  }
360  }
361 
362  if (NStr::IsBlank(ec_numbers)) {
363  ec_numbers = "Blank EC number";
364  }
365 
366  // look for protein name
367  if (feat->IsSetData() && feat->GetData().IsProt() &&
368  feat->GetData().GetProt().IsSetName() &&
369  !feat->GetData().GetProt().GetName().empty()) {
370  prot_name = feat->GetData().GetProt().GetName().front();
371  }
372 
373  // get locus tag
375  if (gene && gene->GetData().GetGene().IsSetLocus_tag()) {
376  locus_tag = gene->GetData().GetGene().GetLocus_tag();
377  }
378 
379  rval = error.GetAccnver() + "\t" + ec_numbers + "\t" + locus_tag + "\t" + prot_name;
380  return rval;
381 }
382 
383 
385 {
386  string rval;
387 
388  if (biosrc.IsSetOrg() &&
389  biosrc.GetOrg().IsSetOrgname() &&
390  biosrc.GetOrg().GetOrgname().IsSetMod()) {
391  ITERATE(COrgName::TMod, it, biosrc.GetOrg().GetOrgname().GetMod()) {
392  if ((*it)->IsSetSubtype() &&
393  (*it)->GetSubtype() == COrgMod::eSubtype_nat_host &&
394  (*it)->IsSetSubname() &&
395  !NStr::IsBlank((*it)->GetSubname())) {
396  if (!NStr::IsBlank(rval)) {
397  rval += ";";
398  }
399  rval += (*it)->GetSubname();
400  }
401  }
402  }
403  return rval;
404 }
405 
406 
408 {
409  string rval;
410  string spec_host;
411  const string kAlternateName = "Specific host value is alternate name: ";
412  if (NStr::StartsWith(error.GetMsg(), kAlternateName)) {
413  spec_host = error.GetMsg().substr(kAlternateName.length());
414  } else if (error.GetObject().GetThisTypeInfo() == CSeqdesc::GetTypeInfo()) {
415  const CSeqdesc* desc = static_cast<const CSeqdesc *>(&(error.GetObject()));
416  if (desc && desc->IsSource()) {
417  spec_host = s_GetSpecificHostFromBioSource(desc->GetSource());
418  }
419  } else if (error.GetObject().GetThisTypeInfo() == CSeq_feat::GetTypeInfo()) {
420  const CSeq_feat* feat = static_cast<const CSeq_feat *>(&(error.GetObject()));
421  if (feat && feat->IsSetData() && feat->GetData().IsBiosrc()) {
422  spec_host = s_GetSpecificHostFromBioSource(feat->GetData().GetBiosrc());
423  }
424  }
425 
426  if (!NStr::IsBlank(spec_host)) {
427  rval = error.GetAccession() + "\t" + spec_host;
428  }
429 
430  return rval;
431 }
432 
433 
435 {
436  string rval;
437 
438  if (biosrc.IsSetOrg() &&
439  biosrc.GetOrg().IsSetOrgname() &&
440  biosrc.GetOrg().GetOrgname().IsSetMod()) {
441  ITERATE(COrgName::TMod, it, biosrc.GetOrg().GetOrgname().GetMod()) {
442  if ((*it)->IsSetSubtype() &&
443  ((*it)->GetSubtype() == COrgMod::eSubtype_bio_material ||
444  (*it)->GetSubtype() == COrgMod::eSubtype_culture_collection ||
445  (*it)->GetSubtype() == COrgMod::eSubtype_specimen_voucher) &&
446  (*it)->IsSetSubname() &&
447  !NStr::IsBlank((*it)->GetSubname())) {
448  size_t pos = NStr::Find((*it)->GetSubname(), ":");
449  if (pos != string::npos) {
450  string code = (*it)->GetSubname().substr(0, pos);
451  if (!NStr::IsBlank(code)) {
452  if (!NStr::IsBlank(rval)) {
453  rval += ";";
454  }
455  rval += code;
456  }
457  }
458  }
459  }
460  }
461  return rval;
462 }
463 
464 
466 {
467  string rval;
468 
469  string codes;
470  if (error.GetObject().GetThisTypeInfo() == CSeqdesc::GetTypeInfo()) {
471  const CSeqdesc* desc = static_cast<const CSeqdesc *>(&(error.GetObject()));
472  if (desc && desc->IsSource()) {
473  codes = s_GetInstCodeFromBioSource(desc->GetSource());
474  }
475  }
476  else if (error.GetObject().GetThisTypeInfo() == CSeq_feat::GetTypeInfo()) {
477  const CSeq_feat* feat = static_cast<const CSeq_feat *>(&(error.GetObject()));
478  if (feat && feat->IsSetData() && feat->GetData().IsBiosrc()) {
479  codes = s_GetInstCodeFromBioSource(feat->GetData().GetBiosrc());
480  }
481  }
482 
483  if (!NStr::IsBlank(codes)) {
484  rval = error.GetAccession() + "\t" + codes;
485  }
486 
487  return rval;
488 }
489 
490 
492 {
493  string rval;
494  for ( CValidError_CI vit(errors); vit; ++vit) {
495  if (err_code == vit->GetErrIndex()) {
496  string this_val = FormatForSubmitterReport(*vit, scope);
497  if (!NStr::IsBlank(this_val)) {
498  if (NStr::IsBlank(rval)) {
499  rval += GetSubmitterFormatErrorGroupTitle(err_code) + "\n";
500  }
501  rval += this_val + "\n";
502  }
503  }
504  }
505  return rval;
506 }
507 
508 
510  (const CValidError& errors, CScope& scope, ESubmitterFormatErrorGroup grp) const
511 {
512  string rval;
513  for ( CValidError_CI vit(errors); vit; ++vit) {
514  CValidErrItem::TErrIndex err_code = vit->GetErrIndex();
515  if (GetSubmitterFormatErrorGroup(err_code) == grp) {
516  string this_val = FormatForSubmitterReport(*vit, scope);
517  if (!NStr::IsBlank(this_val)) {
518  if (NStr::IsBlank(rval)) {
519  rval += GetSubmitterFormatErrorGroupTitle(err_code) + "\n";
520  }
521  rval += this_val + "\n";
522  }
523  }
524  }
525  return rval;
526 }
527 
528 
530 {
531  string rval = error.GetAccession() + ":" + error.GetMsg();
532  return rval;
533 }
534 
535 
536 vector<CValidErrItem::TErrIndex> CValidErrorFormat::GetListOfErrorCodes(const CValidError& errors) const
537 {
538  vector<CValidErrItem::TErrIndex> list;
539 
540  for (CValidError_CI vit(errors); vit; ++vit) {
541  list.push_back(vit->GetErrIndex());
542  }
543  sort(list.begin(), list.end());
544  list.erase(unique(list.begin(), list.end()), list.end());
545  return list;
546 }
547 
548 
549 vector<string> CValidErrorFormat::FormatCompleteSubmitterReport(const CValidError& errors, CScope& scope) const
550 {
551  vector<string> list;
552 
553  // first, do special categories
555  string this_val = FormatCategoryForSubmitterReport(errors, scope, (ESubmitterFormatErrorGroup)t);
556  if (!NStr::IsBlank(this_val)) {
557  list.push_back(this_val);
558  }
559  }
560 
561  // now do errors not in special categories
562  vector<CValidErrItem::TErrIndex> codes = GetListOfErrorCodes(errors);
563  ITERATE(vector<CValidErrItem::TErrIndex>, it, codes) {
565  string this_val = FormatForSubmitterReport(errors, scope, *it);
566  if (!NStr::IsBlank(this_val)) {
567  list.push_back(this_val);
568  }
569  }
570  }
571  return list;
572 }
573 //LCOV_EXCL_STOP
574 
575 
576 static string s_GetFeatureIdLabel (const CObject_id& object_id)
577 {
578  string feature_id;
579  if (object_id.IsId()) {
580  feature_id = NStr::IntToString(object_id.GetId());
581  } else if (object_id.IsStr()) {
582  feature_id = object_id.GetStr();
583  }
584  return feature_id;
585 }
586 
587 
589 {
590  string feature_id;
591  if (feat_id.IsLocal()) {
592  feature_id = s_GetFeatureIdLabel(feat_id.GetLocal());
593  } else if (feat_id.IsGeneral()) {
594  if (feat_id.GetGeneral().IsSetDb()) {
595  feature_id += feat_id.GetGeneral().GetDb();
596  }
597  feature_id += ":";
598  if (feat_id.GetGeneral().IsSetTag()) {
599  feature_id += s_GetFeatureIdLabel (feat_id.GetGeneral().GetTag());
600  }
601  }
602  return feature_id;
603 }
604 
605 
607 {
608  string feature_id;
609  if (ft.IsSetId()) {
610  feature_id = CValidErrorFormat::GetFeatureIdLabel(ft.GetId());
611  } else if (ft.IsSetIds()) {
612  ITERATE(CSeq_feat::TIds, id_it, ft.GetIds()) {
613  feature_id = CValidErrorFormat::GetFeatureIdLabel((**id_it));
614  if (!NStr::IsBlank(feature_id)) {
615  break;
616  }
617  }
618  }
619  return feature_id;
620 }
621 
622 
623 static void s_FixBioseqLabelProblems (string& str)
624 {
625  size_t pos = NStr::Find(str, ",");
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);
628  }
629  pos = NStr::Find(str, "=");
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);
632  }
633 }
634 
635 
636 
637 static string s_GetOrgRefContentLabel (const COrg_ref& org)
638 {
639  string content;
640  if (org.IsSetTaxname()) {
641  content = org.GetTaxname();
642  } else if (org.IsSetCommon()) {
643  content = org.GetCommon();
644  } else if (org.IsSetDb() && !org.GetDb().empty()) {
645  org.GetDb().front()->GetLabel(&content);
646  }
647  return content;
648 }
649 
650 
651 static string s_GetBioSourceContentLabel (const CBioSource& bsrc)
652 {
653  string content;
654  if (bsrc.IsSetOrg()) {
655  content = s_GetOrgRefContentLabel(bsrc.GetOrg());
656  }
657  return content;
658 }
659 
660 
661 static string s_GetFeatureContentLabelExtras (const CSeq_feat& feat)
662 {
663  string tlabel;
664 
665  // Put Seq-feat qual into label
666  if (feat.IsSetQual()) {
667  string prefix("/");
668  ITERATE(CSeq_feat::TQual, it, feat.GetQual()) {
669  tlabel += prefix + (**it).GetQual();
670  prefix = " ";
671  if (!(**it).GetVal().empty()) {
672  tlabel += "=" + (**it).GetVal();
673  }
674  }
675  }
676 
677  // Put Seq-feat comment into label
678  if (feat.IsSetComment()) {
679  if (tlabel.empty()) {
680  tlabel = feat.GetComment();
681  } else {
682  tlabel += "; " + feat.GetComment();
683  }
684  }
685  return tlabel;
686 }
687 
688 
689 static string s_GetCdregionContentLabel (const CSeq_feat& feat, CRef<CScope> scope)
690 {
691  string content;
692 
693  // Check that feature data is Cdregion
694  if (!feat.GetData().IsCdregion()) {
695  return content;
696  }
697 
698  const CGene_ref* gref = nullptr;
699  const CProt_ref* pref = nullptr;
700 
701  // Look for CProt_ref object to create a label from
702  if (feat.IsSetXref()) {
703  ITERATE ( CSeq_feat::TXref, it, feat.GetXref()) {
704  const CSeqFeatXref& xref = **it;
705  if ( !xref.IsSetData() ) {
706  continue;
707  }
708 
709  switch (xref.GetData().Which()) {
711  pref = &xref.GetData().GetProt();
712  break;
714  gref = &xref.GetData().GetGene();
715  break;
716  default:
717  break;
718  }
719  }
720  }
721 
722  // Try and create a label from a CProt_ref in CSeqFeatXref in feature
723  if (pref) {
724  pref->GetLabel(&content);
725  return content;
726  }
727 
728  // Try and create a label from a CProt_ref in the feat product and
729  // return if found
730  if (feat.IsSetProduct() && scope) {
731  try {
732  const CSeq_id& id = GetId(feat.GetProduct(), scope);
733  CBioseq_Handle hnd = scope->GetBioseqHandle(id);
734  if (hnd) {
735  const CBioseq& seq = *hnd.GetCompleteBioseq();
736 
737  // Now look for a CProt_ref feature in seq and
738  // if found call GetLabel() on the CProt_ref
740  for (;it; ++it) {
741  if (it->IsProt()) {
742  it->GetProt().GetLabel(&content);
743  return content;
744  }
745  }
746  }
747  } catch (CObjmgrUtilException&) {}
748  }
749 
750  // Try and create a label from a CGene_ref in CSeqFeatXref in feature
751  if (gref) {
752  gref->GetLabel(&content);
753  }
754 
755  if (NStr::IsBlank(content)) {
756  content = s_GetFeatureContentLabelExtras(feat);
757  }
758 
759  return content;
760 }
761 
762 
764 {
765  string content_label;
766 
767  switch (feat.GetData().Which()) {
768  case CSeqFeatData::e_Pub:
769  content_label = "Cit: ";
770  feat.GetData().GetPub().GetPub().GetLabel(&content_label);
771  break;
773  content_label = "Src: " + s_GetBioSourceContentLabel (feat.GetData().GetBiosrc());
774  break;
775  case CSeqFeatData::e_Imp: {
776  feature::GetLabel(feat, &content_label, feature::fFGL_Both, scope);
777  if (feat.GetData().GetImp().IsSetKey()) {
778  string key = feat.GetData().GetImp().GetKey();
779  string tmp = "[" + key + "]";
780  if (NStr::StartsWith(content_label, tmp)) {
781  content_label = key + content_label.substr(tmp.length());
782  }
783  }
784  } break;
785  case CSeqFeatData::e_Rna:
786  feature::GetLabel(feat, &content_label, feature::fFGL_Both, scope);
788  && NStr::Equal(content_label, "tRNA: tRNA")) {
789  content_label = "tRNA: ";
790  }
791  break;
793  content_label = "CDS: " + s_GetCdregionContentLabel(feat, scope);
794  break;
796  feature::GetLabel(feat, &content_label, feature::fFGL_Both, scope);
797  if (feat.GetData().GetProt().IsSetProcessed()) {
798  switch (feat.GetData().GetProt().GetProcessed()) {
800  content_label = "mat_peptide: " + content_label.substr(6);
801  break;
803  content_label = "sig_peptide: " + content_label.substr(6);
804  break;
806  content_label = "trans_peptide: " + content_label.substr(6);
807  break;
808  default:
809  break;
810  }
811  }
812  break;
813  default:
814  feature::GetLabel(feat, &content_label, feature::fFGL_Both, scope);
815  break;
816  }
817  return content_label;
818 }
819 
820 
821 string CValidErrorFormat::GetFeatureBioseqLabel(const CSeq_feat& ft, CRef<CScope> scope, bool suppress_context)
822 {
823  string desc;
824  // Append label for bioseq of feature location
825  if (!suppress_context && scope) {
826  bool find_failed = false;
827  try {
828  CBioseq_Handle hnd;
829  try {
830  hnd = scope->GetBioseqHandle(ft.GetLocation());
831  } catch (CException&) {
832  CSeq_loc_CI li(ft.GetLocation());
833  while (li && !hnd) {
834  hnd = scope->GetBioseqHandle(li.GetSeq_id());
835  ++li;
836  }
837  }
838  if (hnd) {
840  }
841  } catch (CObjMgrException& ex) {
843  find_failed = true;
844  }
845  } catch (const CException&) {
846  } catch (const std::exception&) {
847  };
848  if (find_failed) {
849  try {
850  CSeq_loc_CI li(ft.GetLocation());
851  CBioseq_Handle hnd = scope->GetBioseqHandle(li.GetSeq_id());
852  if (hnd) {
854  }
855 
856  } catch (const CException&) {
857  } catch (const std::exception&) {
858  };
859  }
860  }
861  return desc;
862 }
863 
864 
865 string CValidErrorFormat::GetFeatureProductLocLabel(const CSeq_feat& ft, CRef<CScope> scope, bool suppress_context)
866 {
867  string desc;
868  // Append label for product of feature
869  if (ft.IsSetProduct() && scope) {
870  string loc_label;
871  if (suppress_context) {
872  CSeq_loc loc;
873  loc.Assign(ft.GetProduct());
874  ChangeSeqLocId(&loc, false, scope);
875  loc_label = GetValidatorLocationLabel(loc, *scope);
876  } else {
877  loc_label = GetValidatorLocationLabel(ft.GetProduct(), *scope);
878  }
879  if (loc_label.size() > 800) {
880  loc_label.replace(797, NPOS, "...");
881  }
882  if (!loc_label.empty()) {
883  desc += "[";
884  desc += loc_label;
885  desc += "]";
886  }
887  }
888  return desc;
889 }
890 
891 
892 string CValidErrorFormat::GetFeatureLocationLabel(const CSeq_feat& ft, CRef<CScope> scope, bool suppress_context)
893 {
894  string loc_label;
895  // Add feature location part of label
896  if (ft.IsSetLocation() && scope) {
897  if (suppress_context) {
898  CSeq_loc loc;
899  loc.Assign(ft.GetLocation());
900  ChangeSeqLocId(&loc, false, scope);
901  loc_label = GetValidatorLocationLabel(loc, *scope);
902  } else {
903  loc_label = GetValidatorLocationLabel(ft.GetLocation(), *scope);
904  }
905  if (loc_label.size() > 800) {
906  loc_label.replace(795, NPOS, "...");
907  }
908  }
909  return loc_label;
910 }
911 
912 //LCOV_EXCL_START
913 //not used
914 string CValidErrorFormat::GetFeatureLabel(const CSeq_feat& ft, CRef<CScope> scope, bool suppress_context)
915 {
916  // Add feature part of label
917  string desc = "FEATURE: ";
918  string content_label = CValidErrorFormat::GetFeatureContentLabel(ft, scope);
919  desc += content_label;
920 
921  // Add feature ID part of label (if present)
922  string feature_id = GetFeatureIdLabel(ft);
923  if (!NStr::IsBlank(feature_id)) {
924  desc += " <" + feature_id + "> ";
925  }
926 
927  // Add feature location part of label
928  string loc_label = GetFeatureLocationLabel(ft, scope, suppress_context);
929  if (!NStr::IsBlank(loc_label)) {
930  desc += " [" + loc_label + "]";
931  }
932 
933  // Append label for bioseq of feature location
934  string bioseq_label = GetFeatureBioseqLabel(ft, scope, suppress_context);
935  if (!NStr::IsBlank(bioseq_label)) {
936  desc += bioseq_label;
937  }
938 
939  // Append label for product of feature
940  string product_label = GetFeatureProductLocLabel(ft, scope, suppress_context);
941  if (!NStr::IsBlank(product_label)) {
942  desc += product_label;
943  }
944  return desc;
945 }
946 //LCOV_EXCL_STOP
947 
948 
950 {
951  string content;
952 
953  switch (ds.Which()) {
954  case CSeqdesc::e_Pub:
955  content = "Pub: ";
956  ds.GetPub().GetPub().GetLabel(&content);
957  break;
958  case CSeqdesc::e_Source:
959  content = "BioSource: " + s_GetBioSourceContentLabel(ds.GetSource());
960  break;
961  case CSeqdesc::e_Modif:
962  ds.GetLabel(&content, CSeqdesc::eBoth);
963  if (NStr::StartsWith(content, "modif: ,")) {
964  content = "Modifier: " + content.substr(8);
965  }
966  break;
967  case CSeqdesc::e_Molinfo:
968  ds.GetLabel(&content, CSeqdesc::eBoth);
969  if (NStr::StartsWith(content, "molinfo: ,")) {
970  content = "molInfo: " + content.substr(10);
971  }
972  break;
973  case CSeqdesc::e_Comment:
974  ds.GetLabel(&content, CSeqdesc::eBoth);
975  if (NStr::StartsWith(content, "comment: ") && NStr::IsBlank(content.substr(9))) {
976  content = "comment: ";
977  }
978  break;
979  case CSeqdesc::e_User:
980  content = "UserObj: ";
981  if (ds.GetUser().IsSetClass()) {
982  content += ds.GetUser().GetClass();
983  } else if (ds.GetUser().IsSetType() && ds.GetUser().GetType().IsStr()) {
984  content += ds.GetUser().GetType().GetStr();
985  }
986  break;
987  default:
988  ds.GetLabel(&content, CSeqdesc::eBoth);
989  break;
990  }
991  // fix descriptor type names
992  string first = content.substr(0, 1);
994  content = first + content.substr(1);
995  size_t colon_pos = NStr::Find(content, ":");
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);
1000  NStr::ToUpper (after_dash);
1001  content = content.substr(0, dash_pos) + after_dash + content.substr(dash_pos + 2);
1002  }
1003  }
1004  if (NStr::StartsWith(content, "BioSource:")) {
1005  content = "BioSrc:" + content.substr(10);
1006  } else if (NStr::StartsWith(content, "Modif:")) {
1007  content = "Modifier:" + content.substr(6);
1008  } else if (NStr::StartsWith(content, "Embl:")) {
1009  content = "EMBL:" + content.substr(5);
1010  } else if (NStr::StartsWith(content, "Pir:")) {
1011  content = "PIR:" + content.substr(4);
1012  }
1013  return content;
1014 }
1015 
1016 
1017 string CValidErrorFormat::GetDescriptorLabel(const CSeqdesc& ds, const CSeq_entry& ctx, CRef<CScope> scope, bool suppress_context)
1018 {
1019  string desc("DESCRIPTOR: ");
1020 
1021  string content = CValidErrorFormat::GetDescriptorContent (ds);
1022 
1023  desc += content;
1024 
1025  desc += " ";
1026  if (ctx.IsSeq()) {
1027  AppendBioseqLabel(desc, ctx.GetSeq(), suppress_context);
1028  } else {
1029  desc += CValidErrorFormat::GetBioseqSetLabel(ctx.GetSet(), scope, suppress_context);
1030  }
1031  return desc;
1032 }
1033 
1034 
1036 {
1037  string desc;
1038 
1040  desc += " [";
1041  string bc_label;
1042  bc->GetLabel(&bc_label, CBioseq::eBoth);
1043  s_FixBioseqLabelProblems(bc_label);
1044  desc += bc_label;
1045  desc += "]";
1046  return desc;
1047 }
1048 
1049 
1050 string CValidErrorFormat::GetBioseqSetLabel(const CBioseq_set& st, CRef<CScope> /*dummy*/, bool suppress_context)
1051 {
1052  return GetBioseqSetLabel(st, suppress_context);
1053 }
1054 
1055 
1056 string CValidErrorFormat::GetBioseqSetLabel(const CBioseq_set& st, bool suppress_context)
1057 {
1058  const auto isSetClass = st.IsSetClass();
1059  suppress_context = suppress_context || !isSetClass;
1060 
1061  int version = 0;
1062  const string& accession = GetAccessionFromBioseqSet(st, &version);
1063  return GetBioseqSetLabel(accession, isSetClass ? st.GetClass() : CBioseq_set::eClass_not_set, suppress_context);
1064 }
1065 
1066 
1067 string CValidErrorFormat::GetBioseqSetLabel(const string& accession, CBioseq_set::EClass setClass, bool suppress_context)
1068 {
1069  string str = "BIOSEQ-SET: ";
1070  if (!suppress_context) {
1071  const auto* tv = CBioseq_set::ENUM_METHOD_NAME(EClass)();
1072  const string& context = tv->FindName(setClass, true);
1073  str += context;
1074  str += ": ";
1075  }
1076 
1077  if(NStr::IsBlank(accession)) {
1078  str += "(No Bioseqs)";
1079  return str;
1080  }
1081 
1082  string temporary(accession); // create modifiable copy of accession
1083  s_FixBioseqLabelProblems(temporary);
1084  str += temporary;
1085  return str;
1086 }
1087 
1088 //LCOV_EXCL_START
1089 //not used
1090 string CValidErrorFormat::GetObjectLabel(const CObject& obj, const CSeq_entry& ctx, CRef<CScope> scope, bool suppress_context)
1091 {
1092  string label = "Unknown object";
1093 
1094  const CSeq_feat* ft = dynamic_cast<const CSeq_feat*>(&obj);
1095  const CSeqdesc* ds = dynamic_cast<const CSeqdesc*>(&obj);
1096  const CBioseq* b = dynamic_cast<const CBioseq*>(&obj);
1097  const CBioseq_set* set = dynamic_cast<const CBioseq_set*>(&obj);
1098 
1099  if (ft) {
1100  label = GetFeatureLabel(*ft, scope, suppress_context);
1101  } else if (ds) {
1102  label = GetDescriptorLabel(*ds, ctx, scope, suppress_context);
1103  } else if (b) {
1104  label = GetBioseqLabel(scope->GetBioseqHandle(*b));
1105  } else if (set) {
1106  label = GetBioseqSetLabel(*set, suppress_context);
1107  }
1108  return label;
1109 }
1110 //LCOV_EXCL_STOP
1111 
1112 
1113 static const string kSuppressFieldLabel = "Suppress";
1114 
1115 static bool s_IsSuppressField (const CUser_field& field)
1116 {
1117  if (field.IsSetLabel() &&
1118  field.GetLabel().IsStr() &&
1120  return true;
1121  } else {
1122  return false;
1123  }
1124 }
1125 
1126 
1128 {
1129  CValidErrorSuppress::AddSuppression(user, error_code);
1130 }
1131 
1132 
1134 {
1135  CValidErrorSuppress::TCodes suppressedCodes;
1136  CValidErrorSuppress::SetSuppressedCodes(user, suppressedCodes);
1137  for (auto code : suppressedCodes) {
1138  errors.SuppressError(code);
1139  }
1140 }
1141 
1142 
1144 {
1145  CValidErrorSuppress::TCodes suppressedCodes;
1146  CValidErrorSuppress::SetSuppressedCodes(se, suppressedCodes);
1147  for (auto code : suppressedCodes) {
1148  errors.SuppressError(code);
1149  }
1150 }
1151 
1152 
1154 {
1155  SetSuppressionRules(*(se.GetCompleteSeq_entry()), errors);
1156 }
1157 
1158 
1160 {
1161  CValidErrorSuppress::TCodes suppressedCodes;
1162  CValidErrorSuppress::SetSuppressedCodes(ss, suppressedCodes);
1163  for (auto code : suppressedCodes) {
1164  errors.SuppressError(code);
1165  }
1166 }
1167 
1168 
1170 {
1171  CValidErrorSuppress::TCodes suppressedCodes;
1172  CValidErrorSuppress::SetSuppressedCodes(seq, suppressedCodes);
1173  for (auto code : suppressedCodes) {
1174  errors.SuppressError(code);
1175  }
1176 }
1177 
1178 
1179 //LCOV_EXCL_START
1180 //not used by asnvalidate but may be useful for other clients of validator library
1182 {
1183  for (auto it : errors.SetErrs()) {
1184  if (it->IsSetLocus_tag()) {
1185  continue;
1186  }
1187  if (it->IsSetObjectType() &&
1188  it->GetObjectType() == CValidErrItem::eObjectType_seqfeat &&
1189  it->IsSetObject() &&
1190  it->GetObject().GetThisTypeInfo() == CSeq_feat::GetTypeInfo()) {
1191  const CSeq_feat* sf = static_cast<const CSeq_feat *>(&(it->GetObject()));
1192  if (sf && sf->IsSetData()) {
1193  it->SetLocus_tag(x_GetLocusTag(*sf, scope));
1194  }
1195  }
1196  }
1197 }
1198 
1199 
1200 const string& CValidErrorFormat::x_GetLocusTag(const CSeq_feat& sf, CScope& scope)
1201 {
1202  const string* rval = &kEmptyStr;
1203 
1204  if (sf.GetData().IsGene()) {
1205  if (sf.GetData().GetGene().IsSetLocus_tag()) {
1206  rval = &sf.GetData().GetGene().GetLocus_tag();
1207  }
1208  } else {
1209  const CGene_ref* g = sf.GetGeneXref();
1210  if (g && g->IsSetLocus_tag()) {
1211  rval = &g->GetLocus_tag();
1212  } else {
1214  if (gene && gene->GetData().GetGene().IsSetLocus_tag()) {
1215  rval = &gene->GetData().GetGene().GetLocus_tag();
1216  }
1217  }
1218  }
1219  return *rval;
1220 }
1221 //LCOV_EXCL_STOP
1222 
1223 
1224 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_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
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:5084
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:2891
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:5412
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:5353
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:5384
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:3405
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
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.
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.
static int version
Definition: mdb_load.c:29
constexpr auto sort(_Init &&init)
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 const char * suffix[]
Definition: pcregrep.c:408
static const char * prefix[]
Definition: pcregrep.c:405
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 Thu Apr 25 08:18:53 2024 by modify_doxy.py rev. 669887