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

Go to the SVN repository for this file.

1 /* $Id: seq_feat_handle.cpp 72299 2016-04-28 19:54:10Z vasilche $
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: Aleksey Grichenko, Eugene Vasilchenko
27 *
28 * File Description:
29 * Seq-feat handle
30 *
31 */
32 
33 
34 #include <ncbi_pch.hpp>
36 #include <objmgr/scope.hpp>
42 
44 
47 
50 
51 class CScope;
52 
53 /////////////////////////////////////////////////////////////////////////////
54 // CSeq_feat_Handle
55 
56 
58  TFeatIndex feat_index)
59  : m_Seq_annot(annot),
60  m_FeatIndex(feat_index)
61 {
62  _ASSERT(!IsTableSNP());
63  _ASSERT(!IsRemoved());
64  _ASSERT(x_GetAnnotObject_Info().IsFeat());
65 }
66 
67 
69  const SSNP_Info& snp_info,
70  CCreatedFeat_Ref& created_ref)
71  : m_Seq_annot(annot),
72  m_FeatIndex(TFeatIndex(annot.x_GetInfo().x_GetSNP_annot_Info().GetIndex(snp_info))
73  | kNoAnnotObjectInfo),
74  m_CreatedFeat(&created_ref)
75 {
77  _ASSERT(!IsRemoved());
78 }
79 
80 
82  CAnnotObject_Info* info)
83  : m_Seq_annot(scope.GetSeq_annotHandle
84  (*info->GetSeq_annot_Info().GetSeq_annotSkeleton())),
85  m_FeatIndex(info->GetAnnotIndex())
86 {
87 }
88 
89 
91 {
92 }
93 
94 
96 {
99  m_FeatIndex = 0;
100  m_Seq_annot.Reset();
101 }
102 
103 
105 {
107 }
108 
109 
111 {
112  return !x_HasAnnotObjectInfo() &&
114 }
115 
116 
118 {
119  return !x_HasAnnotObjectInfo() &&
121 }
122 
123 
125 {
126  return x_HasAnnotObjectInfo() &&
128 }
129 
130 
132 {
133  if ( x_HasAnnotObjectInfo() ) {
135  }
136  else {
138  }
139 }
140 
141 
143 {
144  if ( !x_HasAnnotObjectInfo() ) {
145  NCBI_THROW(CObjMgrException, eInvalidHandle,
146  "CSeq_feat_Handle::x_GetAnnotObject: not Seq-feat info");
147  }
149 }
150 
151 
153 {
155  if ( info.IsRemoved() ) {
156  NCBI_THROW(CObjMgrException, eInvalidHandle,
157  "CSeq_feat_Handle::x_GetAnnotObject_Info: "
158  "Seq-feat was removed");
159  }
160  return info;
161 }
162 
163 
165 {
166  if ( !IsTableSNP() ) {
167  NCBI_THROW(CObjMgrException, eInvalidHandle,
168  "CSeq_feat_Handle::GetSNP_Info: not SNP info");
169  }
171 }
172 
173 
175 {
176  const SSNP_Info& info = x_GetSNP_InfoAny();
177  if ( info.IsRemoved() ) {
178  NCBI_THROW(CObjMgrException, eInvalidHandle,
179  "CSeq_feat_Handle::GetSNP_Info: SNP was removed");
180  }
181  return info;
182 }
183 
184 
186 {
187  return x_GetAnnotObject_Info().GetFeat();
188 }
189 
190 
192 {
193  return ConstRef(&x_GetPlainSeq_feat());
194 }
195 
196 
198 {
199  if ( IsPlainFeat() ) {
200  return ConstRef(&x_GetPlainSeq_feat());
201  }
202  else {
203  return m_CreatedFeat->GetOriginalFeature(*this);
204  }
205 }
206 
207 
209 {
210  return GetOriginalSeq_feat();
211 }
212 
213 
215 {
216  if ( x_HasAnnotObjectInfo() ) {
217  return GetSeq_feat()->IsSetPartial();
218  }
219  else if ( IsTableSNP() ) {
220  // table SNP features do not have partial
221  return false;
222  }
223  else {
224  // TODO
225  return GetSeq_feat()->IsSetPartial();
226  }
227 }
228 
229 
231 {
232  if ( x_HasAnnotObjectInfo() ) {
233  return GetSeq_feat()->GetPartial();
234  }
235  else if ( IsTableSNP() ) {
236  // table SNP features do not have partial
237  return false;
238  }
239  else {
240  // TODO
241  return GetSeq_feat()->GetPartial();
242  }
243 }
244 
245 
247 {
248  return GetSeq_feat()->GetProduct();
249 }
250 
251 
253 {
254  return GetSeq_feat()->GetLocation();
255 }
256 
257 
259 {
260  if ( !*this ) {
261  return false;
262  }
263  if ( x_HasAnnotObjectInfo() ) {
264  return GetSeq_feat()->IsSetData();
265  }
266  else {
267  // SNP table or sorted Seq-table features have data
268  return true;
269  }
270 }
271 
272 
274 {
275  if ( x_HasAnnotObjectInfo() ) {
277  if ( const CSeq_id* id = loc->GetId() ) {
278  return CSeq_id_Handle::GetHandle(*id);
279  }
280  return CSeq_id_Handle();
281  }
282  else if ( IsTableSNP() ) {
284  }
285  else {
286  // TODO
288  if ( const CSeq_id* id = loc->GetId() ) {
289  return CSeq_id_Handle::GetHandle(*id);
290  }
291  return CSeq_id_Handle();
292  }
293 }
294 
295 
297 {
298  if ( x_HasAnnotObjectInfo() ) {
299  return GetSeq_feat()->GetLocation().GetTotalRange();
300  }
301  else if ( IsTableSNP() ) {
302  const SSNP_Info& info = x_GetSNP_Info();
303  return TRange(info.GetFrom(), info.GetTo());
304  }
305  else {
306  // TODO
307  return GetSeq_feat()->GetLocation().GetTotalRange();
308  }
309 }
310 
311 
313 {
314  if ( IsSetProduct() ) {
316  const CSeq_id* id = loc->GetId();
317  if ( id ) {
318  return CSeq_id_Handle::GetHandle(*id);
319  }
320  }
321  return CSeq_id_Handle();
322 }
323 
324 
326 {
327  if ( IsSetProduct() ) {
328  return GetProduct().GetTotalRange();
329  }
330  return TRange::GetEmpty();
331 }
332 
333 
335 {
336  return x_GetSNP_annot_Info().GetSeq_id();
337 }
338 
339 
341 {
342  return x_GetSNP_annot_Info().GetSeq_id().GetGi();
343 }
344 
345 
346 const string& CSeq_feat_Handle::GetSNPComment(void) const
347 {
348  return x_GetSNP_annot_Info().x_GetComment(x_GetSNP_Info().m_CommentIndex);
349 }
350 
351 
353 {
354  return x_GetSNP_Info().GetAllelesCount();
355 }
356 
357 
358 const string& CSeq_feat_Handle::GetSNPAllele(size_t index) const
359 {
360  return x_GetSNP_annot_Info().x_GetAllele(x_GetSNP_Info().GetAlleleStrIndex(index));
361 }
362 
363 
364 const string& CSeq_feat_Handle::GetSNPExtra(void) const
365 {
366  return x_GetSNP_annot_Info().x_GetExtra(x_GetSNP_Info().GetExtraIndex());
367 }
368 
369 
372 {
374 }
375 
376 
377 const string& CSeq_feat_Handle::GetSNPQualityCodeStr(void) const
378 {
379  return x_GetSNP_annot_Info()
380  .x_GetQualityCodesStr(x_GetSNP_Info().GetQualityCodesStrIndex());
381 }
382 
383 
384 void CSeq_feat_Handle::GetSNPQualityCodeOs(vector<char>& os) const
385 {
387  .x_GetQualityCodesOs(x_GetSNP_Info().GetQualityCodesOsIndex(), os);
388 }
389 
390 
392 {
393  if ( x_HasAnnotObjectInfo() ) {
395  }
396  else if ( IsTableSNP() ) {
397  return x_GetSNP_InfoAny().IsRemoved();
398  }
399  else {
400  return false;
401  }
402 }
403 
404 
405 void CSeq_feat_Handle::Remove(void) const
406 {
407  CSeq_feat_EditHandle(*this).Remove();
408 }
409 
410 
411 void CSeq_feat_Handle::Replace(const CSeq_feat& new_feat) const
412 {
413  CSeq_feat_EditHandle(*this).Replace(new_feat);
414 }
415 
416 
417 /////////////////////////////////////////////////////////////////////////////
418 // Methods redirected to corresponding Seq-feat object
419 /////////////////////////////////////////////////////////////////////////////
420 
422 {
423  if ( x_HasAnnotObjectInfo() ) {
425  }
426  else if ( IsTableSNP() ) {
427  return CSeqFeatData::e_Imp;
428  }
429  else {
431  }
432 }
433 
434 
436 {
437  if ( x_HasAnnotObjectInfo() ) {
439  }
440  else if ( IsTableSNP() ) {
442  }
443  else {
445  }
446 }
447 
448 
450 {
451  return GetSeq_feat()->GetGeneXref();
452 }
453 
454 
456 {
457  return GetSeq_feat()->GetProtXref();
458 }
459 
460 
462 {
463  return GetSeq_feat()->GetNamedDbxref(db);
464 }
465 
466 
467 const string& CSeq_feat_Handle::GetNamedQual(const CTempString& qual_name) const
468 {
469  return GetSeq_feat()->GetNamedQual(qual_name);
470 }
471 
472 
473 /////////////////////////////////////////////////////////////////////////////
474 // CSeq_feat_EditHandle
475 
476 
478  : CSeq_feat_Handle(h)
479 {
480  GetAnnot(); // force check of editing mode
481 }
482 
483 
485  TFeatIndex feat_index)
486  : CSeq_feat_Handle(annot, feat_index)
487 {
488 }
489 
490 
492  const SSNP_Info& snp_info,
493  CCreatedFeat_Ref& created_ref)
494  : CSeq_feat_Handle(annot, snp_info, created_ref)
495 {
496 }
497 
498 
500 {
502  CCommandProcessor processor(GetAnnot().x_GetScopeImpl());
503  processor.run(new TCommand(*this));
504 }
505 
506 
507 void CSeq_feat_EditHandle::Replace(const CSeq_feat& new_feat) const
508 {
510  CCommandProcessor processor(GetAnnot().x_GetScopeImpl());
511  processor.run(new TCommand(*this, new_feat));
512 }
513 
515 {
517 }
518 
520 {
521  if ( IsPlainFeat() ) {
523  _ASSERT(IsRemoved());
524  }
525  else {
526  NCBI_THROW(CObjMgrException, eNotImplemented,
527  "CSeq_feat_Handle::Remove: "
528  "handle is SNP table or Seq-table");
529  }
530 }
531 
532 
534 {
535  if ( IsRemoved() || IsPlainFeat() ) {
536  GetAnnot().x_GetInfo().Replace(x_GetFeatIndex(), new_feat);
537  _ASSERT(!IsRemoved());
538  }
539  else {
540  NCBI_THROW(CObjMgrException, eNotImplemented,
541  "CSeq_feat_Handle::Replace: "
542  "handle is SNP table or Seq-table");
543  }
544 }
545 
546 
548 {
549  const_cast<CSeq_feat&>(*GetSeq_feat()).SetGeneXref(value);
550  //Update(); no index information is changed by GeneXref
551 }
552 
553 
555 {
556  CGene_ref& ret = const_cast<CSeq_feat&>(*GetSeq_feat()).SetGeneXref();
557  //Update(); no index information is changed by GeneXref
558  return ret;
559 }
560 
561 
563 {
564  const_cast<CSeq_feat&>(*GetSeq_feat()).SetProtXref(value);
565  //Update(); no index information is changed by ProtXref
566 }
567 
568 
570 {
571  CProt_ref& ret = const_cast<CSeq_feat&>(*GetSeq_feat()).SetProtXref();
572  //Update(); no index information is changed by ProtXref
573  return ret;
574 }
575 
576 
577 void CSeq_feat_EditHandle::AddQualifier(const string& qual_name,
578  const string& qual_val)
579 {
580  const_cast<CSeq_feat&>(*GetSeq_feat()).AddQualifier(qual_name, qual_val);
581  //Update(); no index information is changed by qualifiers
582 }
583 
584 void CSeq_feat_EditHandle::RemoveQualifier(const string& qual_name)
585 {
586  const_cast<CSeq_feat&>(*GetSeq_feat()).RemoveQualifier(qual_name);
587  //Update(); no index information is changed by qualifiers
588 }
589 
590 
591 void CSeq_feat_EditHandle::AddDbxref(const string& db_name,
592  const string& db_key)
593 {
594  const_cast<CSeq_feat&>(*GetSeq_feat()).AddDbxref(db_name, db_key);
595  //Update(); no index information is changed by dbxref
596 }
597 
598 
599 void CSeq_feat_EditHandle::AddDbxref(const string& db_name, int db_key)
600 {
601  const_cast<CSeq_feat&>(*GetSeq_feat()).AddDbxref(db_name, db_key);
602  //Update(); no index information is changed by dbxref
603 }
604 
605 void CSeq_feat_EditHandle::AddExceptText(const string & exception_text)
606 {
607  const_cast<CSeq_feat&>(*GetSeq_feat()).AddExceptText(exception_text);
608  //Update(); no index information is changed by except_text
609 }
610 
611 void CSeq_feat_EditHandle::RemoveExceptText(const string & exception_text)
612 {
613  const_cast<CSeq_feat&>(*GetSeq_feat()).RemoveExceptText(exception_text);
614  //Update(); no index information is changed by except_text
615 }
616 
618 {
619  if ( !IsPlainFeat() ) {
620  NCBI_THROW(CObjMgrException, eInvalidHandle,
621  "CSeq_feat_EditHandle::AddFeatId: not plain Seq-feat");
622  }
624 }
625 
626 
628 {
629  CObject_id obj_id;
630  obj_id.SetId(id);
631  AddFeatId(obj_id);
632 }
633 
634 
635 void CSeq_feat_EditHandle::AddFeatId(const string& id)
636 {
637  CObject_id obj_id;
638  obj_id.SetStr(id);
639  AddFeatId(obj_id);
640 }
641 
642 
644 {
645  if ( !IsPlainFeat() ) {
646  NCBI_THROW(CObjMgrException, eInvalidHandle,
647  "CSeq_feat_EditHandle::AddFeatXref: not plain Seq-feat");
648  }
650 }
651 
652 
654 {
655  CObject_id obj_id;
656  obj_id.SetId(id);
657  AddFeatXref(obj_id);
658 }
659 
660 
661 void CSeq_feat_EditHandle::AddFeatXref(const string& id)
662 {
663  CObject_id obj_id;
664  obj_id.SetStr(id);
665  AddFeatXref(obj_id);
666 }
667 
668 
670 {
671  if ( !IsPlainFeat() ) {
672  NCBI_THROW(CObjMgrException, eInvalidHandle,
673  "CSeq_feat_EditHandle::RemoveFeatId: not plain Seq-feat");
674  }
676 }
677 
678 
680 {
681  CObject_id obj_id;
682  obj_id.SetId(id);
683  RemoveFeatId(obj_id);
684 }
685 
686 
688 {
689  CObject_id obj_id;
690  obj_id.SetStr(id);
691  RemoveFeatId(obj_id);
692 }
693 
694 
696 {
697  if ( !IsPlainFeat() ) {
698  NCBI_THROW(CObjMgrException, eInvalidHandle,
699  "CSeq_feat_EditHandle::RemoveFeatXref: not plain Seq-feat");
700  }
702 }
703 
704 
706 {
707  CObject_id obj_id;
708  obj_id.SetId(id);
709  RemoveFeatXref(obj_id);
710 }
711 
712 
714 {
715  CObject_id obj_id;
716  obj_id.SetStr(id);
717  RemoveFeatXref(obj_id);
718 }
719 
720 
722 {
723  if ( !IsPlainFeat() ) {
724  NCBI_THROW(CObjMgrException, eInvalidHandle,
725  "CSeq_feat_EditHandle::ClearFeatIds: not plain Seq-feat");
726  }
728 }
729 
730 
732 {
733  if ( !IsPlainFeat() ) {
734  NCBI_THROW(CObjMgrException, eInvalidHandle,
735  "CSeq_feat_EditHandle::ClearFeatXrefs: not plain Seq-feat");
736  }
738 }
739 
740 
742 {
743  ClearFeatIds();
744  AddFeatId(id);
745 }
746 
747 
749 {
750  CObject_id obj_id;
751  obj_id.SetId(id);
752  SetFeatId(obj_id);
753 }
754 
755 
756 void CSeq_feat_EditHandle::SetFeatId(const string& id)
757 {
758  CObject_id obj_id;
759  obj_id.SetStr(id);
760  SetFeatId(obj_id);
761 }
762 
763 
764 /////////////////////////////////////////////////////////////////////////////
765 // CSeq_annot_ftable_CI
766 
768  TFlags flags)
769  : m_Flags(flags)
770 {
771  if ( !annot.IsFtable() ) {
772  NCBI_THROW(CObjMgrException, eInvalidHandle,
773  "CSeq_annot_ftable_CI: annot is not ftable");
774  }
775  m_Feat.m_Seq_annot = annot;
776  m_Feat.m_FeatIndex = 0;
777  if ( (m_Flags & fIncludeTable) &&
778  annot.x_GetInfo().x_HasSNP_annot_Info() ) {
780  }
781  x_Settle();
782 }
783 
784 
786 {
788  x_Settle();
789 }
790 
791 
793 {
794  // mark end of features
795  m_Feat.Reset();
796 }
797 
798 
800 {
801  for ( ;; ) {
803  bool is_snp_table = m_Feat.IsTableSNP();
804  if ( is_snp_table ) {
807  }
808  else {
809  end = GetAnnot().x_GetInfo().x_GetAnnotCount();
810  }
811  while ( m_Feat.m_FeatIndex < end ) {
812  if ( !m_Feat.IsRemoved() ) {
813  return;
814  }
816  }
817  if ( !is_snp_table || (m_Flags & fOnlyTable) ) {
818  break;
819  }
820  m_Feat.m_FeatIndex = 0;
821  }
822  x_Reset();
823 }
824 
825 
826 /////////////////////////////////////////////////////////////////////////////
827 // CSeq_annot_ftable_I
828 
830  TFlags flags)
831  : m_Annot(annot), m_Flags(flags)
832 {
833  if ( !annot.IsFtable() ) {
834  NCBI_THROW(CObjMgrException, eInvalidHandle,
835  "CSeq_annot_ftable_I: annot is not ftable");
836  }
837  m_Feat.m_Seq_annot = annot;
838  m_Feat.m_FeatIndex = 0;
839  if ( (m_Flags & fIncludeTable) &&
840  annot.x_GetInfo().x_HasSNP_annot_Info() ) {
841  m_Feat.m_FeatIndex |= m_Feat.kNoAnnotObjectInfo;
842  }
843  x_Settle();
844 }
845 
846 
848 {
849  ++m_Feat.m_FeatIndex;
850  x_Settle();
851 }
852 
853 
855 {
856  // mark end of features
857  m_Feat.Reset();
858 }
859 
860 
862 {
863  for ( ;; ) {
865  bool is_snp_table = m_Feat.IsTableSNP();
866  if ( is_snp_table ) {
869  }
870  else {
871  end = GetAnnot().x_GetInfo().x_GetAnnotCount();
872  }
873  while ( m_Feat.m_FeatIndex < end ) {
874  if ( !m_Feat.IsRemoved() ) {
875  return;
876  }
877  ++m_Feat.m_FeatIndex;
878  }
879  if ( !is_snp_table || (m_Flags & fOnlyTable) ) {
880  break;
881  }
882  m_Feat.m_FeatIndex = 0;
883  }
884  x_Reset();
885 }
886 
887 
void Replace(const CSeq_feat &new_feat) const
Replace the feature with new Seq-feat object.
const string & GetSNPComment(void) const
TAnnotIndex x_GetSNPFeatCount(void) const
CUser_field::TData::E_Choice GetSNPQualityCodeWhich(void) const
TSeqPos GetTo(void) const
Definition: snp_info.hpp:204
const CSeq_annot_EditHandle & GetAnnot(void) const
const SSNP_Info & x_GetSNP_Info(void) const
static CSeq_id_Handle GetHandle(const CSeq_id &id)
Normal way of getting a handle, works for any seq-id.
CSeq_annot_EditHandle GetAnnot(void) const
bool IsSetPartial(void) const
incomplete in some way? Check if a value has been assigned to Partial data member.
Definition: Seq_feat_.hpp:915
CTempString implements a light-weight string on top of a storage buffer whose lifetime management is ...
Definition: tempstr.hpp:62
TFeatType GetFeatType(void) const
#define END_SCOPE(ns)
End the previously defined scope.
Definition: ncbistl.hpp:73
CSeq_annot_Info & x_GetInfo(void) const
TFeatType GetFeatType(void) const
TPartial GetPartial(void) const
Get the Partial member data.
Definition: Seq_feat_.hpp:934
CConstRef< CSeq_feat > GetOriginalSeq_feat(void) const
virtual CSeq_id_Handle GetProductId(void) const
void Remove(void) const
Remove the feature from Seq-annot.
CSeq_annot_Handle m_Seq_annot
CGene_ref & SetGeneXref(void)
void x_RealReplace(const CSeq_feat &new_feat) const
Replace the feature with new Seq-feat object.
const string & GetNamedQual(const CTempString &qual_name) const
Return a named qualifier.
Definition: Seq_feat.cpp:391
const TProduct & GetProduct(void) const
Get the Product member data.
Definition: Seq_feat_.hpp:1061
virtual const CSeq_loc & GetProduct(void) const
bool x_HasSNP_annot_Info(void) const
const CAnnotObject_Info & GetInfo(TAnnotIndex index) const
CConstRef< CDbtag > GetNamedDbxref(const CTempString &db) const
Return a specified DB xref.
Definition: Seq_feat.cpp:377
virtual TRange GetProductTotalRange(void) const
CSeq_feat_EditHandle –.
E_Choice
Choice variants.
TSeqPos GetFrom(void) const
Definition: snp_info.hpp:197
TRange GetTotalRange(void) const
Definition: Seq_loc.hpp:895
const CSeq_annot_Info & x_GetInfo(void) const
CUser_field::TData::E_Choice GetQualityCodesWhich(void) const
void Replace(TAnnotIndex index, const CSeq_feat &new_obj)
const string & x_GetQualityCodesStr(SSNP_Info::TQualityCodesIndex index) const
const string & x_GetExtra(SSNP_Info::TExtraIndex index) const
void Reset(void)
Reset reference object.
Definition: ncbiobj.hpp:1343
CSeq_id::TGi GetSNPGi(void) const
TFeatSubtype GetFeatSubtype(void) const
virtual const CSeq_loc & GetLocation(void) const
const CProt_ref * GetProtXref(void) const
get protein (if present) from Seq-feat.xref list
const string & x_GetComment(SSNP_Info::TCommentIndex index) const
const CProt_ref * GetProtXref(void) const
get protein (if present) from Seq-feat.xref list
Definition: Seq_feat.cpp:210
NCBI_NS_NCBI::TGi TGi
Definition: Seq_id_.hpp:180
void x_GetQualityCodesOs(SSNP_Info::TQualityCodesIndex index, TOctetString &os) const
const string & x_GetAllele(SSNP_Info::TAlleleIndex index) const
TAnnotIndex x_GetAnnotCount(void) const
CSeqFeatData::E_Choice GetFeatType(void) const
const TLocation & GetLocation(void) const
Get the Location member data.
Definition: Seq_feat_.hpp:1082
TFeatIndex x_GetFeatIndex() const
bool IsSetProduct(void) const
CSeqFeatData::ESubtype GetFeatSubtype(void) const
void RemoveFeatId(TAnnotIndex index, const CObject_id &id, EFeatIdType id_type)
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:101
bool IsPlainFeat(void) const
Check if this is plain feature.
const CSeq_annot_SNP_Info & x_GetSNP_annot_Info(void) const
TId & SetId(void)
Select the variant.
Definition: Object_id_.hpp:277
CMDReturn< CMD >::TReturn run(CMD *cmd)
bool IsSortedTableFeat(void) const
Check if this is a simple feature from sorted Seq-table.
static TThisType GetEmpty(void)
Definition: range.hpp:306
const CSeq_id & GetSNPSeq_id(void) const
bool IsTableFeat(void) const
Check if this is non-SNP table feature.
void RemoveExceptText(const string &exception_text)
Remove all instances of the given exception text in this feature, and reset the except flag if there ...
const CSeq_annot_SNP_Info & x_GetSNP_annot_Info(void) const
bool IsRemoved(void) const
const string & GetSNPAllele(size_t index) const
bool IsFtable(void) const
bool IsSetData(void) const
const CAnnotObject_Info & x_GetAnnotObject_Info(void) const
bool IsRegular(void) const
size_t GetAllelesCount(void) const
CSeq_annot_Handle –.
const SSNP_Info & x_GetSNP_InfoAny(void) const
bool IsRemoved(void) const
Return true if this feature was removed already.
void AddFeatId(int id)
Add feature id.
void Remove(void) const
Remove the feature from Seq-annot.
const CSeq_annot_Info & x_GetSeq_annot_Info(void) const
SAnnotTypeSelector GetType(void) const
const CGene_ref * GetGeneXref(void) const
get gene (if present) from Seq-feat.xref list
bool IsSetData(void) const
the specific data Check if a value has been assigned to Data data member.
Definition: Seq_feat_.hpp:885
virtual CSeq_id_Handle GetLocationId(void) const
bool IsSortedTable(void) const
void AddDbxref(const string &db_name, const string &db_key)
add a DB xref to this feature
E_Choice
Choice variants.
CConstRef< CSeq_feat > m_CreatedOriginalFeat
CConstRef< CDbtag > GetNamedDbxref(const CTempString &db) const
Return a specified DB xref.
char value[7]
Definition: config.c:428
Base class for all object manager exceptions.
void SetFeatId(int id)
Set single feature id.
const CSeqTableInfo & GetTableInfo(void) const
CRange< TSeqPos > TRange
const CSeq_id & GetSeq_id(void) const
const SSNP_Info & GetInfo(size_t index) const
virtual bool GetPartial(void) const
virtual TRange GetRange(void) const
Get range for current seq-feat.
TStr & SetStr(void)
Select the variant.
Definition: Object_id_.hpp:304
const string & GetNamedQual(const CTempString &qual_name) const
Return a named qualifier.
bool IsRemoved(void) const
Definition: snp_info.hpp:225
void AddExceptText(const string &exception_text)
Add the given exception_text and set the except flag to true.
CScope –.
Definition: scope.hpp:90
void GetSNPQualityCodeOs(vector< char > &os) const
TGi GetGi(void) const
Get the variant data.
Definition: Seq_id_.hpp:889
const CSeq_annot_Handle & GetAnnot(void) const
TFeatSubtype GetFeatSubtype(void) const
void ClearFeatIds(TAnnotIndex index, EFeatIdType id_type)
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:923
CRef< CCreatedFeat_Ref > m_CreatedFeat
const CGene_ref * GetGeneXref(void) const
See related function in util/feature.hpp.
Definition: Seq_feat.cpp:169
void AddQualifier(const string &qual_name, const string &qual_val)
Add a qualifier to this feature.
const string & GetSNPQualityCodeStr(void) const
void x_RealRemove(void) const
Remove the feature from Seq-annot.
#define _ASSERT
CSeq_feat_EditHandle m_Feat
void AddFeatId(TAnnotIndex index, const CObject_id &id, EFeatIdType id_type)
const CSeq_feat & GetFeat(void) const
namespace ncbi::objects::
Definition: Seq_feat.hpp:55
CConstRef< CSeq_feat > GetOriginalFeature(const CSeq_feat_Handle &feat_h)
CSeq_feat_Handle m_Feat
#define BEGIN_SCOPE(ns)
Define a new scope.
Definition: ncbistl.hpp:70
void Replace(const CSeq_feat &new_feat) const
Replace the feature with new Seq-feat object.
#define NCBI_THROW(exception_class, err_code, message)
Generic macro to throw an exception, given the exception class, error code and message string...
Definition: ncbiexpt.hpp:546
void Update(TAnnotIndex index)
CConstRef< C > ConstRef(const C *object)
Template function for conversion of const object pointer to CConstRef.
Definition: ncbiobj.hpp:1858
#define const
Definition: zconf.h:217
CSeq_feat_Handle –.
bool x_HasAnnotObjectInfo() const
virtual CConstRef< CSeq_feat > GetSeq_feat(void) const
bool IsTableSNP(void) const
Check if this is SNP table feature.
const string & GetSNPExtra(void) const
size_t GetSNPAllelesCount(void) const
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:98
void Update(void) const
Update index after manual modification of the object.
void Remove(TAnnotIndex index)
CConstRef< CSeq_feat > GetPlainSeq_feat(void) const
Get current seq-feat.
CProt_ref & SetProtXref(void)
virtual bool IsSetPartial(void) const
void Reset(void)
Reset reference object.
Definition: ncbiobj.hpp:756
void ClearFeatIds(void)
Clear feature ids.
void RemoveQualifier(const string &qual_name)
Remove all qualifiers with the given name on this feature.
void RemoveFeatId(int id)
Remove feature id.
const CSeq_feat & x_GetPlainSeq_feat(void) const
const CAnnotObject_Info & x_GetAnnotObject_InfoAny(void) const
Modified on Fri Jun 24 18:23:18 2016 by modify_doxy.py rev. 426318