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

Go to the SVN repository for this file.

1 /* $Id: valid_pub.cpp 68556 2015-08-13 20:38:39Z 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, Mati Shomrat, ....
27  *
28  * File Description:
29  * Implementation of private parts of the validator
30  * .......
31  *
32  */
33 #include <ncbi_pch.hpp>
34 #include <corelib/ncbistd.hpp>
35 #include <corelib/ncbistr.hpp>
36 #include <corelib/ncbiapp.hpp>
38 
41 
42 #include <serial/iterator.hpp>
43 #include <serial/enumvalues.hpp>
44 
48 
50 
53 
54 #include <objects/seq/Bioseq.hpp>
56 #include <objects/seq/Seqdesc.hpp>
58 #include <objects/seq/Pubdesc.hpp>
59 #include <objects/seq/MolInfo.hpp>
66 
71 
73 
76 
77 #include <objmgr/bioseq_ci.hpp>
78 #include <objmgr/seqdesc_ci.hpp>
79 #include <objmgr/graph_ci.hpp>
80 #include <objmgr/seq_annot_ci.hpp>
81 #include <objmgr/util/feature.hpp>
82 #include <objmgr/util/sequence.hpp>
83 
84 #include <objmgr/feat_ci.hpp>
85 #include <objmgr/align_ci.hpp>
86 #include <objmgr/seq_vector.hpp>
87 #include <objmgr/scope.hpp>
88 
89 #include <objects/pub/Pub.hpp>
91 
103 #include <objects/biblio/Title.hpp>
105 #include <objects/biblio/Affil.hpp>
107 
108 #include <objtools/error_codes.hpp>
109 #include <util/sgml_entity.hpp>
110 #include <util/line_reader.hpp>
111 
112 #include <algorithm>
113 
114 
115 #include <serial/iterator.hpp>
116 
117 #define NCBI_USE_ERRCODE_X Objtools_Validator
118 
122 using namespace sequence;
123 
124 
125 void CValidError_imp::ValidatePubdesc
126 (const CPubdesc& pubdesc,
127  const CSerialObject& obj,
128  const CSeq_entry *ctx)
129 {
130  int uid = 0, pmid = 0, muid = 0;
131  bool conflicting_pmids = false, redundant_pmids = false, conflicting_muids = false, redundant_muids = false;
132 
133  ValidatePubHasAuthor(pubdesc, obj, ctx);
134 
135  // need to get uid (pmid or muid) in first pass for ValidatePubArticle
136  FOR_EACH_PUB_ON_PUBDESC (pub_iter, pubdesc) {
137  const CPub& pub = **pub_iter;
138 
139  switch( pub.Which() ) {
140  case CPub::e_Muid:
141  if ( muid == 0 ) {
142  muid = pub.GetMuid();
143  } else if ( muid != pub.GetMuid() ) {
144  conflicting_muids = true;
145  } else {
146  redundant_muids = true;
147  }
148  if ( uid == 0 ) {
149  uid = pub.GetMuid();
150  }
151  break;
152 
153  case CPub::e_Pmid:
154  if ( pmid == 0 ) {
155  pmid = pub.GetPmid();
156  } else if ( pmid != pub.GetPmid() ) {
157  conflicting_pmids = true;
158  } else {
159  redundant_pmids = true;
160  }
161  if ( uid == 0 ) {
162  uid = pub.GetPmid();
163  }
164  break;
165 
166  default:
167  break;
168  }
169  }
170 
171  if ( conflicting_pmids ) {
173  "Multiple conflicting pmids in a single publication", obj, ctx);
174  }
175  if ( redundant_pmids ) {
177  "Multiple redundant pmids in a single publication", obj, ctx);
178  }
179  if ( conflicting_muids ) {
181  "Multiple conflicting muids in a single publication", obj, ctx);
182  }
183  if ( redundant_muids ) {
185  "Multiple redundant muids in a single publication", obj, ctx);
186  }
187 
188  // second pass for remaining (non-uid) types
189  FOR_EACH_PUB_ON_PUBDESC (pub_iter, pubdesc) {
190  const CPub& pub = **pub_iter;
191 
192  switch( pub.Which() ) {
193  case CPub::e_Gen:
194  ValidatePubGen(pub.GetGen(), obj, ctx);
195  break;
196 
197  case CPub::e_Sub:
198  ValidateCitSub(pub.GetSub(), obj, ctx);
199  break;
200 
201  case CPub::e_Medline:
203  "Publication is medline entry", obj, ctx);
204  break;
205 
206  /*
207  case CPub::e_Muid:
208  if ( uid == 0 ) {
209  uid = pub.GetMuid();
210  }
211  break;
212 
213  case CPub::e_Pmid:
214  if ( uid == 0 ) {
215  uid = pub.GetPmid();
216  }
217  break;
218  */
219 
220  case CPub::e_Article:
221  ValidatePubArticle(pub.GetArticle(), uid, obj, ctx);
222  if (pubdesc.IsSetComment() && !NStr::IsBlank(pubdesc.GetComment())
223  && pub.GetArticle().IsSetFrom() && pub.GetArticle().GetFrom().IsJournal()
224  && pub.GetArticle().GetFrom().GetJournal().IsSetImp()
227  const string& comment = pubdesc.GetComment();
228  if ((pubstatus == ePubStatus_epublish
229  || pubstatus == ePubStatus_ppublish
230  || pubstatus == ePubStatus_aheadofprint)
231  && (NStr::Find(comment, "Publication Status") != string::npos
232  || NStr::Find(comment, "Publication-Status") != string::npos
233  || NStr::Find(comment, "Publication_Status") != string::npos)) {
235  "Publication status is in comment for pmid " + NStr::IntToString (uid),
236  obj, ctx);
237  }
238  }
239  break;
240 
241  case CPub::e_Equiv:
243  "Publication has unexpected internal Pub-equiv", obj, ctx);
244  break;
245 
246  default:
247  break;
248  }
249  }
250  if (pubdesc.IsSetPub()) {
251  ValidateAuthorsInPubequiv (pubdesc.GetPub(), obj, ctx);
252  }
253 
254 }
255 
256 
257 static bool s_CitGenIsJustBackBoneIDNumber (const CCit_gen& gen)
258 {
259  if (gen.IsSetCit()
260  && NStr::StartsWith (gen.GetCit(), "BackBone id_pub = ")
261  && !gen.IsSetJournal()
262  && !gen.IsSetDate()
263  && !gen.IsSetSerial_number()) {
264  return true;
265  } else {
266  return false;
267  }
268 }
269 
270 
272 (const CCit_gen& gen,
273  const CSerialObject& obj,
274  const CSeq_entry *ctx)
275 {
276  bool is_unpub = false;
277  if ( gen.IsSetCit() && !gen.GetCit().empty() ) {
278  const string& cit = gen.GetCit();
279  // skip if just BackBone id number
281  return;
282  }
283 
284  if (NStr::StartsWith (cit, "submitted", NStr::eNocase)
285  || NStr::StartsWith (cit, "unpublished", NStr::eNocase)
286  || NStr::StartsWith (cit, "Online Publication", NStr::eNocase)
287  || NStr::StartsWith (cit, "Published Only in DataBase", NStr::eNocase)
288  || NStr::StartsWith (cit, "(er) ", NStr::eNocase)) {
289  is_unpub = true;
290  } else {
292  "Unpublished citation text invalid", obj, ctx);
293  }
294 
295  if (NStr::FindCase (cit, "Title=") != string::npos) {
297  "Unpublished citation has embedded Title", obj, ctx);
298  }
299  if (NStr::FindCase (cit, "Journal=") != string::npos) {
301  "Unpublished citation has embedded Journal", obj, ctx);
302  }
303 
304  }
305  if (gen.IsSetSerial_number()) {
306  m_PubSerialNumbers.push_back(gen.GetSerial_number());
307  /* date not required if just serial number */
308  if (!gen.IsSetCit() && !gen.IsSetJournal() && !gen.IsSetDate()) {
309  return;
310  }
311  }
312  if (!gen.IsSetDate()) {
313  if (!is_unpub) {
314  PostObjErr(eDiag_Warning, eErr_GENERIC_MissingPubInfo, "Publication date missing", obj, ctx);
315  }
316  } else if (gen.GetDate().IsStr()) {
317  if (NStr::Equal(gen.GetDate().GetStr(), "?")) {
318  PostObjErr(eDiag_Warning, eErr_GENERIC_MissingPubInfo, "Publication date marked as '?'", obj, ctx);
319  }
320  } else if (gen.GetDate().IsStd() && (!gen.GetDate().GetStd().IsSetYear() || gen.GetDate().GetStd().GetYear() == 0)) {
321  PostObjErr(eDiag_Warning, eErr_GENERIC_MissingPubInfo, "Publication date not set", obj, ctx);
322  } else {
323  int rval = CheckDate (gen.GetDate());
324  if (rval != eDateValid_valid) {
325  PostBadDateError (eDiag_Error, "Publication date has error", rval, obj, ctx);
326  }
327  }
328 }
329 
330 
332 (const CCit_art& art,
333  int uid,
334  const CSerialObject& obj,
335  const CSeq_entry *ctx)
336 {
337  if ( !art.IsSetTitle() || !HasTitle(art.GetTitle()) ) {
339  "Publication has no title", obj, ctx);
340  }
341 
342  if ( art.GetFrom().IsJournal() ) {
343  const CCit_jour& jour = art.GetFrom().GetJournal();
344 
345  bool has_iso_jta = HasIsoJTA(jour.GetTitle());
346  bool in_press = false;
347  bool is_electronic_journal = false;
348 
349  if ( !HasTitle(jour.GetTitle()) ) {
351  "Journal title missing", obj, ctx);
352  }
353 
354  ITERATE (CTitle::Tdata, item, jour.GetTitle().Get() ) {
355  if ((*item)->Which() == CTitle::C_E::e_Name
356  && NStr::StartsWith((*item)->GetName(), "(er)")) {
357  is_electronic_journal = true;
358  break;
359  }
360  }
361 
362  if ( jour.CanGetImp() ) {
363  const CImprint& imp = jour.GetImp();
364 
365  if ( imp.CanGetPrepub() ) {
366  in_press = imp.GetPrepub() == CImprint::ePrepub_in_press;
367  if ( in_press ) {
368  if ( imp.IsSetPages() ) {
369  if (! NStr::IsBlank(imp.GetPages()) ) {
371  "In-press is not expected to have page numbers", obj, ctx);
372  }
373  }
374  if ( (! imp.IsSetDate()) || (imp.GetDate().IsStr() && NStr::Equal (imp.GetDate().GetStr(), "?"))) {
376  "In-press is missing the date", obj, ctx);
377  }
378  }
379  }
380 
381  if (imp.IsSetPubstatus()
383  is_electronic_journal = true;
384  }
385  if ( !imp.IsSetPrepub() &&
386  (!imp.CanGetPubstatus() ||
388  bool no_vol = !imp.IsSetVolume() ||
389  NStr::IsBlank(imp.GetVolume());
390  bool no_pages = !imp.IsSetPages() ||
391  NStr::IsBlank(imp.GetPages());
392 
393  if ( no_vol ) {
394  if (is_electronic_journal) {
396  "Electronic journal volume missing", obj, ctx);
397  } else {
399  "Journal volume missing", obj, ctx);
400  }
401  }
402  if ( no_pages ) {
403  if (is_electronic_journal) {
405  "Electronic journal pages missing", obj, ctx);
406  } else {
408  "Journal pages missing", obj, ctx);
409  }
410  }
411 
412  if ( !no_pages ) {
413  x_ValidatePages(imp.GetPages(), obj, ctx);
414  }
415  if (imp.IsSetDate() && imp.GetDate().Which() != CDate::e_not_set) {
416  if (imp.GetDate().IsStr() && NStr::Equal (imp.GetDate().GetStr(), "?")) {
418  "Publication date marked as '?'", obj, ctx);
419  } else if (imp.GetDate().IsStd()) {
420  if (!imp.GetDate().GetStd().IsSetYear()) {
422  "Publication date missing", obj, ctx);
423  } else if (imp.GetDate().GetStd().GetYear() == 0) {
425  "Publication date not set", obj, ctx);
426  } else {
427  int rval = CheckDate (imp.GetDate());
428  if (rval != eDateValid_valid) {
429  PostBadDateError (eDiag_Error, "Publication date has error", rval, obj, ctx);
430  }
431  }
432  }
433  } else {
435  "Publication date missing", obj, ctx);
436  }
437  }
438  if (imp.IsSetPubstatus()) {
439  CImprint::TPubstatus pubstatus = imp.GetPubstatus();
440  if (pubstatus == ePubStatus_aheadofprint
441  && (!imp.IsSetPrepub() || imp.GetPrepub() != CImprint::ePrepub_in_press)) {
442  bool noVol = !imp.IsSetVolume() || NStr::IsBlank(imp.GetVolume());
443  bool noPages = !imp.IsSetPages() || NStr::IsBlank(imp.GetPages());
444  if (!noVol && !noPages && uid == 0) {
446  "Ahead-of-print without in-press", obj, ctx);
447  }
448  }
449  if (pubstatus == ePubStatus_epublish
450  && imp.IsSetPrepub() && imp.GetPrepub() == CImprint::ePrepub_in_press) {
452  "Electronic-only publication should not also be in-press", obj, ctx);
453  }
454  }
455  }
456  if ( !has_iso_jta && (uid > 0 || in_press || IsRequireISOJTA()) && !is_electronic_journal ) {
458  "ISO journal title abbreviation missing", obj, ctx);
459  }
460  }
461 }
462 
463 
464 bool s_GetDigits(const string& pages, string& digits)
465 {
466  string::size_type pos = 0;
467  string::size_type len = pages.length();
468 
469  digits.erase();
470 
471  // skip alpha at the begining
472  while (pos < len && !isdigit((unsigned char) pages[pos])) {
473  ++pos;
474  }
475 
476  while (pos < len && isdigit((unsigned char) pages[pos])) {
477  digits += pages[pos];
478  ++pos;
479  }
480 
481  _ASSERT (pos >= len || !isdigit((unsigned char) pages[pos]));
482 
483  while (pos < len) {
484  if (isdigit((unsigned char) pages[pos])) {
485  digits.erase();
486  return false;
487  }
488  ++pos;
489  }
490 
491  return true;
492 }
493 
494 
496 (const string& pages,
497  const CSerialObject& obj,
498  const CSeq_entry *ctx)
499 {
500  static const string kRoman = "IVXLCDM";
501 
502  if (pages.empty()) {
503  return;
504  }
505 
506  EDiagSev sev = eDiag_Warning;
507 
508  string start, stop;
509  if (!NStr::SplitInTwo(pages, "-", start, stop) || start.empty() || stop.empty()) {
510  return;
511  }
512 
513  NStr::ReplaceInPlace(start, " ", "");
514  NStr::ReplaceInPlace(stop, " ", "");
515 
516  int p1 = 0, p2 = 0;
517  bool start_good = false, stop_good = false;
518  size_t num_digits = 0, num_chars = 0;
519 
520  if (start.c_str()[0] == '-') {
521  num_chars++;
522  }
523  while (isdigit (start.c_str()[num_chars])) {
524  num_digits++;
525  num_chars++;
526  }
527  if (num_digits == 0) {
528  if (!isalpha(start.c_str()[0])) {
529  PostObjErr(sev, eErr_GENERIC_BadPageNumbering, "Page numbering start looks strange", obj, ctx);
530  }
531  } else {
532  start_good = true;
533  p1 = NStr::StringToInt (start.substr(0, num_digits), NStr::fConvErr_NoThrow);
534 
535  num_digits = 0;
536  num_chars = 0;
537  if (stop.c_str()[0] == '-') {
538  num_chars++;
539  }
540  while (isdigit (stop.c_str()[num_chars])) {
541  num_digits++;
542  num_chars++;
543  }
544  if (num_digits == 0) {
545  PostObjErr(sev, eErr_GENERIC_BadPageNumbering, "Page numbering stop looks strange", obj, ctx);
546  } else {
547  stop_good = true;
548  p2 = NStr::StringToInt (stop.substr(0, num_digits), NStr::fConvErr_NoThrow);
549  }
550 
551  if ((start_good && p1 == 0) || (stop_good && p2 == 0)) {
552  PostObjErr(sev, eErr_GENERIC_BadPageNumbering, "Page numbering has zero value", obj, ctx);
553  } else if ((start_good && p1 < 0) || (stop_good && p2 < 0)) {
554  PostObjErr(sev, eErr_GENERIC_BadPageNumbering, "Page numbering has negative value", obj, ctx);
555  } else if (start_good && stop_good && p1 > p2) {
556  PostObjErr(sev, eErr_GENERIC_BadPageNumbering, "Page numbering out of order", obj, ctx);
557  } else if (start_good && stop_good && p2 > p1 + 50) {
558  PostObjErr(sev, eErr_GENERIC_BadPageNumbering, "Page numbering greater than 50", obj, ctx);
559  }
560  }
561 }
562 
563 
565 {
566  ITERATE (CTitle::Tdata, item, title.Get() ) {
567  const string *str = 0;
568  switch ( (*item)->Which() ) {
569  case CTitle::C_E::e_Name:
570  str = &(*item)->GetName();
571  break;
572 
573  case CTitle::C_E::e_Tsub:
574  str = &(*item)->GetTsub();
575  break;
576 
578  str = &(*item)->GetTrans();
579  break;
580 
581  case CTitle::C_E::e_Jta:
582  str = &(*item)->GetJta();
583  break;
584 
586  str = &(*item)->GetIso_jta();
587  break;
588 
590  str = &(*item)->GetMl_jta();
591  break;
592 
594  str = &(*item)->GetCoden();
595  break;
596 
597  case CTitle::C_E::e_Issn:
598  str = &(*item)->GetIssn();
599  break;
600 
601  case CTitle::C_E::e_Abr:
602  str = &(*item)->GetAbr();
603  break;
604 
605  case CTitle::C_E::e_Isbn:
606  str = &(*item)->GetIsbn();
607  break;
608 
609  default:
610  break;
611  };
612  if ( str != NULL && !NStr::IsBlank(*str) ) {
613  return true;
614  }
615  }
616  return false;
617 }
618 
619 
621 {
622  ITERATE (CTitle::Tdata, item, title.Get() ) {
623  if ( (*item)->IsIso_jta() ) {
624  return true;
625  }
626  }
627  return false;
628 }
629 
630 
632 {
633  if ( authors.CanGetNames() ) {
634  const CAuth_list::TNames& names = authors.GetNames();
635  switch ( names.Which() ) {
637  ITERATE ( list< CRef< CAuthor > >, auth, names.GetStd() ) {
638  const CPerson_id& pid = (*auth)->GetName();
639  if ( pid.IsName() ) {
640  if ( ! NStr::IsBlank(pid.GetName().GetLast()) ) {
641  return true;
642  }
643  } else if ( pid.IsConsortium() ) {
644  if ( ! NStr::IsBlank (pid.GetConsortium()) ) {
645  return true;
646  }
647  }
648  }
649  break;
650 
652  if ( ! IsBlankStringList(names.GetMl()) ) {
653  return true;
654  }
655  break;
656 
658  if ( ! IsBlankStringList(names.GetStr()) ) {
659  return true;
660  }
661  break;
662 
663  default:
664  break;
665  }
666  }
667  return false;
668 }
669 
670 
672 (const CPubdesc& pubdesc,
673  const CSerialObject& obj,
674  const CSeq_entry *ctx)
675 {
676  bool has_name = false;
677  FOR_EACH_PUB_ON_PUBDESC (pub_iter, pubdesc) {
678  const CPub& pub = **pub_iter;
679  switch (pub.Which() ) {
680  case CPub::e_Gen:
681  // don't check if just serial number
682  if (!pub.GetGen().IsSetCit()
683  && !pub.GetGen().IsSetJournal()
684  && !pub.GetGen().IsSetDate()
685  && pub.GetGen().IsSetSerial_number()
686  && pub.GetGen().GetSerial_number() > -1) {
687  // skip
688  } else if (s_CitGenIsJustBackBoneIDNumber(pub.GetGen())) {
689  // just BackBoneID, skip
690  } else {
691  has_name = false;
692  if ( pub.GetGen().IsSetAuthors()
693  && HasName(pub.GetGen().GetAuthors())) {
694  has_name = true;
695  }
696  if (!has_name) {
697  PostObjErr(IsRefSeq() ? eDiag_Warning : eDiag_Error,
699  "Publication has no author names", obj, ctx);
700  }
701  }
702  break;
703  case CPub::e_Article:
704  has_name = false;
705  if ( pub.GetArticle().IsSetAuthors()
706  && HasName(pub.GetArticle().GetAuthors())) {
707  has_name = true;
708  }
709  if (!has_name) {
710  PostObjErr(IsRefSeq() ? eDiag_Warning : eDiag_Error,
712  "Publication has no author names", obj, ctx);
713  }
714  break;
715  default:
716  break;
717  }
718 
719  }
720 }
721 
722 
724 (const CAuth_list::C_Names& names,
725  const CSerialObject& obj,
726  const CSeq_entry *ctx)
727 {
728  if (names.IsStd()) {
729  list<string> consortium_list;
730 
731  ITERATE ( CAuth_list::C_Names::TStd, name, names.GetStd() ) {
732  bool last_is_bad = false;
733  string badauthor = CValidator::BadCharsInAuthor(**name, last_is_bad);
734  if (!NStr::IsBlank(badauthor)) {
735  PostObjErr(eDiag_Warning,
737  "Bad characters in author " + badauthor, obj, ctx);
738  }
739  if ( (*name)->GetName().IsName() ) {
740  const CName_std& nstd = (*name)->GetName().GetName();
741  string last = "";
742  if (nstd.IsSetLast()) {
743  last = nstd.GetLast();
744  NStr::ReplaceInPlace (last, ".", " ");
745  NStr::ReplaceInPlace (last, " ", " ");
747  }
748  string initials = "";
749  if (nstd.IsSetInitials()) {
750  initials = nstd.GetInitials();
751  NStr::ReplaceInPlace (initials, ".", " ");
752  NStr::ReplaceInPlace (initials, " ", " ");
753  NStr::TruncateSpacesInPlace (initials);
754  }
755  if ( (NStr::CompareNocase(last, "et al") == 0) ||
756  (NStr::CompareNocase(last, "et") == 0
757  && NStr::CompareNocase(initials, "al") == 0
758  && (!nstd.IsSetFirst() || nstd.GetFirst().empty()))) {
759  CAuth_list::C_Names::TStd::const_iterator temp = name;
760  if ( ++temp == names.GetStd().end() ) {
762  "Author list ends in et al.", obj, ctx);
763  } else {
765  "Author list contains et al.", obj, ctx);
766  }
767  }
768  // validate suffix, if set and nonempty
769  if (nstd.IsSetSuffix() && !NStr::IsBlank (nstd.GetSuffix())) {
770  string suffix = nstd.GetSuffix();
771 
772  typedef CName_std::TSuffixes TSuffixes;
773  const TSuffixes& suffixes = CName_std::GetStandardSuffixes();
774  bool found = false;
775  ITERATE (TSuffixes, it, suffixes) {
776  if (NStr::EqualNocase (suffix, *it)) {
777  found = true;
778  break;
779  }
780  }
781  if (!found) {
783  "Bad author suffix " + suffix,
784  obj, ctx);
785  }
786  }
787  } else if ( (*name)->GetName().IsConsortium() ) {
788  const string& consortium = (*name)->GetName().GetConsortium();
789  if (NStr::IsBlank (consortium)) {
790  PostObjErr (eDiag_Warning, eErr_GENERIC_PublicationInconsistency, "Empty consortium", obj, ctx);
791  } else {
792  bool found = false;
793  ITERATE (list<string>, cons_str, consortium_list) {
794  if (NStr::EqualNocase (consortium, *cons_str)) {
795  found = true;
796  break;
797  }
798  }
799  if (found) {
801  "Duplicate consortium '" + consortium + "'", obj, ctx);
802  } else {
803  consortium_list.push_back(consortium);
804  }
805  }
806  }
807  }
808  } else if (names.IsMl()) {
809  ITERATE ( list< string >, str, names.GetMl()) {
810  if (CValidator::BadCharsInAuthorName(*str, true, true, false)) {
812  "Bad characters in author " + *str, obj, ctx);
813  }
814  }
815  } else if (names.IsStr()) {
816 
817  ITERATE ( list< string >, str, names.GetStr()) {
818  if (CValidator::BadCharsInAuthorName(*str, true, true, false)) {
820  "Bad characters in author " + *str, obj, ctx);
821  }
822  }
823  }
824 }
825 
826 
828 (const CPub_equiv& pe,
829  const CSerialObject& obj,
830  const CSeq_entry* ctx)
831 {
832  FOR_EACH_PUB_ON_PUBEQUIV (pub_iter, pe) {
833  const CPub& pub = **pub_iter;
834  const CAuth_list* authors = 0;
835  switch ( pub.Which() ) {
836  case CPub::e_Gen:
837  if ( pub.GetGen().IsSetAuthors() ) {
838  authors = &(pub.GetGen().GetAuthors());
839  }
840  break;
841  case CPub::e_Sub:
842  authors = &(pub.GetSub().GetAuthors());
843  break;
844  case CPub::e_Article:
845  if ( pub.GetArticle().IsSetAuthors() ) {
846  authors = &(pub.GetArticle().GetAuthors());
847  }
848  break;
849  case CPub::e_Book:
850  authors = &(pub.GetBook().GetAuthors());
851  break;
852  case CPub::e_Proc:
853  authors = &(pub.GetProc().GetBook().GetAuthors());
854  break;
855  case CPub::e_Man:
856  authors = &(pub.GetMan().GetCit().GetAuthors());
857  break;
858  case CPub::e_Patent:
859  authors = &(pub.GetPatent().GetAuthors());
860  break;
861  case CPub::e_Equiv:
862  ValidateAuthorsInPubequiv (pub.GetEquiv(), obj, ctx);
863  break;
864  default:
865  break;
866  }
867 
868  if ( !authors ) {
869  continue;
870  }
871 
872  const CAuth_list::C_Names& names = authors->GetNames();
873  ValidateAuthorList (names, obj, ctx);
874  }
875 }
876 
877 
878 static bool s_IsRefSeqInSep(const CSeq_entry& se, CScope& scope)
879 {
880  for (CBioseq_CI it(scope, se); it; ++it) {
881  FOR_EACH_SEQID_ON_BIOSEQ (id, *(it->GetCompleteBioseq())) {
882  if ((*id)->IsOther()) {
883  const CTextseq_id* tsip = (*id)->GetTextseq_Id();
884  if (tsip != NULL && tsip->IsSetAccession()) {
885  return true;
886  }
887  }
888  }
889  }
890  return false;
891 }
892 
893 
894 static bool s_IsHtgInSep(const CSeq_entry& se)
895 {
897  if ((*it)->Which() == CSeqdesc::e_Molinfo) {
898  CMolInfo::TTech tech = (*it)->GetMolinfo().GetTech();
899  if (tech == CMolInfo::eTech_htgs_0 ||
900  tech == CMolInfo::eTech_htgs_1 ||
901  tech == CMolInfo::eTech_htgs_2 ||
902  tech == CMolInfo::eTech_htgs_3) {
903  return true;
904  }
905  }
906  }
907  if (se.IsSet()) {
909  if (s_IsHtgInSep(**it)) {
910  return true;
911  }
912  }
913  }
914  return false;
915 }
916 
917 
918 static bool s_IsPDBInSep(const CSeq_entry& se, CScope& scope)
919 {
920  for (CBioseq_CI it(scope, se); it; ++it) {
921  FOR_EACH_SEQID_ON_BIOSEQ (id, *(it->GetCompleteBioseq())) {
922  if ((*id)->IsPdb()) {
923  return true;
924  }
925  }
926  }
927  return false;
928 }
929 
930 
932 (const CAffil::TStd& std,
933  const CSerialObject& obj,
934  const CSeq_entry *ctx)
935 {
936  EDiagSev sev = eDiag_Critical;
937  if (IsGenbank() || IsRefSeq()) {
938  sev = eDiag_Warning;
939  }
940  if (!std.IsSetCountry() || NStr::IsBlank(std.GetCountry())) {
941  PostObjErr (sev, eErr_GENERIC_MissingPubInfo,
942  "Submission citation affiliation has no country",
943  obj, ctx);
944  } else if (NStr::EqualCase (std.GetCountry(), "USA")) {
945  if (!std.IsSetSub() || NStr::IsBlank (std.GetSub())) {
947  "Submission citation affiliation has no state",
948  obj, ctx);
949  }
950  }
951  if ((!std.IsSetDiv() || NStr::IsBlank(std.GetDiv())) && (!std.IsSetAffil() || NStr::IsBlank(std.GetAffil()))) {
952  PostObjErr (sev, eErr_GENERIC_MissingPubInfo,
953  "Submission citation affiliation has no institution",
954  obj, ctx);
955  }
956 }
957 
958 
960 (const CCit_sub& cs,
961  const CSerialObject& obj,
962  const CSeq_entry *ctx)
963 {
964  bool has_name = false,
965  has_affil = false;
966 
967  if ( cs.CanGetAuthors() ) {
968  const CAuth_list& authors = cs.GetAuthors();
969  has_name = HasName(authors);
970 
971  if ( authors.CanGetAffil() ) {
972  const CAffil& affil = authors.GetAffil();
973 
974  switch ( affil.Which() ) {
975  case CAffil::e_Str:
976  {{
977  if ( !NStr::IsBlank(affil.GetStr()) ) {
978  has_affil = true;
979  }
980  }}
981  break;
982 
983  case CAffil::e_Std:
984  {{
985  const CAffil::TStd& std = affil.GetStd();
986 #define HAS_VALUE(x) (std.CanGet##x() && !NStr::IsBlank(std.Get##x()))
987  if ( HAS_VALUE(Affil) || HAS_VALUE(Div) ||
988  HAS_VALUE(City) || HAS_VALUE(Sub) ||
989  HAS_VALUE(Country) || HAS_VALUE(Street) ||
990  HAS_VALUE(Email) || HAS_VALUE(Fax) ||
991  HAS_VALUE(Phone) || HAS_VALUE(Postal_code) ) {
992  has_affil = true;
993  ValidateSubAffil (std, obj, ctx);
994  }
995  }}
996 #undef HAS_VALUE
997  break;
998 
999  default:
1000  break;
1001  }
1002 
1003  }
1004  }
1005 
1006  if ( !has_name ) {
1007  EDiagSev sev = eDiag_Critical;
1008  if (IsGenbank() || IsRefSeq()) {
1009  sev = eDiag_Warning;
1010  }
1011  PostObjErr(sev, eErr_GENERIC_MissingPubInfo,
1012  "Submission citation has no author names", obj, ctx);
1013  }
1014  if ( !has_affil ) {
1015  EDiagSev sev =
1016  s_IsRefSeqInSep(GetTSE(), *m_Scope) || s_IsHtgInSep(GetTSE()) || s_IsPDBInSep(GetTSE(), *m_Scope) ?
1018  PostObjErr(sev, eErr_GENERIC_MissingPubInfo,
1019  "Submission citation has no affiliation", obj, ctx);
1020  }
1021 
1022  if (cs.IsSetDate()) {
1023  int rval = CheckDate (cs.GetDate());
1024  if (rval != eDateValid_valid) {
1025  PostBadDateError (eDiag_Error, "Submission citation date has error", rval, obj, ctx);
1026  }
1027  } else {
1029  "Submission citation has no date", obj, ctx);
1030  }
1031 }
1032 
1033 
1034 static bool s_IsNoncuratedRefSeq (const CBioseq& seq)
1035 {
1036  FOR_EACH_SEQID_ON_BIOSEQ (id_it, seq) {
1037  if ((*id_it)->IsOther()) {
1038  if ((*id_it)->GetOther().IsSetAccession()) {
1039  string accession = (*id_it)->GetOther().GetAccession();
1040  if (NStr::StartsWith(accession, "NM_")
1041  || NStr::StartsWith(accession, "NP_")
1042  || NStr::StartsWith(accession, "NG_")
1043  || NStr::StartsWith(accession, "NR_")) {
1044  return false;
1045  } else {
1046  return true;
1047  }
1048  }
1049  }
1050  }
1051  return false;
1052 }
1053 
1054 
1056 {
1057  FOR_EACH_SEQID_ON_BIOSEQ (id_it, seq) {
1058  if ((*id_it)->IsOther()
1059  && (*id_it)->GetOther().IsSetAccession()) {
1060  const string& accession = (*id_it)->GetOther().GetAccession();
1061  if (NStr::StartsWith (accession, "NM_")
1062  || NStr::StartsWith(accession, "NP_")
1063  || NStr::StartsWith(accession, "NG_")
1064  || NStr::StartsWith(accession, "NR_")) {
1065  sev = eDiag_Warning;
1066  return false;
1067  }
1068  return true;
1069  }
1070  }
1071 
1072  return false;
1073 }
1074 
1075 
1077 {
1078  EDiagSev sev = eDiag_Error;
1079 
1080  if (!m_NoPubs && !m_IsSeqSubmit) {
1081  if (seq.IsAa()) {
1083  if (bsh) {
1084  bsh = GetNucBioseq (bsh);
1085  if (bsh) {
1086  const CBioseq& nuc = *(bsh.GetCompleteBioseq());
1087  if(!IsNoncuratedRefSeq (nuc, sev)
1088  && !IsWGSIntermediate(nuc)
1089  && !IsTSAIntermediate(nuc)) {
1090  PostErr (sev, eErr_SEQ_DESCR_NoPubFound, "No publications refer to this Bioseq.", seq);
1091  }
1092  return;
1093  }
1094  }
1095  }
1096  if (!IsNoncuratedRefSeq (seq, sev)
1097  && !IsWGSIntermediate(seq)
1098  && !IsTSAIntermediate(seq)) {
1099  PostErr (sev, eErr_SEQ_DESCR_NoPubFound, "No publications refer to this Bioseq.", seq);
1100  }
1101  }
1102 }
1103 
1104 
1105 static bool s_IsGpipe (const CBioseq& seq)
1106 {
1107  bool is_gpipe = false;
1108 
1109  FOR_EACH_SEQID_ON_BIOSEQ (id_it, seq) {
1110  if ((*id_it)->IsGpipe()) {
1111  is_gpipe = true;
1112  break;
1113  }
1114  }
1115  return is_gpipe;
1116 }
1117 
1118 
1119 static bool s_CuratedRefSeqLowerToWarning (const CBioseq& seq)
1120 {
1121  FOR_EACH_SEQID_ON_BIOSEQ (id_it, seq) {
1122  if ((*id_it)->IsOther() && (*id_it)->GetOther().IsSetAccession()) {
1123  const string& str = (*id_it)->GetOther().GetAccession();
1124  if (NStr::StartsWith(str, "NM_")
1125  || NStr::StartsWith(str, "NP_")
1126  || NStr::StartsWith(str, "NG_")
1127  || NStr::StartsWith(str, "NR_")) {
1128  return true;
1129  }
1130  }
1131  }
1132  return false;
1133 }
1134 
1135 static bool s_IsWgs_Contig (const CBioseq& seq)
1136 {
1137  CSeq_inst::ERepr rp = seq.GetInst().GetRepr();
1138  if (rp == CSeq_inst::eRepr_virtual) return false;
1139  IF_EXISTS_CLOSEST_MOLINFO (mi_ref, seq, NULL) {
1140  const CMolInfo& molinf = (*mi_ref).GetMolinfo();
1141  if (molinf.GetTech() == NCBI_TECH(wgs)) return true;
1142  if (molinf.GetTech() == NCBI_TECH(tsa)) return true;
1143  }
1144  return false;
1145 }
1146 
1147 static bool s_IsTSA_Contig (const CBioseq& seq)
1148 {
1149  /*
1150  CSeq_inst::ERepr rp = seq.GetInst().GetRepr();
1151  if (rp == CSeq_inst::eRepr_virtual) return false;
1152  */
1153  IF_EXISTS_CLOSEST_MOLINFO (mi_ref, seq, NULL) {
1154  const CMolInfo& molinf = (*mi_ref).GetMolinfo();
1155  if (molinf.GetTech() == NCBI_TECH(wgs)) return true;
1156  if (molinf.GetTech() == NCBI_TECH(tsa)) return true;
1157  }
1158  return false;
1159 }
1160 
1161 
1163 {
1164  if ( m_NoPubs ) {
1165  if ( !m_IsGPS && !cs) {
1167  if (b_it)
1168  {
1169  CConstRef<CBioseq> bioseq = b_it->GetCompleteBioseq();
1170  if ( !s_IsNoncuratedRefSeq(*bioseq)
1171  && !s_IsGpipe(*bioseq)
1172  && !s_IsWgs_Contig(*bioseq)
1173  && !s_IsTSA_Contig(*bioseq) ) {
1174  EDiagSev sev = eDiag_Error;
1175  if (s_CuratedRefSeqLowerToWarning(*bioseq)) {
1176  sev = eDiag_Warning;
1177  }
1179  "No publications anywhere on this entire record.", se);
1180  }
1181  }
1182  }
1183  }
1184  if ( m_NoCitSubPubs && !cs ) {
1186  if (b_it) {
1187  CConstRef<CBioseq> bioseq = b_it->GetCompleteBioseq();
1188  if ( !s_IsNoncuratedRefSeq(*bioseq)
1189  && !s_IsWgs_Contig(*bioseq)
1190  && !s_IsTSA_Contig(*bioseq) ) {
1191  EDiagSev sev = eDiag_Info;
1192  if (m_genomeSubmission) {
1193  sev = eDiag_Error;
1194  }
1195  if (s_CuratedRefSeqLowerToWarning(*bioseq)) {
1196  sev = eDiag_Warning;
1197  }
1199  "No submission citation anywhere on this entire record.", se);
1200  }
1201  }
1202  }
1203 }
1204 
1205 
1206 void CValidError_imp::FindCollidingSerialNumbers (const CSerialObject& obj)
1207 {
1208  if (m_PubSerialNumbers.size() < 2) {
1209  return;
1210  }
1211  sort (m_PubSerialNumbers.begin(), m_PubSerialNumbers.end());
1212 
1213  vector<int>::iterator it1 = m_PubSerialNumbers.begin();
1214  vector<int>::iterator it2 = it1;
1215  ++it2;
1216  while (it2 != m_PubSerialNumbers.end()) {
1217  if (*it1 == *it2) {
1219  "Multiple publications have serial number " + NStr::IntToString(*it1),
1220  obj);
1221  while (it2 != m_PubSerialNumbers.end() && *it2 == *it1) {
1222  ++it2;
1223  }
1224  if (it2 != m_PubSerialNumbers.end()) {
1225  it1 = it2;
1226  ++it2;
1227  }
1228  } else {
1229  it1 = it2;
1230  ++it2;
1231  }
1232  }
1233 }
1234 
1235 
bool IsSetLast(void) const
Check if a value has been assigned to Last data member.
Definition: Name_std_.hpp:390
bool IsSetFrom(void) const
Check if a value has been assigned to From data member.
Definition: Cit_art_.hpp:545
const TMan & GetMan(void) const
Get the variant data.
Definition: Pub_.cpp:365
User-defined methods of the data storage class.
bool IsSetInitials(void) const
first + middle initials Check if a value has been assigned to Initials data member.
Definition: Name_std_.hpp:550
bool IsStd(void) const
Check if variant Std is selected.
Definition: Auth_list_.hpp:396
CBioseq_Handle –.
TPrepub GetPrepub(void) const
Get the Prepub member data.
Definition: Imprint_.hpp:1030
bool IsBlankStringList(const list< string > &str_list)
Definition: utilities.cpp:110
.hpp User-defined methods of the data storage class.
Definition: Name_std.hpp:55
const TAuthors & GetAuthors(void) const
Get the Authors member data.
Definition: Cit_sub_.hpp:345
bool IsSetCit(void) const
anything, not parsable Check if a value has been assigned to Cit data member.
Definition: Cit_gen_.hpp:554
static const char * suffix[]
Definition: pcregrep.c:254
const TDate & GetDate(void) const
Get the Date member data.
Definition: Cit_sub_.hpp:443
#define FOR_EACH_SEQID_ON_BIOSEQ(Itr, Var)
FOR_EACH_SEQID_ON_BIOSEQ EDIT_EACH_SEQID_ON_BIOSEQ.
Definition: seq_macros.hpp:308
static bool s_CitGenIsJustBackBoneIDNumber(const CCit_gen &gen)
Definition: valid_pub.cpp:257
const TTitle & GetTitle(void) const
Get the Title member data.
Definition: Cit_jour_.hpp:205
User-defined methods of the data storage class.
#define FOR_EACH_PUB_ON_PUBEQUIV(Itr, Var)
Definition: pub_macros.hpp:86
Title, Translated AJB.
Definition: Title_.hpp:113
const TPatent & GetPatent(void) const
Get the variant data.
Definition: Pub_.cpp:321
bool CanGetAffil(void) const
Check if it is safe to call GetAffil method.
Definition: Auth_list_.hpp:496
bool IsSetAuthors(void) const
Check if a value has been assigned to Authors data member.
Definition: Cit_gen_.hpp:594
static bool Equal(const CTempString &str, SIZE_TYPE pos, SIZE_TYPE n, const char *pattern, ECase use_case=eCase)
Test for equality of a substring with a pattern.
Definition: ncbistr.hpp:5172
void AddBioseqWithNoPub(const CBioseq &seq)
Definition: valid_pub.cpp:1076
#define END_SCOPE(ns)
End the previously defined scope.
Definition: ncbistl.hpp:73
to cite a variety of ways
Definition: Pub_.hpp:113
const TVolume & GetVolume(void) const
Get the Volume member data.
Definition: Imprint_.hpp:731
static bool SplitInTwo(const CTempString &str, const CTempString &delim, string &str1, string &str2, TSplitFlags flags=0)
Split a string into two pieces using the specified delimiters.
Definition: ncbistr.cpp:3230
bool IsSetComment(void) const
any comment on this pub in context Check if a value has been assigned to Comment data member...
Definition: Pubdesc_.hpp:923
EDiagSev
Severity level for the posted diagnostics.
Definition: ncbidiag.hpp:638
bool IsAa(void) const
Definition: Bioseq.cpp:332
Definition: Pub.hpp:55
const TCit & GetCit(void) const
Get the Cit member data.
Definition: Cit_gen_.hpp:566
Case insensitive compare.
Definition: ncbistr.hpp:1265
static bool IsBlank(const CTempString &str, SIZE_TYPE pos=0)
Check if a string is blank (has no text).
Definition: ncbistr.cpp:102
const TProc & GetProc(void) const
Get the variant data.
Definition: Pub_.cpp:299
CSeq_entry_Handle GetSeq_entryHandle(CDataLoader *loader, const TBlobId &blob_id, EMissing action=eMissing_Default)
Get Seq-entry handle by its blob-id, with possible loading.
Definition: scope.cpp:113
const TDate & GetDate(void) const
Get the Date member data.
Definition: Cit_gen_.hpp:815
bool CanGetNames(void) const
Check if it is safe to call GetNames method.
Definition: Auth_list_.hpp:464
void ValidateSubAffil(const CAffil::TStd &std, const CSerialObject &obj, const CSeq_entry *ctx)
Definition: valid_pub.cpp:932
const TConsortium & GetConsortium(void) const
Get the variant data.
Definition: Person_id_.hpp:411
specifically ISO jta J
Definition: Title_.hpp:115
TPubstatus GetPubstatus(void) const
Get the Pubstatus member data.
Definition: Imprint_.hpp:1138
bool IsStr(void) const
Check if variant Str is selected.
Definition: Date_.hpp:300
static bool s_IsNoncuratedRefSeq(const CBioseq &seq)
Definition: valid_pub.cpp:1034
bool IsSetCountry(void) const
Author Affiliation, Country Check if a value has been assigned to Country data member.
Definition: Affil_.hpp:822
#define FOR_EACH_DESCRIPTOR_ON_SEQENTRY
const TAffil & GetAffil(void) const
Get the Affil member data.
Definition: Affil_.hpp:674
int isalpha(Uchar c)
Definition: ncbictype.hpp:58
bool IsSetPubstatus(void) const
current status of this publication Check if a value has been assigned to Pubstatus data member...
Definition: Imprint_.hpp:1119
const TSub & GetSub(void) const
Get the variant data.
Definition: Pub_.cpp:189
unordered High Throughput sequence contig
Definition: MolInfo_.hpp:137
static bool BadCharsInAuthorName(const string &str, bool allowcomma, bool allowperiod, bool last)
Definition: validator.cpp:290
ERepr
representation class
Definition: Seq_inst_.hpp:91
const TAuthors & GetAuthors(void) const
Get the Authors member data.
Definition: Cit_pat_.hpp:683
const TBook & GetBook(void) const
Get the Book member data.
Definition: Cit_proc_.hpp:206
E_Choice Which(void) const
Which variant is currently selected.
Definition: Date_.hpp:271
Warning message.
Definition: ncbidiag.hpp:640
const TAffil & GetAffil(void) const
Get the Affil member data.
Definition: Auth_list_.hpp:502
static bool EqualCase(const CTempString &str, SIZE_TYPE pos, SIZE_TYPE n, const char *pattern)
Case-sensitive equality of a substring with a pattern.
Definition: ncbistr.hpp:5114
const TAuthors & GetAuthors(void) const
Get the Authors member data.
Definition: Cit_gen_.hpp:606
#define NULL
Definition: ncbistd.hpp:225
const TImp & GetImp(void) const
Get the Imp member data.
Definition: Cit_jour_.hpp:235
bool s_GetDigits(const string &pages, string &digits)
Definition: valid_pub.cpp:464
bool IsName(void) const
Check if variant Name is selected.
Definition: Person_id_.hpp:359
bool IsSetPrepub(void) const
Check if a value has been assigned to Prepub data member.
Definition: Imprint_.hpp:1011
void x_ValidatePages(const string &pages, const CSerialObject &obj, const CSeq_entry *ctx=0)
Definition: valid_pub.cpp:496
bool CanGetImp(void) const
Check if it is safe to call GetImp method.
Definition: Cit_jour_.hpp:229
bool IsSetSuffix(void) const
Jr, Sr, III Check if a value has been assigned to Suffix data member.
Definition: Name_std_.hpp:590
static string & ReplaceInPlace(string &src, const string &search, const string &replace, SIZE_TYPE start_pos=0, SIZE_TYPE max_replace=0)
Replace occurrences of a substring within a string.
Definition: ncbistr.cpp:3075
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
Definition: ncbimisc.hpp:872
const TEquiv & GetEquiv(void) const
Get the variant data.
Definition: Pub_.cpp:387
Title, Subordinate A B.
Definition: Title_.hpp:112
epublish, but will be followed by print
Definition: PubStatus_.hpp:75
const TPub & GetPub(void) const
Get the Pub member data.
Definition: Pubdesc_.hpp:583
bool IsSetFirst(void) const
Check if a value has been assigned to First data member.
Definition: Name_std_.hpp:430
static string IntToString(int value, TNumToStringFlags flags=0, int base=10)
Convert int to string.
Definition: ncbistr.hpp:4719
Definition: Title.hpp:50
specifically MEDLINE jta J
Definition: Title_.hpp:116
void ValidateCitSub(const CCit_sub &cs, const CSerialObject &obj, const CSeq_entry *ctx=0)
Definition: valid_pub.cpp:960
static string BadCharsInAuthor(const CName_std &author, bool &last_is_bad)
Definition: validator.cpp:350
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:101
void FindCollidingSerialNumbers(const CSerialObject &obj)
Definition: valid_pub.cpp:1206
general or generic unparsed
Definition: Pub_.hpp:102
bool IsSetAuthors(void) const
authors (ANSI requires) Check if a value has been assigned to Authors data member.
Definition: Cit_art_.hpp:524
PubMedId.
Definition: Pub_.hpp:114
bool IsJournal(void) const
Check if variant Journal is selected.
Definition: Cit_art_.hpp:485
bool IsStd(void) const
Check if variant Std is selected.
Definition: Date_.hpp:320
User-defined methods of the data storage class.
static int StringToInt(const CTempString &str, TStringToNumFlags flags=0, int base=10)
Convert string to int.
Definition: ncbistr.cpp:474
const TStr & GetStr(void) const
Get the variant data.
Definition: Auth_list_.hpp:442
bool CanGetPubstatus(void) const
Check if it is safe to call GetPubstatus method.
Definition: Imprint_.hpp:1125
const TFirst & GetFirst(void) const
Get the First member data.
Definition: Name_std_.hpp:442
const TCountry & GetCountry(void) const
Get the Country member data.
Definition: Affil_.hpp:834
static bool IsTSAIntermediate(const CBioseq &seq)
Informational message.
Definition: ncbidiag.hpp:639
Title, Anal,Coll,Mono AJB.
Definition: Title_.hpp:111
bool IsSetDate(void) const
replaces imp, will become required Check if a value has been assigned to Date data member...
Definition: Cit_sub_.hpp:431
TRepr GetRepr(void) const
Get the Repr member data.
Definition: Seq_inst_.hpp:550
void ValidateAuthorList(const CAuth_list::C_Names &names, const CSerialObject &obj, const CSeq_entry *ctx=0)
Definition: valid_pub.cpp:724
bool HasName(const CAuth_list &authors)
Definition: valid_pub.cpp:631
TSerial_number GetSerial_number(void) const
Get the Serial_number member data.
Definition: Cit_gen_.hpp:843
TMuid GetMuid(void) const
Get the variant data.
Definition: Pub_.hpp:608
static int CompareNocase(const CTempString &str, SIZE_TYPE pos, SIZE_TYPE n, const char *pattern)
Case-insensitive compare of a substring with a pattern.
Definition: ncbistr.cpp:170
Error message.
Definition: ncbidiag.hpp:641
vector< int > m_PubSerialNumbers
Definition: validatorp.hpp:842
#define IF_EXISTS_CLOSEST_MOLINFO(Cref, Var, Lvl)
IF_EXISTS_CLOSEST_MOLINFO.
Definition: seq_macros.hpp:153
bool IsSetPages(void) const
Check if a value has been assigned to Pages data member.
Definition: Imprint_.hpp:799
Lightweight interface for getting lines of data with minimal memory copying.
bool IsNoncuratedRefSeq(const CBioseq &seq, EDiagSev &sev)
Definition: valid_pub.cpp:1055
proceedings of a meeting
Definition: Pub_.hpp:109
accepted, not published
Definition: Imprint_.hpp:96
void ValidatePubGen(const CCit_gen &gen, const CSerialObject &obj, const CSeq_entry *ctx=0)
Definition: valid_pub.cpp:272
published electronically by publisher
Definition: PubStatus_.hpp:68
const TCit & GetCit(void) const
Get the Cit member data.
Definition: Cit_let_.hpp:257
bool CanGetPrepub(void) const
Check if it is safe to call GetPrepub method.
Definition: Imprint_.hpp:1017
static bool s_IsHtgInSep(const CSeq_entry &se)
Definition: valid_pub.cpp:894
CBioseq_Handle GetNucBioseq(CBioseq_set_Handle bioseq_set)
Definition: utilities.cpp:560
const TPages & GetPages(void) const
Get the Pages member data.
Definition: Imprint_.hpp:811
std representation
Definition: Affil_.hpp:90
bool IsSet(void) const
Check if variant Set is selected.
Definition: Seq_entry_.hpp:263
TYear GetYear(void) const
Get the Year member data.
Definition: Date_std_.hpp:412
const TStd & GetStd(void) const
Get the variant data.
Definition: Date_.cpp:109
int CheckDate(const CDate &date, bool require_full_date=false)
Definition: utilities.cpp:771
const TTitle & GetTitle(void) const
Get the Title member data.
Definition: Cit_art_.hpp:515
bool IsSetAccession(void) const
Check if a value has been assigned to Accession data member.
int isdigit(Uchar c)
Definition: ncbictype.hpp:61
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:5200
.hpp User-defined methods of the data storage class.
Definition: Pubdesc.hpp:53
User-defined methods of the data storage class.
const TAuthors & GetAuthors(void) const
Get the Authors member data.
Definition: Cit_art_.hpp:536
const TNames & GetNames(void) const
Get the Names member data.
Definition: Auth_list_.hpp:470
const TStd & GetStd(void) const
Get the variant data.
Definition: Affil_.cpp:212
static bool s_IsWgs_Contig(const CBioseq &seq)
Definition: valid_pub.cpp:1135
The Object manager core.
bool IsSetImp(void) const
Check if a value has been assigned to Imp data member.
Definition: Cit_jour_.hpp:223
bool IsSetSub(void) const
Author Affiliation, County Sub Check if a value has been assigned to Sub data member.
Definition: Affil_.hpp:782
const TFrom & GetFrom(void) const
Get the From member data.
Definition: Cit_art_.hpp:557
E_Choice Which(void) const
Which variant is currently selected.
Definition: Pub_.hpp:555
CImprint –.
Definition: Imprint.hpp:65
No variant selected.
Definition: Date_.hpp:127
const TDiv & GetDiv(void) const
Get the Div member data.
Definition: Affil_.hpp:714
unparsed string
Definition: Affil_.hpp:519
bool IsSetYear(void) const
full year (including 1900) Check if a value has been assigned to Year data member.
Definition: Date_std_.hpp:393
const TName & GetName(void) const
Get the variant data.
Definition: Person_id_.cpp:137
bool IsSetDate(void) const
date of publication Check if a value has been assigned to Date data member.
Definition: Imprint_.hpp:689
const TDate & GetDate(void) const
Get the Date member data.
Definition: Imprint_.hpp:701
finished High Throughput sequence
Definition: MolInfo_.hpp:139
E_Choice Which(void) const
Which variant is currently selected.
Definition: Affil_.hpp:1062
bool IsStr(void) const
Check if variant Str is selected.
Definition: Auth_list_.hpp:436
published in print by publisher
Definition: PubStatus_.hpp:69
manuscript, thesis, or letter
Definition: Pub_.hpp:112
#define FOR_EACH_SEQENTRY_ON_SEQSET(Itr, Var)
FOR_EACH_SEQENTRY_ON_SEQSET EDIT_EACH_SEQENTRY_ON_SEQSET.
bool IsSetSerial_number(void) const
for GenBank style references Check if a value has been assigned to Serial_number data member...
Definition: Cit_gen_.hpp:824
bool CanGetAuthors(void) const
Check if it is safe to call GetAuthors method.
Definition: Cit_sub_.hpp:339
bool IsSetPub(void) const
the citation(s) Check if a value has been assigned to Pub data member.
Definition: Pubdesc_.hpp:571
static bool s_IsPDBInSep(const CSeq_entry &se, CScope &scope)
Definition: valid_pub.cpp:918
bool IsMl(void) const
Check if variant Ml is selected.
Definition: Auth_list_.hpp:416
static bool s_IsGpipe(const CBioseq &seq)
Definition: valid_pub.cpp:1105
CScope –.
Definition: scope.hpp:90
TTech GetTech(void) const
Get the Tech member data.
Definition: MolInfo_.hpp:483
void ValidatePubHasAuthor(const CPubdesc &pubdesc, const CSerialObject &obj, const CSeq_entry *ctx=0)
Definition: valid_pub.cpp:672
const TGen & GetGen(void) const
Get the variant data.
Definition: Pub_.cpp:167
const TBook & GetBook(void) const
Get the variant data.
Definition: Pub_.cpp:277
#define FOR_EACH_PUB_ON_PUBDESC(Itr, Var)
FOR_EACH_PUB_ON_PUBDESC EDIT_EACH_PUB_ON_PUBDESC.
Definition: pub_macros.hpp:127
MEDLINE, semi-structured.
Definition: Auth_list_.hpp:114
Definition: Seq_entry.hpp:55
single genomic reads for coordination
Definition: MolInfo_.hpp:141
const TPmid & GetPmid(void) const
Get the variant data.
Definition: Pub_.hpp:683
const TSet & GetSet(void) const
Get the variant data.
Definition: Seq_entry_.cpp:124
CBioseq_Handle GetBioseqHandle(const CSeq_id &id)
Get bioseq handle by seq-id.
Definition: scope.cpp:95
info on the molecule and techniques
Definition: Seqdesc_.hpp:134
static CRef< CScope > m_Scope
static bool s_CuratedRefSeqLowerToWarning(const CBioseq &seq)
Definition: valid_pub.cpp:1119
int len
#define HAS_VALUE(x)
const TStr & GetStr(void) const
Get the variant data.
Definition: Date_.hpp:306
bool IsSetVolume(void) const
Check if a value has been assigned to Volume data member.
Definition: Imprint_.hpp:719
static SIZE_TYPE Find(const CTempString &str, const CTempString &pattern, SIZE_TYPE start=0, SIZE_TYPE end=NPOS, EOccurrence which=eFirst, ECase use_case=eCase)
Find the pattern in the specified range of a string.
Definition: ncbistr.hpp:5261
Title, Abbreviated B.
Definition: Title_.hpp:119
Defines the CNcbiApplication and CAppException classes for creating NCBI applications.
static bool s_IsRefSeqInSep(const CSeq_entry &se, CScope &scope)
Definition: valid_pub.cpp:878
const TSub & GetSub(void) const
Get the Sub member data.
Definition: Affil_.hpp:794
const TJournal & GetJournal(void) const
Get the variant data.
Definition: Cit_art_.cpp:111
bool IsSetDate(void) const
Check if a value has been assigned to Date data member.
Definition: Cit_gen_.hpp:803
bool IsConsortium(void) const
Check if variant Consortium is selected.
Definition: Person_id_.hpp:405
bool HasIsoJTA(const CTitle &title)
Definition: valid_pub.cpp:620
const TSuffix & GetSuffix(void) const
Get the Suffix member data.
Definition: Name_std_.hpp:602
static void TruncateSpacesInPlace(string &str, ETrunc where=eTrunc_Both)
Truncate spaces in a string (in-place)
Definition: ncbistr.cpp:2899
list< CRef< C_E > > Tdata
Definition: Title_.hpp:477
void ReportMissingPubs(const CSeq_entry &se, const CCit_sub *cs)
Definition: valid_pub.cpp:1162
Critical error message.
Definition: ncbidiag.hpp:642
const TInitials & GetInitials(void) const
Get the Initials member data.
Definition: Name_std_.hpp:562
const TStr & GetStr(void) const
Get the variant data.
Definition: Affil_.hpp:1097
bool IsSetAffil(void) const
Author Affiliation, Name Check if a value has been assigned to Affil data member. ...
Definition: Affil_.hpp:662
static SIZE_TYPE FindCase(const CTempString &str, const CTempString &pattern, SIZE_TYPE start=0, SIZE_TYPE end=NPOS, EOccurrence which=eFirst)
Find the pattern in the specified range of a string using a case sensitive search.
Definition: ncbistr.hpp:5270
submission
Definition: Pub_.hpp:103
#define _ASSERT
ordered High Throughput sequence contig
Definition: MolInfo_.hpp:138
bool HasTitle(const CTitle &title)
Definition: valid_pub.cpp:564
#define BEGIN_SCOPE(ns)
Define a new scope.
Definition: ncbistl.hpp:70
medline uid
Definition: Pub_.hpp:105
const TInst & GetInst(void) const
Get the Inst member data.
Definition: Bioseq_.hpp:326
CBioseq_CI –.
Definition: bioseq_ci.hpp:68
User-defined methods of the data storage class.
list< CRef< CAuthor > > TStd
Definition: Auth_list_.hpp:170
#define const
Definition: zconf.h:217
const TMl & GetMl(void) const
Get the variant data.
Definition: Auth_list_.hpp:422
const TLast & GetLast(void) const
Get the Last member data.
Definition: Name_std_.hpp:402
const TAuthors & GetAuthors(void) const
Get the Authors member data.
Definition: Cit_book_.hpp:337
const Tdata & Get(void) const
Get the member data.
Definition: Title_.hpp:782
const TArticle & GetArticle(void) const
Get the variant data.
Definition: Pub_.cpp:233
void PostErr(EDiagSev sv, EErrType et, const string &msg, const CSerialObject &obj)
Definition: validatorp.cpp:297
const TStd & GetStd(void) const
Get the variant data.
Definition: Auth_list_.hpp:402
static bool IsWGSIntermediate(const CBioseq &seq)
static const TSuffixes & GetStandardSuffixes(void)
Get a list of NCBI's standard suffixes.
Definition: Name_std.cpp:55
bool IsSetDiv(void) const
Author Affiliation, Division Check if a value has been assigned to Div data member.
Definition: Affil_.hpp:702
bool IsSetJournal(void) const
Check if a value has been assigned to Journal data member.
Definition: Cit_gen_.hpp:662
E_Choice Which(void) const
Which variant is currently selected.
Definition: Auth_list_.hpp:367
.hpp User-defined methods of the data storage class.
Definition: Auth_list.hpp:55
static bool EqualNocase(const CTempString &str, SIZE_TYPE pos, SIZE_TYPE n, const char *pattern)
Case-insensitive equality of a substring with a pattern.
Definition: ncbistr.hpp:5143
static bool s_IsTSA_Contig(const CBioseq &seq)
Definition: valid_pub.cpp:1147
CConstRef< CBioseq > GetCompleteBioseq(void) const
Get the complete bioseq.
.hpp User-defined methods of the data storage class.
Definition: Affil.hpp:55
On error, return zero and set.
Definition: ncbistr.hpp:280
void ValidatePubArticle(const CCit_art &art, int uid, const CSerialObject &obj, const CSeq_entry *ctx=0)
Definition: valid_pub.cpp:332
bool IsSetTitle(void) const
title of paper (ANSI requires) Check if a value has been assigned to Title data member.
Definition: Cit_art_.hpp:503
CRef< CScope > m_Scope
Definition: validatorp.hpp:760
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:98
void ValidateAuthorsInPubequiv(const CPub_equiv &pe, const CSerialObject &obj, const CSeq_entry *ctx=0)
Definition: valid_pub.cpp:828
const TComment & GetComment(void) const
Get the Comment member data.
Definition: Pubdesc_.hpp:935
#define NCBI_TECH(Type)
Definition: seq_macros.hpp:118
Title, Abbreviated J.
Definition: Title_.hpp:114
User-defined methods of the data storage class.
Modified on Fri Aug 28 13:21:24 2015 by modify_doxy.py rev. 426318