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

Go to the SVN repository for this file.

1 /* $Id: ftanet.cpp 102964 2024-08-11 13:12:24Z stakhovv $
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  * File Name: ftanet.cpp
27  *
28  * Author: Sergey Bazhin
29  *
30  * File Description:
31  * Functions for real working with the servers and network.
32  *
33  */
34 
35 #include <ncbi_pch.hpp>
36 
37 #include "ftacpp.hpp"
38 
40 
45 #include <objects/seq/Pubdesc.hpp>
47 #include <objects/pub/Pub.hpp>
56 #include <objects/biblio/Affil.hpp>
60 #include <objects/pub/Pub_set.hpp>
63 #include <objmgr/util/sequence.hpp>
65 
66 #include <dbapi/driver/drivers.hpp>
67 
68 #include "index.h"
69 
72 #include <corelib/ncbi_message.hpp>
73 
74 #include "ftaerr.hpp"
75 #include "asci_blk.h"
76 #include "ftamed.h"
77 #include "utilfun.h"
78 #include "ref.h"
80 
81 #ifdef THIS_FILE
82 # undef THIS_FILE
83 #endif
84 #define THIS_FILE "ftanet.cpp"
85 
86 #define HEALTHY_ACC "U12345"
87 
90 
91 struct KwordBlk {
92  const char* str;
94 };
95 
96 static const KwordBlk PubStatus[] = {
97  { "Publication Status: Available-Online prior to print", 51 },
98  { "Publication Status : Available-Online prior to print", 52 },
99  { "Publication_Status: Available-Online prior to print", 51 },
100  { "Publication_Status : Available-Online prior to print", 52 },
101  { "Publication-Status: Available-Online prior to print", 51 },
102  { "Publication-Status : Available-Online prior to print", 52 },
103  { "Publication Status: Online-Only", 31 },
104  { "Publication Status : Online-Only", 32 },
105  { "Publication_Status: Online-Only", 31 },
106  { "Publication_Status : Online-Only", 32 },
107  { "Publication-Status: Online-Only", 31 },
108  { "Publication-Status : Online-Only", 32 },
109  { "Publication Status: Available-Online", 36 },
110  { "Publication Status : Available-Online", 37 },
111  { "Publication_Status: Available-Online", 36 },
112  { "Publication_Status : Available-Online", 37 },
113  { "Publication-Status: Available-Online", 36 },
114  { "Publication-Status : Available-Online", 37 },
115  { nullptr, 0 }
116 };
117 
118 /**********************************************************/
119 void fta_strip_pub_comment(string& comment, const KwordBlk* kbp)
120 {
121  const char* p;
122 
123  ShrinkSpaces(comment);
124  for (; kbp->str; kbp++) {
125  for (;;) {
126  p = StringIStr(comment.c_str(), kbp->str);
127  if (! p)
128  break;
129  size_t i = p - comment.c_str();
130  size_t j = i + kbp->len;
131  while (j < comment.size() && (comment[j] == ' ' || comment[j] == ';'))
132  j++;
133  comment.erase(i, j);
134  }
135  }
136 
137  ShrinkSpaces(comment);
138 
139  p = comment.empty() ? nullptr : comment.c_str();
140  if (p && (StringEquNI(p, "Publication Status", 18) ||
141  StringEquNI(p, "Publication_Status", 18) ||
142  StringEquNI(p, "Publication-Status", 18)))
143  ErrPostEx(SEV_WARNING, ERR_REFERENCE_UnusualPubStatus, "An unusual Publication Status comment exists for this record: \"%s\". If it is a new variant of the special comments used to indicate ahead-of-print or online-only articles, then the comment must be added to the appropriate table of the parser.", p);
144 }
145 
146 /**********************************************************/
147 static void fta_fix_last_initials(CName_std& namestd,
148  bool initials)
149 {
150  char* str;
151  char* p;
152 
153  if (initials) {
154  if (! namestd.IsSetInitials())
155  return;
156  str = namestd.SetInitials().data();
157  } else {
158  if (! namestd.IsSetLast())
159  return;
160  str = namestd.SetLast().data();
161  }
162 
163  size_t i = strlen(str);
164  if (i > 5) {
165  p = &str[i - 5];
166  if ((*p == ' ' || *p == '.') && ! strcmp(p + 1, "III.")) {
167  namestd.SetSuffix("III");
168  if (*p == '.')
169  p++;
170  *p = '\0';
171  if (initials)
172  namestd.SetInitials(str);
173  else
174  namestd.SetLast(str);
175  return;
176  }
177  }
178  if (i > 4) {
179  p = &str[i - 4];
180  if ((*p == ' ' || *p == '.') &&
181  (! strcmp(p + 1, "III") || ! strcmp(p + 1, "2nd") ||
182  ! strcmp(p + 1, "Jr.") || ! strcmp(p + 1, "IV."))) {
183  if (! strcmp(p + 1, "III"))
184  namestd.SetSuffix("III");
185  else if (! strcmp(p + 1, "2nd"))
186  namestd.SetSuffix("II");
187  else if (! strcmp(p + 1, "Jr."))
188  namestd.SetSuffix("Jr.");
189  else
190  namestd.SetSuffix("IV");
191  if (*p == '.')
192  p++;
193  *p = '\0';
194  if (initials)
195  namestd.SetInitials(str);
196  else
197  namestd.SetLast(str);
198  return;
199  }
200  }
201  if (i > 3) {
202  p = &str[i - 3];
203  if ((*p == ' ' || *p == '.') &&
204  (! strcmp(p + 1, "Jr") || ! strcmp(p + 1, "IV") ||
205  ! strcmp(p + 1, "II"))) {
206  if (! strcmp(p + 1, "Jr"))
207  namestd.SetSuffix("Jr.");
208  else if (! strcmp(p + 1, "IV"))
209  namestd.SetSuffix("IV");
210  else
211  namestd.SetSuffix("II");
212  if (*p == '.')
213  p++;
214  *p = '\0';
215  if (initials)
216  namestd.SetInitials(str);
217  else
218  namestd.SetLast(str);
219  return;
220  }
221  }
222 }
223 
224 /**********************************************************/
226 {
227  for (const auto& pub : pub_list) {
228  if (! pub->IsPmid())
229  continue;
230  // got_pmid = true;
231  break;
232  }
233 
234  for (auto& pub : pub_list) {
235  CAuth_list* authors;
236  if (pub->IsArticle()) {
237  CCit_art& art = pub->SetArticle();
238  if (! art.IsSetAuthors() || ! art.CanGetAuthors())
239  continue;
240 
241  authors = &art.SetAuthors();
242  } else if (pub->IsSub()) {
243  CCit_sub& sub = pub->SetSub();
244  if (! sub.IsSetAuthors() || ! sub.CanGetAuthors())
245  continue;
246 
247  authors = &sub.SetAuthors();
248  } else if (pub->IsGen()) {
249  CCit_gen& gen = pub->SetGen();
250  if (! gen.IsSetAuthors() || ! gen.CanGetAuthors())
251  continue;
252 
253  authors = &gen.SetAuthors();
254  } else if (pub->IsBook()) {
255  CCit_book& book = pub->SetBook();
256  if (! book.IsSetAuthors() || ! book.CanGetAuthors())
257  continue;
258 
259  authors = &book.SetAuthors();
260  } else if (pub->IsMan()) {
261  CCit_let& man = pub->SetMan();
262  if (! man.IsSetCit() || ! man.CanGetCit())
263  continue;
264 
265  CCit_book& book = man.SetCit();
266  if (! book.IsSetAuthors() || ! book.CanGetAuthors())
267  continue;
268 
269  authors = &book.SetAuthors();
270  } else if (pub->IsPatent()) {
271  CCit_pat& pat = pub->SetPatent();
272  if (! pat.IsSetAuthors() || ! pat.CanGetAuthors())
273  continue;
274 
275  authors = &pat.SetAuthors();
276  } else
277  continue;
278 
279 
280  if (authors->IsSetAffil() && authors->CanGetAffil() &&
281  authors->GetAffil().Which() == CAffil::e_Str) {
282  CAffil& affil = authors->SetAffil();
283  ShrinkSpaces(affil.SetStr());
284  }
285 
286  if (authors->IsSetNames() && authors->CanGetNames() &&
287  authors->GetNames().Which() == CAuth_list::TNames::e_Std) {
288  CAuth_list::TNames::TStd& names = authors->SetNames().SetStd();
289  for (auto& it : names) {
290  if (it->IsSetAffil() && it->CanGetAffil() &&
291  it->GetAffil().Which() == CAffil::e_Str) {
292  CAffil& affil = it->SetAffil();
293  ShrinkSpaces(affil.SetStr());
294  }
295  if (it->IsSetName() && it->CanGetName() &&
296  it->GetName().IsName()) {
297  CName_std& namestd = it->SetName().SetName();
298  if (! namestd.IsSetSuffix()) {
299  fta_fix_last_initials(namestd, true);
300  if (! namestd.IsSetSuffix())
301  fta_fix_last_initials(namestd, false);
302  }
303  }
304  }
305  }
306  }
307 }
308 
309 /**********************************************************/
310 static void fta_fix_imprint_language(TPubList& pub_list)
311 {
312  for (auto& pub : pub_list) {
313  if (! pub->IsArticle())
314  continue;
315 
316  CCit_art& art = pub->SetArticle();
317  if (! art.IsSetFrom() || ! art.GetFrom().IsJournal())
318  continue;
319 
320  CCit_jour& journal = art.SetFrom().SetJournal();
321 
322  if (journal.IsSetImp() && journal.GetImp().IsSetLanguage()) {
323  string language = journal.GetImp().GetLanguage();
324  char* p;
325  char* lang = language.data();
326  for (p = lang; *p != '\0'; p++)
327  if (*p >= 'A' && *p <= 'Z')
328  *p |= 040; // tolower()
329  journal.SetImp().SetLanguage(lang);
330  }
331  }
332 }
333 
334 /**********************************************************/
335 static void fta_strip_er_remarks(CPubdesc& pub_descr)
336 {
337  if (! pub_descr.IsSetComment())
338  return;
339 
340  for (const auto& pub : pub_descr.GetPub().Get()) {
341  if (! pub->IsArticle())
342  continue;
343 
344  const CCit_art& art = pub->GetArticle();
345  if (! art.IsSetFrom() || ! art.GetFrom().IsJournal())
346  continue;
347 
348  const CCit_jour& journal = art.GetFrom().GetJournal();
349 
350  int status = 0;
351  if (journal.IsSetImp() && journal.GetImp().IsSetPubstatus())
352  status = journal.GetImp().GetPubstatus();
353 
354  if (status == ePubStatus_epublish ||
355  status == ePubStatus_ppublish ||
356  status == ePubStatus_aheadofprint) {
357  string comment = pub_descr.GetComment();
359  if (! comment.empty())
360  pub_descr.SetComment(comment);
361  else
362  pub_descr.ResetComment();
363  }
364  }
365 }
366 
367 /**********************************************************/
368 static Uint1 fta_init_med_server(bool normalize)
369 {
370  InitPubmedClient(normalize);
371  if (! GetPubmedClient()->Init())
372  return 2;
373  return 1;
374 }
375 
376 /**********************************************************/
378 {
379  CTaxon1 taxon_srv;
380  if (! taxon_srv.Init())
381  return (2);
382  return (1);
383 }
384 
385 /**********************************************************/
387 {
388  if (pp->taxserver != 0) {
390  if (pp->taxserver == 2) {
391  ErrPostStr(SEV_WARNING, ERR_SERVER_Failed, "TaxArchInit call failed.");
392  }
393  } else {
394  ErrPostStr(SEV_WARNING, ERR_SERVER_NoTaxLookup, "No taxonomy lookup will be performed.");
395  }
396 
397  if (pp->medserver != 0) {
399  if (pp->medserver == 2) {
400  ErrPostStr(SEV_ERROR, ERR_SERVER_Failed, "MedArchInit call failed.");
401  }
402  } else {
403  ErrPostStr(SEV_WARNING, ERR_SERVER_NoPubMedLookup, "No medline lookup will be performed.");
404  }
405 }
406 
407 /**********************************************************/
409 {
410  if (pp->medserver == 1)
411  GetPubmedClient()->Fini();
412  /* if(pp->taxserver == 1)
413  tax1_fini();*/
414 }
415 
416 #if 0 // RW-707
417 //std::shared_ptr<CPubseqAccess> s_pubseq;
418 
419 /**********************************************************/
420 static Uint1 fta_init_pubseq(void)
421 {
422  // C Toolkit's accpubseq.h library gets username/password from
423  // the environment.
424  // We are now using C++ Toolkit's cpubseq.hpp library which require
425  // credentials during the construction of CPubseqAccess. So read
426  // the environment here and pass it along to the constructor.
427 
429 // DBAPI_RegisterDriver_CTLIB();
430 
431  char* env_val = getenv("ALTER_OPEN_SERVER");
432  string idserver = env_val ? env_val : "";
433 
434  env_val = getenv("ALTER_USER_NAME");
435  string idusername = env_val ? env_val : "";
436 
437  env_val = getenv("ALTER_USER_PASSWORD");
438  string idpassword = env_val ? env_val : "";
439 
440  s_pubseq.reset(new CPubseqAccess(idserver.empty() ? "PUBSEQ_OS_INTERNAL_GI64" : idserver.c_str(),
441  idusername.empty() ? "anyone" : idusername.c_str(),
442  idpassword.empty() ? "allowed" : idpassword.c_str()));
443 
444  if (! s_pubseq || ! s_pubseq->CheckConnection())
445  return(2);
446  return(1);
447 }
448 
449 /**********************************************************/
450 void fta_entrez_fetch_enable(ParserPtr pp)
451 {
452  return; // RW-707
453 
454  if(pp->entrez_fetch != 0)
455  {
456  pp->entrez_fetch = fta_init_pubseq();
457  if(pp->entrez_fetch == 2)
458  {
460  "Failed to connect to PUBSEQ OS.");
461  }
462  }
463  else
464  {
466  "No PUBSEQ Bioseq fetch will be performed.");
467  }
468 }
469 
470 /**********************************************************/
471 void fta_entrez_fetch_disable(ParserPtr pp)
472 {
473  if(pp->entrez_fetch == 1)
474  s_pubseq.reset();
475 }
476 #endif
477 
478 /**********************************************************/
479 void fta_fill_find_pub_option(ParserPtr pp, bool htag, bool rtag)
480 {
481  pp->fpo.always_look = ! htag;
482  pp->fpo.replace_cit = ! rtag;
483  pp->fpo.merge_ids = true;
484 }
485 
486 
487 class CFindPub
488 {
489 
490 public:
492  m_pParser(pp),
494  {
495  if (m_pParser) {
496  const auto& findPubOptions = m_pParser->fpo;
497  m_pPubFix.reset(new edit::CPubFix(
498  findPubOptions.always_look,
499  findPubOptions.replace_cit,
500  findPubOptions.merge_ids,
501  m_pPubFixListener.get(),
502  GetPubmedClient()));
503  }
504  }
505 
506  using TEntryList = list<CRef<CSeq_entry>>;
507  void Apply(TEntryList& entries);
508 
509 private:
510  void fix_pub_equiv(CPub_equiv& pub_equiv, bool er);
511  void fix_pub_annot(CPub& pub, bool er);
512  void find_pub(list<CRef<CSeq_annot>>& annots, CSeq_descr& descrs);
513 
515  unique_ptr<CPubFixMessageListener> m_pPubFixListener;
516  unique_ptr<edit::CPubFix> m_pPubFix;
517 };
518 
519 
520 /**********************************************************/
521 static void fta_check_pub_ids(TPubList& pub_list)
522 {
523  bool found = false;
524  for (const auto& pub : pub_list) {
525  if (pub->IsArticle()) {
526  found = true;
527  break;
528  }
529  }
530 
531  if (found)
532  return;
533 
534  for (CPub_equiv::Tdata::iterator pub = pub_list.begin(); pub != pub_list.end();) {
535  if (! (*pub)->IsMuid() && ! (*pub)->IsPmid()) {
536  ++pub;
537  continue;
538  }
539 
540  ErrPostEx(SEV_ERROR, ERR_REFERENCE_ArticleIdDiscarded, "Article identifier was found for an unpublished, direct submission, book or unparsable article reference, and has been discarded : %s %d.", (*pub)->IsMuid() ? "MUID" : "PMID", (*pub)->GetMuid());
541 
542  pub = pub_list.erase(pub);
543  }
544 }
545 
546 
547 /**********************************************************/
548 void CFindPub::fix_pub_equiv(CPub_equiv& pub_equiv, bool er)
549 {
550  if (! m_pParser)
551  return;
552 
554 
555  list<CRef<CPub>> cit_arts;
556  for (auto& pPub : pub_equiv.Set()) {
557  if (! pPub->IsGen()) {
558  continue;
559  }
560  const CCit_gen& cit_gen = pPub->SetGen();
561  if (cit_gen.IsSetCit() &&
562  (StringEquN(cit_gen.GetCit().c_str(), "(er)", 4) || er)) {
563  cit_arts.push_back(pPub);
564  break;
565  }
566  }
567 
568  if (cit_arts.empty()) {
569  fta_check_pub_ids(pub_equiv.Set());
570  m_pPubFix->FixPubEquiv(pub_equiv);
571  return;
572  }
573 
574  auto& cit_gen = cit_arts.front();
575 
576  list<CRef<CPub>> others;
577  CRef<CPub> pMuid, pPmid;
578 
579  for (auto& pPub : pub_equiv.Set()) {
580  if (cit_gen == pPub)
581  continue;
582  if (pPub->IsMuid() && ! pMuid)
583  pMuid = pPub;
584  else if (pPub->IsPmid() && ! pPmid)
585  pPmid = pPub;
586  else if (! pPub->IsArticle())
587  others.push_back(pPub);
588  }
589 
590 
591  TEntrezId oldpmid = pPmid ? pPmid->GetPmid() : ZERO_ENTREZ_ID;
592  TEntrezId oldmuid = pMuid ? pMuid->GetMuid() : ZERO_ENTREZ_ID;
593  TEntrezId muid = ZERO_ENTREZ_ID;
594  TEntrezId pmid = ZERO_ENTREZ_ID;
595 
596  CRef<CCit_art> new_cit_art;
597  if (oldpmid > ZERO_ENTREZ_ID) {
598  new_cit_art = FetchPubPmId(oldpmid);
599  if (new_cit_art.Empty()) {
600  ErrPostEx(SEV_REJECT, ERR_REFERENCE_InvalidPmid, "MedArch failed to find a Cit-art for reference with pmid \"%d\".", oldpmid);
601  ibp->drop = true;
602  } else {
603  if (new_cit_art->IsSetIds()) {
604  for (const auto& pId : new_cit_art->GetIds().Get()) {
605  if (pId->IsPubmed()) {
606  pmid = pId->GetPubmed();
607  } else if (pId->IsMedline()) {
608  muid = pId->GetMedline();
609  }
610  }
611  }
612 
613  if (pmid == ZERO_ENTREZ_ID) {
614  ErrPostStr(SEV_REJECT, ERR_REFERENCE_CitArtLacksPmid, "Cit-art returned by MedArch lacks pmid identifier in its ArticleIdSet.");
615  ibp->drop = true;
616  } else if (pmid != oldpmid) {
617  ErrPostEx(SEV_REJECT, ERR_REFERENCE_DifferentPmids, "Pmid \"%d\" used for lookup does not match pmid \"%d\" in the ArticleIdSet of the Cit-art returned by MedArch.", oldpmid, pmid);
618  ibp->drop = true;
619  }
620  if (muid > ZERO_ENTREZ_ID && oldmuid > ZERO_ENTREZ_ID && muid != oldmuid) {
621  ErrPostEx(SEV_ERROR, ERR_REFERENCE_MuidPmidMissMatch, "Reference has supplied Medline UI \"%d\" but it does not match muid \"%d\" in the Cit-art returned by MedArch.", oldmuid, muid);
622  }
623  }
624  }
625 
626  if (new_cit_art.NotEmpty() && ! ibp->drop) {
627  cit_arts.clear();
628  CRef<CPub> new_pub(new CPub);
629  new_pub->SetArticle(*new_cit_art);
630  cit_arts.push_back(new_pub);
631 
632  if (pmid > ZERO_ENTREZ_ID && ! pPmid) {
633  pPmid = Ref(new CPub());
634  pPmid->SetPmid().Set(pmid);
635  }
636 
637  if (muid > ZERO_ENTREZ_ID && ! pMuid) {
638  pMuid = Ref(new CPub());
639  pMuid->SetMuid(muid);
640  }
641  }
642 
643  auto& pub_list = pub_equiv.Set();
644  pub_list = others;
645  if (pPmid) {
646  pub_list.push_back(pPmid);
647  }
648  if (pMuid && muid > ZERO_ENTREZ_ID) {
649  pub_list.push_back(pMuid);
650  }
651  pub_list.splice(pub_list.end(), cit_arts);
652 }
653 
654 /**********************************************************/
655 void CFindPub::fix_pub_annot(CPub& pub, bool er)
656 {
657  if (! m_pParser)
658  return;
659 
660  if (pub.IsEquiv()) {
661  fix_pub_equiv(pub.SetEquiv(), er);
662  if (m_pParser->qamode)
665  return;
666  }
667 
668  m_pPubFix->FixPub(pub);
669 }
670 
671 
672 /**********************************************************/
673 void CFindPub::find_pub(list<CRef<CSeq_annot>>& annots, CSeq_descr& descrs)
674 {
675  bool er = any_of(begin(descrs.Get()), end(descrs.Get()), [](CRef<CSeqdesc> pDesc) {
676  if (pDesc->IsPub()) {
677  const auto& pubdesc = pDesc->GetPub();
678  return (pubdesc.IsSetComment() &&
679  fta_remark_is_er(pubdesc.GetComment()));
680  }
681  return false;
682  });
683 
684 
685  for (auto& pDescr : descrs.Set()) {
686  if (! pDescr->IsPub())
687  continue;
688 
689  CPubdesc& pub_descr = pDescr->SetPub();
690  fix_pub_equiv(pub_descr.SetPub(), er);
691  if (m_pParser->qamode)
692  fta_fix_imprint_language(pub_descr.SetPub().Set());
693  fta_fix_affil(pub_descr.SetPub().Set(), m_pParser->source);
694  fta_strip_er_remarks(pub_descr);
695  }
696 
697  for (auto& pAnnot : annots) {
698  if (! pAnnot->IsSetData() || ! pAnnot->GetData().IsFtable()) /* feature table */
699  continue;
700 
701  for (auto& pFeat : pAnnot->SetData().SetFtable()) {
702  if (pFeat->IsSetData() && pFeat->GetData().IsPub()) /* pub feature */
703  {
704  CPubdesc& pub_descr = pFeat->SetData().SetPub();
705  fix_pub_equiv(pub_descr.SetPub(), er);
706  if (m_pParser->qamode)
707  fta_fix_imprint_language(pub_descr.SetPub().Set());
708  fta_fix_affil(pub_descr.SetPub().Set(), m_pParser->source);
709  fta_strip_er_remarks(pub_descr);
710  }
711 
712  if (! pFeat->IsSetCit()) {
713  continue;
714  }
715 
716  for (auto& pPub : pFeat->SetCit().SetPub()) {
717  if (pPub) {
718  fix_pub_annot(*pPub, er);
719  }
720  }
721  }
722  }
723 }
724 
725 /**********************************************************/
726 // static void fta_find_pub(ParserPtr pp, TEntryList& seq_entries)
727 void CFindPub::Apply(list<CRef<CSeq_entry>>& seq_entries)
728 {
729  for (auto& pEntry : seq_entries) {
730  for (CTypeIterator<CBioseq_set> bio_set(Begin(*pEntry)); bio_set; ++bio_set) {
731  find_pub(bio_set->SetAnnot(), bio_set->SetDescr());
732 
733  if (bio_set->GetDescr().Get().empty())
734  bio_set->ResetDescr();
735 
736  if (bio_set->SetAnnot().empty())
737  bio_set->ResetAnnot();
738  }
739 
740  for (CTypeIterator<CBioseq> bioseq(Begin(*pEntry)); bioseq; ++bioseq) {
741  find_pub(bioseq->SetAnnot(), bioseq->SetDescr());
742 
743  if (bioseq->GetDescr().Get().empty())
744  bioseq->ResetDescr();
745 
746  if (bioseq->SetAnnot().empty())
747  bioseq->ResetAnnot();
748  }
749  }
750 }
751 
752 /**********************************************************/
754 {
755  if (pp->medserver == 0)
756  return;
757 
758  if (pp->medserver == 2)
760 
761  if (pp->medserver == 1) {
762  CFindPub find_pub(pp);
763  find_pub.Apply(seq_entries);
764  }
765 }
766 
767 #if 0
768 /**********************************************************/
769 static void new_synonym(COrg_ref& org_ref, COrg_ref& tax_org_ref)
770 {
771  if (!org_ref.CanGetSyn() || !tax_org_ref.CanGetSyn())
772  return;
773 
774  for (const string& org_syn : org_ref.GetSyn()) {
775  bool found = false;
776  for (const string& tax_syn : tax_org_ref.GetSyn()) {
777  if (org_syn == tax_syn) {
778  found = true;
779  break;
780  }
781  }
782 
783  if (!found)
784  {
786  "New synonym: %s for [%s].",
787  org_syn.c_str(), org_ref.GetTaxname().c_str());
788  }
789  }
790 }
791 #endif
792 
793 #define TAX_SERVER_TIMEOUT 3
794 static const STimeout s_timeout = { TAX_SERVER_TIMEOUT, 0 };
795 
796 static void fix_synonyms(CTaxon1& taxon, COrg_ref& org_ref)
797 {
798  bool with_syns = taxon.SetSynonyms(false);
799  if (! with_syns)
800  org_ref.SetSyn().clear();
801  else
802  taxon.SetSynonyms(true);
803 }
804 
805 /**********************************************************/
806 static CRef<COrg_ref> fta_get_orgref_byid(ParserPtr pp, bool* drop, TTaxId taxid, bool isoh)
807 {
808  CConstRef<CTaxon2_data> taxdata;
809 
810  CTaxon1 taxon;
811 
812  bool connection_failed = false;
813  for (size_t i = 0; i < 3 && taxdata.Empty(); ++i) {
814  if (taxon.Init(&s_timeout)) {
815  taxdata = taxon.GetById(taxid);
816  } else {
817  connection_failed = true;
818  break;
819  }
820  }
821 
822  CRef<COrg_ref> ret;
823  if (taxdata.Empty()) {
824  if (connection_failed) {
825  ErrPostEx(SEV_FATAL, ERR_SERVER_TaxServerDown, "Taxonomy lookup failed for taxid %d, apparently because the server is down. Cannot generate ASN.1 for this entry.", TAX_ID_TO(int, taxid));
826  *drop = true;
827  } else {
828  ErrPostEx(SEV_ERROR, ERR_ORGANISM_TaxNameNotFound, "Taxname not found: [taxid %d].", TAX_ID_TO(int, taxid));
829  }
830  return ret;
831  }
832 
833  if (taxdata->GetIs_species_level() != 1 && ! isoh) {
834  ErrPostEx(SEV_WARNING, ERR_ORGANISM_TaxIdNotSpecLevel, "Taxarch hit is not on species level: [taxid %d].", TAX_ID_TO(int, taxid));
835  }
836 
837  ret.Reset(new COrg_ref);
838  ret->Assign(taxdata->GetOrg());
839  fix_synonyms(taxon, *ret);
840 
841  if (ret->IsSetSyn() && ret->GetSyn().empty())
842  ret->ResetSyn();
843 
844  return ret;
845 }
846 
847 /**********************************************************/
848 CRef<COrg_ref> fta_fix_orgref_byid(ParserPtr pp, TTaxId taxid, bool* drop, bool isoh)
849 {
850  CRef<COrg_ref> ret;
851 
852  if (taxid <= ZERO_TAX_ID && pp->taxserver == 0)
853  return ret;
854 
855  if (pp->taxserver == 2)
857 
858  if (pp->taxserver == 2) {
859  ErrPostEx(SEV_FATAL, ERR_SERVER_TaxServerDown, "Taxonomy lookup failed for taxid %d, because the server is down. Cannot generate ASN.1 for this entry.", TAX_ID_TO(int, taxid));
860  *drop = true;
861  return ret;
862  }
863 
864  ret = fta_get_orgref_byid(pp, drop, taxid, isoh);
865  if (ret.NotEmpty()) {
866  ErrPostEx(SEV_INFO, ERR_SERVER_TaxNameWasFound, "Taxname _was_ found for taxid %d", TAX_ID_TO(int, taxid));
867  }
868 
869  return ret;
870 }
871 
872 /**********************************************************/
873 static CRef<COrg_ref> fta_replace_org(ParserPtr pp, bool* drop, COrg_ref& org_ref, const Char* pn, int merge, Int4 attempt)
874 {
875  IndexblkPtr ibp = pp->entrylist[pp->curindx];
876 
877  CConstRef<CTaxon2_data> taxdata;
878 
879  CTaxon1 taxon;
880 
881  bool connection_failed = true;
882  for (size_t i = 0; i < 3 && taxdata.Empty(); ++i) {
883  if (taxon.Init(&s_timeout)) {
884  if (merge) {
885  taxdata = taxon.LookupMerge(org_ref);
886  } else
887  taxdata = taxon.Lookup(org_ref);
888  connection_failed = false;
889  break;
890  } else
891  taxon.Fini();
892  }
893 
894  CRef<COrg_ref> ret;
895 
896  if (taxdata.Empty()) {
897  if (attempt == 1)
898  return ret;
899 
900  if (connection_failed) {
901  ErrPostEx(SEV_FATAL, ERR_SERVER_TaxServerDown, "Taxonomy lookup failed for \"%s\", apparently because the server is down. Cannot generate ASN.1 for this entry.", pn);
902  *drop = true;
903  } else if (taxon.GetTaxIdByOrgRef(org_ref) < ZERO_TAX_ID) {
904  if ((pp->source == Parser::ESource::DDBJ || pp->source == Parser::ESource::EMBL) &&
905  ibp->is_pat && ibp->taxid > ZERO_TAX_ID && ! ibp->organism.empty()) {
906  ret = fta_fix_orgref_byid(pp, ibp->taxid, &ibp->drop, true);
907  if (ret.NotEmpty() && ret->IsSetTaxname() &&
908  ret->GetTaxname() == ibp->organism) {
909  ibp->no_gc_warning = true;
910  return ret;
911  }
912  }
913  ErrPostEx(SEV_ERROR, ERR_ORGANISM_TaxIdNotUnique, "Not an unique Taxonomic Id for [%s].", pn);
914  } else {
915  ErrPostEx(SEV_ERROR, ERR_ORGANISM_TaxNameNotFound, "Taxon Id not found for [%s].", pn);
916  }
917  return ret;
918  }
919 
920  if (taxdata->GetIs_species_level() != 1 && (ibp->is_pat == false ||
922  ErrPostEx(SEV_WARNING, ERR_ORGANISM_TaxIdNotSpecLevel, "Taxarch hit is not on species level for [%s].", pn);
923  }
924 
925  ret.Reset(new COrg_ref);
926 
927  if (merge)
928  ret->Assign(org_ref);
929  else
930  ret->Assign(taxdata->GetOrg());
931 
932  return ret;
933 }
934 
935 /**********************************************************/
936 void fta_fix_orgref(ParserPtr pp, COrg_ref& org_ref, bool* drop, char* organelle)
937 {
938  Int4 attempt;
939  int merge;
940 
941  if (org_ref.IsSetTaxname()) {
942  string taxname = org_ref.GetTaxname();
943 
944  size_t last_char = taxname.size();
945  for (; last_char; --last_char) {
946  if (! isspace(taxname[last_char]))
947  break;
948  }
949 
950  if (! isspace(taxname[last_char]))
951  ++last_char;
952  org_ref.SetTaxname(taxname.substr(0, last_char));
953  }
954 
955  if (pp->taxserver == 0)
956  return;
957 
958  if (pp->taxserver == 2)
960 
961  string old_taxname;
962  if (organelle) {
963  string taxname = org_ref.IsSetTaxname() ? org_ref.GetTaxname() : "",
964  organelle_str(organelle),
965  space(taxname.size() ? " " : "");
966 
967  old_taxname = taxname;
968  taxname = organelle_str + space + taxname;
969  org_ref.SetTaxname(taxname);
970  attempt = 1;
971  } else {
972  attempt = 2;
973  }
974 
975  string taxname = org_ref.IsSetTaxname() ? org_ref.GetTaxname() : "";
976  if (pp->taxserver == 2) {
977  ErrPostEx(SEV_FATAL, ERR_SERVER_TaxServerDown, "Taxonomy lookup failed for \"%s\", because the server is down. Cannot generate ASN.1 for this entry.", taxname.c_str());
978  *drop = true;
979  } else {
980  merge = 1;
981 
982  CRef<COrg_ref> new_org_ref = fta_replace_org(pp, drop, org_ref, taxname.c_str(), merge, attempt);
983  if (new_org_ref.Empty() && attempt == 1) {
984  org_ref.SetTaxname(old_taxname);
985  old_taxname.clear();
986  new_org_ref = fta_replace_org(pp, drop, org_ref, "", merge, 2);
987  }
988 
989  if (new_org_ref.NotEmpty()) {
990  ErrPostEx(SEV_INFO, ERR_SERVER_TaxNameWasFound, "Taxon Id _was_ found for [%s]", taxname.c_str());
991 
992  org_ref.Assign(*new_org_ref);
993  }
994  }
995 
996  if (org_ref.IsSetSyn() && org_ref.GetSyn().empty())
997  org_ref.ResetSyn();
998 }
999 
1000 /**********************************************************/
1002 {
1003  TGi gi = sequence::GetGiForId(id, GetScope());
1004  if (gi > ZERO_GI)
1005  return (gi);
1006 
1007 
1008  CSeq_id test_id;
1009  test_id.SetGenbank().SetAccession(HEALTHY_ACC);
1010 
1011  int i = 0;
1012  for (; i < 5; i++) {
1013  if (sequence::GetGiForId(test_id, GetScope()) > ZERO_GI)
1014  break;
1015  SleepSec(3);
1016  }
1017 
1018  if (i == 5)
1019  return GI_CONST(-1);
1020 
1021  gi = sequence::GetGiForId(id, GetScope());
1022  if (gi > ZERO_GI)
1023  return (gi);
1024 
1025  return ZERO_GI;
1026 }
1027 
1028 /**********************************************************
1029  * returns -1 if couldn't get division;
1030  * 1 if it's CON;
1031  * 0 if it's not CON.
1032  */
1033 Int4 fta_is_con_div(ParserPtr pp, const CSeq_id& id, const Char* acc)
1034 {
1035  if (pp->entrez_fetch == 0)
1036  return (-1);
1037  // if (pp->entrez_fetch == 2)
1038  // pp->entrez_fetch = fta_init_pubseq();
1039  if (pp->entrez_fetch == 2) {
1040  ErrPostEx(SEV_ERROR, ERR_ACCESSION_CannotGetDivForSecondary, "Failed to determine division code for secondary accession \"%s\". Entry dropped.", acc);
1041  pp->entrylist[pp->curindx]->drop = true;
1042  return (-1);
1043  }
1044 
1045  TGi gi = fta_get_gi_for_seq_id(id);
1046  if (gi < ZERO_GI) {
1047  ErrPostEx(SEV_ERROR, ERR_ACCESSION_CannotGetDivForSecondary, "Failed to determine division code for secondary accession \"%s\". Entry dropped.", acc);
1048  pp->entrylist[pp->curindx]->drop = true;
1049  return (-1);
1050  }
1051 
1052  if (gi == ZERO_GI)
1053  return (0);
1054 #if 0 // RW-707
1055  CPubseqAccess::IdGiClass id_gi;
1056  CPubseqAccess::IdBlobClass id_blob;
1057 
1058  if (! s_pubseq->GetIdGiClass(gi, id_gi) || ! s_pubseq->GetIdBlobClass(id_gi, id_blob) ||
1059  id_blob.div[0] == '\0') {
1060  ErrPostEx(SEV_ERROR, ERR_ACCESSION_CannotGetDivForSecondary, "Failed to determine division code for secondary accession \"%s\". Entry dropped.", acc);
1061  pp->entrylist[pp->curindx]->drop = true;
1062  return (-1);
1063  }
1064  if (NStr::EqualNocase(id_blob.div, "CON"))
1065  return (1);
1066 #endif
1067  return (0);
1068 }
1069 
1070 /**********************************************************/
1072 {
1074 }
1075 
User-defined methods of the data storage class.
User-defined methods of the data storage class.
void ShrinkSpaces(char *line)
Definition: asci_blk.cpp:118
@Affil.hpp User-defined methods of the data storage class.
Definition: Affil.hpp:56
@Auth_list.hpp User-defined methods of the data storage class.
Definition: Auth_list.hpp:57
CConstRef –.
Definition: ncbiobj.hpp:1266
void Apply(TEntryList &entries)
Definition: ftanet.cpp:727
list< CRef< CSeq_entry > > TEntryList
Definition: ftanet.cpp:506
unique_ptr< edit::CPubFix > m_pPubFix
Definition: ftanet.cpp:516
void find_pub(list< CRef< CSeq_annot >> &annots, CSeq_descr &descrs)
Definition: ftanet.cpp:673
void fix_pub_annot(CPub &pub, bool er)
Definition: ftanet.cpp:655
void fix_pub_equiv(CPub_equiv &pub_equiv, bool er)
Definition: ftanet.cpp:548
Parser * m_pParser
Definition: ftanet.cpp:514
unique_ptr< CPubFixMessageListener > m_pPubFixListener
Definition: ftanet.cpp:515
CFindPub(Parser *pp)
Definition: ftanet.cpp:491
static TRegisterLoaderInfo RegisterInObjectManager(CObjectManager &om, CReader *reader=0, CObjectManager::EIsDefault is_default=CObjectManager::eDefault, CObjectManager::TPriority priority=CObjectManager::kPriority_NotSet)
Definition: gbloader.cpp:366
@Name_std.hpp User-defined methods of the data storage class.
Definition: Name_std.hpp:56
Definition: Pub.hpp:56
@Pubdesc.hpp User-defined methods of the data storage class.
Definition: Pubdesc.hpp:54
@Seq_descr.hpp User-defined methods of the data storage class.
Definition: Seq_descr.hpp:55
CRef< CTaxon2_data > GetById(TTaxId tax_id)
Definition: taxon1.cpp:230
void Fini(void)
Definition: taxon1.cpp:203
TTaxId GetTaxIdByOrgRef(const COrg_ref &inp_orgRef)
Definition: taxon1.cpp:489
CConstRef< CTaxon2_data > LookupMerge(COrg_ref &inp_orgRef, string *psLog=0, TOrgRefStatus *pStatusOut=0)
Definition: taxon1.cpp:429
bool SetSynonyms(bool on_off)
Definition: taxon1.cpp:746
bool Init(void)
Definition: taxon1.cpp:101
CRef< CTaxon2_data > Lookup(const COrg_ref &inp_orgRef, string *psLog=0)
Definition: taxon1.cpp:384
Template class for iteration on objects of class C.
Definition: iterator.hpp:673
#define ERR_REFERENCE_UnusualPubStatus
Definition: flat2err.h:317
#define ERR_SERVER_NotUsed
Definition: flat2err.h:470
#define ERR_SERVER_NoTaxLookup
Definition: flat2err.h:476
#define ERR_SERVER_Failed
Definition: flat2err.h:471
#define ERR_REFERENCE_ArticleIdDiscarded
Definition: flat2err.h:316
#define ERR_REFERENCE_MuidPmidMissMatch
Definition: flat2err.h:312
#define ERR_ORGANISM_TaxIdNotSpecLevel
Definition: flat2err.h:193
#define ERR_ACCESSION_CannotGetDivForSecondary
Definition: flat2err.h:171
#define ERR_SERVER_NoPubMedLookup
Definition: flat2err.h:477
#define ERR_ORGANISM_TaxNameNotFound
Definition: flat2err.h:192
#define ERR_REFERENCE_InvalidPmid
Definition: flat2err.h:308
#define ERR_SERVER_TaxServerDown
Definition: flat2err.h:475
#define ERR_ORGANISM_TaxIdNotUnique
Definition: flat2err.h:191
#define ERR_SERVER_TaxNameWasFound
Definition: flat2err.h:474
#define ERR_REFERENCE_CitArtLacksPmid
Definition: flat2err.h:310
#define ERR_ORGANISM_NewSynonym
Definition: flat2err.h:194
#define ERR_REFERENCE_DifferentPmids
Definition: flat2err.h:311
list< CRef< objects::CSeq_entry > > TEntryList
std::list< CRef< objects::CPub > > TPubList
Definition: ftablock.h:63
bool StringEquNI(const char *s1, const char *s2, size_t n)
Definition: ftacpp.hpp:131
bool StringEquN(const char *s1, const char *s2, size_t n)
Definition: ftacpp.hpp:121
edit::CEUtilsUpdater * GetPubmedClient()
Definition: ftamed.cpp:86
void InitPubmedClient(bool normalize)
Definition: ftamed.cpp:77
CRef< CCit_art > FetchPubPmId(TEntrezId pmid)
Definition: ftamed.cpp:92
USING_SCOPE(objects)
static CRef< COrg_ref > fta_get_orgref_byid(ParserPtr pp, bool *drop, TTaxId taxid, bool isoh)
Definition: ftanet.cpp:806
Int4 fta_is_con_div(ParserPtr pp, const CSeq_id &id, const Char *acc)
Definition: ftanet.cpp:1033
#define HEALTHY_ACC
Definition: ftanet.cpp:86
#define TAX_SERVER_TIMEOUT
Definition: ftanet.cpp:793
void fta_find_pub_explore(ParserPtr pp, TEntryList &seq_entries)
Definition: ftanet.cpp:753
static void fta_check_pub_ids(TPubList &pub_list)
Definition: ftanet.cpp:521
static TGi fta_get_gi_for_seq_id(const CSeq_id &id)
Definition: ftanet.cpp:1001
void fta_fini_servers(ParserPtr pp)
Definition: ftanet.cpp:408
CRef< COrg_ref > fta_fix_orgref_byid(ParserPtr pp, TTaxId taxid, bool *drop, bool isoh)
Definition: ftanet.cpp:848
void fta_init_servers(ParserPtr pp)
Definition: ftanet.cpp:386
static void fta_fix_affil(TPubList &pub_list, Parser::ESource source)
Definition: ftanet.cpp:225
static void fta_fix_last_initials(CName_std &namestd, bool initials)
Definition: ftanet.cpp:147
static Uint1 fta_init_tax_server(void)
Definition: ftanet.cpp:377
void fta_init_gbdataloader()
Definition: ftanet.cpp:1071
static const STimeout s_timeout
Definition: ftanet.cpp:794
void fta_fill_find_pub_option(ParserPtr pp, bool htag, bool rtag)
Definition: ftanet.cpp:479
static CRef< COrg_ref > fta_replace_org(ParserPtr pp, bool *drop, COrg_ref &org_ref, const Char *pn, int merge, Int4 attempt)
Definition: ftanet.cpp:873
static void fta_fix_imprint_language(TPubList &pub_list)
Definition: ftanet.cpp:310
static void fix_synonyms(CTaxon1 &taxon, COrg_ref &org_ref)
Definition: ftanet.cpp:796
static const KwordBlk PubStatus[]
Definition: ftanet.cpp:96
void fta_strip_pub_comment(string &comment, const KwordBlk *kbp)
Definition: ftanet.cpp:119
static void fta_strip_er_remarks(CPubdesc &pub_descr)
Definition: ftanet.cpp:335
static Uint1 fta_init_med_server(bool normalize)
Definition: ftanet.cpp:368
void fta_fix_orgref(ParserPtr pp, COrg_ref &org_ref, bool *drop, char *organelle)
Definition: ftanet.cpp:936
static const struct name_t names[]
static void Init(void)
Definition: cursor6.c:76
static const char * str(char *buf, int n)
Definition: stats.c:84
#define SEV_INFO
Definition: gicache.c:89
#define SEV_WARNING
Definition: gicache.c:90
#define SEV_ERROR
Definition: gicache.c:91
#define SEV_FATAL
Definition: gicache.c:93
#define SEV_REJECT
Definition: gicache.c:92
SStrictId_Entrez::TId TEntrezId
TEntrezId type for entrez ids which require the same strictness as TGi.
Definition: ncbimisc.hpp:1041
#define ZERO_TAX_ID
Definition: ncbimisc.hpp:1115
#define TAX_ID_TO(T, tax_id)
Definition: ncbimisc.hpp:1110
SStrictId_Tax::TId TTaxId
Taxon id type.
Definition: ncbimisc.hpp:1048
#define GI_CONST(gi)
Definition: ncbimisc.hpp:1087
#define ZERO_GI
Definition: ncbimisc.hpp:1088
#define ZERO_ENTREZ_ID
Definition: ncbimisc.hpp:1102
#define ErrPostStr
Definition: ncbierr.hpp:68
#define ErrPostEx(sev, err_code,...)
Definition: ncbierr.hpp:78
void DBAPI_RegisterDriver_FTDS(void)
TPrim & Set(void)
Definition: serialbase.hpp:351
virtual void Assign(const CSerialObject &source, ESerialRecursionMode how=eRecursive)
Set object to copy of another one.
CBeginInfo Begin(C &obj)
Get starting point of object hierarchy.
Definition: iterator.hpp:1004
TGi GetGiForId(const objects::CSeq_id &id, CScope &scope, EGetIdType flags=0)
Given a Seq-id retrieve the corresponding GI.
Definition: sequence.cpp:668
static CRef< CObjectManager > GetInstance(void)
Return the existing object manager or create one.
bool Empty(void) const THROWS_NONE
Check if CConstRef is empty – not pointing to any object which means having a null value.
Definition: ncbiobj.hpp:1385
CRef< C > Ref(C *object)
Helper functions to get CRef<> and CConstRef<> objects.
Definition: ncbiobj.hpp:2015
void Reset(void)
Reset reference object.
Definition: ncbiobj.hpp:773
bool NotEmpty(void) const THROWS_NONE
Check if CRef is not empty – pointing to an object and has a non-null value.
Definition: ncbiobj.hpp:726
bool Empty(void) const THROWS_NONE
Check if CRef is empty – not pointing to any object, which means having a null value.
Definition: ncbiobj.hpp:719
uint8_t Uint1
1-byte (8-bit) unsigned integer
Definition: ncbitype.h:99
int16_t Int2
2-byte (16-bit) signed integer
Definition: ncbitype.h:100
int32_t Int4
4-byte (32-bit) signed integer
Definition: ncbitype.h:102
char Char
Alias for char.
Definition: ncbitype.h:93
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
static bool EqualNocase(const CTempString s1, SIZE_TYPE pos, SIZE_TYPE n, const char *s2)
Case-insensitive equality of a substring with another string.
Definition: ncbistr.hpp:5347
bool CanGetAffil(void) const
Check if it is safe to call GetAffil method.
Definition: Auth_list_.hpp:504
bool IsSetAffil(void) const
author affiliation Check if a value has been assigned to Affil data member.
Definition: Auth_list_.hpp:498
bool IsSetAuthors(void) const
authors (ANSI requires) Check if a value has been assigned to Authors data member.
Definition: Cit_art_.hpp:534
const TJournal & GetJournal(void) const
Get the variant data.
Definition: Cit_art_.cpp:111
void SetAuthors(TAuthors &value)
Assign a value to Authors data member.
Definition: Cit_pat_.cpp:68
const TFrom & GetFrom(void) const
Get the From member data.
Definition: Cit_art_.hpp:567
const TCit & GetCit(void) const
Get the Cit member data.
Definition: Cit_gen_.hpp:588
const TAffil & GetAffil(void) const
Get the Affil member data.
Definition: Auth_list_.hpp:510
void SetFrom(TFrom &value)
Assign a value to From data member.
Definition: Cit_art_.cpp:248
void SetAffil(TAffil &value)
Assign a value to Affil data member.
Definition: Auth_list_.cpp:160
bool IsSetFrom(void) const
Check if a value has been assigned to From data member.
Definition: Cit_art_.hpp:555
void SetAuthors(TAuthors &value)
Assign a value to Authors data member.
Definition: Cit_art_.cpp:227
bool IsSetAuthors(void) const
not necessarily authors of the paper Check if a value has been assigned to Authors data member.
Definition: Cit_sub_.hpp:345
void SetAuthors(TAuthors &value)
Assign a value to Authors data member.
Definition: Cit_sub_.cpp:74
bool IsSetCit(void) const
anything, not parsable Check if a value has been assigned to Cit data member.
Definition: Cit_gen_.hpp:576
list< CRef< CAuthor > > TStd
Definition: Auth_list_.hpp:170
const Tdata & Get(void) const
Get the member data.
TStr & SetStr(void)
Select the variant.
Definition: Affil_.hpp:1200
bool CanGetAuthors(void) const
Check if it is safe to call GetAuthors method.
Definition: Cit_sub_.hpp:351
void SetCit(TCit &value)
Assign a value to Cit data member.
Definition: Cit_let_.cpp:70
bool IsSetNames(void) const
Check if a value has been assigned to Names data member.
Definition: Auth_list_.hpp:464
bool CanGetCit(void) const
Check if it is safe to call GetCit method.
Definition: Cit_let_.hpp:261
bool IsSetAuthors(void) const
author/inventor Check if a value has been assigned to Authors data member.
Definition: Cit_pat_.hpp:703
E_Choice Which(void) const
Which variant is currently selected.
Definition: Affil_.hpp:1158
void SetNames(TNames &value)
Assign a value to Names data member.
Definition: Auth_list_.cpp:149
void SetAuthors(TAuthors &value)
Assign a value to Authors data member.
Definition: Cit_book_.cpp:93
bool CanGetNames(void) const
Check if it is safe to call GetNames method.
Definition: Auth_list_.hpp:472
bool CanGetAuthors(void) const
Check if it is safe to call GetAuthors method.
Definition: Cit_pat_.hpp:709
bool IsSetIds(void) const
lots of ids Check if a value has been assigned to Ids data member.
Definition: Cit_art_.hpp:585
bool IsSetAuthors(void) const
authors Check if a value has been assigned to Authors data member.
Definition: Cit_book_.hpp:335
bool IsJournal(void) const
Check if variant Journal is selected.
Definition: Cit_art_.hpp:495
const TNames & GetNames(void) const
Get the Names member data.
Definition: Auth_list_.hpp:478
bool IsSetCit(void) const
same fields as a book Check if a value has been assigned to Cit data member.
Definition: Cit_let_.hpp:255
const TIds & GetIds(void) const
Get the Ids member data.
Definition: Cit_art_.hpp:597
bool CanGetAuthors(void) const
Check if it is safe to call GetAuthors method.
Definition: Cit_art_.hpp:540
bool CanGetAuthors(void) const
Check if it is safe to call GetAuthors method.
Definition: Cit_book_.hpp:341
E_Choice Which(void) const
Which variant is currently selected.
Definition: Auth_list_.hpp:375
@ ePubStatus_ppublish
published in print by publisher
Definition: PubStatus_.hpp:69
@ ePubStatus_aheadofprint
epublish, but will be followed by print
Definition: PubStatus_.hpp:75
@ ePubStatus_epublish
published electronically by publisher
Definition: PubStatus_.hpp:68
@ e_Str
unparsed string
Definition: Affil_.hpp:545
@ e_Std
full citations
Definition: Auth_list_.hpp:113
void SetInitials(const TInitials &value)
Assign a value to Initials data member.
Definition: Name_std_.hpp:619
bool IsSetSuffix(void) const
Jr, Sr, III Check if a value has been assigned to Suffix data member.
Definition: Name_std_.hpp:645
void SetLast(const TLast &value)
Assign a value to Last data member.
Definition: Name_std_.hpp:431
bool IsSetInitials(void) const
first + middle initials Check if a value has been assigned to Initials data member.
Definition: Name_std_.hpp:598
bool IsSetLast(void) const
Check if a value has been assigned to Last data member.
Definition: Name_std_.hpp:410
void SetSuffix(const TSuffix &value)
Assign a value to Suffix data member.
Definition: Name_std_.hpp:666
bool CanGetSyn(void) const
Check if it is safe to call GetSyn method.
Definition: Org_ref_.hpp:510
void ResetSyn(void)
Reset Syn data member.
Definition: Org_ref_.cpp:76
TSyn & SetSyn(void)
Assign a value to Syn data member.
Definition: Org_ref_.hpp:522
const TTaxname & GetTaxname(void) const
Get the Taxname member data.
Definition: Org_ref_.hpp:372
const TSyn & GetSyn(void) const
Get the Syn member data.
Definition: Org_ref_.hpp:516
void SetTaxname(const TTaxname &value)
Assign a value to Taxname data member.
Definition: Org_ref_.hpp:381
bool IsSetTaxname(void) const
preferred formal name Check if a value has been assigned to Taxname data member.
Definition: Org_ref_.hpp:360
bool IsSetSyn(void) const
synonyms for taxname or common Check if a value has been assigned to Syn data member.
Definition: Org_ref_.hpp:504
TPmid & SetPmid(void)
Select the variant.
Definition: Pub_.hpp:690
TMuid & SetMuid(void)
Select the variant.
Definition: Pub_.hpp:615
const TPmid & GetPmid(void) const
Get the variant data.
Definition: Pub_.hpp:683
Tdata & Set(void)
Assign a value to data member.
Definition: Pub_equiv_.hpp:171
const Tdata & Get(void) const
Get the member data.
Definition: Pub_equiv_.hpp:165
TEquiv & SetEquiv(void)
Select the variant.
Definition: Pub_.cpp:393
bool IsEquiv(void) const
Check if variant Equiv is selected.
Definition: Pub_.hpp:671
TMuid GetMuid(void) const
Get the variant data.
Definition: Pub_.hpp:608
TArticle & SetArticle(void)
Select the variant.
Definition: Pub_.cpp:239
void SetAccession(const TAccession &value)
Assign a value to Accession data member.
TGenbank & SetGenbank(void)
Select the variant.
Definition: Seq_id_.cpp:243
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:973
void ResetComment(void)
Reset Comment data member.
Definition: Pubdesc_.cpp:118
void SetPub(TPub &value)
Assign a value to Pub data member.
Definition: Pubdesc_.cpp:72
const TComment & GetComment(void) const
Get the Comment member data.
Definition: Pubdesc_.hpp:985
const Tdata & Get(void) const
Get the member data.
Definition: Seq_descr_.hpp:166
void SetComment(const TComment &value)
Assign a value to Comment data member.
Definition: Pubdesc_.hpp:994
const TPub & GetPub(void) const
Get the Pub member data.
Definition: Pubdesc_.hpp:605
int i
const CharType(& source)[N]
Definition: pointer.h:1149
int strcmp(const char *str1, const char *str2)
Definition: odbc_utils.hpp:160
IMessage/IMessageListener interfaces and basic implementations.
void SleepSec(unsigned long sec, EInterruptOnSignal onsignal=eRestartOnSignal)
Sleep.
int isspace(Uchar c)
Definition: ncbictype.hpp:69
#define nullptr
Definition: ncbimisc.hpp:45
User-defined methods of the data storage class.
CRef< CPub > journal(ParserPtr pp, char *bptr, char *eptr, CRef< CAuth_list > &auth_list, CRef< CTitle::C_E > &title, bool has_muid, CRef< CCit_art > &cit_art, Int4 er)
Definition: ref.cpp:1457
bool no_gc_warning
Definition: ftablock.h:226
TTaxId taxid
Definition: ftablock.h:224
string organism
Definition: ftablock.h:223
bool is_pat
Definition: ftablock.h:202
bool drop
Definition: ftablock.h:182
const char * str
Definition: ftanet.cpp:92
Int2 len
Definition: ftanet.cpp:93
vector< IndexblkPtr > entrylist
SFindPubOptions fpo
Timeout structure.
Definition: ncbi_types.h:76
CScope & GetScope()
Char * StringIStr(const Char *where, const Char *what)
Definition: utilfun.cpp:591
static wxAcceleratorEntry entries[3]
Modified on Fri Sep 20 14:58:09 2024 by modify_doxy.py rev. 669887