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

Go to the SVN repository for this file.

1 /* $Id: edit_seq_ends_with_align.cpp 37738 2017-02-13 16:04:36Z filippov $
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: Igor Filippov
27  */
28 
29 
30 #include <ncbi_pch.hpp>
37 #include <objmgr/scope.hpp>
39 #include <objmgr/feat_ci.hpp>
40 #include <objmgr/align_ci.hpp>
41 #include <objmgr/bioseq_ci.hpp>
42 #include <objmgr/seq_annot_ci.hpp>
43 #include <objmgr/graph_ci.hpp>
44 #include <objmgr/seq_map.hpp>
45 #include <objmgr/seq_map_ci.hpp>
46 #include <objmgr/util/sequence.hpp>
54 
55 #include <wx/button.h>
56 #include <wx/sizer.h>
57 #include <wx/stattext.h>
58 #include <wx/msgdlg.h>
59 #include <wx/valtext.h>
60 
63 
64 
65 /*!
66  * CEditSeqEndsWithAlign type definition
67  */
68 
69 IMPLEMENT_DYNAMIC_CLASS( CEditSeqEndsWithAlign, wxDialog )
70 
71 
72 /*!
73  * CEditSeqEndsWithAlign event table definition
74  */
75 
76 BEGIN_EVENT_TABLE( CEditSeqEndsWithAlign, wxDialog )
77 
78 ////@begin CEditSeqEndsWithAlign event table entries
79 ////@end CEditSeqEndsWithAlign event table entries
80 
82 
83 
84 /*!
85  * CEditSeqEndsWithAlign constructors
86  */
87 
89 {
90  Init();
91 }
92 
93 CEditSeqEndsWithAlign::CEditSeqEndsWithAlign( wxWindow* parent, objects::CSeq_entry_Handle seh,
94  wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style )
95 : m_TopSeqEntry(seh)
96 {
97  Init();
98  Create(parent, id, caption, pos, size, style);
99 }
100 
101 
102 
103 bool CEditSeqEndsWithAlign::Create( wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style )
104 {
105 ////@begin CEditSeqEndsWithAlign creation
106  SetExtraStyle(wxWS_EX_BLOCK_EVENTS);
107  wxDialog::Create( parent, id, caption, pos, size, style );
108 
109  CreateControls();
110  if (GetSizer())
111  {
112  GetSizer()->SetSizeHints(this);
113  }
114  Centre();
115 ////@end CEditSeqEndsWithAlign creation
116 
117  return true;
118 }
119 
120 
121 /*!
122  * CEditSeqEndsWithAlign destructor
123  */
124 
126 {
127 ////@begin CEditSeqEndsWithAlign destruction
128 ////@end CEditSeqEndsWithAlign destruction
129 }
130 
131 
132 /*!
133  * Member initialisation
134  */
135 
137 {
138 
139 }
140 
141 
142 /*!
143  * Control creation for CEditSeqEndsWithAlign
144  */
145 
147 {
148  CEditSeqEndsWithAlign* itemDialog1 = this;
149 
150  wxBoxSizer* itemBoxSizer2 = new wxBoxSizer(wxVERTICAL);
151  itemDialog1->SetSizer(itemBoxSizer2);
152 
153  wxBoxSizer* itemBoxSizer3 = new wxBoxSizer(wxHORIZONTAL);
154  itemBoxSizer2->Add(itemBoxSizer3, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
155 
156  wxStaticText* stattext1 = new wxStaticText( itemDialog1, wxID_STATIC, _("Trim before alignment coordinate"), wxDefaultPosition, wxDefaultSize, 0 );
157  itemBoxSizer3->Add(stattext1, 0, wxALIGN_TOP|wxALL, 5);
158  m_Before = new wxTextCtrl( itemDialog1, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(100, -1), 0 );
159  itemBoxSizer3->Add(m_Before, 0, wxALIGN_TOP|wxLEFT|wxRIGHT|wxBOTTOM, 5);
160  m_Before->SetValidator( wxTextValidator( wxFILTER_NUMERIC ) );
161 
162  wxBoxSizer* itemBoxSizer4 = new wxBoxSizer(wxHORIZONTAL);
163  itemBoxSizer2->Add(itemBoxSizer4, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
164 
165  wxStaticText* stattext2 = new wxStaticText( itemDialog1, wxID_STATIC, _("Trim after alignment coordinate"), wxDefaultPosition, wxDefaultSize, 0 );
166  itemBoxSizer4->Add(stattext2, 0, wxALIGN_TOP|wxALL, 5);
167  m_After = new wxTextCtrl( itemDialog1, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(100, -1), 0 );
168  itemBoxSizer4->Add(m_After, 0, wxALIGN_TOP|wxLEFT|wxRIGHT|wxBOTTOM, 5);
169  m_After->SetValidator( wxTextValidator( wxFILTER_NUMERIC ) );
170 
171  wxBoxSizer* itemBoxSizer12 = new wxBoxSizer(wxHORIZONTAL);
172  itemBoxSizer2->Add(itemBoxSizer12, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
173 
174  wxButton* itemButton13 = new wxButton( itemDialog1, wxID_OK, _("Accept"), wxDefaultPosition, wxDefaultSize, 0 );
175  itemBoxSizer12->Add(itemButton13, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
176 
177  wxButton* itemButton14 = new wxButton( itemDialog1, wxID_CANCEL, _("Cancel"), wxDefaultPosition, wxDefaultSize, 0 );
178  itemBoxSizer12->Add(itemButton14, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
179 }
180 
181 
182 /*!
183  * Should we show tooltips?
184  */
185 
187 {
188  return true;
189 }
190 
191 /*!
192  * Get bitmap resources
193  */
194 
195 wxBitmap CEditSeqEndsWithAlign::GetBitmapResource( const wxString& name )
196 {
197  // Bitmap retrieval
198  wxUnusedVar(name);
199  return wxNullBitmap;
200 }
201 
202 /*!
203  * Get icon resources
204  */
205 
206 wxIcon CEditSeqEndsWithAlign::GetIconResource( const wxString& name )
207 {
208  // Icon retrieval
209  wxUnusedVar(name);
210  return wxNullIcon;
211 }
212 
214 {
215  CRef<CCmdComposite> cmd(new CCmdComposite("Edit Sequence Ends With Alignment"));
216  for ( CBioseq_CI bi(m_TopSeqEntry); bi; ++bi)
217  {
218  const CBioseq_Handle& bsh = *bi;
219  int before = wxAtoi(m_Before->GetValue());
220  int after = wxAtoi(m_After->GetValue());
221  before--;
222  after--;
223  if (m_After->GetValue().IsEmpty())
224  after = bsh.GetBioseqLength()-1;
225  CAlign_CI align_ci(bsh);
226  if (align_ci)
227  {
228  const CSeq_align& align = *align_ci;
229  int row = FindRow(bsh, align);
230  if (row >= 0)
231  {
233  CRef<CScope> scope_copy(new CScope(*object_manager));
234 
235  int real_before = FindPosition(align,row,before);
236  if (real_before < 0)
237  {
238  before++;
239  while (real_before < 0 && before < bsh.GetBioseqLength())
240  {
241  real_before = FindPosition(align,row,before);
242  before++;
243  }
244  }
245  if (real_before < 0 || m_Before->GetValue().IsEmpty())
246  real_before = 0;
247  int real_after = FindPosition(align,row,after);
248  if (real_after < 0)
249  {
250  after--;
251  while (real_after < 0 && after >= 0)
252  {
253  real_after = FindPosition(align,row,after);
254  after--;
255  }
256  }
257  if (real_after < 0 || m_After->GetValue().IsEmpty())
258  real_after = bsh.GetBioseqLength()-1;
261  CSeq_entry_Handle edited_seh = scope_copy->AddTopLevelSeqEntry(*copy);
262  TrimBeforeAfter(edited_seh.GetSeq(), real_before, real_after);
264  cmd->AddCommand(*cmd_bioseq);
265  AdjustFeatureLocations(bsh, real_before, real_after, cmd);
266  TrimQualityScores(bsh, real_before, real_after, cmd);
267  }
268  }
269  }
270 
271  for (CSeq_annot_CI annot_ci(m_TopSeqEntry); annot_ci; ++annot_ci)
272  {
273  if (annot_ci->IsAlign())
274  {
275  CRef<CCmdDelSeq_annot> del_align(new CCmdDelSeq_annot(*annot_ci));
276  cmd->AddCommand(*del_align);
277  }
278  }
279  return cmd;
280 }
281 
282 
284 {
285  int row = -1;
286  int num_rows = align.CheckNumRows();
287  for (int r = 0; r < num_rows; r++)
288  {
289  if (bsh.IsSynonym(align.GetSeq_id(r)))
290  {
291  row = r;
292  break;
293  }
294  }
295  return row;
296 }
297 
299 {
300  int pos = -1;
301  int num_rows = align.CheckNumRows();
302  if (align.IsSetSegs() && align.GetSegs().IsDenseg())
303  {
304  const vector< TSignedSeqPos > &starts = align.GetSegs().GetDenseg().GetStarts();
305  const vector< TSeqPos > &lens = align.GetSegs().GetDenseg().GetLens();
306  int i = 0;
307 
308  while (i < lens.size())
309  {
310  if (starts[i*num_rows+row] >= 0 && offset < lens[i])
311  {
312  if (offset < 0)
313  offset = 0;
314  pos = offset + starts[i*num_rows+row];
315  break;
316  }
317  offset -= lens[i];
318  i++;
319  }
320  }
321  return pos;
322 }
323 
324 void CEditSeqEndsWithAlign::TrimBeforeAfter(CBioseq_Handle edited_bsh, int before, int after)
325 {
326  SSeqMapSelector selector;
327  selector.SetFlags(CSeqMap::fFindData);
328  CBioseq_EditHandle besh(edited_bsh);
329  CSeqMap_I seqmap_i(besh, selector);
330  int start = 0;
331  while (seqmap_i)
332  {
333  TSeqPos len = seqmap_i.GetLength();
334  if (before >= start+len)
335  {
336  seqmap_i = seqmap_i.Remove();
337  }
338  else if (before > start && before < start+len && after >= start+len-1)
339  {
340  string seq_in;
341  if (besh.IsNa())
342  seqmap_i.GetSequence(seq_in, CSeqUtil::e_Iupacna);
343  else
344  seqmap_i.GetSequence(seq_in, CSeqUtil::e_Iupacaa);
345  string seq_out = seq_in.substr(before - start);
346  if (besh.IsNa())
348  else
350  ++seqmap_i;
351  }
352  else if (after < start)
353  {
354  seqmap_i = seqmap_i.Remove();
355  }
356  else if (before > start && before < start+len && after < start+len-1)
357  {
358  string seq_in;
359  if (besh.IsNa())
360  seqmap_i.GetSequence(seq_in, CSeqUtil::e_Iupacna);
361  else
362  seqmap_i.GetSequence(seq_in, CSeqUtil::e_Iupacaa);
363  string seq_out = seq_in.substr(before - start,after - before + 1);
364  if (besh.IsNa())
366  else
368  ++seqmap_i;
369  }
370  else if (before <= start && after >= start && after+1 < start+len)
371  {
372  string seq_in;
373  if (besh.IsNa())
374  seqmap_i.GetSequence(seq_in, CSeqUtil::e_Iupacna);
375  else
376  seqmap_i.GetSequence(seq_in, CSeqUtil::e_Iupacaa);
377  string seq_out = seq_in.substr(0, after - start + 1);
378  if (besh.IsNa())
380  else
382  ++seqmap_i;
383  }
384  else
385  {
386  ++seqmap_i;
387  }
388  start += len;
389  }
390 }
391 
393 {
394  CRef<CSeq_loc> loc = bsh.GetRangeSeq_loc(0,0);
396  SAnnotSelector sel;
397  CScope &scope = bsh.GetScope();
398 
399  for (CFeat_CI feat_it(scope, *loc, sel); feat_it; ++feat_it)
400  {
401  CRef<CSeq_feat> new_feat(new CSeq_feat);
402  new_feat->Assign(feat_it->GetOriginalFeature());
403  const CSeq_loc& feat_loc = feat_it->GetLocation();
404  bool modified = false;
405  bool removed = false;
406  CRef<CSeq_loc> loc = AdjustLoc(feat_loc, before, after, seq_start, modified, removed);
407 
408  if (modified)
409  {
410  if (removed)
411  {
412  CRef<CCmdDelSeq_feat> cmd_del(new CCmdDelSeq_feat(feat_it->GetSeq_feat_Handle()));
413  if (cmd_del)
414  {
415  cmd->AddCommand(*cmd_del);
416  }
417  }
418  else
419  {
420  if (new_feat->IsSetData() && new_feat->GetData().IsCdregion())
421  {
422  EDIT_EACH_CODEBREAK_ON_CDREGION(code_break, new_feat->SetData().SetCdregion())
423  {
424  if ((*code_break)->IsSetLoc())
425  {
426  bool cb_modified = false;
427  bool cb_removed = false;
428  CRef<CSeq_loc> cb_loc = AdjustLoc((*code_break)->GetLoc(), before, after, seq_start, cb_modified, cb_removed);
429  if (cb_modified)
430  {
431  if (cb_removed)
432  ERASE_CODEBREAK_ON_CDREGION(code_break, new_feat->SetData().SetCdregion());
433  else
434  (*code_break)->SetLoc(*cb_loc);
435  }
436  }
437  }
438  int diff = before - (feat_loc.GetStart(objects::eExtreme_Biological) - seq_start);
439  if (feat_loc.GetStrand() == eNa_strand_minus)
440  diff = (feat_loc.GetStart(objects::eExtreme_Biological) - seq_start) - after;
441  AdjustFrame(new_feat->SetData().SetCdregion(), before, diff);
442  }
443  if (new_feat->IsSetData() && new_feat->GetData().IsRna() && new_feat->GetData().GetRna().IsSetExt()
444  && new_feat->GetData().GetRna().GetExt().IsTRNA() && new_feat->GetData().GetRna().GetExt().GetTRNA().IsSetAnticodon())
445  {
446  bool ac_modified = false;
447  bool ac_removed = false;
448  CRef<CSeq_loc> ac_loc = AdjustLoc(new_feat->GetData().GetRna().GetExt().GetTRNA().GetAnticodon(), before, after, seq_start, ac_modified, ac_removed);
449  if (ac_modified)
450  {
451  if (ac_removed)
452  new_feat->SetData().SetRna().SetExt().SetTRNA().ResetAnticodon();
453  else
454  new_feat->SetData().SetRna().SetExt().SetTRNA().SetAnticodon(*ac_loc);
455  }
456  }
457  new_feat->SetLocation(*loc);
458  CRef< CCmdChangeSeq_feat > cmd_change_feat(new CCmdChangeSeq_feat(feat_it->GetSeq_feat_Handle(),*new_feat));
459  if (cmd_change_feat)
460  {
461  cmd->AddCommand(*cmd_change_feat);
462  }
463  }
464  }
465 
466  }
467 }
468 
469 CRef<CSeq_loc> CEditSeqEndsWithAlign::AdjustLoc(const CSeq_loc& feat_loc, int before, int after, TSeqPos seq_start, bool &modified, bool &removed)
470 {
471  CRef<CSeq_loc> new_loc(new CSeq_loc);
472  new_loc->Assign(feat_loc);
473  CSeq_loc_I loc_it(*new_loc);
474  while(loc_it)
475  {
476  CSeq_loc_CI::TRange feat_range = loc_it.GetRange();
477  TSeqPos feat_start = feat_range.GetFrom() - seq_start;
478  TSeqPos feat_stop = feat_range.GetTo() - seq_start;
479  int new_start = feat_start;
480  int new_stop = feat_stop;
481  if (new_start < before && new_stop < before)
482  {
483  new_start = 0;
484  new_stop = 0;
485  }
486  else if (new_start < before && new_stop >= before && new_stop <= after)
487  {
488  new_start = 0;
489  new_stop -= before;
490  }
491  else if (new_start < before && new_stop > after)
492  {
493  new_start = 0;
494  new_stop = after - before;
495  }
496  else if (new_start >= before && new_start <= after && new_stop > after)
497  {
498  new_start -= before;
499  new_stop = after-before;
500  }
501  else if (new_start >= before && new_start <= after && new_stop >= before && new_stop <= after)
502  {
503  new_start -= before;
504  new_stop -= before;
505  }
506  else if ( new_start > after && new_stop > after)
507  {
508  new_start = 0;
509  new_stop = 0;
510  }
511 
512  if (new_stop <= new_start)
513  {
514  loc_it.Delete();
515  continue;
516  }
517  if (feat_start != new_start)
518  {
519  loc_it.SetFrom(new_start);
520  }
521  if (feat_stop != new_stop)
522  {
523  loc_it.SetTo(new_stop);
524  }
525  ++loc_it;
526  }
527  CRef<CSeq_loc> loc = loc_it.MakeSeq_loc();
528  modified = loc_it.HasChanges();
529  removed = (loc_it.GetSize() == 0 || loc->GetStart(objects::eExtreme_Positional) == loc->GetStop(objects::eExtreme_Positional));
530  loc_it.Rewind();
531  return loc;
532 }
533 
534 void CEditSeqEndsWithAlign::AdjustFrame(CCdregion &feat, int before, int diff)
535 {
536  if (diff <= 0)
537  return;
538  int orig_frame = 0;
539  if (feat.IsSetFrame())
540  {
541  if (feat.GetFrame() == CCdregion::eFrame_two)
542  {
543  orig_frame = 1;
544  } else if (feat.GetFrame() == CCdregion::eFrame_three)
545  {
546  orig_frame = 2;
547  }
548  }
549  int new_offset = (orig_frame - diff) % 3;
550  if (orig_frame < diff && new_offset != 0)
551  {
552  new_offset = 3 - ((diff - orig_frame) % 3);
553  }
554 
556  switch (new_offset) {
557  case 0:
558  new_frame = CCdregion::eFrame_one;
559  break;
560  case 1:
561  new_frame = CCdregion::eFrame_two;
562  break;
563  case 2:
564  new_frame = CCdregion::eFrame_three;
565  break;
566  default:
567  new_frame = CCdregion::eFrame_not_set;
568  break;
569  }
570  feat.SetFrame(new_frame);
571 }
572 
574 {
575  CRef<CSeq_loc> loc = bsh.GetRangeSeq_loc(0,0);
577 
579  CGraph_CI graph_ci(bsh, graph_sel);
580  for (; graph_ci; ++graph_ci)
581  {
582 
583  const CMappedGraph& graph = *graph_ci;
584 
585  CRef<CSeq_graph> new_graph(new CSeq_graph());
586  new_graph->Assign(graph.GetOriginalGraph());
587 
588  if (new_graph->IsSetLoc())
589  {
590  bool g_modified = false;
591  bool g_removed = false;
592  CRef<CSeq_loc> g_loc = AdjustLoc(new_graph->GetLoc(), before, after, seq_start, g_modified, g_removed);
593  if (g_modified)
594  {
595  if (g_removed)
596  {
597  new_graph->ResetLoc();
598  CIRef<IEditCommand> delGraph(new CCmdDelSeq_graph( graph.GetSeq_graph_Handle() ));
599  command->AddCommand(*delGraph);
600  }
601  else
602  {
603  TSeqPos graph_start = new_graph->GetLoc().GetStart(eExtreme_Positional);
604  TSeqPos graph_stop = new_graph->GetLoc().GetStop(eExtreme_Positional);
605  // Copy start/stop values are relative to bioseq coordinate system.
606  // Change them so that they are relative to graph location.
607  int copy_start = before - graph_start;
608  int copy_stop = after - graph_start;
609 
610  new_graph->SetLoc(*g_loc);
611 
612  CSeq_graph::TGraph& dst_data = new_graph->SetGraph();
613  const CSeq_graph::TGraph& src_data = graph.GetOriginalGraph().GetGraph();
614  switch ( src_data.Which() )
615  {
617  {
618  // Update data values
619  dst_data.SetByte().ResetValues();
620  dst_data.SetByte().SetValues().insert(
621  dst_data.SetByte().SetValues().end(),
622  src_data.GetByte().GetValues().begin() + copy_start,
623  src_data.GetByte().GetValues().begin() + copy_stop + 1);
624  }
625  break;
627  {
628  // Update data values
629  dst_data.SetInt().ResetValues();
630  dst_data.SetInt().SetValues().insert(
631  dst_data.SetInt().SetValues().end(),
632  src_data.GetInt().GetValues().begin() + copy_start,
633  src_data.GetInt().GetValues().begin() + copy_stop + 1);
634 
635  }
636  break;
638  {
639  // Update data values
640  dst_data.SetReal().ResetValues();
641  dst_data.SetReal().SetValues().insert(
642  dst_data.SetReal().SetValues().end(),
643  src_data.GetReal().GetValues().begin() + copy_start,
644  src_data.GetReal().GetValues().begin() + copy_stop + 1);
645 
646  }
647  break;
648  default: break;
649  }
650  // Update numvals
651  new_graph->SetNumval(copy_stop - copy_start + 1);
652  CIRef<IEditCommand> chgGraph( new CCmdChangeGraph( graph.GetSeq_graph_Handle(), *new_graph ));
653  command->AddCommand(*chgGraph);
654  }
655  }
656  }
657  }
658 }
659 
660 
User-defined methods of the data storage class.
User-defined methods of the data storage class.
@ eExtreme_Positional
numerical value
Definition: Na_strand.hpp:63
@ eExtreme_Biological
5' and 3'
Definition: Na_strand.hpp:62
User-defined methods of the data storage class.
User-defined methods of the data storage class.
CAlign_CI –.
Definition: align_ci.hpp:63
CBioseq_CI –.
Definition: bioseq_ci.hpp:69
CBioseq_EditHandle –.
CBioseq_Handle –.
CCdregion –.
Definition: Cdregion.hpp:66
static void AdjustFrame(CCdregion &feat, int before, int diff)
static void TrimBeforeAfter(CBioseq_Handle edited_bsh, int before, int after)
static void TrimQualityScores(CBioseq_Handle bsh, int before, int after, CRef< CCmdComposite > command)
static int FindRow(const CBioseq_Handle &bsh, const CSeq_align &align)
void CreateControls()
Creates the controls and sizers.
static int FindPosition(const CSeq_align &align, int row, int after)
wxBitmap GetBitmapResource(const wxString &name)
Retrieves bitmap resources.
void Init()
Initialises member variables.
wxIcon GetIconResource(const wxString &name)
Retrieves icon resources.
bool Create(wxWindow *parent, wxWindowID id=wxID_ANY, const wxString &caption=_("Edit Sequence Ends With Alignment"), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU|wxCLOSE_BOX|wxTAB_TRAVERSAL)
Creation.
static CRef< CSeq_loc > AdjustLoc(const CSeq_loc &feat_loc, int before, int after, TSeqPos seq_start, bool &modified, bool &removed)
static void AdjustFeatureLocations(CBioseq_Handle bsh, int before, int after, CRef< CCmdComposite > cmd)
CRef< CCmdComposite > GetCommand()
static bool ShowToolTips()
Should we show tooltips?
CFeat_CI –.
Definition: feat_ci.hpp:64
CGraph_CI –.
Definition: graph_ci.hpp:234
CMappedGraph –.
Definition: graph_ci.hpp:61
CScope –.
Definition: scope.hpp:92
Non-const iterator over CSeqMap (allows to edit the sequence).
Definition: seq_map_ci.hpp:407
@ e_Iupacna
Definition: sequtil.hpp:47
@ e_Iupacaa
Definition: sequtil.hpp:55
TDim CheckNumRows(void) const
Validatiors.
Definition: Seq_align.cpp:73
const CSeq_id & GetSeq_id(TDim row) const
Get seq-id (the first one if segments have different ids).
Definition: Seq_align.cpp:317
CSeq_annot_CI –.
CSeq_entry_Handle –.
Definition: Seq_entry.hpp:56
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:593
static CS_COMMAND * cmd
Definition: ct_dynamic.c:26
#define _(proto)
Definition: ct_nlmzip_i.h:78
static void Init(void)
Definition: cursor6.c:76
USING_SCOPE(objects)
unsigned int TSeqPos
Type for sequence locations and lengths.
Definition: ncbimisc.hpp:875
virtual void Assign(const CSerialObject &source, ESerialRecursionMode how=eRecursive)
Set object to copy of another one.
CRef< CSeq_loc > MakeSeq_loc(EMakeType make_type=eMake_CompactType) const
return constructed CSeq_loc with all changes
Definition: Seq_loc.cpp:2946
void Rewind(void)
Reset the iterator to the initial state.
Definition: Seq_loc.hpp:1104
void SetFrom(TSeqPos from)
Set the range from position.
Definition: Seq_loc.cpp:2818
void SetTo(TSeqPos to)
Set the range to position.
Definition: Seq_loc.cpp:2829
void Delete(void)
Delete current element, and make iterator to point to the next element.
Definition: Seq_loc.cpp:2724
ENa_strand GetStrand(void) const
Get the location's strand.
Definition: Seq_loc.cpp:882
virtual void Assign(const CSerialObject &source, ESerialRecursionMode how=eRecursive)
Override Assign() to incorporate cache invalidation.
Definition: Seq_loc.cpp:337
TSeqPos GetStart(ESeqLocExtremes ext) const
Return start and stop positions of the seq-loc.
Definition: Seq_loc.cpp:915
bool HasChanges(void) const
return true of any part was changed since initialization
Definition: Seq_loc.cpp:2706
size_t GetSize(void) const
Get number of ranges.
Definition: Seq_loc.cpp:2636
TRange GetRange(void) const
Get the range.
Definition: Seq_loc.hpp:1042
TSeqPos GetStop(ESeqLocExtremes ext) const
Definition: Seq_loc.cpp:963
static CRef< CObjectManager > GetInstance(void)
Return the existing object manager or create one.
CSeq_entry_Handle AddTopLevelSeqEntry(CSeq_entry &top_entry, TPriority pri=kPriority_Default, EExist action=eExist_Default)
Add seq_entry, default priority is higher than for defaults or loaders Add object to the score with p...
Definition: scope.cpp:522
TSeqPos GetBioseqLength(void) const
CSeq_entry_Handle GetSeq_entry_Handle(void) const
Get parent Seq-entry handle.
TSeq GetSeq(void) const
CConstRef< CSeq_entry > GetCompleteSeq_entry(void) const
Complete and get const reference to the seq-entry.
CScope & GetScope(void) const
Get scope this handle belongs to.
CRef< CSeq_loc > GetRangeSeq_loc(TSeqPos start, TSeqPos stop, ENa_strand strand=eNa_strand_unknown) const
Return CSeq_loc referencing the given range and strand on the bioseq If start == 0,...
bool IsNa(void) const
bool IsSynonym(const CSeq_id &id) const
Check if this id can be used to obtain this bioseq handle.
CSeqMap_I & Remove(void)
Remove current segment.
Definition: seq_map_ci.cpp:893
void GetSequence(string &buffer, CSeqUtil::ECoding buffer_coding) const
Get current sequence as a string with the selected encoding.
Definition: seq_map_ci.cpp:901
SSeqMapSelector & SetFlags(TFlags flags)
Select segment type(s)
Definition: seq_map_ci.hpp:179
void SetSequence(const string &buffer, CSeqUtil::ECoding buffer_coding, CSeq_data::E_Choice seq_data_coding)
Set sequence data.
Definition: seq_map_ci.cpp:937
const CSeq_graph & GetOriginalGraph(void) const
Get original graph with unmapped location/product.
Definition: graph_ci.hpp:70
TSeqPos GetLength(void) const
return length of current segment
Definition: seq_map_ci.hpp:672
CSeq_graph_Handle GetSeq_graph_Handle(void) const
Get original graph handle.
Definition: graph_ci.cpp:93
@ fFindData
Definition: seq_map.hpp:129
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
TTo GetTo(void) const
Get the To member data.
Definition: Range_.hpp:269
TFrom GetFrom(void) const
Get the From member data.
Definition: Range_.hpp:222
const TAnticodon & GetAnticodon(void) const
Get the Anticodon member data.
Definition: Trna_ext_.hpp:649
bool IsTRNA(void) const
Check if variant TRNA is selected.
Definition: RNA_ref_.hpp:498
bool IsSetAnticodon(void) const
location of anticodon Check if a value has been assigned to Anticodon data member.
Definition: Trna_ext_.hpp:637
bool IsSetExt(void) const
generic fields for ncRNA, tmRNA, miscRNA Check if a value has been assigned to Ext data member.
Definition: RNA_ref_.hpp:604
const TExt & GetExt(void) const
Get the Ext member data.
Definition: RNA_ref_.hpp:616
const TTRNA & GetTRNA(void) const
Get the variant data.
Definition: RNA_ref_.cpp:134
const TDenseg & GetDenseg(void) const
Get the variant data.
Definition: Seq_align_.cpp:153
const TStarts & GetStarts(void) const
Get the Starts member data.
Definition: Dense_seg_.hpp:530
const TLens & GetLens(void) const
Get the Lens member data.
Definition: Dense_seg_.hpp:555
bool IsSetSegs(void) const
Check if a value has been assigned to Segs data member.
Definition: Seq_align_.hpp:909
const TSegs & GetSegs(void) const
Get the Segs member data.
Definition: Seq_align_.hpp:921
bool IsDenseg(void) const
Check if variant Denseg is selected.
Definition: Seq_align_.hpp:740
bool IsSetData(void) const
the specific data Check if a value has been assigned to Data data member.
Definition: Seq_feat_.hpp:913
void SetLocation(TLocation &value)
Assign a value to Location data member.
Definition: Seq_feat_.cpp:131
bool IsCdregion(void) const
Check if variant Cdregion 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
void SetData(TData &value)
Assign a value to Data data member.
Definition: Seq_feat_.cpp:94
const TRna & GetRna(void) const
Get the variant data.
bool IsRna(void) const
Check if variant Rna is selected.
void SetFrame(TFrame value)
Assign a value to Frame data member.
Definition: Cdregion_.hpp:540
bool IsSetFrame(void) const
Check if a value has been assigned to Frame data member.
Definition: Cdregion_.hpp:509
@ eFrame_not_set
not set, code uses one
Definition: Cdregion_.hpp:95
@ eFrame_three
reading frame
Definition: Cdregion_.hpp:98
@ eNa_strand_minus
Definition: Na_strand_.hpp:67
bool IsSetLoc(void) const
region this applies to Check if a value has been assigned to Loc data member.
Definition: Seq_graph_.hpp:857
void ResetValues(void)
Reset Values data member.
Definition: Real_graph_.cpp:50
TValues & SetValues(void)
Assign a value to Values data member.
TByte & SetByte(void)
Select the variant.
Definition: Seq_graph_.cpp:159
const TInt & GetInt(void) const
Get the variant data.
Definition: Seq_graph_.cpp:131
void SetNumval(TNumval value)
Assign a value to Numval data member.
TReal & SetReal(void)
Select the variant.
Definition: Seq_graph_.cpp:115
TInt & SetInt(void)
Select the variant.
Definition: Seq_graph_.cpp:137
const TGraph & GetGraph(void) const
Get the Graph member data.
TValues & SetValues(void)
Assign a value to Values data member.
const TValues & GetValues(void) const
Get the Values member data.
Definition: Int_graph_.hpp:425
const TByte & GetByte(void) const
Get the variant data.
Definition: Seq_graph_.cpp:153
void SetGraph(TGraph &value)
Assign a value to Graph data member.
Definition: Seq_graph_.cpp:250
const TReal & GetReal(void) const
Get the variant data.
Definition: Seq_graph_.cpp:109
void ResetValues(void)
Reset Values data member.
Definition: Int_graph_.cpp:50
void ResetLoc(void)
Reset Loc data member.
Definition: Seq_graph_.cpp:215
const TValues & GetValues(void) const
Get the Values member data.
void ResetValues(void)
Reset Values data member.
Definition: Byte_graph_.cpp:50
E_Choice Which(void) const
Which variant is currently selected.
Definition: Seq_graph_.hpp:716
const TValues & GetValues(void) const
Get the Values member data.
void SetLoc(TLoc &value)
Assign a value to Loc data member.
Definition: Seq_graph_.cpp:224
const TLoc & GetLoc(void) const
Get the Loc member data.
Definition: Seq_graph_.hpp:869
TValues & SetValues(void)
Assign a value to Values data member.
Definition: Int_graph_.hpp:431
const TSeq & GetSeq(void) const
Get the variant data.
Definition: Seq_entry_.cpp:102
const TInst & GetInst(void) const
Get the Inst member data.
Definition: Bioseq_.hpp:336
@ e_Iupacna
IUPAC 1 letter nuc acid code.
Definition: Seq_data_.hpp:104
@ e_Iupacaa
IUPAC 1 letter amino acid code.
Definition: Seq_data_.hpp:105
END_EVENT_TABLE()
int i
int len
const struct ncbi::grid::netcache::search::fields::SIZE size
const char * command
double r(size_t dimension_, const Int4 *score_, const double *prob_, double theta_)
void copy(Njn::Matrix< S > *matrix_, const Njn::Matrix< T > &matrix0_)
Definition: njn_matrix.hpp:613
The Object manager core.
int offset
Definition: replacements.h:160
Utility macros and typedefs for exploring NCBI objects from seqfeat.asn.
#define EDIT_EACH_CODEBREAK_ON_CDREGION(Itr, Var)
#define ERASE_CODEBREAK_ON_CDREGION(Itr, Var)
ERASE_CODEBREAK_ON_CDREGION.
static static static wxID_ANY
SAnnotSelector –.
Selector used in CSeqMap methods returning iterators.
Definition: seq_map_ci.hpp:113
Modified on Sat Dec 09 04:48:23 2023 by modify_doxy.py rev. 669887