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

Go to the SVN repository for this file.

1 /* $Id: report_object.cpp 98802 2023-01-07 18:23:10Z gotvyans $
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: Colleen Bollin
27  *
28  * File Description:
29  * class for storing results for Discrepancy Report
30  *
31  * $Log:$
32  */
33 
34 #include <ncbi_pch.hpp>
35 
36 #include "discrepancy_core.hpp"
38 #include <objects/general/Date.hpp>
43 #include <objects/pub/Pub.hpp>
45 #include <objects/seq/Pubdesc.hpp>
46 #include <objects/seq/Seqdesc.hpp>
54 #include <objmgr/seq_vector.hpp>
55 #include <objmgr/util/feature.hpp>
56 #include <objmgr/util/sequence.hpp>
59 
62 
65 
67 
68 string GetLocusTagForFeature(const CSeq_feat& seq_feat, CScope& scope)
69 {
70  string tag;
71  if (seq_feat.GetData().IsGene()) {
72  const CGene_ref& gene = seq_feat.GetData().GetGene();
73  tag = (gene.CanGetLocus_tag()) ? gene.GetLocus_tag() : kEmptyStr;
74  } else {
75  const CGene_ref* gene = seq_feat.GetGeneXref();
76  if (gene) {
77  tag = (gene->CanGetLocus_tag()) ? gene->GetLocus_tag() : kEmptyStr;
78  }
79  else {
80  CConstRef<CSeq_feat> gene2 = sequence::GetGeneForFeature(seq_feat, scope);
81  if (gene2.NotEmpty()) {
82  tag = (gene2->GetData().GetGene().CanGetLocus_tag()) ? gene2->GetData().GetGene().GetLocus_tag() : kEmptyStr;
83  }
84  }
85  }
86  return tag;
87 }
88 
89 
90 string GetProduct(const CProt_ref& prot_ref)
91 {
92  string rval;
93  if (prot_ref.CanGetName() && !prot_ref.GetName().empty()) {
94  rval = prot_ref.GetName().front();
95  }
96  return rval;
97 }
98 
99 
100 string GetProductForCDS(const CSeq_feat& cds, CScope& scope)
101 {
102  // use protein xref if available
103  const CProt_ref* prot = cds.GetProtXref();
104  if (prot) {
105  return GetProduct(*prot);
106  }
107 
108  // should be the longest protein feature on the bioseq pointed by the cds.GetProduct()
109  if (cds.IsSetProduct()) {
113  scope);
114  if (prot_seq_feat && prot_seq_feat->GetData().IsProt()) {
115  return GetProduct(prot_seq_feat->GetData().GetProt());
116  }
117  }
118  return (kEmptyStr);
119 }
120 
121 
122 void GetSeqFeatLabel(const CSeq_feat& seq_feat, string& label)
123 {
124  label.clear();
125 
127  size_t pos;
128  if (seq_feat.GetData().IsRna() && !label.empty() && (string::npos != (pos = label.find("RNA-")))) {
129  label = label.substr(pos + 4);
130  }
131  string number = "/number=";
132  if (!label.empty()
135  && (string::npos != (pos = label.find(number)))) {
136  label = label.substr(pos + number.size());
137  if (label.find("exon") == 0 || label.find("intron") == 0) { // pos
138  label = label.substr(0, label.find(' '));
139  }
140  }
141 }
142 
143 
144 static bool IsAccession(const CSeq_id& id)
145 {
146  return id.Which() == CSeq_id::e_Genbank
147  || id.Which() == CSeq_id::e_Ddbj
148  || id.Which() == CSeq_id::e_Embl
149  || id.Which() == CSeq_id::e_Other;
150 }
151 
152 
154 {
155  const CBioseq::TId& seq_id_ls = bioseq.GetId();
156  CConstRef<CSeq_id> best_seq_id;
157  int best_score = CSeq_id::kMaxScore;
158  for (const auto& it : seq_id_ls) {
159  if (IsAccession(*it)) {
160  return it;
161  }
162  else {
163  int score = it->BaseBestRankScore();
164  if (best_score > score) {
165  best_seq_id = it;
166  best_score = score;
167  }
168  }
169  }
170  return best_seq_id;
171 }
172 
173 
175 {
176  if (pnt.IsSetId()) {
177  CBioseq_Handle bsh = scope.GetBioseqHandle(pnt.GetId());
178  if (bsh) {
180  if (best_id) {
181  pnt.SetId().Assign(*best_id);
182  }
183  }
184  }
185 }
186 
187 
188 void UpgradeSeqLocId(CSeq_interval& interval, CScope& scope)
189 {
190  if (interval.IsSetId()) {
191  CBioseq_Handle bsh = scope.GetBioseqHandle(interval.GetId());
192  if (bsh) {
194  if (best_id) {
195  interval.SetId().Assign(*best_id);
196  }
197  }
198  }
199 }
200 
201 
202 void UpgradeSeqLocId(CSeq_loc& loc, CScope& scope)
203 {
204  switch (loc.Which()) {
205  case CSeq_loc::e_Bond:
206  if (loc.GetBond().IsSetA()) {
207  UpgradeSeqLocId(loc.SetBond().SetA(), scope);
208  }
209  if (loc.GetBond().IsSetB()) {
210  UpgradeSeqLocId(loc.SetBond().SetB(), scope);
211  }
212  break;
213  case CSeq_loc::e_Equiv:
214  for (auto& it : loc.SetEquiv().Set()) {
215  UpgradeSeqLocId(*it, scope);
216  }
217  break;
218  case CSeq_loc::e_Int:
219  UpgradeSeqLocId(loc.SetInt(), scope);
220  break;
221 
222  case CSeq_loc::e_Mix:
223  for (auto& it : loc.SetMix().Set()) {
224  UpgradeSeqLocId(*it, scope);
225  }
226  break;
228  for (auto& it : loc.SetPacked_int().Set()) {
229  UpgradeSeqLocId(*it, scope);
230  }
231  break;
233  if (loc.GetPacked_pnt().IsSetId()) {
234  CBioseq_Handle bsh = scope.GetBioseqHandle(loc.GetPacked_pnt().GetId());
235  if (bsh) {
237  if (best_id) {
238  loc.SetPacked_pnt().SetId().Assign(*best_id);
239  }
240  }
241  }
242  break;
243  case CSeq_loc::e_Pnt:
244  UpgradeSeqLocId(loc.SetPnt(), scope);
245  break;
246  case CSeq_loc::e_Whole:
247  {{
248  CBioseq_Handle bsh = scope.GetBioseqHandle(loc.GetPacked_pnt().GetId());
249  if (bsh) {
251  if (best_id) {
252  loc.SetWhole().Assign(*best_id);
253  }
254  }
255  }}
256  break;
257  case CSeq_loc::e_Null:
258  case CSeq_loc::e_Empty:
259  case CSeq_loc::e_Feat:
260  case CSeq_loc::e_not_set:
261  break;
262  }
263 }
264 
265 
266 string GetSeqLocDescription(const CSeq_loc& loc, CScope& scope)
267 {
268  string location;
269 
270  CRef<CSeq_loc> cpy(new CSeq_loc());
271  cpy->Assign(loc);
272  UpgradeSeqLocId(*cpy, scope);
273  cpy->GetLabel(&location);
274  return location;
275 }
276 
277 
278 void CDiscrepancyObject::GetTextObjectDescription(const CSeq_feat& seq_feat, CScope& scope, string &label, string &location, string &locus_tag)
279 {
280  location = GetSeqLocDescription(seq_feat.GetLocation(), scope);
281  label = seq_feat.GetData().GetKey();
282  locus_tag = GetLocusTagForFeature (seq_feat, scope);
283 }
284 
285 
286 string CDiscrepancyObject::GetTextObjectDescription(const CSeq_feat& seq_feat, CScope& scope, const string& product)
287 {
288  string location;
289  string label;
290  string locus_tag;
291  GetTextObjectDescription(seq_feat, scope, label, location, locus_tag);
292  string rval = label + "\t" + product + "\t" + location + "\t" + locus_tag; // + "\n";
293  return rval;
294 }
295 
296 //CDiscrepancyObject::GetTextObjectDescription(*feat, scope, m_FeatureType, m_Product, m_Location, m_LocusTag);
297 
298 void CDiscrepancyObject::GetTextObjectDescription(const CSeq_feat& seq_feat, CScope& scope, string &label, string &context, string &location, string &locus_tag)
299 {
300  if ( seq_feat.GetData().IsProt()) {
302  if (bioseq) {
303  const CSeq_feat* cds = sequence::GetCDSForProduct(*bioseq, &scope);
304  if (cds) {
305  context = GetProduct(seq_feat.GetData().GetProt());
306  GetTextObjectDescription(*cds, scope, label, location, locus_tag);
307  return;
308  }
309  }
310  } else if (seq_feat.GetData().IsBiosrc() && seq_feat.GetData().GetBiosrc().IsSetOrg()) {
311  const COrg_ref& org = seq_feat.GetData().GetBiosrc().GetOrg();
312  label = (org.CanGetTaxname() ? org.GetTaxname()
313  : (org.CanGetCommon() ? org.GetCommon() : kEmptyStr));
314  location = GetSeqLocDescription(seq_feat.GetLocation(), scope);
315  locus_tag.clear();
316  return;
317  }
318 
319  GetTextObjectDescription(seq_feat, scope, label, location, locus_tag);
320  context.clear();
321  if (seq_feat.GetData().IsCdregion()) {
322  context = GetProductForCDS(seq_feat, scope);
323  if (NStr::IsBlank(context)) {
324  GetSeqFeatLabel(seq_feat, context);
325  }
326  } else if (seq_feat.GetData().IsPub()) {
327  seq_feat.GetData().GetPub().GetPub().GetLabel(&context);
328  } else if (seq_feat.GetData().IsGene()) {
329  if (seq_feat.GetData().GetGene().CanGetLocus() &&
330  !NStr::IsBlank(seq_feat.GetData().GetGene().GetLocus())) {
331  context = seq_feat.GetData().GetGene().GetLocus();
332  } else if (seq_feat.GetData().GetGene().CanGetDesc()) {
333  context = seq_feat.GetData().GetGene().GetDesc();
334  }
335  else context = GetLocusTagForFeature(seq_feat, scope);
336  }
337  else GetSeqFeatLabel(seq_feat, context);
338 }
339 
340 
342 {
344  size_t n = m_Ref->m_Text.find('\t');
345  if (n != string::npos) {
346  return m_Ref->m_Text.substr(0, n);
347  }
348  }
349  return kEmptyStr;
350 }
351 
352 
354 {
356  size_t n = m_Ref->m_Text.find('\t');
357  if (n != string::npos) {
358  n++;
359  size_t m = m_Ref->m_Text.find('\t', n);
360  if (m != string::npos) {
361  return m_Ref->m_Text.substr(n, m - n);
362  }
363  }
364  }
365  return kEmptyStr;
366 }
367 
368 
370 {
372  size_t n = m_Ref->m_Text.find('\t');
373  if (n != string::npos) {
374  n++;
375  n = m_Ref->m_Text.find('\t', n);
376  if (n != string::npos) {
377  n++;
378  size_t m = m_Ref->m_Text.find('\t', n);
379  if (m != string::npos) {
380  return m_Ref->m_Text.substr(n, m - n);
381  }
382  }
383  }
384  }
385  return kEmptyStr;
386 }
387 
388 
390 {
392  size_t n = m_Ref->m_Text.find('\t');
393  if (n != string::npos) {
394  n++;
395  n = m_Ref->m_Text.find('\t', n);
396  if (n != string::npos) {
397  n++;
398  n = m_Ref->m_Text.find('\t', n);
399  if (n != string::npos) {
400  n++;
401  return m_Ref->m_Text.substr(n);
402  }
403  }
404  }
405  }
406  return kEmptyStr;
407 }
408 
409 
411 {
412  string type;
413  string location;
414  string context;
415  string locus_tag;
416  GetTextObjectDescription(seq_feat, scope, type, context, location, locus_tag);
417  return type + "\t" + context + "\t" + location + "\t" + locus_tag;
418 }
419 
420 
422 {
423  string label;
424  switch (sd.Which())
425  {
426  case CSeqdesc::e_Comment: return (sd.GetComment());
427  case CSeqdesc::e_Region: return (sd.GetRegion());
428  case CSeqdesc::e_Het: return (sd.GetHet());
429  case CSeqdesc::e_Title: return (sd.GetTitle());
430  case CSeqdesc::e_Name: return (sd.GetName());
433  break;
436  break;
437  case CSeqdesc::e_Org:
438  {
439  const COrg_ref& org = sd.GetOrg();
440  label = (org.CanGetTaxname() ? org.GetTaxname()
441  : (org.CanGetCommon()? org.GetCommon(): kEmptyStr));
442  }
443  break;
444  case CSeqdesc::e_Pub:
445  sd.GetPub().GetPub().GetLabel(&label);
446  break;
447  case CSeqdesc::e_User:
448  {
449  const CUser_object& uop = sd.GetUser();
450  label = (uop.CanGetClass()? uop.GetClass()
451  : (uop.GetType().IsStr()? uop.GetType().GetStr(): kEmptyStr));
452  }
453  break;
454  case CSeqdesc::e_Method:
455  label = (ENUM_METHOD_NAME(EGIBB_method)()->FindName(sd.GetMethod(), true));
456  break;
458  label = (ENUM_METHOD_NAME(EGIBB_mol)()->FindName(sd.GetMol_type(), true));
459  break;
460  case CSeqdesc::e_Modif:
461  for (const EGIBB_mod& it : sd.GetModif()) {
462  label
463  += ENUM_METHOD_NAME(EGIBB_mod)()->FindName(it, true) + ", ";
464  }
465  label = label.substr(0, label.size()-2);
466  break;
467  case CSeqdesc::e_Source:
468  {
469  const COrg_ref& org = sd.GetSource().GetOrg();
470  label = (org.CanGetTaxname() ? org.GetTaxname()
471  : (org.CanGetCommon()? org.GetCommon(): kEmptyStr));
472  }
473  break;
474  case CSeqdesc::e_Maploc:
475  sd.GetMaploc().GetLabel(&label);
476  break;
477  case CSeqdesc::e_Molinfo:
478  sd.GetMolinfo().GetLabel(&label);
479  break;
480  case CSeqdesc::e_Dbxref:
481  sd.GetDbxref().GetLabel(&label);
482  break;
483  default:
484  break;
485  }
486  return label;
487 }
488 
489 
490 // label for Bioseq includes "best" ID, plus length, plus number of
491 // non-ATGC characters (if any), plus number of gaps (if any)
493 {
494  string rval;
495  CConstRef<CSeq_id> id = GetBestId(bs);
496  id->GetLabel(&rval, CSeq_id::eContent);
497  return rval;
498 }
499 
500 
502 {
503  CNcbiOstrstream result_strm;
504 
505  CBioseq_set::EClass bioseq_set_class =
507  if( bioseq_set_class == CBioseq_set::eClass_segset ||
508  bioseq_set_class == CBioseq_set::eClass_nuc_prot )
509  {
510  switch(bioseq_set_class) {
512  result_strm << "ss|";
513  break;
515  result_strm << "np|";
516  break;
517  default:
518  _TROUBLE;
519  }
520 
521  // get representative bioseq from bioseq-set
522  CBioseq_CI bioseq_ci(bssh);
523  if( ! bioseq_ci ) {
524  return "(EMPTY BIOSEQ-SET)";
525  }
526  const CBioseq_Handle & main_bsh = *bioseq_ci;
527  CConstRef<CSeq_id> best_seq_id = GetBestId(*main_bsh.GetCompleteBioseq());
528  _ASSERT(best_seq_id); // a Bioseq must have at least one Seq-id
529  {
530  string seq_id_str;
531  best_seq_id->GetLabel(&seq_id_str, CSeq_id::eContent);
532  result_strm << seq_id_str;
533  }
534 
535  } else {
536  // get first child of bssh (which could be a bioseq or bioseq-set)
537  CSeq_entry_CI direct_child_ci(bssh); // NOT recursive
538  if( ! direct_child_ci ) {
539  // no child, so this is the best we can do
540  return "BioseqSet";
541  }
542 
543  result_strm << "Set containing ";
544  if( direct_child_ci->IsSeq() ) {
545  CConstRef<CSeq_id> best_seq_id = GetBestId(*direct_child_ci->GetSeq().GetCompleteBioseq());
546  _ASSERT(best_seq_id); // a Bioseq must have at least one Seq-id
547  {
548  string seq_id_str;
549  best_seq_id->GetLabel(&seq_id_str, CSeq_id::eContent);
550  result_strm << seq_id_str;
551  }
552  } else {
553  _ASSERT(direct_child_ci->IsSet());
554  result_strm << GetTextObjectDescription(direct_child_ci->GetSet());
555  }
556  }
557 
558  return string(CNcbiOstrstreamToString(result_strm));
559 }
560 
561 
User-defined methods of the data storage class.
CBioseq_CI –.
Definition: bioseq_ci.hpp:69
CBioseq_Handle –.
CBioseq_set_Handle –.
CConstRef –.
Definition: ncbiobj.hpp:1266
void GetDate(string *label, bool year_only=false) const
Append a standardized string representation of the date to the label.
Definition: Date.hpp:149
void GetLabel(string *label) const
Definition: Dbtag.cpp:187
string GetFeatureType() const override
CRef< CDiscrepancyContext::CRefNode > m_Ref
string GetLocusTag() const override
string GetLocation() const override
string GetProductName() const override
static string GetTextObjectDescription(const CSeq_feat &seq_feat, CScope &scope)
void GetLabel(string *label) const
Definition: MolInfo.cpp:56
CNcbiOstrstreamToString class helps convert CNcbiOstrstream to a string Sample usage:
Definition: ncbistre.hpp:802
bool GetLabel(string *label, TLabelFlags flags=0, ELabelVersion version=eLabel_DefaultVersion) const override
Append a label to "label" based on content.
Definition: Pub_equiv.cpp:56
CScope –.
Definition: scope.hpp:92
ESubtype GetSubtype(void) const
string GetKey(EVocabulary vocab=eVocabulary_full) const
CSeq_entry_CI –.
namespace ncbi::objects::
Definition: Seq_feat.hpp:58
const CProt_ref * GetProtXref(void) const
get protein (if present) from Seq-feat.xref list
Definition: Seq_feat.cpp:222
static int type
Definition: getdata.c:31
static const char location[]
Definition: config.c:97
string
Definition: cgiapp.hpp:687
#define ENUM_METHOD_NAME(EnumName)
Definition: serialbase.hpp:994
void GetLabel(string *label, ELabelType type=eDefault, TLabelFlags flags=fLabel_Default) const
Append a label for this Seq-id to the supplied string.
Definition: Seq_id.cpp:2040
string GetLabel(const CSeq_id &id)
@ kMaxScore
Definition: Seq_id.hpp:733
@ eContent
Untagged human-readable accession or the like.
Definition: Seq_id.hpp:605
void SetPacked_int(TPacked_int &v)
Definition: Seq_loc.hpp:984
void SetMix(TMix &v)
Definition: Seq_loc.hpp:987
void SetWhole(TWhole &v)
Definition: Seq_loc.hpp:982
void SetPacked_pnt(TPacked_pnt &v)
Definition: Seq_loc.hpp:986
virtual void Assign(const CSerialObject &source, ESerialRecursionMode how=eRecursive)
Override Assign() to incorporate cache invalidation.
Definition: Seq_loc.cpp:337
void SetPnt(TPnt &v)
Definition: Seq_loc.hpp:985
void SetInt(TInt &v)
Definition: Seq_loc.hpp:983
void SetEquiv(TEquiv &v)
Definition: Seq_loc.hpp:988
void SetBond(TBond &v)
Definition: Seq_loc.hpp:989
void GetLabel(string *label) const
Appends a label suitable for display (e.g., error messages) label must point to an existing string ob...
Definition: Seq_loc.cpp:3467
CMappedFeat GetBestOverlappingFeat(const CMappedFeat &feat, CSeqFeatData::ESubtype need_subtype, sequence::EOverlapType overlap_type, CFeatTree *feat_tree=0, const SAnnotSelector *base_sel=0)
Definition: feature.cpp:3653
@ fFGL_Content
Include its content if there is any.
Definition: feature.hpp:73
@ eOverlap_Contains
2nd contains 1st extremes
const CSeq_feat * GetCDSForProduct(const CBioseq &product, CScope *scope)
Get the encoding CDS feature of a given protein sequence.
Definition: sequence.cpp:2549
CBioseq_Handle GetBioseqFromSeqLoc(const CSeq_loc &loc, CScope &scope, CScope::EGetBioseqFlag flag=CScope::eGetBioseq_Loaded)
Retrieve the Bioseq Handle from a location.
Definition: sequence.cpp:308
CConstRef< CSeq_feat > GetGeneForFeature(const CSeq_feat &feat, CScope &scope)
Finds gene for feature, but obeys SeqFeatXref directives.
Definition: sequence.cpp:1529
CBioseq_Handle GetBioseqHandle(const CSeq_id &id)
Get bioseq handle by seq-id.
Definition: scope.cpp:95
CConstRef< CBioseq > GetCompleteBioseq(void) const
Get the complete bioseq.
TSet GetSet(void) const
TSeq GetSeq(void) const
bool IsSet(void) const
bool IsSeq(void) const
bool NotEmpty(void) const THROWS_NONE
Check if CConstRef is not empty – pointing to an object and has a non-null value.
Definition: ncbiobj.hpp:1392
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define END_SCOPE(ns)
End the previously defined scope.
Definition: ncbistl.hpp:75
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
#define BEGIN_SCOPE(ns)
Define a new scope.
Definition: ncbistl.hpp:72
#define kEmptyStr
Definition: ncbistr.hpp:123
static bool IsBlank(const CTempString str, SIZE_TYPE pos=0)
Check if a string is blank (has no text).
Definition: ncbistr.cpp:106
static const char label[]
bool IsSetOrg(void) const
Check if a value has been assigned to Org data member.
Definition: BioSource_.hpp:497
const TOrg & GetOrg(void) const
Get the Org member data.
Definition: BioSource_.hpp:509
const TDesc & GetDesc(void) const
Get the Desc member data.
Definition: Gene_ref_.hpp:599
bool CanGetLocus(void) const
Check if it is safe to call GetLocus method.
Definition: Gene_ref_.hpp:499
bool CanGetLocus_tag(void) const
Check if it is safe to call GetLocus_tag method.
Definition: Gene_ref_.hpp:787
bool CanGetDesc(void) const
Check if it is safe to call GetDesc method.
Definition: Gene_ref_.hpp:593
const TLocus_tag & GetLocus_tag(void) const
Get the Locus_tag member data.
Definition: Gene_ref_.hpp:793
const TLocus & GetLocus(void) const
Get the Locus member data.
Definition: Gene_ref_.hpp:505
bool IsStr(void) const
Check if variant Str is selected.
Definition: Object_id_.hpp:291
bool CanGetClass(void) const
Check if it is safe to call GetClass method.
const TClass & GetClass(void) const
Get the Class member data.
const TStr & GetStr(void) const
Get the variant data.
Definition: Object_id_.hpp:297
const TType & GetType(void) const
Get the Type member data.
bool CanGetCommon(void) const
Check if it is safe to call GetCommon method.
Definition: Org_ref_.hpp:413
const TTaxname & GetTaxname(void) const
Get the Taxname member data.
Definition: Org_ref_.hpp:372
const TCommon & GetCommon(void) const
Get the Common member data.
Definition: Org_ref_.hpp:419
bool CanGetTaxname(void) const
Check if it is safe to call GetTaxname method.
Definition: Org_ref_.hpp:366
const TName & GetName(void) const
Get the Name member data.
Definition: Prot_ref_.hpp:378
bool CanGetName(void) const
Check if it is safe to call GetName method.
Definition: Prot_ref_.hpp:372
const TPub & GetPub(void) const
Get the variant data.
bool IsProt(void) const
Check if variant Prot is selected.
bool IsCdregion(void) const
Check if variant Cdregion is selected.
const TLocation & GetLocation(void) const
Get the Location member data.
Definition: Seq_feat_.hpp:1117
bool IsGene(void) const
Check if variant Gene is selected.
const TData & GetData(void) const
Get the Data member data.
Definition: Seq_feat_.hpp:925
bool IsPub(void) const
Check if variant Pub is selected.
const TBiosrc & GetBiosrc(void) const
Get the variant data.
const TProduct & GetProduct(void) const
Get the Product member data.
Definition: Seq_feat_.hpp:1096
bool IsBiosrc(void) const
Check if variant Biosrc is selected.
const TGene & GetGene(void) const
Get the variant data.
const TProt & GetProt(void) const
Get the variant data.
bool IsSetProduct(void) const
product of process Check if a value has been assigned to Product data member.
Definition: Seq_feat_.hpp:1084
bool IsRna(void) const
Check if variant Rna is selected.
void SetId(TId &value)
Assign a value to Id data member.
Definition: Seq_point_.cpp:61
bool IsSetId(void) const
WARNING: this used to be optional Check if a value has been assigned to Id data member.
Definition: Seq_point_.hpp:378
const TId & GetId(void) const
Get the Id member data.
bool IsSetA(void) const
connection to a least one residue Check if a value has been assigned to A data member.
Definition: Seq_bond_.hpp:201
void SetId(TId &value)
Assign a value to Id data member.
E_Choice Which(void) const
Which variant is currently selected.
Definition: Seq_loc_.hpp:475
const TId & GetId(void) const
Get the Id member data.
const TId & GetId(void) const
Get the Id member data.
Definition: Seq_point_.hpp:390
const TPacked_pnt & GetPacked_pnt(void) const
Get the variant data.
Definition: Seq_loc_.cpp:260
bool IsSetId(void) const
WARNING: this used to be optional Check if a value has been assigned to Id data member.
bool IsSetId(void) const
Check if a value has been assigned to Id data member.
bool IsSetB(void) const
other end may not be available Check if a value has been assigned to B data member.
Definition: Seq_bond_.hpp:231
const TBond & GetBond(void) const
Get the variant data.
Definition: Seq_loc_.cpp:326
@ e_Other
for historical reasons, 'other' = 'refseq'
Definition: Seq_id_.hpp:104
@ e_Ddbj
DDBJ.
Definition: Seq_id_.hpp:107
@ e_not_set
No variant selected.
Definition: Seq_loc_.hpp:97
@ e_Null
not placed
Definition: Seq_loc_.hpp:98
@ e_Equiv
equivalent sets of locations
Definition: Seq_loc_.hpp:106
@ e_Empty
to NULL one Seq-id in a collection
Definition: Seq_loc_.hpp:99
@ e_Feat
indirect, through a Seq-feat
Definition: Seq_loc_.hpp:108
@ e_Int
from to
Definition: Seq_loc_.hpp:101
@ e_Whole
whole sequence
Definition: Seq_loc_.hpp:100
@ eClass_nuc_prot
nuc acid and coded proteins
Definition: Bioseq_set_.hpp:99
@ eClass_segset
segmented sequence + parts
EGIBB_method
sequencing methods
const THet & GetHet(void) const
Get the variant data.
Definition: Seqdesc_.hpp:1176
const TUser & GetUser(void) const
Get the variant data.
Definition: Seqdesc_.cpp:384
const TDbxref & GetDbxref(void) const
Get the variant data.
Definition: Seqdesc_.cpp:428
const TUpdate_date & GetUpdate_date(void) const
Get the variant data.
Definition: Seqdesc_.cpp:494
const TTitle & GetTitle(void) const
Get the variant data.
Definition: Seqdesc_.hpp:1032
const TSource & GetSource(void) const
Get the variant data.
Definition: Seqdesc_.cpp:566
const TPub & GetPub(void) const
Get the variant data.
Definition: Seqdesc_.cpp:356
const TMaploc & GetMaploc(void) const
Get the variant data.
Definition: Seqdesc_.cpp:290
TMethod GetMethod(void) const
Get the variant data.
Definition: Seqdesc_.hpp:985
const TId & GetId(void) const
Get the Id member data.
Definition: Bioseq_.hpp:290
const TOrg & GetOrg(void) const
Get the variant data.
Definition: Seqdesc_.cpp:240
list< CRef< CSeq_id > > TId
Definition: Bioseq_.hpp:94
EGIBB_mod
GenInfo Backbone modifiers.
Definition: GIBB_mod_.hpp:64
TMol_type GetMol_type(void) const
Get the variant data.
Definition: Seqdesc_.hpp:938
const TModif & GetModif(void) const
Get the variant data.
Definition: Seqdesc_.hpp:965
E_Choice Which(void) const
Which variant is currently selected.
Definition: Seqdesc_.hpp:903
const TCreate_date & GetCreate_date(void) const
Get the variant data.
Definition: Seqdesc_.cpp:472
EGIBB_mol
type of molecule represented
Definition: GIBB_mol_.hpp:64
const TPub & GetPub(void) const
Get the Pub member data.
Definition: Pubdesc_.hpp:605
const TComment & GetComment(void) const
Get the variant data.
Definition: Seqdesc_.hpp:1058
const TMolinfo & GetMolinfo(void) const
Get the variant data.
Definition: Seqdesc_.cpp:588
const TName & GetName(void) const
Get the variant data.
Definition: Seqdesc_.hpp:1012
const TRegion & GetRegion(void) const
Get the variant data.
Definition: Seqdesc_.hpp:1108
@ e_Het
cofactor, etc associated but not bound
Definition: Seqdesc_.hpp:132
@ e_Org
if all from one organism
Definition: Seqdesc_.hpp:116
@ e_User
user defined object
Definition: Seqdesc_.hpp:124
@ e_Update_date
date of last update
Definition: Seqdesc_.hpp:129
@ e_Pub
a reference to the publication
Definition: Seqdesc_.hpp:122
@ e_Mol_type
type of molecule
Definition: Seqdesc_.hpp:111
@ e_Dbxref
xref to other databases
Definition: Seqdesc_.hpp:126
@ e_Comment
a more extensive comment
Definition: Seqdesc_.hpp:117
@ e_Method
sequencing method
Definition: Seqdesc_.hpp:113
@ e_Region
overall region (globin locus)
Definition: Seqdesc_.hpp:123
@ e_Molinfo
info on the molecule and techniques
Definition: Seqdesc_.hpp:134
@ e_Modif
modifiers
Definition: Seqdesc_.hpp:112
@ e_Maploc
map location of this sequence
Definition: Seqdesc_.hpp:119
@ e_Create_date
date entry first created/released
Definition: Seqdesc_.hpp:128
@ e_Title
a title for this sequence
Definition: Seqdesc_.hpp:115
@ e_Name
a name for this sequence
Definition: Seqdesc_.hpp:114
@ e_Source
source of materials, includes Org-ref
Definition: Seqdesc_.hpp:133
yy_size_t n
const char * tag
static BOOL number
Definition: pcregrep.c:193
USING_SCOPE(objects)
string GetProductForCDS(const CSeq_feat &cds, CScope &scope)
void GetSeqFeatLabel(const CSeq_feat &seq_feat, string &label)
static bool IsAccession(const CSeq_id &id)
string GetLocusTagForFeature(const CSeq_feat &seq_feat, CScope &scope)
CConstRef< CSeq_id > GetBestId(const CBioseq &bioseq)
string GetProduct(const CProt_ref &prot_ref)
string GetSeqLocDescription(const CSeq_loc &loc, CScope &scope)
void UpgradeSeqLocId(CSeq_point &pnt, CScope &scope)
USING_NCBI_SCOPE
Generic utility macros and templates for exploring NCBI objects.
#define GET_FIELD_OR_DEFAULT(Var, Fld, Dflt)
GET_FIELD_OR_DEFAULT base macro.
Definition: type.c:6
#define _TROUBLE
#define _ASSERT
static CS_CONTEXT * context
Definition: will_convert.c:21
#define const
Definition: zconf.h:232
Modified on Wed Apr 17 13:09:05 2024 by modify_doxy.py rev. 669887