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

Go to the SVN repository for this file.

1 /* $Id: Seq_feat.cpp 97464 2022-07-20 12:28:40Z grichenk $
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: .......
27  *
28  * File Description:
29  * .......
30  *
31  * Remark:
32  * This code was originally generated by application DATATOOL
33  * using specifications from the ASN data definition file
34  * 'seqfeat.asn'.
35  */
36 
37 // generated includes
38 #include <ncbi_pch.hpp>
45 #include <vector>
46 
47 
49 
50 BEGIN_objects_SCOPE // namespace ncbi::objects::
51 
52 
53 // destructor
55 {
56 }
57 
58 
60 
61 
62 static int s_TypeOrder[] = {
63  3, // e_not_set = 0,
64  0, // e_Gene,
65  3, // e_Org,
66  2, // e_Cdregion,
67  3, // e_Prot,
68  1, // e_Rna,
69  3 // e_Pub, and the rest
70 };
71 
72 
73 static inline
74 bool s_IsOperon(const CSeqFeatData& fd)
75 {
76  return fd.Which() == CSeqFeatData::e_Imp &&
78 }
79 
80 
81 static inline
83 {
84  CCdregion::EFrame frame = fd.GetCdregion().GetFrame();
85  if ( frame == CCdregion::eFrame_not_set ) {
86  frame = CCdregion::eFrame_one;
87  }
88  return frame;
89 }
90 
91 
93 
94 
96 {
97  return s_TypeOrder[min(size_t(type),
98  sizeof(s_TypeOrder)/sizeof(s_TypeOrder[0])-1)];
99 }
100 
101 
102 // Corresponds to SortFeatItemListByPos from the C toolkit
104  const CSeq_loc& loc1,
105  const CSeq_loc& loc2) const
106 {
107  const CSeqFeatData& data1 = GetData();
108  const CSeqFeatData& data2 = f2.GetData();
109  CSeqFeatData::E_Choice type1 = data1.Which();
110  CSeqFeatData::E_Choice type2 = data2.Which();
111 
112  // operon first
113  if ( int diff = s_IsOperon(data2) - s_IsOperon(data1) ) {
114  return diff;
115  }
116  if ( type1 != type2 ) {
117  // order by feature type
118  int order1 = GetTypeSortingOrder(type1);
119  int order2 = GetTypeSortingOrder(type2);
120  int diff = order1 - order2;
121  if ( diff != 0 )
122  return diff;
123  }
124 
125  // minus strand last
126  ENa_strand strand1 = loc1.GetStrand();
127  ENa_strand strand2 = loc2.GetStrand();
128  if ( int diff = IsReverse(strand1) - IsReverse(strand2) ) {
129  return diff;
130  }
131 
132  if ( int diff = loc1.CompareSubLoc(loc2, strand1) ) {
133  return diff;
134  }
135 
136  {{ // compare subtypes
137  CSeqFeatData::ESubtype subtype1 = data1.GetSubtype();
138  CSeqFeatData::ESubtype subtype2 = data2.GetSubtype();
139  int diff = subtype1 - subtype2;
140  if ( diff != 0 )
141  return diff;
142  }}
143 
144  // subtypes are equal, types must be equal too
145  _ASSERT(type1 == type2);
146 
147  // type dependent comparison
148  if ( type1 == CSeqFeatData::e_Cdregion ) {
149  // compare frames of identical CDS ranges
150  if ( int diff = s_GetCdregionOrder(data1)-s_GetCdregionOrder(data2) ) {
151  return diff;
152  }
153  }
154  else if ( type1 == CSeqFeatData::e_Imp ) {
155  // compare labels of imp features
156  int diff = NStr::CompareNocase(data1.GetImp().GetKey(),
157  data2.GetImp().GetKey());
158  if ( diff != 0 )
159  return diff;
160  }
161 
162  // XXX - should compare parent seq-annots
163  // XXX 1. parent Seq-annot idx.itemID
164  // XXX 2. features itemID
165 
166  return 0; // unknown
167 }
168 
169 
171 {
172  int diff = Compare(f2);
173  if (diff) return diff;
174  stringstream s1, s2;
175  s1 << MSerial_AsnText << *this;
176  s2 << MSerial_AsnText << f2;
177  return s1.str().compare(s2.str());
178 }
179 
180 
182 
183 {
184  ITERATE(CSeq_feat::TXref, it, GetXref ()) {
185  if ((*it)->IsSetData () && (*it)->GetData ().IsGene ()) {
186  return &((*it)->GetData ().GetGene ());
187  }
188  }
189  return 0;
190 }
191 
193 
194 {
195  TXref& xref = SetXref();
197  CSeqFeatXref& ref = **it;
198  if (ref.IsSetData() && ref.GetData().IsGene()) {
199  ref.SetData().SetGene(value);
200  return;
201  }
202  }
204  xref.push_back(gref);
205  gref->SetData().SetGene(value);
206 }
207 
209 {
210  TXref& xref = SetXref();
212  CSeqFeatXref& ref = **it;
213  if (ref.IsSetData() && ref.GetData().IsGene()) {
214  return ref.SetData().SetGene();
215  }
216  }
218  xref.push_back(gref);
219  return gref->SetData().SetGene();
220 }
221 
223 
224 {
225  ITERATE(CSeq_feat::TXref, it, GetXref ()) {
226  if ((*it)->IsSetData () && (*it)->GetData ().IsProt ()) {
227  return &((*it)->GetData ().GetProt ());
228  }
229  }
230  return 0;
231 }
232 
234 
235 {
236  TXref& xref = SetXref();
238  CSeqFeatXref& ref = **it;
239  if (ref.IsSetData() && ref.GetData().IsProt()) {
240  ref.SetData().SetProt(value);
241  return;
242  }
243  }
245  xref.push_back(pref);
246  pref->SetData().SetProt(value);
247 }
248 
250 
251 {
252  TXref& xref = SetXref();
254  CSeqFeatXref& ref = **it;
255  if (ref.IsSetData() && ref.GetData().IsProt()) {
256  return ref.SetData().SetProt();
257  }
258  }
260  xref.push_back(pref);
261  return pref->SetData().SetProt();
262 }
263 
264 
266 {
267  if (!IsSetXref()) {
268  return false;
269  }
270  ITERATE(CSeq_feat::TXref, xit, GetXref()) {
271  if ((*xit)->IsSetId() && (*xit)->GetId().Equals(id)) {
272  return true;
273  }
274  }
275  return false;
276 }
277 
278 
280 {
281  if (HasSeqFeatXref(id)) {
282  return false;
283  }
285  x1->SetId().Assign(id);
286  SetXref().push_back(x1);
287  return true;
288 }
289 
290 
291 void CSeq_feat::AddQualifier(const string& qual_name, const string& qual_val)
292 {
293  CRef<CGb_qual> qual(new CGb_qual());
294  qual->SetQual(qual_name);
295  qual->SetVal(qual_val);
296  SetQual().push_back(qual);
297 }
298 
300  const string& qual_name, const string& qual_val)
301 {
302  if (IsSetQual()) {
303  NON_CONST_ITERATE (TQual, iter, SetQual()) {
304  if ( (*iter)->GetQual() == qual_name ) {
305  (*iter)->SetVal(qual_val);
306  return;
307  }
308  }
309  }
310 
311  // we didn't find an already-existing qual, so we add it
312  AddQualifier(qual_name, qual_val);
313 }
314 
315 void CSeq_feat::RemoveQualifier(const string& qual_name)
316 {
317  // qual is a vector so we have to be careful; carelessly
318  // removing all quals that match as we find them
319  // is a potentially quadratic-time operation.
320  // Instead we construct a new qual vector and do a swap (swap should
321  // be a constant-time operation)
322 
323  if( ! IsSetQual() ) {
324  return;
325  }
326 
327  TQual new_qual_vec;
328  new_qual_vec.reserve(GetQual().size());
329 
330  ITERATE (TQual, iter, GetQual()) {
331  if ( (*iter)->GetQual() != qual_name ) {
332  new_qual_vec.push_back(*iter);
333  }
334  }
335 
336  if( new_qual_vec.size() != GetQual().size() ) {
337  // swap should be a constant-time operation
338  if ( new_qual_vec.empty() ) {
339  ResetQual();
340  }
341  else {
342  SetQual().swap(new_qual_vec);
343  }
344  }
345 }
346 
347 void CSeq_feat::AddDbxref(const string& db, const string& tag)
348 {
349  CRef<CDbtag> dbtag(new CDbtag());
350  dbtag->SetDb(db);
351  dbtag->SetTag().SetStr(tag);
352  SetDbxref().push_back(dbtag);
353 }
354 
355 
356 void CSeq_feat::AddDbxref(const string& db, int tag)
357 {
358  CRef<CDbtag> dbtag(new CDbtag());
359  dbtag->SetDb(db);
360  dbtag->SetTag().SetId(tag);
361  SetDbxref().push_back(dbtag);
362 }
363 
364 void CSeq_feat::AddExceptText(const string & exception_text)
365 {
366  // always set this
367  SetExcept(true);
368 
369  if( ! IsSetExcept_text() ) {
370  SetExcept_text(exception_text);
371  return;
372  }
373 
374  if( HasExceptionText(exception_text) ) {
375  // nothing to do; it already has it
376  return;
377  }
378 
379  string & sCurrentExceptTextContents = SetExcept_text();
380  if( ! sCurrentExceptTextContents.empty() ) {
381  sCurrentExceptTextContents += ", ";
382  }
383  sCurrentExceptTextContents += NStr::TruncateSpaces(exception_text);
384 }
385 
386 void CSeq_feat::RemoveExceptText(const string & exception_text)
387 {
388  if( ! IsSetExcept() || ! GetExcept() || ! IsSetExcept_text() ) {
389  return;
390  }
391 
392  list<CTempString> list_of_except_texts;
393  NStr::Split(GetExcept_text(), ",", list_of_except_texts, NStr::fSplit_Tokenize);
394 
395  // remove occurrences of exception_text (case-insensitive)
396  string new_except_texts; // build answer in this variable
397  ITERATE(list<CTempString>, text_it, list_of_except_texts) {
398  if( ! NStr::EqualNocase(*text_it, exception_text) ) {
399  if( ! new_except_texts.empty() ) {
400  new_except_texts += ", ";
401  }
402  new_except_texts += NStr::TruncateSpaces_Unsafe(*text_it);
403  }
404  }
405 
406  // no exceptions left, so erase
407  if( new_except_texts.empty() ) {
408  ResetExcept();
409  }
410 
411  // swap faster than assignment
412  SetExcept_text().swap(new_except_texts);
413 }
414 
416 {
417  if (IsSetDbxref()) {
418  ITERATE (TDbxref, iter, GetDbxref()) {
419  if ( (*iter)->GetDb() == db) {
420  return *iter;
421  }
422  }
423  }
424 
425  return CConstRef<CDbtag>();
426 }
427 
428 
429 const string& CSeq_feat::GetNamedQual(const CTempString& qual_name) const
430 {
431  if (IsSetQual()) {
432  ITERATE (TQual, iter, GetQual()) {
433  if ( (*iter)->GetQual() == qual_name && (*iter)->IsSetVal()) {
434  return (*iter)->GetVal();
435  }
436  }
437  }
438 
439  return kEmptyStr;
440 }
441 
444 {
446 
447  if( ! IsSetExcept() || ! GetExcept() || ! IsSetExcept_text() )
448  {
449  return pAnswerSet; // empty set
450  }
451 
452  const string & raw_exception_texts = GetExcept_text();
453 
454  vector<CTempStringEx> exception_parts;
455  NStr::Split(raw_exception_texts, ",", exception_parts, NStr::fSplit_Tokenize);
456 
457  ITERATE( vector<CTempStringEx>, part_it, exception_parts ) {
458  pAnswerSet->insert( NStr::TruncateSpaces_Unsafe(*part_it) );
459  }
460 
461  return pAnswerSet;
462 }
463 
464 bool CSeq_feat::HasExceptionText(const string & exception_text ) const
465 {
466  CTempString sCleanedInputText =
467  NStr::TruncateSpaces_Unsafe(exception_text);
468 
469  if( sCleanedInputText.empty() ) {
470  // it's preferable for the caller not to give us an
471  // empty string, but... just in ycase
472  return false;
473  }
474 
475  AutoPtr<TExceptionTextSet> p_exception_text_set = GetTempExceptionTextSet();
476 
477  // is it in the set?
478  return ( p_exception_text_set->find(sCleanedInputText) !=
479  p_exception_text_set->end() );
480 }
481 
482 
483 // second element in pair indicates whether exception text is
484 // permitted only for RefSeq records
487  { "16S ribosomal RNA and 23S ribosomal RNA overlap", true },
488  { "16S ribosomal RNA and 5S ribosomal RNA overlap", true },
489  { "23S ribosomal RNA and 16S ribosomal RNA overlap", true },
490  { "23S ribosomal RNA and 5S ribosomal RNA overlap", true },
491  { "5S ribosomal RNA and 16S ribosomal RNA overlap", true },
492  { "5S ribosomal RNA and 23S ribosomal RNA overlap", true },
493  { "adjusted for low-quality genome", true },
494  { "alternative processing", false },
495  { "alternative start codon", false },
496  { "annotated by transcript or proteomic data", false },
497  { "artificial frameshift", false },
498  { "artificial location", false },
499  { "circular RNA", false },
500  { "dicistronic gene", false },
501  { "gene split at contig boundary", false },
502  { "gene split at sequence boundary", false },
503  { "genetic code exception", false },
504  { "heterogeneous population sequenced", false },
505  { "low-quality sequence region", false },
506  { "mismatches in transcription", true },
507  { "mismatches in translation", true },
508  { "modified codon recognition", false },
509  { "nonconsensus splice site", false },
510  { "rearrangement required for product", false },
511  { "reasons given in citation", false },
512  { "ribosomal slippage", false },
513  { "RNA editing", false },
514  { "trans-splicing", false },
515  { "transcribed product replaced", false },
516  { "transcribed pseudogene", false },
517  { "translated product replaced", false },
518  { "translation initiation by tRNA-Leu at CUG codon", true },
519  { "unclassified transcription discrepancy", true },
520  { "unclassified translation discrepancy", true },
521  { "unextendable partial coding region", false }
522 };
525 
526 vector<string> CSeq_feat::GetListOfLegalExceptions(bool include_refseq)
527 {
528  vector<string> exception_list;
529 
530  TExceptionPairMap::const_iterator it = sc_ExceptionPairMap.begin();
531  while (it != sc_ExceptionPairMap.end()) {
532  if (include_refseq || !it->second) {
533  exception_list.push_back(it->first);
534  }
535  ++it;
536  }
537 
538  return exception_list;
539 }
540 
541 
542 bool CSeq_feat::IsExceptionTextInLegalList(const string& exception_text, bool allow_refseq)
543 {
544  TExceptionPairMap::const_iterator it = sc_ExceptionPairMap.find(exception_text.c_str());
545  if (it != sc_ExceptionPairMap.end() && (allow_refseq || !it->second)) {
546  return true;
547  } else {
548  return false;
549  }
550 }
551 
552 
553 bool CSeq_feat::IsExceptionTextRefSeqOnly(const string& exception_text)
554 {
555  TExceptionPairMap::const_iterator it = sc_ExceptionPairMap.find(exception_text.c_str());
556  if (it == sc_ExceptionPairMap.end()) {
557  return false;
558  } else {
559  return it->second;
560  }
561 }
562 
563 
564 CConstRef<CUser_object> CSeq_feat::FindExt(const string& ext_type) const
565 {
567  if ( IsSetExts() ) {
568  ITERATE(TExts, it, GetExts()) {
569  const CObject_id& obj_type = (*it)->GetType();
570  if ( obj_type.IsStr() && obj_type.GetStr() == ext_type ) {
571  ret.Reset(it->GetPointer());
572  break;
573  }
574  }
575  }
576  if ( !ret && IsSetExt()) {
577  if (GetExt().GetType().IsStr()) {
578  if (GetExt().GetType().GetStr() == ext_type) {
579  ret.Reset(&GetExt());
580  }
581  else if (GetExt().GetType().GetStr() == "CombinedFeatureUserObjects") {
582  ITERATE (TExt::TData, it, GetExt().GetData()) {
583  const CUser_field& f = **it;
584  if (f.GetData().IsObject() &&
585  f.GetData().GetObject().GetType().IsStr() &&
586  f.GetData().GetObject().GetType().GetStr() == ext_type) {
587  ret.Reset(&f.GetData().GetObject());
588  break;
589  }
590  }
591  }
592  }
593  }
594  return ret;
595 }
596 
597 CRef<CUser_object> CSeq_feat::FindExt(const string& ext_type)
598 {
599  CRef<CUser_object> ret;
600  if ( IsSetExts() ) {
602  const CObject_id& obj_type = (*it)->GetType();
603  if ( obj_type.IsStr() && obj_type.GetStr() == ext_type ) {
604  ret.Reset(it->GetPointer());
605  break;
606  }
607  }
608  }
609  if ( !ret && IsSetExt()) {
610  if (GetExt().GetType().IsStr()) {
611  if (GetExt().GetType().GetStr() == ext_type) {
612  ret.Reset(&SetExt());
613  }
614  else if (GetExt().GetType().GetStr() == "CombinedFeatureUserObjects") {
616  CUser_field& f = **it;
617  if (f.GetData().IsObject() &&
618  f.GetData().GetObject().GetType().IsStr() &&
619  f.GetData().GetObject().GetType().GetStr() == ext_type) {
620  ret.Reset(&f.SetData().SetObject());
621  break;
622  }
623  }
624  }
625  }
626  }
627  return ret;
628 }
629 
630 void
632 {
633  // ext must have type set
634  if( ! ext->IsSetType() || ! ext->GetType().IsStr()) {
635  NCBI_USER_THROW("Seq-feat Ext must have a type");
636  }
637 
638  // if requested, remove all previous ones, effectively simulating
639  // a replace function.
640  if( add_flags & fAddExt_ReplaceAll ) {
641  const string & ext_type = ext->GetType().GetStr();
642  RemoveExt(ext_type);
643  }
644 
645  SetExts().push_back(ext);
646 }
647 
648 void
649 CSeq_feat::RemoveExt(const string& ext_type)
650 {
651  if ( IsSetExts() ) {
652  TExts & exts = SetExts();
653  // Exts are list, so constant time removal per element
654  ERASE_ITERATE(TExts, it, exts) {
655  const CObject_id& obj_type = (*it)->GetType();
656  if ( obj_type.IsStr() && obj_type.GetStr() == ext_type ) {
657  exts.erase(it);
658  }
659  }
660  if( exts.empty() ) {
661  ResetExts();
662  }
663  }
664  if ( IsSetExt()) {
665  if (GetExt().GetType().IsStr()) {
666  if (GetExt().GetType().GetStr() == ext_type) {
667  ResetExt();
668  }
669  else if (GetExt().GetType().GetStr() == "CombinedFeatureUserObjects") {
670  // build new ext vector since cannot remove easily as
671  // we go along.
672  TExt::TData new_ext_data;
673  TExt::TData & curr_ext_data = SetExt().SetData();
674  NON_CONST_ITERATE (TExt::TData, it, curr_ext_data) {
675  CUser_field& f = **it;
676  if (f.GetData().IsObject() &&
677  f.GetData().GetObject().GetType().IsStr() &&
678  f.GetData().GetObject().GetType().GetStr() == ext_type) {
679  continue;
680  }
681  new_ext_data.push_back(*it);
682  }
683 
684  if( new_ext_data.empty() ) {
685  ResetExt();
686  } else if( new_ext_data.size() != curr_ext_data.size() ) {
687  // swap is constant time
688  new_ext_data.swap(curr_ext_data);
689  }
690  }
691  }
692  }
693 }
694 
695 
697 {
698 }
699 
700 END_objects_SCOPE // namespace ncbi::objects::
701 
703 
704 /* Original file checksum: lines: 61, chars: 1885, CRC32: 417ca6e0 */
bool IsReverse(ENa_strand s)
Definition: Na_strand.hpp:75
static int s_GetCdregionOrder(const CSeqFeatData &fd)
Definition: Seq_feat.cpp:82
DEFINE_STATIC_ARRAY_MAP(TExceptionPairMap, sc_ExceptionPairMap, k_LegalExceptionMap)
BEGIN_LOCAL_NAMESPACE
Definition: Seq_feat.cpp:59
static int s_TypeOrder[]
Definition: Seq_feat.cpp:62
static bool s_IsOperon(const CSeqFeatData &fd)
Definition: Seq_feat.cpp:74
CStaticArrayMap< const char *, bool, PNocase_CStr > TExceptionPairMap
Definition: Seq_feat.cpp:523
SStaticPair< const char *, bool > TExceptionPairElem
Definition: Seq_feat.cpp:485
END_LOCAL_NAMESPACE
Definition: Seq_feat.cpp:92
static const TExceptionPairElem k_LegalExceptionMap[]
Definition: Seq_feat.cpp:486
AutoPtr –.
Definition: ncbimisc.hpp:401
Definition: Dbtag.hpp:53
CFeat_id –.
Definition: Feat_id.hpp:66
@Gb_qual.hpp User-defined methods of the data storage class.
Definition: Gb_qual.hpp:61
CRef –.
Definition: ncbiobj.hpp:618
ESubtype GetSubtype(void) const
CSeqFeatXref –.
Definition: SeqFeatXref.hpp:66
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
const string & GetNamedQual(const CTempString &qual_name) const
Return a named qualifier.
Definition: Seq_feat.cpp:429
int GetTypeSortingOrder(void) const
Return relative importance order of features by their type.
Definition: Seq_feat.hpp:249
void RemoveExceptText(const string &exception_text)
Remove all instances of the given exception text in this feature, and reset the except flag if there ...
Definition: Seq_feat.cpp:386
void AddExceptText(const string &exception_text)
Add the given exception_text and set the except flag to true.
Definition: Seq_feat.cpp:364
bool HasSeqFeatXref(const CSeqFeatXref::TId &id) const
Definition: Seq_feat.cpp:265
CProt_ref & SetProtXref(void)
Definition: Seq_feat.cpp:249
int CompareNonLocation(const CSeq_feat &f2, const CSeq_loc &loc1, const CSeq_loc &loc2) const
Compare relative order of this feature and feature f2 similarily to the Compare() method,...
Definition: Seq_feat.cpp:103
void RemoveExt(const string &ext_type)
Remove all Exts with the given type.
Definition: Seq_feat.cpp:649
CConstRef< CDbtag > GetNamedDbxref(const CTempString &db) const
Return a specified DB xref.
Definition: Seq_feat.cpp:415
int CompareStrict(const CSeq_feat &f2) const
Compare features more thoroughly than Compare() - return zero only if the features are identical,...
Definition: Seq_feat.cpp:170
CConstRef< CUser_object > FindExt(const string &ext_type) const
Find extension by type in exts container.
Definition: Seq_feat.cpp:564
CGene_ref & SetGeneXref(void)
Definition: Seq_feat.cpp:208
static vector< string > GetListOfLegalExceptions(bool include_refseq)
Produces the list of legal exceptions.
Definition: Seq_feat.cpp:526
int TAddExt
binary OR of EAddExt
Definition: Seq_feat.hpp:196
bool HasExceptionText(const string &exception_text) const
Returns whether or not the given exception_text is set for this feature.
Definition: Seq_feat.cpp:464
int Compare(const CSeq_feat &f2) const
Compare relative order of this feature and feature f2, ordering first by features' coordinates,...
Definition: Seq_feat.hpp:242
void AddOrReplaceQualifier(const string &qual_name, const string &qual_val)
Add a qualifier to this feature, or replace the value for the first one if it already exists.
Definition: Seq_feat.cpp:299
static bool IsExceptionTextInLegalList(const string &exception_text, bool allow_refseq)
Indicates whether this specific text occurs in the list of legal exceptions.
Definition: Seq_feat.cpp:542
void AddQualifier(const string &qual_name, const string &qual_val)
Add a qualifier to this feature.
Definition: Seq_feat.cpp:291
void RemoveQualifier(const string &qual_name)
Remove all qualifiers with the given name; do nothing if no such qualifier exists.
Definition: Seq_feat.cpp:315
@ fAddExt_ReplaceAll
Before adding, remove all previous.
Definition: Seq_feat.hpp:194
AutoPtr< TExceptionTextSet > GetTempExceptionTextSet(void) const
Returns a case-insensitive set of exception texts.
Definition: Seq_feat.cpp:443
const CGene_ref * GetGeneXref(void) const
See related function in util/feature.hpp.
Definition: Seq_feat.cpp:181
void AddDbxref(const string &db_name, const string &db_key)
add a DB xref to this feature
Definition: Seq_feat.cpp:347
void AddExt(CRef< CUser_object > ext, TAddExt add_flags=0)
Add an extension by type in exts container.
Definition: Seq_feat.cpp:631
bool AddSeqFeatXref(const CSeqFeatXref::TId &id)
Definition: Seq_feat.cpp:279
static bool IsExceptionTextRefSeqOnly(const string &exception_text)
Indicates whether this specific text is a RefSeq-only exception.
Definition: Seq_feat.cpp:553
~CSeq_feat(void)
destructor
Definition: Seq_feat.cpp:54
class CStaticArrayMap<> provides access to a static array in much the same way as CStaticArraySet<>,...
Definition: static_map.hpp:175
TBase::const_iterator const_iterator
Definition: static_map.hpp:179
CTempString implements a light-weight string on top of a storage buffer whose lifetime management is ...
Definition: tempstr.hpp:65
virtual ~ISeq_feat(void)
Definition: Seq_feat.cpp:696
Definition: set.hpp:45
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
Definition: ncbimisc.hpp:815
#define ERASE_ITERATE(Type, Var, Cont)
Non-constant version with ability to erase current element, if container permits.
Definition: ncbimisc.hpp:843
#define NON_CONST_ITERATE(Type, Var, Cont)
Non constant version of ITERATE macro.
Definition: ncbimisc.hpp:822
#define NCBI_USER_THROW(message)
Throw a quick-and-dirty runtime exception of type 'CException' with the given error message and error...
Definition: ncbiexpt.hpp:715
#define MSerial_AsnText
I/O stream manipulators –.
Definition: serialbase.hpp:696
ENa_strand GetStrand(void) const
Get the location's strand.
Definition: Seq_loc.cpp:882
int CompareSubLoc(const CSeq_loc &loc, ENa_strand strand, const ISubLocFilter *filter=NULL) const
Compare first-level sub-locations sequentially to order them by biological "complexity".
Definition: Seq_loc.cpp:805
void Reset(void)
Reset reference object.
Definition: ncbiobj.hpp:1439
void Reset(void)
Reset reference object.
Definition: ncbiobj.hpp:773
#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 CTempString TruncateSpaces_Unsafe(const CTempString str, ETrunc where=eTrunc_Both)
Truncate spaces in a string.
Definition: ncbistr.cpp:3191
#define kEmptyStr
Definition: ncbistr.hpp:123
static int CompareNocase(const CTempString s1, SIZE_TYPE pos, SIZE_TYPE n, const char *s2)
Case-insensitive compare of a substring with another string.
Definition: ncbistr.cpp:219
static list< string > & Split(const CTempString str, const CTempString delim, list< string > &arr, TSplitFlags flags=0, vector< SIZE_TYPE > *token_pos=NULL)
Split a string using specified delimiters.
Definition: ncbistr.cpp:3461
bool empty(void) const
Return true if the represented string is empty (i.e., the length is zero)
Definition: tempstr.hpp:334
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:5353
static string TruncateSpaces(const string &str, ETrunc where=eTrunc_Both)
Truncate spaces in a string.
Definition: ncbistr.cpp:3186
@ fSplit_Tokenize
All delimiters are merged and trimmed, to get non-empty tokens only.
Definition: ncbistr.hpp:2508
bool IsStr(void) const
Check if variant Str is selected.
Definition: Object_id_.hpp:291
bool IsSetType(void) const
type of object within class Check if a value has been assigned to Type data member.
void SetTag(TTag &value)
Assign a value to Tag data member.
Definition: Dbtag_.cpp:66
TData & SetData(void)
Assign a value to Data data member.
const TStr & GetStr(void) const
Get the variant data.
Definition: Object_id_.hpp:297
const TType & GetType(void) const
Get the Type member data.
void SetDb(const TDb &value)
Assign a value to Db data member.
Definition: Dbtag_.hpp:229
vector< CRef< CUser_field > > TData
TXref & SetXref(void)
Assign a value to Xref data member.
Definition: Seq_feat_.hpp:1314
void SetQual(const TQual &value)
Assign a value to Qual data member.
Definition: Gb_qual_.hpp:221
const TKey & GetKey(void) const
Get the Key member data.
Definition: Imp_feat_.hpp:259
vector< CRef< CDbtag > > TDbxref
Definition: Seq_feat_.hpp:123
TDbxref & SetDbxref(void)
Assign a value to Dbxref data member.
Definition: Seq_feat_.hpp:1339
void SetData(TData &value)
Assign a value to Data data member.
const TData & GetData(void) const
Get the Data member data.
bool IsSetQual(void) const
qualifiers Check if a value has been assigned to Qual data member.
Definition: Seq_feat_.hpp:1135
E_Choice Which(void) const
Which variant is currently selected.
const TExts & GetExts(void) const
Get the Exts member data.
Definition: Seq_feat_.hpp:1477
bool IsProt(void) const
Check if variant Prot is selected.
bool IsSetExt(void) const
user defined structure extension Check if a value has been assigned to Ext data member.
Definition: Seq_feat_.hpp:1207
TExcept & SetExcept(void)
Assign a value to Except data member.
Definition: Seq_feat_.hpp:1025
list< CRef< CUser_object > > TExts
Definition: Seq_feat_.hpp:127
void ResetExcept(void)
Reset Except data member.
Definition: Seq_feat_.hpp:1002
const TQual & GetQual(void) const
Get the Qual member data.
Definition: Seq_feat_.hpp:1147
bool IsSetXref(void) const
cite other relevant features Check if a value has been assigned to Xref data member.
Definition: Seq_feat_.hpp:1296
TExts & SetExts(void)
Assign a value to Exts data member.
Definition: Seq_feat_.hpp:1483
E_Choice
Choice variants.
TData & SetData(void)
Assign a value to Data data member.
Definition: Seq_feat_.hpp:934
void ResetExts(void)
Reset Exts data member.
Definition: Seq_feat_.cpp:206
bool IsGene(void) const
Check if variant Gene is selected.
TFrame GetFrame(void) const
Get the Frame member data.
Definition: Cdregion_.hpp:534
const TData & GetData(void) const
Get the Data member data.
Definition: Seq_feat_.hpp:925
bool IsSetData(void) const
the specific data Check if a value has been assigned to Data data member.
bool IsSetExcept(void) const
something funny about this? Check if a value has been assigned to Except data member.
Definition: Seq_feat_.hpp:990
const TExcept_text & GetExcept_text(void) const
Get the Except_text member data.
Definition: Seq_feat_.hpp:1405
bool IsSetExcept_text(void) const
explain if except=TRUE Check if a value has been assigned to Except_text data member.
Definition: Seq_feat_.hpp:1393
const TDbxref & GetDbxref(void) const
Get the Dbxref member data.
Definition: Seq_feat_.hpp:1333
const TCdregion & GetCdregion(void) const
Get the variant data.
void ResetExt(void)
Reset Ext data member.
Definition: Seq_feat_.cpp:148
void SetVal(const TVal &value)
Assign a value to Val data member.
Definition: Gb_qual_.hpp:268
bool IsSetExts(void) const
set of extensions; will replace 'ext' field Check if a value has been assigned to Exts data member.
Definition: Seq_feat_.hpp:1465
TExt & SetExt(void)
Assign a value to Ext data member.
Definition: Seq_feat_.cpp:158
TExcept GetExcept(void) const
Get the Except member data.
Definition: Seq_feat_.hpp:1009
const TXref & GetXref(void) const
Get the Xref member data.
Definition: Seq_feat_.hpp:1308
vector< CRef< CSeqFeatXref > > TXref
Definition: Seq_feat_.hpp:122
vector< CRef< CGb_qual > > TQual
Definition: Seq_feat_.hpp:117
bool IsSetDbxref(void) const
support for xref to other databases Check if a value has been assigned to Dbxref data member.
Definition: Seq_feat_.hpp:1321
TQual & SetQual(void)
Assign a value to Qual data member.
Definition: Seq_feat_.hpp:1153
const TExt & GetExt(void) const
Get the Ext member data.
Definition: Seq_feat_.hpp:1219
TExcept_text & SetExcept_text(void)
Assign a value to Except_text data member.
Definition: Seq_feat_.hpp:1428
void ResetQual(void)
Reset Qual data member.
Definition: Seq_feat_.cpp:136
const TImp & GetImp(void) const
Get the variant data.
@ eFrame_not_set
not set, code uses one
Definition: Cdregion_.hpp:95
ENa_strand
strand of nucleic acid
Definition: Na_strand_.hpp:64
const struct ncbi::grid::netcache::search::fields::SIZE size
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
const char * tag
T min(T x_, T y_)
double f(double x_, const double &y_)
Definition: njn_root.hpp:188
Template structure SStaticPair is simlified replacement of STL pair<> Main reason of introducing this...
Definition: static_set.hpp:60
Definition: type.c:6
#define _ASSERT
Modified on Wed Apr 17 13:08:53 2024 by modify_doxy.py rev. 669887