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

Go to the SVN repository for this file.

1 /* $Id: gui_object_info_variation.cpp 46604 2021-08-02 19:09:20Z evgeniev $
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 * Authors: Liangshou Wu, Dmitry Rudnev
27 *
28 * File Description:
29 * Gui Object Info class specifically for Single-nucleotide polymorphism
30 * commonly known as SNP.
31 *
32 */
33 #include <sstream>
34 
38 #include <gui/objutils/tooltip.hpp>
39 #include <gui/objutils/utils.hpp>
40 #include <gui/objutils/snp_gui.hpp>
41 #include <gui/utils/fetch_url.hpp>
48 
49 #define __CAN_USE_TOOLTIP_SVC
50 #ifdef __CAN_USE_TOOLTIP_SVC
52 #endif
53 
56 
57 
59 {
60 public:
61  virtual string GetSubtype() const;
62  virtual void GetToolTip(ITooltipFormatter& tooltip, string& t_title, TSeqPos at_p = (TSeqPos)-1, bool* isGeneratedBySvc = NULL) const;
63  virtual void GetLinks(ITooltipFormatter& links, bool no_ncbi_base) const;
64 
65 private:
66 #ifdef __CAN_USE_TOOLTIP_SVC
67  static void x_ConvertTooltips(ITooltipFormatter& tooltip, const CDbsnpTooltipServiceReply& DbsnpTooltipServiceReply);
68  static void x_GetTooltipService();
69  static bool m_isUseTooltipService;
70  static string m_sTooltipServiceHost;
71 #endif
72 };
73 
74 #ifdef __CAN_USE_TOOLTIP_SVC
77 #endif
78 
80 {
81  return "SNP";
82 }
83 
84 static void s_AddTopLevelGenomicLinks(bool& isFirstGenomicLocation,
85  bool isMultiple,
86  const string& sVariationID,
87  const NSNPWebServices::TSNPSearchResultList& SNPSearchResultList,
88  ITooltipFormatter* pFormatter)
89 {
90  bool trusted_data = pFormatter->IsTrustedData();
91  pFormatter->SetTrustedData(true);
92  ITERATE(NSNPWebServices::TSNPSearchResultList, iSNPSearchResultList, SNPSearchResultList) {
93  pFormatter->StartRow();
94  if(isFirstGenomicLocation) {
95  pFormatter->AddTagCol(isMultiple ?
96  "Genomic locations:" : "Genomic location:");
97  isFirstGenomicLocation = false;
98  } else {
99  pFormatter->AddTagCol("");
100  }
101  const CVariation::TPlacements& Placements((*iSNPSearchResultList)->GetPlacements());
102  CRef<CVariantPlacement> pPlacement(Placements.front());
103  string sAccession(pPlacement->GetLoc().GetId()->GetSeqIdString(true));
104  string sAssembly(pPlacement->GetAssembly().GetTag().GetStr());
105  string sGenomicPosFrom(NStr::NumericToString(pPlacement->GetLoc().GetStart(eExtreme_Positional)+1));
106  string sGenomicPosTo(NStr::NumericToString(pPlacement->GetLoc().GetStop(eExtreme_Positional)+1));
107  string sLabel(sAccession + " @ " + sGenomicPosFrom + " @" + sAssembly);
108  string sUrl("/projects/sviewer/?id=" + sAccession +
109  "&v=" + sGenomicPosFrom + ":" + sGenomicPosTo +
110  "&mk=" + sGenomicPosFrom + '|' + sVariationID + "|008000");
111  pFormatter->AddValueCol(pFormatter->CreateGenomicLink(sLabel, sUrl), true);
112  pFormatter->FinishRow();
113  }
114  pFormatter->SetTrustedData(trusted_data);
115 }
116 
117 #ifdef __CAN_USE_TOOLTIP_SVC
119 {
120  if(m_sTooltipServiceHost.empty()) {
122  m_isUseTooltipService = reg.GetBool("snp_web_services", "use_tooltip_service", true);
124  ?
125  reg.GetString("snp_web_services", "tooltip_host", "https://www.ncbi.nlm.nih.gov/projects/variation/tooltips")
126  :
127  string("dummy");
128  }
129 }
130 #endif
131 
132 void CGuiObjectInfoVariation::GetToolTip(ITooltipFormatter& tooltip, string& t_title, TSeqPos /*at_p*/, bool* isGeneratedBySvc) const
133 {
136  bool isSnp(NSnp::IsSnp(*m_Feat));
138 
139  string sVariationID;
140  if (Rsid) {
141  sVariationID = "rs" + NStr::NumericToString(Rsid);
142  } else {
143  feature::GetLabel(*m_Feat, &sVariationID,
145  if(isGeneratedBySvc) {
146  *isGeneratedBySvc = false;
147  }
148  }
149 /*
150  // commented out as requested in SV-1343 on 07/23/2013 in favor of
151  // using SNP search for top-level SNP hits discovery below
152  // this code is retained as it may prove useful for tooltips other than SNP
153  CSeqUtils::TLocVec MappedUpLocs(CSeqUtils::GetLocPlacements(m_Feat->GetLocation()));
154  bool isFirstGenomicLocation(true);
155  ITERATE(CSeqUtils::TLocVec, iMappedUpLocs, MappedUpLocs) {
156  const CSeq_id& seq_id((*iMappedUpLocs)->GetInt().GetId());
157  string sChr(CSeqUtils::GetChrGI(seq_id.GetGi()));
158  if(!sChr.empty()) {
159  tooltip.StartRow();
160  if(isFirstGenomicLocation) {
161  tooltip.AddTagCol(MappedUpLocs.size() > 1 ?
162  "Genomic locations:" : "Genomic location:");
163  isFirstGenomicLocation = false;
164  } else {
165  tooltip.AddTagCol("");
166  }
167  string sAccession;
168  CLabel::GetLabel(seq_id, &sAccession, CLabel::eContent, m_Scope.GetPointer());
169  string sGenomicPosFrom(NStr::NumericToString((*iMappedUpLocs)->GetInt().GetFrom()+1));
170  string sGenomicPosTo(NStr::NumericToString((*iMappedUpLocs)->GetInt().GetTo()+1));
171  string sLabel(sAccession + " @ " + sGenomicPosFrom);
172  string sUrl("/projects/sviewer/?id=" + NStr::NumericToString(seq_id.GetGi()) +
173  "&v=" + sGenomicPosFrom + ":" + sGenomicPosTo +
174  "&m=" + sGenomicPosFrom + "!&mn=" + sVariationID);
175  tooltip.AddValueCol(tooltip.CreateNcbiLink(sLabel, sUrl));
176  tooltip.FinishRow();
177  }
178  }
179 */
180  if(Rsid) {
181 #ifdef __CAN_USE_TOOLTIP_SVC
184  string sSNPTooltipURL(m_sTooltipServiceHost + "/" + NStr::NumericToString(Rsid));
185  string sTooltipResult;
186  CFetchURL::Fetch(sSNPTooltipURL, sTooltipResult, kDefaultTimeout, true/*use-cache*/);
187  CDbsnpTooltipServiceReply DbsnpTooltipServiceReply;
188  if(isGeneratedBySvc) {
189  *isGeneratedBySvc = true;
190  }
191 
192  //!! check for empty string, deserialization exceptions, etc
193  if(sTooltipResult.empty()) {
194  tooltip.AddRow("Error:", "Empty response from tooltip service");
195  LOG_POST(Error << "Empty response from tooltip service for id '" << sVariationID << "'");
196  return;
197  }
198 
199  std::stringstream TooltipResultStream(sTooltipResult);
200 
201  try {
202  TooltipResultStream >> MSerial_Json >> DbsnpTooltipServiceReply;
203  } catch(const std::exception& err) {
204  tooltip.AddRow("Error:", "Invalid response from tooltip service");
205  LOG_POST(Error << "Invalid response from tooltip service for id '" << sVariationID << "', error: " << err.what());
206  return;
207  }
208 
209  x_ConvertTooltips(tooltip, DbsnpTooltipServiceReply);
210  } else {
211 #endif
212  if(isGeneratedBySvc) {
213  *isGeneratedBySvc = false;
214  }
215  NSNPWebServices::TSNPSearchResultList SNPSearchResultList;
216  try {
217  NSNPWebServices::Search(sVariationID, SNPSearchResultList);
218  }
219  catch (const std::exception& err) {
220  LOG_POST(Warning << "NSNPWebServices::Search() failed for id '" << sVariationID << "':" << err.what());
221  }
222 
223  NSNPWebServices::TSNPSearchResultList FirstPriorityList;
224  NSNPWebServices::TSNPSearchResultList SecondPriorityList;
225  NSNPWebServices::TSNPSearchResultList ThirdPriorityList;
226  int nLocations(0);
227 
228  ITERATE(NSNPWebServices::TSNPSearchResultList, iSNPSearchResultList, SNPSearchResultList) {
229  // look for top level information in ext
230  if(!(*iSNPSearchResultList)->CanGetExt()) {
231  continue;
232  }
233  const CVariation::TExt& Ext((*iSNPSearchResultList)->GetExt());
234  ITERATE(CVariation::TExt, iExt, Ext) {
235  if((*iExt)->HasField(NSNPWebServices::c_SNPVarExt_TopLevel)) {
236  const CUser_field& UserField((*iExt)->GetField(NSNPWebServices::c_SNPVarExt_TopLevel));
237  // must be a string or we cry
238  NCBI_ASSERT(UserField.CanGetData() && UserField.GetData().IsStr(), "Wrong type of user field for gene_symbol");
239 
240  // only if the string is "yes", we have a top level
241  if(UserField.GetData().GetStr() == "yes") {
242  // CVariation used as a search result can have one and only one placement
243  NCBI_ASSERT((*iSNPSearchResultList)->CanGetPlacements(), "Unexpected absence of placements in SNP Search Result!");
244  const CVariation::TPlacements& Placements((*iSNPSearchResultList)->GetPlacements());
245  NCBI_ASSERT(Placements.size(), "Unexpected number of placements in SNP Search Result!");
246  CRef<CVariantPlacement> pPlacement(Placements.front());
247  string sAssembly(pPlacement->GetAssembly().GetTag().GetStr());
248  ++nLocations;
249 
250  if(NStr::StartsWith(sAssembly, "GRCh", NStr::eNocase)) {
251  FirstPriorityList.push_back(*iSNPSearchResultList);
252  break;
253  }
254  if(NStr::StartsWith(sAssembly, "CHM", NStr::eNocase)) {
255  SecondPriorityList.push_back(*iSNPSearchResultList);
256  break;
257  }
258  ThirdPriorityList.push_back(*iSNPSearchResultList);
259  break;
260  }
261  }
262  }
263  }
264  if(nLocations) {
265  bool isFirstGenomicLocation(true);
266  s_AddTopLevelGenomicLinks(isFirstGenomicLocation, nLocations > 1, sVariationID, FirstPriorityList, &tooltip);
267  s_AddTopLevelGenomicLinks(isFirstGenomicLocation, nLocations > 1, sVariationID, SecondPriorityList, &tooltip);
268  s_AddTopLevelGenomicLinks(isFirstGenomicLocation, nLocations > 1, sVariationID, ThirdPriorityList, &tooltip);
269  }
270 
271  string sVariantType(bitfield.GetVariationClassString());
272  tooltip.AddRow("Variation ID:", sVariationID);
273 
274  string sLength(NStr::IntToString(m_Feat->GetLocation().GetTotalRange().GetLength(), NStr::fWithCommas));
275  tooltip.AddRow("Variant Type:", sVariantType + ", length " + sLength);
276 #ifdef __CAN_USE_TOOLTIP_SVC
277  }
278 #endif
279  } else {
280  tooltip.AddRow("Variation:", sVariationID);
281  }
282  if(!m_isUseTooltipService || !isSnp) {
283  /// alleles come next
284  NSnp::TAlleles Alleles;
285  NSnp::GetAlleles(*m_Feat, Alleles);
286  if ( !Alleles.empty() ) {
287  tooltip.AddRow("Alleles:", NStr::Join(Alleles, "/"));
288  }
289  if(bitfield.IsTrue(CSnpBitfield::eIsSomatic)) {
290  tooltip.AddRow("Allele origin:", "Somatic");
291  }
292 
293  if (m_Feat->IsSetComment()) {
294  tooltip.AddRow("Comment:", m_Feat->GetComment());
295  }
296  }
297 }
298 
299 
300 void CGuiObjectInfoVariation::GetLinks(ITooltipFormatter& links, bool no_ncbi_base) const
301 {
302  if (m_Feat->IsSetDbxref()) {
303  string base_url = no_ncbi_base ? "" : CSeqUtils::GetNcbiBaseUrl();
304  const CSeq_feat::TDbxref& refs = m_Feat->GetDbxref();
305  links.AddLinksTitle("Go To");
306 
307  ITERATE (CSeq_feat::TDbxref, iter, refs) {
308  const CRef<CDbtag>& dbt = *iter;
309  if (NSnp::IsSnp(*dbt)) {
310  string rsid{NStr::NumericToString(NSnp::GetRsid(*dbt))};
311  ///
312  /// link for SNP summary
313  ///
314  string name = "SNP summary:";
315  string label = "rs";
316  label += rsid;
317  string link = base_url + "/snp/rs";
318  link += rsid;
319 
320  links.AddLinkRow(name, label, link);
321 
322  CSnpBitfield bf(*m_Feat);
323  if(bf.isGood()) {
324  ///
325  /// link for Genotype information
326  ///
328  name = "Genotype information for";
329  label = "rs";
330  label += rsid;
331  link = base_url + "/snp/rs";
332  link += rsid + "#frequency_tab";
333  links.AddLinkRow(name, label, link);
334  }
335 
336  ///
337  /// link for SNP3D web page
338  ///
340  name = "SNP3D Page for";
341  label = "rs" + rsid;
342  link = base_url + "/projects/SNP/snp3D.cgi?rsnum=";
343  link += rsid;
344  links.AddLinkRow(name, label, link);
345  }
346 
347  ///
348  /// link for OMIM page for this SNP
349  ///
351  name = "OMIM information for";
352  label = "rs" + rsid;
353  link = base_url + "/projects/SNP/snp_redirect.cgi?snp_id=";
354  link += rsid;
355  links.AddLinkRow(name, label, link);
356  }
357 
358  // VarVu link for clinical SNPs
360  // try to match genes to the current position
363 
364  if(m_Feat->CanGetLocation()) {
365  CFeat_CI feat_iter(*m_Scope, m_Feat->GetLocation(), sel_gene);
366 
367  CConstRef<CSeq_feat> mapped_feat;
368  for ( ; feat_iter; ++feat_iter) {
369  mapped_feat.Reset(&feat_iter->GetMappedFeature());
370  string sGeneLocus;
371  if(mapped_feat->GetData().Which() == CSeqFeatData::e_Gene &&
372  mapped_feat->GetData().GetGene().IsSetLocus()) {
373  sGeneLocus = mapped_feat->GetData().GetGene().GetLocus();
374  }
375 
376  if( !sGeneLocus.empty() ) {
377  name = "Variation viewer for";
378  label = "rs" + rsid;
379  label += " (" + sGeneLocus + ")",
380  link = base_url + "/sites/varvu?rs=";
381  link += rsid + "&gene=" + sGeneLocus;
382  links.AddLinkRow(name, label, link);
383  }
384  }
385  }
386  }
387  }
388  }
389  }
390  }
391 }
392 
393 #ifdef __CAN_USE_TOOLTIP_SVC
395 {
396  if(DbsnpTooltipServiceReply.IsTooltip_data()) {
397  string sCurrentSectionName;
398  const auto& tooltip_data(DbsnpTooltipServiceReply.GetTooltip_data());
399  for(const auto& tooltip_section: tooltip_data.Get()) {
400  if(tooltip_section->CanGetSection()) {
401  sCurrentSectionName = tooltip_section->GetSection();
402  if(!sCurrentSectionName.empty()) {
403  tooltip.AddSectionRow(sCurrentSectionName);
404  }
405  }
406  if(tooltip_section->CanGetValues()) {
407  bool trusted_data = tooltip.IsTrustedData();
408  tooltip.SetTrustedData(true);
409  for(const auto& tooltip_row: tooltip_section->GetValues()) {
410  string sURL(tooltip_row->CanGetUrl() ? tooltip_row->GetUrl() : "");
411  string sValue(tooltip_row->GetValue());
412  bool isLink(!sURL.empty());
413  if(isLink) {
414  // this is a hackish solution for the problem of special treatment for
415  // genomic URLs in GBench
416  if(sCurrentSectionName == "Genomic locations") {
417  sValue = tooltip.CreateGenomicLink(sValue, sURL);
418  } else {
419  sValue = tooltip.CreateNcbiLink(sValue, sURL);
420  }
421  }
422  tooltip.AddRow(tooltip_row->GetKey() + ":", sValue, 200, isLink);
423  }
424  tooltip.SetTrustedData(trusted_data);
425  }
426  }
427  }
428  if(DbsnpTooltipServiceReply.IsError()) {
429  tooltip.AddRow("Error:", DbsnpTooltipServiceReply.GetError().GetMessage());
430  }
431 }
432 #endif
433 
@ eExtreme_Positional
numerical value
Definition: Na_strand.hpp:63
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
CDbsnpTooltipServiceReply –.
CFeat_CI –.
Definition: feat_ci.hpp:64
virtual void GetLinks(ITooltipFormatter &links, bool no_ncbi_base) const
Get a set of links.
static void x_ConvertTooltips(ITooltipFormatter &tooltip, const CDbsnpTooltipServiceReply &DbsnpTooltipServiceReply)
virtual void GetToolTip(ITooltipFormatter &tooltip, string &t_title, TSeqPos at_p=(TSeqPos) -1, bool *isGeneratedBySvc=NULL) const
Get tooltip.
virtual string GetSubtype() const
static CNcbiApplication * Instance(void)
Singleton method.
Definition: ncbiapp.cpp:244
CNcbiRegistry –.
Definition: ncbireg.hpp:913
CSnpBitfield is a facade for representing any version of the SNP bitfield.
bool IsTrue(EProperty prop) const
bool isGood() const
const char * GetVariationClassString() const
@ eHasSnp3D
Has 3D structure SNP3D.
primitive interface to arrange tabular data in the tooltips
Definition: tooltip.hpp:55
static TRsid GetRsid(const CMappedFeat &mapped_feat)
Return rsid of SNP.
Definition: snp_utils.cpp:109
vector< string > TAlleles
list of alleles belonging to particular SNP a deletion is represented by a "-"
Definition: snp_utils.hpp:188
static bool IsSnp(const CMappedFeat &mapped_feat)
Determine if feature is a SNP.
Definition: snp_utils.cpp:62
CObject_id::TId8 TRsid
Definition: snp_utils.hpp:70
static void GetAlleles(const CMappedFeat &mapped_feat, TAlleles &Alleles)
Return list of alleles encoded in qual.
Definition: snp_utils.cpp:237
static CSnpBitfield GetBitfield(const CMappedFeat &)
Return bitfield information stored in the feature.
Definition: snp_utils.cpp:220
const CNcbiRegistry & GetConfig(void) const
Get the application's cached configuration parameters (read-only).
unsigned int TSeqPos
Type for sequence locations and lengths.
Definition: ncbimisc.hpp:875
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
Definition: ncbimisc.hpp:815
string
Definition: cgiapp.hpp:687
#define NULL
Definition: ncbistd.hpp:225
#define NCBI_ASSERT(expr, mess)
Definition: ncbidbg.hpp:130
#define LOG_POST(message)
This macro is deprecated and it's strongly recomended to move in all projects (except tests) to macro...
Definition: ncbidiag.hpp:226
void Error(CExceptionArgs_Base &args)
Definition: ncbiexpt.hpp:1197
void Warning(CExceptionArgs_Base &args)
Definition: ncbiexpt.hpp:1191
static objects::SAnnotSelector GetAnnotSelector(TAnnotFlags flags=0)
request an annotation selector for a given type
Definition: utils.cpp:167
static string GetNcbiBaseUrl()
Definition: utils.cpp:971
virtual void FinishRow()=0
finish the row (i.e. no other contents will be added to it)
virtual string CreateGenomicLink(const string &sText, const string &sUrl) const
Definition: tooltip.hpp:191
static void GetLabel(const CObject &obj, string *label, ELabelType type=eDefault)
Definition: label.cpp:140
static const string c_SNPVarExt_TopLevel
Definition: snp_gui.hpp:262
list< CRef< CVariation > > TSNPSearchResultList
various placements of a variation
Definition: snp_gui.hpp:227
virtual void AddRow(const string &sContents="", unsigned colspan=2)=0
add a row with a cell, spanning across all columns
virtual bool IsTrustedData()
indicates whether the data is coming from a trusted source
Definition: tooltip.hpp:231
virtual void AddValueCol(const string &sContents="", unsigned width=200, bool isNoWrap=false)=0
adds a value column to the row
static void Fetch(const string &url, string &result, const STimeout *timeout=kDefaultTimeout, bool is_cache=false)
Fetch a URL from the net using http GET.
Definition: fetch_url.cpp:80
virtual void AddLinksTitle(const string &sTitle)=0
add a row with the links title
virtual void SetTrustedData(bool trusted_data)
indicates whether the data is coming from a trusted source
Definition: tooltip.hpp:227
virtual void AddTagCol(const string &sContents="", const string &sBulletSrc="")=0
adds a tag column to the row
CRef< objects::CScope > m_Scope
virtual void AddLinkRow(const string &sTag, const string &sValue, unsigned valueColWidth=200)=0
add a row with two columns
CConstRef< objects::CSeq_feat > m_Feat
virtual void AddSectionRow(const string &sContents)=0
add a section row
virtual void StartRow()=0
start a new table row
virtual string CreateNcbiLink(const string &sText, const string &sUrl) const =0
construct the HTML code for a link from the displayed text label and supplied NCBI URL path
static void Search(const std::string &sTerms, const std::string &sAssemblyAccession, TSNPSearchCompoundResultList &ResultList)
search for given SNP ID(s) and get a list of results
@ eContent
Definition: label.hpp:62
#define MSerial_Json
Definition: serialbase.hpp:699
string GetSeqIdString(bool with_version=false) const
Return seqid string with optional version for text seqid type.
Definition: Seq_id.cpp:2144
string GetLabel(const CSeq_id &id)
TSeqPos GetStart(ESeqLocExtremes ext) const
Return start and stop positions of the seq-loc.
Definition: Seq_loc.cpp:915
const CSeq_id * GetId(void) const
Get the id of the location return NULL if has multiple ids or no id at all.
Definition: Seq_loc.hpp:941
TSeqPos GetStop(ESeqLocExtremes ext) const
Definition: Seq_loc.cpp:963
@ fFGL_Content
Include its content if there is any.
Definition: feature.hpp:73
SAnnotSelector & IncludeFeatSubtype(TFeatSubtype subtype)
Include feature subtype in the search.
const CSeq_feat & GetMappedFeature(void) const
Feature mapped to the master sequence.
TObjectType * GetPointer(void) THROWS_NONE
Get pointer,.
Definition: ncbiobj.hpp:998
void Reset(void)
Reset reference object.
Definition: ncbiobj.hpp:1439
virtual bool GetBool(const string &section, const string &name, bool default_value, TFlags flags=0, EErrAction err_action=eThrow) const
Get boolean value of specified parameter name.
Definition: ncbireg.cpp:391
virtual string GetString(const string &section, const string &name, const string &default_value, TFlags flags=0) const
Get the parameter string value.
Definition: ncbireg.cpp:321
#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 string IntToString(int value, TNumToStringFlags flags=0, int base=10)
Convert int to string.
Definition: ncbistr.hpp:5083
static string Join(const TContainer &arr, const CTempString &delim)
Join strings using the specified delimiter.
Definition: ncbistr.hpp:2697
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:5411
static enable_if< is_arithmetic< TNumeric >::value||is_convertible< TNumeric, Int8 >::value, string >::type NumericToString(TNumeric value, TNumToStringFlags flags=0, int base=10)
Convert numeric value to string.
Definition: ncbistr.hpp:673
@ fWithCommas
Use commas as thousands separator.
Definition: ncbistr.hpp:254
@ eNocase
Case insensitive compare.
Definition: ncbistr.hpp:1206
#define kDefaultTimeout
Definition: ncbi_types.h:81
static const char label[]
bool IsSetLocus(void) const
Official gene symbol Check if a value has been assigned to Locus data member.
Definition: Gene_ref_.hpp:493
const TLocus & GetLocus(void) const
Get the Locus member data.
Definition: Gene_ref_.hpp:505
const TStr & GetStr(void) const
Get the variant data.
const TTag & GetTag(void) const
Get the Tag member data.
Definition: Dbtag_.hpp:267
const TData & GetData(void) const
Get the Data member data.
bool CanGetData(void) const
Check if it is safe to call GetData method.
bool IsStr(void) const
Check if variant Str is selected.
const TStr & GetStr(void) const
Get the variant data.
Definition: Object_id_.hpp:297
vector< CRef< CDbtag > > TDbxref
Definition: Seq_feat_.hpp:123
E_Choice Which(void) const
Which variant is currently selected.
const TData & GetData(void) const
Get the Data member data.
Definition: Seq_feat_.hpp:925
const TGene & GetGene(void) const
Get the variant data.
list< CRef< CVariantPlacement > > TPlacements
list< CRef< CUser_object > > TExt
const TAssembly & GetAssembly(void) const
Get the Assembly member data.
const TLoc & GetLoc(void) const
Get the Loc member data.
bool IsError(void) const
Check if variant Error is selected.
const TError & GetError(void) const
Get the variant data.
const TMessage & GetMessage(void) const
Get the Message member data.
const TTooltip_data & GetTooltip_data(void) const
Get the variant data.
bool IsTooltip_data(void) const
Check if variant Tooltip_data is selected.
USING_SCOPE(objects)
static void s_AddTopLevelGenomicLinks(bool &isFirstGenomicLocation, bool isMultiple, const string &sVariationID, const NSNPWebServices::TSNPSearchResultList &SNPSearchResultList, ITooltipFormatter *pFormatter)
SAnnotSelector –.
Modified on Fri Dec 08 08:22:20 2023 by modify_doxy.py rev. 669887