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

Go to the SVN repository for this file.

1 /* $Id: feat_table_ds.cpp 47479 2023-05-02 13:24:02Z ucko $
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: Mike DiCuccio, Andrey Yazhuk
27  *
28  * File Description:
29  *
30  */
31 
32 #include <ncbi_pch.hpp>
33 
36 
37 #include <gui/objutils/utils.hpp>
38 #include <gui/objutils/label.hpp>
39 
40 #include <gui/utils/app_job.hpp>
43 
44 #include <objmgr/feat_ci.hpp>
45 #include <objmgr/util/feature.hpp>
46 #include <objmgr/util/sequence.hpp>
47 
53 
54 
56 
58 
59 
60 static int s_CountIntervals( const CSeq_loc& loc ){
61 
62  switch( loc.Which() ){
63  case CSeq_loc::e_Null:
64  case CSeq_loc::e_Empty:
65  case CSeq_loc::e_Whole:
66  case CSeq_loc::e_Int:
67  case CSeq_loc::e_Pnt:
68  case CSeq_loc::e_Bond:
69  case CSeq_loc::e_Feat:
70  return 1;
71 
73  return static_cast<int>(loc.GetPacked_int().Get().size());
74 
76  return static_cast<int>(loc.GetPacked_pnt().GetPoints().size());
77 
78  case CSeq_loc::e_Mix:
79  {{
80  int ivals = 0;
81  ITERATE( CSeq_loc::TMix::Tdata, iter, loc.GetMix().Get() ){
82  ivals += s_CountIntervals(**iter);
83  }
84  return ivals;
85  }}
86 
87  default:
88  {{
89  int size = 0;
90  for( CSeq_loc_CI iter( loc ); iter; ++iter ){
91  ++size;
92  }
93  return size;
94  }}
95  }
96 }
97 
98 
99 /////////////////////////////////////////////////////////////////////////////
100 ///
101 /// AppJobs for background loading and preparation
102 ///
104 {
105 public:
106  vector<CFeatTableDS::SFeatureRow> m_Features;
107 };
108 
109 
110 /////////////////////////////////////////////////////////////////////////////
111 ///
112 /// Alignment-based data source
113 ///
115 {
116 public:
117  CFeatureRetrievalJob( const CSerialObject& obj, CScope& scope, SAnnotSelector& sel );
118 
119  /// @name IAppJob implementation
120  /// @{
121  virtual EJobState Run();
123  virtual CRef<CObject> GetResult();
125  virtual string GetDescr() const;
126  /// @}
127 
128 protected:
129 
133 
134  /// for status reporting
137 
138  // for job results/status
141 };
142 
143 
144 /////////////////////////////////////////////////////////////////////////////
145 
147  const CSerialObject& obj, CScope& scope, SAnnotSelector& sel
148 )
149  : m_Object(&obj)
150  , m_Scope(&scope)
151  , m_Sel(sel)
152  , m_TotalComparisons(1)
153  , m_CompletedComparisons(0)
154 {
155 }
156 
157 
159 {
163 }
164 
165 
167 {
168  return CRef<CObject>( m_Result.GetPointer() );
169 }
170 
171 
173 {
175 }
176 
177 
179 {
180  return string( "CFeatureRetrievalJob" );
181 }
182 
183 
185 {
186  m_Error.Reset( NULL );
188 
189  try {
190  const CSerialObject* object = m_Object.GetPointer();
191  const CSeq_id* seq_id = NULL;
192 
193  CFeat_CI feat_iter;
194 
195  for(;;){
196  const CSeq_annot* annot = dynamic_cast<const CSeq_annot*>(object);
197  if( annot ){
198  feat_iter = CFeat_CI( m_Scope->GetSeq_annotHandle( *annot ), m_Sel );
199  break;
200  }
201 
202  const CSeq_loc* seq_loc = dynamic_cast<const CSeq_loc*>(object);
203  if( seq_loc ){
204  feat_iter = CFeat_CI( *m_Scope, *seq_loc, m_Sel );
205  seq_id = seq_loc->GetId();
206 
207  break;
208  }
209 
210  seq_id = dynamic_cast<const CSeq_id*>(object);
211  if( seq_id ){
212  feat_iter = CFeat_CI( m_Scope->GetBioseqHandle( *seq_id ), m_Sel );
213  break;
214  }
215 
216  break;
217  }
218 
219  m_Result -> m_Features.reserve( feat_iter.GetSize() );
220 
221  /// now, find features to be loaded
222  for( int i = 0; feat_iter && !IsCanceled(); ++feat_iter ){
223  const CMappedFeat& mapped = *feat_iter;
224  const CSeq_loc& mapped_loc = mapped.GetLocation();
225  if( mapped_loc.GetId() != NULL ){
226  CFeatTableDS::SFeatureRow proxy( i++, mapped );
227  proxy.FillIn();
228 
229  m_Result->m_Features.push_back( proxy );
230 
231  } else if( seq_id != NULL ){
233  for( CSeq_loc_CI ci( mapped_loc ); ci; ++ci ){
234  const CSeq_id& part_id = ci.GetSeq_id();
235  if( !sequence::IsSameBioseq( *seq_id, part_id, m_Scope ) ){
236  continue;
237  }
238 
239  range += ci.GetRange();
240  }
241 
243  proxy.row_idx = i++;
244  proxy.FillIn( mapped, range );
245 
246  m_Result->m_Features.push_back( proxy );
247 
248  } else {
250  for( CSeq_loc_CI ci( mapped_loc ); ci; ++ci ){
251  range = ci.GetRange();
252 
254  proxy.row_idx = i++;
255  proxy.FillIn( mapped, range );
256 
257  m_Result->m_Features.push_back( proxy );
258  }
259  }
260  }
261  } catch( CException& ex ){
262  LOG_POST(Error << "Feature Table retrieval:" << ex.what() );
263 
264  m_Error.Reset( new CAppJobError( ex.what() ) );
265 
266  return eFailed;
267  }
268 
269  return IsCanceled() ? eCanceled : eCompleted;
270 }
271 
272 
273 /////////////////////////////////////////////////////////////////////////////
274 // CFeatTableDS implementation
275 void CFeatTableDS::SFeatureRow::FillIn( const objects::CMappedFeat& map_feat )
276 {
277  if( filledIn ){
278  return;
279  }
280 
281  const CSeq_feat& feat = map_feat.GetOriginalFeature();
282  CScope& scope = map_feat.GetAnnot().GetScope();
285 
286  CSeq_loc::TRange range = map_feat.GetLocation().GetTotalRange();
287  from = (int) range.GetFrom() +1;
288  to = (int) range.GetTo() +1;
289  length = (int) range.GetLength();
290  partial = false;
291 
292  ENa_strand naStrand = sequence::GetStrand( map_feat.GetLocation() );
293  switch( naStrand ){
294  case eNa_strand_unknown:
295  strand = "?";
296  break;
297  case eNa_strand_plus:
298  strand = "+";
299  break;
300  case eNa_strand_minus:
301  strand = "-";
302  break;
303  case eNa_strand_both:
304  strand = "+-";
305  break;
306  case eNa_strand_both_rev:
307  strand = "+- (rev)";
308  break;
309  case eNa_strand_other:
310  strand = "other";
311  break;
312  }
313 
314  if( map_feat.IsSetProduct() ){
315  const CSeq_loc& loc = map_feat.GetProduct();
316  CLabel::GetLabel( loc, &product, CLabel::eDefault, &scope );
317  }
318 
319  intervals = s_CountIntervals( map_feat.GetLocation() );
320 
321  filledIn = true;
322 }
323 
325 {
326  if( filledIn ){
327  return;
328  }
329 
330  const CSeq_feat& feat = map_feat.GetOriginalFeature();
331  CScope& scope = map_feat.GetAnnot().GetScope();
332  CLabel::GetLabel( feat, &label, CLabel::eDefault, &scope );
333  feature::GetLabel( feat, &type, feature::fFGL_Type, &scope );
334 
335  from = (int) range.GetFrom() +1;
336  to = (int) range.GetTo() +1;
337  length = (int) range.GetLength();
338  partial = true;
339 
340  ENa_strand naStrand = sequence::GetStrand( map_feat.GetLocation() );
341  switch( naStrand ){
342  case eNa_strand_unknown:
343  strand = "?";
344  break;
345  case eNa_strand_plus:
346  strand = "+";
347  break;
348  case eNa_strand_minus:
349  strand = "-";
350  break;
351  case eNa_strand_both:
352  strand = "+-";
353  break;
354  case eNa_strand_both_rev:
355  strand = "+- (rev)";
356  break;
357  case eNa_strand_other:
358  strand = "other";
359  break;
360  }
361 
362  if( map_feat.IsSetProduct() ){
363  const CSeq_loc& loc = map_feat.GetProduct();
364  CLabel::GetLabel( loc, &product, CLabel::eDefault, &scope );
365  }
366 
367  intervals = s_CountIntervals( map_feat.GetLocation() );
368 
369  filledIn = true;
370 }
371 
372 
373 
375  : m_ActiveJob( -1 )
376 {
377 }
378 
380 {
381  Clear();
382 }
383 
384 void CFeatTableDS::Init( const CSerialObject& obj, objects::CScope& scope, const objects::SAnnotSelector* sel)
385 {
386  m_Object.Reset( &obj );
387  m_Scope.Reset( &scope );
388 
389  if( sel == NULL ){
391  m_Selector
392  .SetExcludeExternal( true )
393  .ExcludeFeatSubtype( CSeqFeatData::eSubtype_variation )
394  //.SetResolveNone()
395  .SetAdaptiveDepth()
396  ;
397  } else {
398  m_Selector = *sel;
399  }
400 
401  Update();
402 }
403 
405 {
406  m_Selector = sel;
407 
408  Update();
409 }
410 
412 {
415 
416  ClearCurrentJob();
417 
418  try {
419  m_ActiveJob = disp.StartJob( *job, "ObjManagerEngine", *this, -1, true );
420 
421  } catch( CAppJobException& e ){
422  LOG_POST( Error << "CFeatTableDS::Update(): Failed to start job: " << e.GetMsg() );
423  LOG_POST( Error << e.ReportAll() );
424  }
425 }
426 
428 {
429  if( m_ActiveJob != -1 ){
430  /// delete any active jobs
432  try {
433  disp.DeleteJob( m_ActiveJob );
434 
435  } catch( CAppJobException& e ){
436  switch( e.GetErrCode() ) {
439  /// this is fine - job probably already finished
440  break;
441 
442  default:
443  // something wrong
444  LOG_POST( Error << "CFeatTableDS::ClearCurrentJob(): " << e.GetMsg() );
445  LOG_POST( Error << e.ReportAll() );
446  }
447  }
448 
449  m_ActiveJob = -1;
450  }
451 }
452 
454 {
455  ClearCurrentJob();
456 
457  m_FeatureRows.clear();
458 
462 }
463 
465 {
466  m_TypeHash.clear();
467  ITERATE( vector<SFeatureRow>, it, m_FeatureRows ){
468  m_TypeHash[it->type] = "";
469  }
470 }
471 
472 void CFeatTableDS::GetTypeNames( vector<string>& names ) const
473 {
474  ITERATE( TTypeHash, it, m_TypeHash ){
475  names.push_back( it->first );
476  }
477 }
478 
482 
483 
484 void CFeatTableDS::OnJobNotification( CEvent* evt )
485 {
486  x_OnJobNotification( evt );
487 }
488 
489 
491 {
492  CAppJobNotification* notif = dynamic_cast<CAppJobNotification*>( evt );
493  _ASSERT( notif );
494  if( !notif ){
495  return;
496  }
497 
498  int job_id = notif -> GetJobID();
499  if( job_id != -1 && job_id != m_ActiveJob ){
500  return;
501  }
502 
503  switch( notif -> GetState() ){
504  case IAppJob::eCompleted:
505  {{
506  CRef<CObject> res_obj = notif -> GetResult();
507  if( !res_obj.IsNull() ){
509  dynamic_cast<CFeatureRetrievalResult*>( &*res_obj )
510  ;
511  m_FeatureRows.clear();
512  m_FeatureRows.swap( result -> m_Features );
513 
516  }
517  }}
518 
519  m_ActiveJob = -1;
521  break;
522 
523  case IAppJob::eFailed:
524  case IAppJob::eCanceled:
525  m_ActiveJob = -1;
527  break;
528 
529  default:
530  break;
531  }
532 }
533 
535 {
536  _ASSERT( (int)row < GetNumRows() );
537 
538  return m_FeatureRows[row];
539 }
540 
541 
542 const CSeq_feat& CFeatTableDS::GetFeature( size_t row ) const
543 {
544  return GetFeatureRow( row ).feat.GetOriginalFeature();
545 }
546 
548 {
550 }
551 
552 
553 ////////////////////////////////////////////////////
554 // Part of ITableModel implementation
555 
556 static wxString s_FeatTableColNames[] = {
557  wxT( "#" ),
558  wxT("Label"),
559  wxT("Type"),
560  wxT("Start"),
561  wxT("Stop"),
562  wxT("Length"),
563  wxT("Strand"),
564  wxT("Product"),
565  wxT("Intervals")
566 };
567 static const int s_FeatTableNumCols = sizeof(s_FeatTableColNames) / sizeof(wxString);
568 
569 
571 {
572  return s_FeatTableNumCols;
573 }
574 
575 wxString CFeatTableDS::GetColumnName( int aColIx ) const
576 {
577  _ASSERT( aColIx < GetNumColumns() );
578 
579  if( aColIx < s_FeatTableNumCols ){
580  return s_FeatTableColNames[aColIx];
581 
582  } else {
583  return CwxAbstractTableModel::GetColumnName( aColIx );
584  }
585 }
586 
587 wxString CFeatTableDS::GetColumnType( int aColIx ) const
588 {
589  _ASSERT( aColIx < GetNumColumns() );
590 
591  switch( aColIx ){
592  case eLabel:
593  case eType:
594  case eStrand:
595  case eProduct:
596  return wxT("string");
597  case eNum:
598  case eFrom:
599  case eTo:
600  case eLength:
601  case eIntervals:
602  return wxT("int");
603  default:
604  return wxT("char");
605  }
606 }
607 
609 {
610  return static_cast<int>(m_FeatureRows.size());
611 }
612 
613 wxVariant CFeatTableDS::GetValueAt( int row, int col ) const
614 {
615  _ASSERT( row < (int)GetNumRows() );
616 
617  wxString rv;
618  switch( col ){
619  case eNum:
620  return row+1;
621  case eLabel:
622  return ToWxString( m_FeatureRows[row].label );
623 
624  case eType:
625  rv = ToWxString( m_FeatureRows[row].type );
626  if( m_FeatureRows[row].partial ){
627  rv += wxT(" (partial)");
628  }
629  return rv;
630 
631  case eFrom:
632  return m_FeatureRows[row].from;
633  case eTo:
634  return m_FeatureRows[row].to;
635  case eLength:
636  return m_FeatureRows[row].length;
637  case eStrand:
638  return ToWxString( m_FeatureRows[row].strand );
639  case eProduct:
640  return ToWxString( m_FeatureRows[row].product );
641  case eIntervals:
642  return m_FeatureRows[row].intervals;
643  default:
644  break;
645  }
646 
647  return ToWxString( kEmptyStr );
648 }
649 
651  : m_Disabled( false )
652  , m_Label( wxEmptyString ), m_Types(), m_FromLoc( -1 ), m_ToLoc( -1 ), m_InclLoc( false )
653  , m_LengthLoc( -1 ), m_Product( wxEmptyString ), m_NoProduct( false )
654 {
655 }
656 
657 bool SFeatureFilter:: operator()( const IRowModel& aRow ) const
658 {
659  if( m_Disabled ){
660  return true;
661  }
662 
663  if( !m_Label.empty() ){
664  wxString line =
665  aRow.GetValueAtColumn( CFeatTableDS::eLabel ).GetString().Upper()
666  ;
667 
668  size_t ix = line.Find( m_Label.Upper() );
669  if( ix == wxNOT_FOUND ){
670  return false;
671  }
672  }
673 
674  if( !m_Types.IsEmpty() ){
675  wxString line =
676  aRow.GetValueAtColumn( CFeatTableDS::eType ).GetString()
677  ;
678 
679  size_t ix = m_Types.Index( line, false, false );
680  if( ix == wxNOT_FOUND ){
681  return false;
682  }
683  }
684 
685  size_t from = aRow.GetValueAtColumn( CFeatTableDS::eFrom ).GetLong();
686  size_t to = aRow.GetValueAtColumn( CFeatTableDS::eTo ).GetLong();
687 
688  if( m_InclLoc ){
689  if(
690  !( (m_FromLoc < 0 || (size_t)m_FromLoc < from)
691  && (m_ToLoc < 0 || to < (size_t)m_ToLoc) )
692  ){
693  return false;
694  }
695  } else {
696  if(
697  !( (m_FromLoc < 0 || (size_t)m_FromLoc < to)
698  && (m_ToLoc < 0 || from < (size_t)m_ToLoc) )
699  ){
700  return false;
701  }
702  }
703 
704  if( m_LengthLoc > 0 ){
705  if( m_LengthLoc != aRow.GetValueAtColumn( CFeatTableDS::eLength ).GetLong() ){
706  return false;
707  }
708  }
709 
710  wxString prod =
711  aRow.GetValueAtColumn( CFeatTableDS::eProduct ).GetString().Upper()
712  ;
713 
714  if( m_NoProduct ){
715  if( !prod.empty() ){
716  return false;
717  }
718  } else if( !m_Product.empty() ){
719  if( prod.empty() ){
720  return false;
721  }
722 
723  size_t ix = prod.Find( m_Product.Upper() );
724  if( ix == wxNOT_FOUND ){
725  return false;
726  }
727  }
728 
729  return true;
730 }
731 
static CRef< CScope > m_Scope
User-defined methods of the data storage class.
#define false
Definition: bool.h:36
size_t GetSize(void) const
CAppJobDispatcher.
CAppJobError Default implementation for IAppJobError - encapsulates a text error message.
IAppJobListener Interface for components that need to be notified about changes in Jobs.
CAppJobNotification Notification send by CAppJobEventTranslator.
CAppJobProgress Default implementation for IAppJobProgress - the class encapsulates a text message an...
CEventHandler.
CEvent - generic event implementation TODO TODO - Attachments.
Definition: event.hpp:86
CFeatTableDS Data source for Feature Table widget.
virtual int GetNumRows() const
Returns the number of rows in the model.
virtual wxVariant GetValueAt(int row, int col) const
void Update()
reloads data based on current settings
TTypeHash m_TypeHash
vector< SFeatureRow > m_FeatureRows
CRef< objects::CScope > m_Scope
void OnJobNotification(CEvent *evt)
const objects::CSeq_feat & GetFeature(size_t row) const
const SFeatureRow & GetFeatureRow(size_t row) const
virtual int GetNumColumns() const
Returns the number of columns in the model.
virtual wxString GetColumnName(int aColIx) const
Returns a default name for the column using spreadsheet conventions: A, B, C, ...
void SetSelector(const objects::SAnnotSelector &sel)
sets the DataSource-specific filter
CConstRef< CSerialObject > m_Object
virtual void x_OnJobNotification(CEvent *evt)
void ClearCurrentJob()
void x_UpdateTypeHash()
void GetTypeNames(vector< string > &names) const
objects::SAnnotSelector m_Selector
void Init(const CSerialObject &obj, objects::CScope &scope, const objects::SAnnotSelector *sel=0)
virtual ~CFeatTableDS()
void x_NotifyObserversNow()
CAppJobDispatcher::TJobID m_ActiveJob
app job notification and control
virtual wxString GetColumnType(int aColIx) const
Tries to extract actual type from row 0 value if it exists.
CFeat_CI –.
Definition: feat_ci.hpp:64
Alignment-based data source.
virtual CRef< CObject > GetResult()
Returns the Job Result.
SAnnotSelector m_Sel
size_t m_TotalComparisons
for status reporting
virtual EJobState Run()
Function that does all the useful work, called by the Engine.
CRef< CFeatureRetrievalResult > m_Result
CRef< CScope > m_Scope
CConstRef< CSerialObject > m_Object
virtual CConstIRef< IAppJobError > GetError()
Returns IAppJobError object describing internal error that caused the Job to fail.
virtual CConstIRef< IAppJobProgress > GetProgress()
return progress object, the function shall be synchronized internally.
virtual string GetDescr() const
Returns a human readable description of the Job (optional)
CRef< CAppJobError > m_Error
CFeatureRetrievalJob(const CSerialObject &obj, CScope &scope, SAnnotSelector &sel)
AppJobs for background loading and preparation.
vector< CFeatTableDS::SFeatureRow > m_Features
Base class to build jobs with cancel functionality.
CMappedFeat –.
Definition: mapped_feat.hpp:59
CObject –.
Definition: ncbiobj.hpp:180
CScope –.
Definition: scope.hpp:92
namespace ncbi::objects::
Definition: Seq_feat.hpp:58
Seq-loc iterator class – iterates all intervals from a seq-loc in the correct order.
Definition: Seq_loc.hpp:453
Base class for all serializable objects.
Definition: serialbase.hpp:150
virtual wxString GetColumnName(int col_idx) const
Returns a default name for the column using spreadsheet conventions: A, B, C, ...
Definition: table_model.cpp:82
virtual void x_FireDataChanged()
virtual wxVariant GetValueAtColumn(int col) const =0
void clear()
Definition: map.hpp:169
static const struct name_t names[]
USING_SCOPE(objects)
static wxString s_FeatTableColNames[]
static int s_CountIntervals(const CSeq_loc &loc)
static const int s_FeatTableNumCols
#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 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
virtual const char * what(void) const noexcept
Standard report (includes full backlog).
Definition: ncbiexpt.cpp:342
static objects::SAnnotSelector GetAnnotSelector(TAnnotFlags flags=0)
request an annotation selector for a given type
Definition: utils.cpp:167
static void GetLabel(const CObject &obj, string *label, ELabelType type=eDefault)
Definition: label.cpp:140
static CAppJobDispatcher & GetInstance()
virtual bool IsCanceled() const override
bool DeleteJob(TJobID job_id)
when a Job is deleted the listener is not notified
EJobState
Job states (describe FSM)
Definition: app_job.hpp:86
TJobID StartJob(IAppJob &job, const string &engine_name, IEngineParams *params=NULL)
Starts a Job on the specified engine in "passive mode" - no notifications or progress reports will be...
#define ON_EVENT(type, id, handler)
#define END_EVENT_MAP()
Ends definition of Command Map.
#define BEGIN_EVENT_MAP(thisClass, baseClass)
Begins definition of Command Map for CEventHandler-derived class.
virtual bool Send(CEvent *evt, EDispatch disp_how=eDispatch_Default, int pool_name=ePool_Default)
Sends an event synchronously.
void SetNormDone(float done)
@ eEngine_UnknownJob
the job is not registered in the Engine
@ eUnknownJob
Job record lost.
@ eCanceled
Definition: app_job.hpp:91
@ eCompleted
Definition: app_job.hpp:89
@ eFailed
Definition: app_job.hpp:90
@ eDefault
Definition: label.hpp:73
string GetLabel(const CSeq_id &id)
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
@ fFGL_Type
Always include the feature's type.
Definition: feature.hpp:72
ENa_strand GetStrand(const CSeq_loc &loc, CScope *scope=0)
Returns eNa_strand_unknown if multiple Bioseqs in loc Returns eNa_strand_other if multiple strands in...
bool IsSameBioseq(const CSeq_id &id1, const CSeq_id &id2, CScope *scope, CScope::EGetBioseqFlag get_flag=CScope::eGetBioseq_All)
Determines if two CSeq_ids represent the same CBioseq.
CBioseq_Handle GetBioseqHandle(const CSeq_id &id)
Get bioseq handle by seq-id.
Definition: scope.cpp:95
CSeq_annot_Handle GetSeq_annotHandle(const CSeq_annot &annot, EMissing action=eMissing_Default)
Definition: scope.cpp:192
const CSeq_annot_Handle & GetAnnot(void) const
Get handle to seq-annot for this feature.
bool IsSetProduct(void) const
CScope & GetScope(void) const
Get scope this handle belongs to.
const CSeq_loc & GetLocation(void) const
const CSeq_feat & GetOriginalFeature(void) const
Get original feature with unmapped location/product.
const CSeq_loc & GetProduct(void) const
TObjectType * GetPointer(void) const THROWS_NONE
Get pointer,.
Definition: ncbiobj.hpp:1684
TObjectType * GetPointer(void) THROWS_NONE
Get pointer,.
Definition: ncbiobj.hpp:998
void Reset(void)
Reset reference object.
Definition: ncbiobj.hpp:1439
void Reset(void)
Reset reference object.
Definition: ncbiobj.hpp:773
bool IsNull(void) const THROWS_NONE
Check if pointer is null – same effect as Empty().
Definition: ncbiobj.hpp:735
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
#define kEmptyStr
Definition: ncbistr.hpp:123
static const char label[]
ENa_strand
strand of nucleic acid
Definition: Na_strand_.hpp:64
const Tdata & Get(void) const
Get the member data.
list< CRef< CSeq_loc > > Tdata
E_Choice Which(void) const
Which variant is currently selected.
Definition: Seq_loc_.hpp:475
const Tdata & Get(void) const
Get the member data.
const TPacked_pnt & GetPacked_pnt(void) const
Get the variant data.
Definition: Seq_loc_.cpp:260
const TPoints & GetPoints(void) const
Get the Points member data.
const TMix & GetMix(void) const
Get the variant data.
Definition: Seq_loc_.cpp:282
const TPacked_int & GetPacked_int(void) const
Get the variant data.
Definition: Seq_loc_.cpp:216
@ eNa_strand_plus
Definition: Na_strand_.hpp:66
@ eNa_strand_other
Definition: Na_strand_.hpp:70
@ eNa_strand_minus
Definition: Na_strand_.hpp:67
@ eNa_strand_unknown
Definition: Na_strand_.hpp:65
@ eNa_strand_both_rev
in reverse orientation
Definition: Na_strand_.hpp:69
@ eNa_strand_both
in forward orientation
Definition: Na_strand_.hpp:68
@ e_Null
not placed
Definition: Seq_loc_.hpp:98
@ e_Empty
to NULL one Seq-id in a collection
Definition: Seq_loc_.hpp:99
@ e_Feat
indirect, through a Seq-feat
Definition: Seq_loc_.hpp:108
@ e_Int
from to
Definition: Seq_loc_.hpp:101
@ e_Whole
whole sequence
Definition: Seq_loc_.hpp:100
unsigned int
A callback function used to compare two keys in a database.
Definition: types.hpp:1210
int i
#define wxT(x)
Definition: muParser.cpp:41
range(_Ty, _Ty) -> range< _Ty >
const struct ncbi::grid::netcache::search::fields::SIZE size
our actual features
void FillIn(const objects::CMappedFeat &map_feat)
objects::CMappedFeat feat
SAnnotSelector –.
virtual bool operator()(const IRowModel &aRow) const
wxArrayString m_Types
Definition: type.c:6
#define _ASSERT
else result
Definition: token2.c:20
wxString ToWxString(const string &s)
Definition: wx_utils.hpp:173
Modified on Wed Dec 06 07:13:52 2023 by modify_doxy.py rev. 669887