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

Go to the SVN repository for this file.

1 /* $Id: sequence_set.cpp 97253 2022-06-29 17:35:29Z dzhang $
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: Paul Thiessen
27 *
28 * File Description:
29 * Classes to hold sets of sequences
30 *
31 * ===========================================================================
32 */
33 
34 #include <ncbi_pch.hpp>
35 #include <corelib/ncbistd.hpp>
36 #include <corelib/ncbistre.hpp>
37 #include <corelib/ncbistl.hpp>
38 #include <util/xregexp/regexp.hpp>
39 
45 #include <objects/seq/Seq_inst.hpp>
46 #include <objects/seq/Seq_data.hpp>
47 #include <objects/seq/NCBIeaa.hpp>
48 #include <objects/seq/IUPACaa.hpp>
50 #include <objects/seq/NCBI4na.hpp>
51 #include <objects/seq/NCBI8na.hpp>
52 #include <objects/seq/NCBI2na.hpp>
53 #include <objects/seq/IUPACna.hpp>
58 #include <objects/seq/Seqdesc.hpp>
62 
64 
65 #include "sequence_set.hpp"
66 #include "molecule.hpp"
67 #include "structure_set.hpp"
68 #include "cn3d_tools.hpp"
69 #include "molecule_identifier.hpp"
70 #include "messenger.hpp"
71 #include "chemical_graph.hpp"
72 
75 
76 
77 BEGIN_SCOPE(Cn3D)
78 
79 static void UnpackSeqSet(CBioseq_set& bss, SequenceSet *parent, SequenceSet::SequenceList& seqlist)
80 {
81  CBioseq_set::TSeq_set::iterator q, qe = bss.SetSeq_set().end();
82  for (q=bss.SetSeq_set().begin(); q!=qe; ++q) {
83  if (q->GetObject().IsSeq()) {
84 
85  // only store amino acid or nucleotide sequences
86  if (q->GetObject().GetSeq().GetInst().GetMol() != CSeq_inst::eMol_aa &&
87  q->GetObject().GetSeq().GetInst().GetMol() != CSeq_inst::eMol_dna &&
88  q->GetObject().GetSeq().GetInst().GetMol() != CSeq_inst::eMol_rna &&
89  q->GetObject().GetSeq().GetInst().GetMol() != CSeq_inst::eMol_na)
90  continue;
91 
92  const Sequence *sequence = new Sequence(parent, q->GetObject().SetSeq());
93  if (!sequence || !sequence->identifier)
94  FATALMSG("Can't create Sequence object, aborting...");
95  seqlist.push_back(sequence);
96 
97  } else { // Bioseq-set
98  UnpackSeqSet(q->GetObject().SetSet(), parent, seqlist);
99  }
100  }
101 }
102 
103 static void UnpackSeqEntry(CSeq_entry& seqEntry, SequenceSet *parent, SequenceSet::SequenceList& seqlist)
104 {
105  if (seqEntry.IsSeq()) {
106  const Sequence *sequence = new Sequence(parent, seqEntry.SetSeq());
107  if (!sequence || !sequence->identifier)
108  FATALMSG("Can't create Sequence object, aborting...");
109  seqlist.push_back(sequence);
110  } else { // Bioseq-set
111  UnpackSeqSet(seqEntry.SetSet(), parent, seqlist);
112  }
113 }
114 
116  StructureBase(parent)
117 {
118  SeqEntryList::iterator s, se = seqEntries.end();
119  for (s=seqEntries.begin(); s!=se; ++s)
120  UnpackSeqEntry(s->GetObject(), this, sequences);
121  TRACEMSG("number of sequences: " << sequences.size());
122 }
123 
124 const Sequence * SequenceSet::FindMatchingSequence(const ncbi::objects::CBioseq::TId& ids) const
125 {
126  SequenceList::const_iterator s, se = sequences.end();
127  for (s=sequences.begin(); s!=se; ++s) {
128  CBioseq::TId::const_iterator i, ie = ids.end();
129  for (i=ids.begin(); i!=ie; ++i)
130  if ((*s)->identifier->MatchesSeqId(**i))
131  return *s;
132  }
133  return NULL;
134 }
135 
136 #define FIRSTOF2(byte) (((byte) & 0xF0) >> 4)
137 #define SECONDOF2(byte) ((byte) & 0x0F)
138 
139 static void StringFrom4na(const vector< char >& vec, string *str, bool isDNA)
140 {
141  if (SECONDOF2(vec.back()) > 0)
142  str->resize(vec.size() * 2);
143  else
144  str->resize(vec.size() * 2 - 1);
145 
146  // first, extract 4-bit values
147  unsigned int i;
148  for (i=0; i<vec.size(); ++i) {
149  str->at(2*i) = FIRSTOF2(vec[i]);
150  if (SECONDOF2(vec[i]) > 0) str->at(2*i + 1) = SECONDOF2(vec[i]);
151  }
152 
153  // then convert 4-bit values to ascii characters
154  for (i=0; i<str->size(); ++i) {
155  switch (str->at(i)) {
156  case 1: str->at(i) = 'A'; break;
157  case 2: str->at(i) = 'C'; break;
158  case 4: str->at(i) = 'G'; break;
159  case 8: isDNA ? str->at(i) = 'T' : str->at(i) = 'U'; break;
160  default:
161  str->at(i) = 'X';
162  }
163  }
164 }
165 
166 #define FIRSTOF4(byte) (((byte) & 0xC0) >> 6)
167 #define SECONDOF4(byte) (((byte) & 0x30) >> 4)
168 #define THIRDOF4(byte) (((byte) & 0x0C) >> 2)
169 #define FOURTHOF4(byte) ((byte) & 0x03)
170 
171 static void StringFrom2na(const vector< char >& vec, string *str, bool isDNA)
172 {
173  str->resize(vec.size() * 4);
174 
175  // first, extract 4-bit values
176  unsigned int i;
177  for (i=0; i<vec.size(); ++i) {
178  str->at(4*i) = FIRSTOF4(vec[i]);
179  str->at(4*i + 1) = SECONDOF4(vec[i]);
180  str->at(4*i + 2) = THIRDOF4(vec[i]);
181  str->at(4*i + 3) = FOURTHOF4(vec[i]);
182  }
183 
184  // then convert 4-bit values to ascii characters
185  for (i=0; i<str->size(); ++i) {
186  switch (str->at(i)) {
187  case 0: str->at(i) = 'A'; break;
188  case 1: str->at(i) = 'C'; break;
189  case 2: str->at(i) = 'G'; break;
190  case 3: isDNA ? str->at(i) = 'T' : str->at(i) = 'U'; break;
191  }
192  }
193 }
194 
195 static void StringFromStdaa(const vector < char >& vec, string *str)
196 {
197  str->resize(vec.size());
198  for (unsigned int i=0; i<vec.size(); ++i)
200 }
201 
202 Sequence::Sequence(SequenceSet *parent, ncbi::objects::CBioseq& bioseq) :
203  StructureBase(parent), bioseqASN(&bioseq), identifier(NULL), molecule(NULL), isProtein(false)
204 {
205  if (bioseq.IsSetDescr()) {
206  string defline, taxid;
207  CSeq_descr::Tdata::const_iterator d, de = bioseq.GetDescr().Get().end();
208  for (d=bioseq.GetDescr().Get().begin(); d!=de; ++d) {
209 
210  // get "defline" from title or compound
211  if ((*d)->IsTitle()) { // prefer title over compound
212  defline = (*d)->GetTitle();
213  } else if (defline.size() == 0 && (*d)->IsPdb() && (*d)->GetPdb().GetCompound().size() > 0) {
214  defline = (*d)->GetPdb().GetCompound().front();
215  }
216 
217  // get taxonomy
218  if ((*d)->IsSource()) {
219  if ((*d)->GetSource().GetOrg().IsSetTaxname())
220  taxid = (*d)->GetSource().GetOrg().GetTaxname();
221  else if ((*d)->GetSource().GetOrg().IsSetCommon())
222  taxid = (*d)->GetSource().GetOrg().GetCommon();
223  }
224  }
225  if (taxid.size() > 0)
226  taxonomy = string("[") + taxid + ']';
227  if (defline.size() > 0) {
228  title = defline;
229  // remove taxonomy repeated at end of title
230  if (taxonomy.size() > 0 && NStr::EndsWith(title, taxonomy, NStr::eNocase))
231  title = title.substr(0, title.size() - taxonomy.size());
232  if (title[title.size() - 1] == ' ')
233  title = title.substr(0, title.size() - 1);
234  }
235  }
236 
237  // get link to MMDB id - mainly for CDD's where Biostrucs have to be loaded separately
239  if (bioseq.IsSetAnnot()) {
240  CBioseq::TAnnot::const_iterator a, ae = bioseq.GetAnnot().end();
241  for (a=bioseq.GetAnnot().begin(); a!=ae; ++a) {
242  if (a->GetObject().GetData().IsIds()) {
243  CSeq_annot::C_Data::TIds::const_iterator i, ie = a->GetObject().GetData().GetIds().end();
244  for (i=a->GetObject().GetData().GetIds().begin(); i!=ie; ++i) {
245  if (i->GetObject().IsGeneral() &&
246  i->GetObject().GetGeneral().GetDb() == "mmdb" &&
247  i->GetObject().GetGeneral().GetTag().IsId()) {
248  mmdbID = i->GetObject().GetGeneral().GetTag().GetId();
249  break;
250  }
251  }
252  if (i != ie) break;
253  }
254  }
255  }
256 
257  // get sequence string
258  if (bioseq.GetInst().GetRepr() == CSeq_inst::eRepr_raw && bioseq.GetInst().IsSetSeq_data()) {
259 
260  // protein formats
261  if (bioseq.GetInst().GetSeq_data().IsNcbieaa()) {
262  sequenceString = bioseq.GetInst().GetSeq_data().GetNcbieaa().Get();
263  isProtein = true;
264  } else if (bioseq.GetInst().GetSeq_data().IsIupacaa()) {
265  sequenceString = bioseq.GetInst().GetSeq_data().GetIupacaa().Get();
266  isProtein = true;
267  } else if (bioseq.GetInst().GetSeq_data().IsNcbistdaa()) {
268  StringFromStdaa(bioseq.GetInst().GetSeq_data().GetNcbistdaa().Get(), &sequenceString);
269  isProtein = true;
270  }
271 
272  // nucleotide formats
273  else if (bioseq.GetInst().GetSeq_data().IsIupacna()) {
274  sequenceString = bioseq.GetInst().GetSeq_data().GetIupacna().Get();
275  // convert 'T' to 'U' for RNA
276  if (bioseq.GetInst().GetMol() == CSeq_inst::eMol_rna) {
277  for (unsigned int i=0; i<sequenceString.size(); ++i) {
278  if (sequenceString[i] == 'T')
279  sequenceString[i] = 'U';
280  }
281  }
282  } else if (bioseq.GetInst().GetSeq_data().IsNcbi4na()) {
283  StringFrom4na(bioseq.GetInst().GetSeq_data().GetNcbi4na().Get(), &sequenceString,
284  (bioseq.GetInst().GetMol() == CSeq_inst::eMol_dna));
285  } else if (bioseq.GetInst().GetSeq_data().IsNcbi8na()) { // same repr. for non-X as 4na
286  StringFrom4na(bioseq.GetInst().GetSeq_data().GetNcbi8na().Get(), &sequenceString,
287  (bioseq.GetInst().GetMol() == CSeq_inst::eMol_dna));
288  } else if (bioseq.GetInst().GetSeq_data().IsNcbi2na()) {
289  StringFrom2na(bioseq.GetInst().GetSeq_data().GetNcbi2na().Get(), &sequenceString,
290  (bioseq.GetInst().GetMol() == CSeq_inst::eMol_dna));
291  if (bioseq.GetInst().IsSetLength() && bioseq.GetInst().GetLength() < sequenceString.length())
292  sequenceString.resize(bioseq.GetInst().GetLength());
293  }
294 
295  else {
296  ERRORMSG("Sequence::Sequence() - sequence " << bioseq.GetId().front()->GetSeqIdString()
297  << ": confused by sequence string format");
298  return;
299  }
300 
301  // check length
302  if (bioseq.GetInst().IsSetLength() && bioseq.GetInst().GetLength() != sequenceString.length()) {
303  ERRORMSG("Sequence::Sequence() - sequence string length mismatch");
304  return;
305  }
306 
307  // force uppercase
308  for (unsigned int i=0; i<sequenceString.length(); ++i)
309  sequenceString[i] = toupper((unsigned char) sequenceString[i]);
310 
311  } else {
312  ERRORMSG("Sequence::Sequence() - sequence " << bioseq.GetId().front()->GetSeqIdString() << ": confused by sequence representation");
313  return;
314  }
315 
316  // get identifier (may be NULL if there's a problem!)
317  identifier = MoleculeIdentifier::GetIdentifier(this, mmdbID, bioseq.GetId());
318 }
319 
320 string Sequence::GetDescription(void) const
321 {
322  string descr;
323  if (taxonomy.size() > 0)
324  descr = taxonomy;
325  if (title.size() > 0) {
326  if (descr.size() > 0)
327  descr += ' ';
328  descr += title;
329  } else if (molecule) {
330  const StructureObject *object;
331  if (molecule->GetParentOfType(&object)) {
332  if (object->graph->name.size() > 0) {
333  if (descr.size() > 0)
334  descr += ' ';
335  descr += object->graph->name;
336  }
337  }
338  }
339  return descr;
340 }
341 
342 void Sequence::AddMMDBAnnotTag(int mmdbID) const
343 {
344  CBioseq::TAnnot::const_iterator a, ae = bioseqASN->GetAnnot().end();
345  CSeq_annot::C_Data::TIds::const_iterator i, ie;
346  bool found = false;
347  for (a=bioseqASN->GetAnnot().begin(); a!=ae; ++a) {
348  if ((*a)->GetData().IsIds()) {
349  for (i=(*a)->GetData().GetIds().begin(), ie=(*a)->GetData().GetIds().end(); i!=ie; ++i) {
350  if ((*i)->IsGeneral() && (*i)->GetGeneral().GetDb() == "mmdb" &&
351  (*i)->GetGeneral().GetTag().IsId())
352  {
353  found = true;
354  TRACEMSG("mmdb link already present in sequence " << identifier->ToString());
355  if ((*i)->GetGeneral().GetTag().GetId() != mmdbID ||
357  identifier->mmdbID != mmdbID))
358  ERRORMSG("Sequence::AddMMDBAnnotTag() - mmdbID mismatch");
359  break;
360  }
361  }
362  }
363  if (found) break;
364  }
365  if (!found) {
366  CRef < CSeq_id > seqid(new CSeq_id());
367  seqid->SetGeneral().SetDb("mmdb");
368  seqid->SetGeneral().SetTag().SetId(mmdbID);
369  CRef < CSeq_annot > annot(new CSeq_annot());
370  annot->SetData().SetIds().push_back(seqid);
371  (const_cast<Sequence*>(this))->bioseqASN->SetAnnot().push_back(annot);
372  }
373 }
374 
376 {
377  CSeq_id *sid = new CSeq_id();
378  FillOutSeqId(sid);
379  return sid;
380 }
381 
382 void Sequence::FillOutSeqId(ncbi::objects::CSeq_id *sid) const
383 {
384  sid->Reset();
385  CBioseq::TId::const_iterator i, ie = bioseqASN->GetId().end();
386 
387  // use pdb id if present
388  for (i=bioseqASN->GetId().begin(); i!=ie; ++i) {
389  if ((*i)->IsPdb()) {
390  sid->Assign(**i);
391  return;
392  }
393  }
394 
395  // use gi if present
396  for (i=bioseqASN->GetId().begin(); i!=ie; ++i) {
397  if ((*i)->IsGi()) {
398  sid->Assign(**i);
399  return;
400  }
401  }
402 
403  // otherwise, just use the first one
404  if (bioseqASN->GetId().size() > 0)
405  sid->Assign(bioseqASN->GetId().front().GetObject());
406  else
407  ERRORMSG("Sequence::FillOutSeqId() - can't do Seq-id on sequence " << identifier->ToString());
408 
409  // dangerous to create new Seq-id's...
410 // if (identifier->pdbID.size() > 0 && identifier->pdbChain != MoleculeIdentifier::VALUE_NOT_SET) {
411 // sid->SetPdb().SetMol().Set(identifier->pdbID);
412 // if (identifier->pdbChain != ' ') sid->SetPdb().SetChain(identifier->pdbChain);
413 // } else if (identifier->gi != MoleculeIdentifier::GI_NOT_SET) { // use gi
414 // sid->SetGi(identifier->gi);
415 // } else if (identifier->accession.size() > 0) {
416 // CObject_id *oid = new CObject_id();
417 // oid->SetStr(identifier->accession);
418 // sid->SetLocal(*oid);
419 }
420 
422 {
423  if (molecule) {
424  const StructureObject *object;
425  if (!molecule->GetParentOfType(&object)) return identifier->mmdbID;
427  identifier->mmdbID != object->mmdbID)
428  ERRORMSG("Sequence::GetOrSetMMDBLink() - mismatched MMDB ID: identifier says "
429  << identifier->mmdbID << ", StructureObject says " << object->mmdbID);
430  else
431  const_cast<MoleculeIdentifier*>(identifier)->mmdbID = object->mmdbID;
432  }
433  return identifier->mmdbID;
434 }
435 
437 {
438  CNcbiOstrstream oss;
439  oss << "https://www.ncbi.nlm.nih.gov/" << (isProtein ? "protein" : "nuccore") << "/";
440  // prefer gi's, since accessions can be outdated
442  oss << identifier->gi;
443  } else if (identifier->pdbID.size() > 0) {
444  oss << identifier->pdbID.c_str();
445  if (identifier->pdbChain != " ")
446  oss << '_' << identifier->pdbChain.c_str();
447  } else {
448  string label = identifier->GetLabel();
449  if (label == "query" || label == "consensus")
450  return;
451  oss << label;
452  }
453  LaunchWebPage(((string) CNcbiOstrstreamToString(oss)).c_str());
454 }
455 
456 bool Sequence::HighlightPattern(const string& prositePattern, const MoleculeHighlightMap& restrictTo) const
457 {
458  bool retval = true;
459  try {
460 
461  // update CRegexp if not the same pattern as before
462  static unique_ptr < CRegexp > regexp;
463  static string previousPrositePattern;
464  static int nGroups;
465  if (!regexp.get() || prositePattern != previousPrositePattern) {
466 
467  // convert from ProSite syntax
468  string regexPattern;
469  if (!Prosite2Regex(prositePattern, &regexPattern, &nGroups))
470  throw "error converting ProSite to regex syntax";
471 
472  // create pattern buffer
473  TRACEMSG("creating CRegexp with pattern '" << regexPattern << "'");
474  regexp.reset(new CRegexp(regexPattern, CRegexp::fCompile_ungreedy));
475 
476  previousPrositePattern = prositePattern;
477  }
478 
479  // do the search, finding all non-overlapping matches
480  int i, start = 0;
481  while (start < (int)Length()) {
482 
483  // do the search
484  string ignore = regexp->GetMatch(sequenceString, start, 0, CRegexp::fMatch_default, true);
485  if (regexp->NumFound() <= 0)
486  break;
487 
488 // TRACEMSG("got match, num (sub)patterns: " << regexp->NumFound());
489 // for (i=0; i<regexp->NumFound(); ++i)
490 // TRACEMSG(" " << i << ": " << (regexp->GetResults(i)[0] + 1) << '-' << regexp->GetResults(i)[1]);
491 
492  // check to see if this entire match is within the restricted set
493  bool addMatch = true;
494  if (restrictTo.size() > 0) {
495  MoleculeHighlightMap::const_iterator r = restrictTo.find(identifier);
496  if (r != restrictTo.end()) {
497  for (i=1; i<regexp->NumFound(); ++i) {
498  for (int j=regexp->GetResults(i)[0]; j<=regexp->GetResults(i)[1]-1; ++j) {
499  if (!r->second[j]) {
500  addMatch = false;
501  break;
502  }
503  }
504  if (!addMatch)
505  break;
506  }
507  } else
508  addMatch = false;
509  }
510 
511  // parse the match subpatterns, highlight each subpattern range
512  if (addMatch)
513  for (i=1; i<regexp->NumFound(); ++i)
514  GlobalMessenger()->AddHighlights(this, regexp->GetResults(i)[0], regexp->GetResults(i)[1] - 1);
515 
516  // start next search after the end of this one
517  start = regexp->GetResults(regexp->NumFound() - 1)[1];
518  }
519 
520  } catch (const char *err) {
521  ERRORMSG("Sequence::HighlightPattern() - " << err);
522  retval = false;
523  } catch (exception& e) {
524  ERRORMSG("Sequence::HighlightPattern() - caught exception: " << e.what());
525  retval = false;
526  }
527 
528  return retval;
529 }
530 
531 END_SCOPE(Cn3D)
#define static
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
USING_SCOPE(objects)
static void StringFromStdaa(const vector< char > &vec, string *str)
static void UnpackSeqSet(CBioseq_set &bss, SequenceSet *parent, SequenceSet::SequenceList &seqlist)
static void StringFrom4na(const vector< char > &vec, string *str, bool isDNA)
static void UnpackSeqEntry(CSeq_entry &seqEntry, SequenceSet *parent, SequenceSet::SequenceList &seqlist)
#define FOURTHOF4(byte)
#define SECONDOF2(byte)
#define SECONDOF4(byte)
#define THIRDOF4(byte)
#define FIRSTOF4(byte)
static void StringFrom2na(const vector< char > &vec, string *str, bool isDNA)
USING_NCBI_SCOPE
#define FIRSTOF2(byte)
CNcbiOstrstreamToString class helps convert CNcbiOstrstream to a string Sample usage:
Definition: ncbistre.hpp:802
CRegexp –.
Definition: regexp.hpp:70
Definition: Seq_entry.hpp:56
std::string name
void AddHighlights(const Sequence *sequence, unsigned int seqIndexFrom, unsigned int seqIndexTo)
Definition: messenger.cpp:248
std::string GetLabel(void) const
static const int VALUE_NOT_SET
std::string ToString(void) const
static const MoleculeIdentifier * GetIdentifier(const Molecule *molecule, const SeqIdList &ids)
static const TGi GI_NOT_SET
std::list< ncbi::CRef< ncbi::objects::CSeq_entry > > SeqEntryList
std::list< ncbi::CRef< Sequence > > SequenceList
const Sequence * FindMatchingSequence(const ncbi::objects::CBioseq::TId &ids) const
SequenceSet(SeqEntryList &seqEntries)
SequenceList sequences
Definition: cav_seqset.hpp:73
void UnpackSeqEntry(const objects::CSeq_entry &seqEntry)
Definition: cav_seqset.cpp:99
void FillOutSeqId(ncbi::objects::CSeq_id *sid) const
bool isProtein
const Molecule * molecule
std::string GetDescription(void) const
std::string title
const MoleculeIdentifier * identifier
unsigned int Length(void) const
void AddMMDBAnnotTag(int mmdbID) const
string sequenceString
Definition: cav_seqset.hpp:93
void LaunchWebBrowserWithInfo(void) const
bool HighlightPattern(const std::string &pattern, const MoleculeHighlightMap &restrictTo) const
std::string taxonomy
Sequence(ncbi::objects::CBioseq &bioseq)
int GetOrSetMMDBLink(void) const
std::map< const MoleculeIdentifier *, std::vector< bool > > MoleculeHighlightMap
ncbi::objects::CSeq_id * CreateSeqId(void) const
CConstRef< objects::CBioseq > bioseqASN
Definition: cav_seqset.hpp:90
bool GetParentOfType(const T **ptr, bool warnIfNotFound=true) const
const ChemicalGraph * graph
void LaunchWebPage(const char *url)
Definition: cn3d_tools.cpp:432
#define TRACEMSG(stream)
Definition: cn3d_tools.hpp:83
#define FATALMSG(stream)
Definition: cn3d_tools.hpp:87
#define ERRORMSG(stream)
Definition: cn3d_tools.hpp:86
Include a standard set of the NCBI C++ Toolkit most basic headers.
bool Prosite2Regex(const std::string &prosite, std::string *regex, std::string *errString)
Definition: cuUtils.cpp:203
#define false
Definition: bool.h:36
static const char * str(char *buf, int n)
Definition: stats.c:84
string
Definition: cgiapp.hpp:687
#define NULL
Definition: ncbistd.hpp:225
TObjectType & GetObject(void) const
Get object.
Definition: ncbiobj.hpp:1697
@ fCompile_ungreedy
Definition: regexp.hpp:106
@ fMatch_default
Definition: regexp.hpp:127
#define END_SCOPE(ns)
End the previously defined scope.
Definition: ncbistl.hpp:75
#define BEGIN_SCOPE(ns)
Define a new scope.
Definition: ncbistl.hpp:72
static bool EndsWith(const CTempString str, const CTempString end, ECase use_case=eCase)
Check if a string ends with a specified suffix value.
Definition: ncbistr.hpp:5430
@ eNocase
Case insensitive compare.
Definition: ncbistr.hpp:1206
static const char label[]
void SetTag(TTag &value)
Assign a value to Tag data member.
Definition: Dbtag_.cpp:66
void SetDb(const TDb &value)
Assign a value to Db data member.
Definition: Dbtag_.hpp:229
TGeneral & SetGeneral(void)
Select the variant.
Definition: Seq_id_.cpp:375
TSet & SetSet(void)
Select the variant.
Definition: Seq_entry_.cpp:130
bool IsSeq(void) const
Check if variant Seq is selected.
Definition: Seq_entry_.hpp:257
TSeq & SetSeq(void)
Select the variant.
Definition: Seq_entry_.cpp:108
void SetData(TData &value)
Assign a value to Data data member.
Definition: Seq_annot_.cpp:244
@ eRepr_raw
continuous sequence
Definition: Seq_inst_.hpp:94
@ eMol_na
just a nucleic acid
Definition: Seq_inst_.hpp:113
int i
Messenger * GlobalMessenger(void)
Definition: messenger.cpp:73
unsigned int a
Definition: ncbi_localip.c:102
int toupper(Uchar c)
Definition: ncbictype.hpp:73
The NCBI C++/STL use hints.
NCBI C++ stream class wrappers for triggering between "new" and "old" C++ stream libraries.
double r(size_t dimension_, const Int4 *score_, const double *prob_, double theta_)
char LookupCharacterFromNCBIStdaaNumber(unsigned char n)
Definition: su_pssm.cpp:142
C++ wrappers for the Perl-compatible regular expression (PCRE) library.
Modified on Wed Apr 17 13:10:45 2024 by modify_doxy.py rev. 669887