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

Go to the SVN repository for this file.

1 /* $Id: remove_sequences_from_alignments.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: Igor Filippov
27  */
28 
29 
30 #include <ncbi_pch.hpp>
31 
32 ////@begin includes
33 ////@end includes
34 
35 #include <objmgr/scope.hpp>
37 #include <objmgr/seq_annot_ci.hpp>
38 #include <objmgr/align_ci.hpp>
39 #include <objmgr/util/sequence.hpp>
40 #include <gui/objutils/label.hpp>
49 
50 #include <wx/button.h>
51 
52 ////@begin XPM images
53 ////@end XPM images
54 
56 
57 static bool GetIdLabel(const CSeq_id& id, set<string> &labels, const string name = "", bool detect = false, bool found = false)
58 {
59  string label;
60  id.GetLabel(&label);
61  if (!detect)
62  {
63  if (!label.empty())
64  labels.insert(label);
65  }
66  else
67  {
68  if (label == name) found = true;
69  }
70  return found;
71 }
72 
73 
74 template<class T>
75 static bool GetIds(const T& d, set<string> &labels, const string name = "", bool detect = false, bool found = false)
76 {
77  if (d.IsSetIds())
78  for (typename T::TIds::const_iterator id_iter = d.GetIds().begin(); id_iter != d.GetIds().end(); ++id_iter)
79  found = GetIdLabel(**id_iter, labels, name, detect, found);
80  return found;
81 }
82 
83 template<class T>
84 static bool GetSeqId(const T& d, set<string> &labels, const string name = "", bool detect = false, bool found = false)
85 {
86  if (d.IsSetId())
87  found = GetIdLabel(d.GetId(), labels, name, detect, found);
88  return found;
89 }
90 
91 
92 IMPLEMENT_DYNAMIC_CLASS( CRemoveSeqFromAlignDlg, wxDialog )
93 
94 
95 
96 BEGIN_EVENT_TABLE( CRemoveSeqFromAlignDlg, wxDialog )
97 
98 
100 
101 
103 {
104  Init();
105 }
106 
107 CRemoveSeqFromAlignDlg::CRemoveSeqFromAlignDlg( wxWindow* parent, objects::CSeq_entry_Handle seh,
108  wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style )
109 : m_TopSeqEntry(seh)
110 {
111  Init(seh);
112  Create(parent, id, caption, pos, size, style);
113 }
114 
115 bool CRemoveSeqFromAlignDlg::Create( wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style )
116 {
117  SetExtraStyle(wxWS_EX_BLOCK_EVENTS);
118  wxDialog::Create( parent, id, caption, pos, size, style );
119 
120  CreateControls();
121  if (GetSizer())
122  {
123  GetSizer()->SetSizeHints(this);
124  }
125  Centre();
126 
127  SetSize(wxSize(280, 600));
128  return true;
129 }
130 
131 
133 {
134 }
135 
136 
137 /*!
138  * Member initialisation
139  */
140 
142 {
143  m_ListCtrl = NULL;
144 }
145 
146 void CRemoveSeqFromAlignDlg::Init(objects::CSeq_entry_Handle seh)
147 {
148  m_ListCtrl = NULL;
149  SearchSeq_entry (seh, *(seh.GetCompleteSeq_entry()));
150 }
151 
152 
153 
154 
156 {
157  CRemoveSeqFromAlignDlg* itemDialog1 = this;
158 
159  wxBoxSizer* itemBoxSizer2 = new wxBoxSizer(wxVERTICAL);
160  itemDialog1->SetSizer(itemBoxSizer2);
161 
162  wxBoxSizer* itemBoxSizer3 = new wxBoxSizer(wxHORIZONTAL);
163  itemBoxSizer2->Add(itemBoxSizer3, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
164 
165  m_ListCtrl = new wxListCtrl( itemDialog1, ID_LISTCTRL_SEQ_ALIGN, wxDefaultPosition, wxSize(240, 550), wxLC_REPORT );
166  itemBoxSizer3->Add(m_ListCtrl, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
167 
168  m_ListCtrl->InsertColumn(0," Sequence ID",wxLIST_FORMAT_LEFT,237);
169  int i = 0;
170  for (set<string>::iterator e = m_Label.begin(); e != m_Label.end(); e++)
171  {
172  m_ListCtrl->InsertItem(i, ToWxString(*e));
173  i++;
174  }
175 
176  wxBoxSizer* itemBoxSizer12 = new wxBoxSizer(wxHORIZONTAL);
177  itemBoxSizer2->Add(itemBoxSizer12, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
178 
179  wxButton* itemButton13 = new wxButton( itemDialog1, wxID_OK, _("Accept"), wxDefaultPosition, wxDefaultSize, 0 );
180  itemBoxSizer12->Add(itemButton13, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
181 
182  wxButton* itemButton14 = new wxButton( itemDialog1, wxID_CANCEL, _("Cancel"), wxDefaultPosition, wxDefaultSize, 0 );
183  itemBoxSizer12->Add(itemButton14, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
184 }
185 
186 
187 /*!
188  * Should we show tooltips?
189  */
190 
192 {
193  return true;
194 }
195 
196 /*!
197  * Get bitmap resources
198  */
199 
200 wxBitmap CRemoveSeqFromAlignDlg::GetBitmapResource( const wxString& name )
201 {
202  // Bitmap retrieval
203  wxUnusedVar(name);
204  return wxNullBitmap;
205 }
206 
207 /*!
208  * Get icon resources
209  */
210 
211 wxIcon CRemoveSeqFromAlignDlg::GetIconResource( const wxString& name )
212 {
213  // Icon retrieval
214  wxUnusedVar(name);
215  return wxNullIcon;
216 }
217 
218 void CRemoveSeqFromAlignDlg::SearchSeq_entry (objects::CSeq_entry_Handle tse, const CSeq_entry& se)
219 {
221  for ( CSeq_annot_CI it(seh, CSeq_annot_CI::eSearch_entry); it ; ++it )
222  {
223  CConstRef<CSeq_annot> annot = it->GetCompleteSeq_annot();
224  if (annot->IsSetData() && annot->GetData().IsAlign())
225  {
226  CSeq_annot::C_Data::TAlign aligns = annot->GetData().GetAlign();
227  for (CSeq_annot::C_Data::TAlign::iterator a=aligns.begin(); a!=aligns.end(); a++)
228  GetAlignLabel(**a);
229  }
230  }
231 
232 
233  if (se.IsSet())
234  {
236  {
237  SearchSeq_entry (tse, **it);
238  }
239  }
240 }
241 
242 bool CRemoveSeqFromAlignDlg::GetIdsFromLocs(const CStd_seg::TLoc& locs, set<string> &labels, const string name, bool detect, bool found)
243 {
244  for (CStd_seg::TLoc::const_iterator l = locs.begin(); l != locs.end(); ++l)
245  found = GetIdsFromLoc(**l, labels, name, detect, found);
246  return found;
247 }
248 
249 bool CRemoveSeqFromAlignDlg::GetIdsFromLoc(const CSeq_loc& loc, set<string> &labels, const string name, bool detect, bool found)
250 {
251  switch (loc.Which())
252  {
253  case CSeq_loc::e_Empty: found = GetIdLabel(loc.GetEmpty(), labels, name, detect, found); break;
254  case CSeq_loc::e_Whole: found = GetIdLabel(loc.GetWhole(), labels, name, detect, found); break;
255  case CSeq_loc::e_Int: found = GetSeqId(loc.GetInt(), labels, name, detect, found); break;
257  if (loc.GetPacked_int().CanGet())
258  for (CPacked_seqint::Tdata::const_iterator d = loc.GetPacked_int().Get().begin(); d != loc.GetPacked_int().Get().end(); ++d)
259  found = GetSeqId(**d, labels, name, detect, found);
260  break;
261  case CSeq_loc::e_Pnt: found = GetSeqId(loc.GetPnt(), labels, name, detect, found); break;
262  case CSeq_loc::e_Packed_pnt: found = GetSeqId(loc.GetPacked_pnt(), labels, name, detect, found); break;
263  case CSeq_loc::e_Mix:
264  if (loc.GetMix().CanGet())
265  for (CSeq_loc_mix::Tdata::const_iterator d = loc.GetMix().Get().begin(); d != loc.GetMix().Get().end(); ++d)
266  found = GetIdsFromLoc(**d, labels, name, detect, found);
267  break;
268  case CSeq_loc::e_Equiv:
269  if (loc.GetEquiv().CanGet())
270  for (CSeq_loc_equiv::Tdata::const_iterator d = loc.GetEquiv().Get().begin(); d != loc.GetEquiv().Get().end(); ++d)
271  found = GetIdsFromLoc(**d, labels, name, detect, found);
272  break;
273  case CSeq_loc::e_Bond:
274  if (loc.GetBond().CanGetA())
275  found = GetSeqId(loc.GetBond().GetA(), labels, name, detect, found);
276  break;
277  case CSeq_loc::e_Feat:
278  default: break;
279  }
280  return found;
281 }
282 
284 {
285  if (align.IsSetSegs())
286  {
287  switch(align.GetSegs().Which())
288  {
290  for (CSeq_align::C_Segs::TDendiag::const_iterator d = align.GetSegs().GetDendiag().begin(); d != align.GetSegs().GetDendiag().end(); ++d)
291  GetIds(**d, m_Label);
292  break;
293  case CSeq_align::C_Segs::e_Denseg: // segments
294  GetIds(align.GetSegs().GetDenseg(), m_Label);
295  break;
297  for (CSeq_align::C_Segs::TStd::const_iterator d = align.GetSegs().GetStd().begin(); d != align.GetSegs().GetStd().end(); ++d) // iterate over seq loc. See SeqIdPtrFromSeqAlign in salpacc.c
298  { // also SeqLocId in sequtil.c
299  GetIds(**d, m_Label);
300  if (!(*d)->IsSetIds() && (*d)->IsSetLoc())
301  GetIdsFromLocs((*d)->GetLoc(), m_Label);
302  }
303  break;
304  case CSeq_align::C_Segs::e_Packed: // segments
305  GetIds(align.GetSegs().GetPacked(), m_Label);
306  break;
308  for (CSeq_align::C_Segs::TDisc::Tdata::const_iterator a = align.GetSegs().GetDisc().Get().begin(); a != align.GetSegs().GetDisc().Get().end(); ++a)
309  GetAlignLabel(**a);
310  break;
312  {
313  if (align.GetSegs().GetSpliced().IsSetProduct_id())
315  if (align.GetSegs().GetSpliced().IsSetGenomic_id())
317  break;
318  }
320  if (align.GetSegs().GetSparse().IsSetRows())
321  {
322  for (CSeq_align::C_Segs::TSparse::TRows::const_iterator d = align.GetSegs().GetSparse().GetRows().begin(); d != align.GetSegs().GetSparse().GetRows().end(); ++d)
323  {
324  if ((*d)->IsSetFirst_id()) GetIdLabel((*d)->GetFirst_id(), m_Label);
325  if ((*d)->IsSetSecond_id()) GetIdLabel((*d)->GetSecond_id(), m_Label);
326  }
327  }
328  break;
329  default: break;
330  }
331  }
332 }
333 
334 
335 bool CRemoveSeqFromAlignDlg::RemoveIdLabel(const CSeq_align& align, const string name, bool& modified)
336 {
337  set<string> labels;
338  bool rem = false;
339  if (align.IsSetSegs()) // Kill the whole align if it's pairwise align GetIds().size() == 2.
340  // TODO - sequin does not like if it's #1 seqid in a pair-wise align
341  { // See CheckForRemoveSequenceFromAlignmentsProblemsCallback in sqnutil3.c
342  // and SeqIdOrderInBioseqIdList in sequtil.c; Note that SeqIdOrderInBioseqIdList counts from 1 !!!!
343  switch(align.GetSegs().Which())
344  {
345  case CSeq_align::C_Segs::e_Dendiag: // Dendiag is removed if id is found. See RemoveOneSequenceFromAlignment in sqnutil3.c
346  for (CSeq_align::C_Segs::TDendiag::const_iterator d = align.GetSegs().GetDendiag().begin(); d != align.GetSegs().GetDendiag().end(); ++d)
347  rem = rem || GetIds(**d, labels, name,true);
348  break;
349  case CSeq_align::C_Segs::e_Denseg: // segments - the only one potentially not killed outright. see SeqAlignBioseqDeleteById in salpedit.c
350  if (GetIds(align.GetSegs().GetDenseg(), labels, name,true))
351  {
352  if (align.GetSegs().GetDenseg().GetIds().size() == 2)
353  rem = true;
354  else
355  modified = true;
356  }
357  break;
359  for (CSeq_align::C_Segs::TStd::const_iterator d = align.GetSegs().GetStd().begin(); d != align.GetSegs().GetStd().end(); ++d)
360  {
361  bool find_id = GetIds(**d, labels, name,true);
362  if (!(*d)->IsSetIds() && (*d)->IsSetLoc())
363  find_id = GetIdsFromLocs((*d)->GetLoc(), labels, name,true,find_id);
364  int dim = 2;
365  if ((*d)->IsSetIds())
366  dim = static_cast<int>((*d)->GetIds().size());
367  else if ( (*d)->IsSetDim() )
368  dim = (*d)->GetDim();
369  rem = rem || (find_id && dim == 2);
370  }
371  break;
372  case CSeq_align::C_Segs::e_Packed: // segments
373  if (GetIds(align.GetSegs().GetPacked(), labels, name,true) && align.GetSegs().GetPacked().GetIds().size() == 2)
374  rem = true;
375  break;
377  for (CSeq_align::C_Segs::TDisc::Tdata::const_iterator a = align.GetSegs().GetDisc().Get().begin(); a != align.GetSegs().GetDisc().Get().end(); ++a)
378  rem = rem || RemoveIdLabel(**a, name, modified); // Should we remove only the underlying sub-align?
379  break;
381  {
382  if (align.GetSegs().GetSpliced().IsSetProduct_id())
383  rem = rem || GetIdLabel(align.GetSegs().GetSpliced().GetProduct_id(), labels, name, true);
384  if (align.GetSegs().GetSpliced().IsSetGenomic_id())
385  rem = rem || GetIdLabel(align.GetSegs().GetSpliced().GetGenomic_id(), labels, name, true);
386  break;
387  }
389  if (align.GetSegs().GetSparse().IsSetRows())
390  {
391  unsigned int num = 0;
392  for (CSeq_align::C_Segs::TSparse::TRows::const_iterator d = align.GetSegs().GetSparse().GetRows().begin(); d != align.GetSegs().GetSparse().GetRows().end(); ++d)
393  {
394  bool found = false;
395  if ((*d)->IsSetFirst_id()) found = GetIdLabel((*d)->GetFirst_id(), labels, name, true);
396  if ((*d)->IsSetSecond_id()) found = found || GetIdLabel((*d)->GetSecond_id(), labels, name, true);
397  if (found) num++;
398  }
399  if (num == align.GetSegs().GetSparse().GetRows().size()) rem = true;
400  else if (num > 0 ) modified = true;
401  }
402  break;
403  default: break;
404  }
405  }
406  return rem;
407 }
408 
409 
411 {
412  long item = -1;
413  CRef<CCmdComposite> cmd( new CCmdComposite("Remove Sequences From Alignments") );
414  vector<string> names;
415  if (m_ListCtrl && m_TopSeqEntry)
416  for ( ;; )
417  {
418  item = m_ListCtrl->GetNextItem(item, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED);
419  if ( item == -1 ) break;
420  string name = ToStdString(m_ListCtrl->GetItemText(item));
421  names.push_back(name);
422  }
423  if (!names.empty())
425  return cmd;
426 }
427 
429 {
430  set<string> labels;
431  if (align->IsSetSegs() && align->GetSegs().Which() == CSeq_align::C_Segs::e_Denseg
432  && GetIds(align->GetSegs().GetDenseg(), labels, name,true) && align->GetSegs().GetDenseg().GetIds().size() != 2)
433  {
434  unsigned int dim = static_cast<unsigned int>(align->GetSegs().GetDenseg().GetIds().size());
435  unsigned int index = 0;
436  bool found = false;
437  CDense_seg::TIds ids;
438  for (CDense_seg::TIds::const_iterator id_iter = align->GetSegs().GetDenseg().GetIds().begin(); id_iter != align->GetSegs().GetDenseg().GetIds().end(); ++id_iter)
439  {
440  if (GetIdLabel(**id_iter, labels, name,true)) found = true;
441  else ids.push_back(*id_iter);
442 
443  if (!found) index++;
444  }
445 
446  if (align->GetSegs().GetDenseg().IsSetNumseg() && index<align->GetSegs().GetDenseg().GetIds().size())
447  {
448  unsigned int numseg = align->GetSegs().GetDenseg().GetNumseg();
449  // remove starts, strands
450  CDense_seg::TStarts starts;
451  CDense_seg::TStarts::const_iterator start_iter;
452  CDense_seg::TStrands strands;
453  CDense_seg::TStrands::const_iterator strand_iter;
454 
455  if (align->GetSegs().GetDenseg().IsSetStarts()) start_iter = align->GetSegs().GetDenseg().GetStarts().begin();
456  if (align->GetSegs().GetDenseg().IsSetStrands()) strand_iter = align->GetSegs().GetDenseg().GetStrands().begin();
457 
458  for (unsigned int seg = 0; seg<numseg; seg++)
459  for (unsigned int i=0; i<dim; i++)
460  if (i != index)
461  {
462  if (align->GetSegs().GetDenseg().IsSetStarts() && start_iter != align->GetSegs().GetDenseg().GetStarts().end())
463  {
464  starts.push_back(*start_iter);
465  start_iter++;
466  }
467  if (align->GetSegs().GetDenseg().IsSetStrands() && strand_iter != align->GetSegs().GetDenseg().GetStrands().end())
468  {
469  strands.push_back(*strand_iter);
470  strand_iter++;
471  }
472  }
473  else
474  {
475  if (align->GetSegs().GetDenseg().IsSetStarts() && start_iter != align->GetSegs().GetDenseg().GetStarts().end())
476  start_iter++;
477 
478  if (align->GetSegs().GetDenseg().IsSetStrands() && strand_iter != align->GetSegs().GetDenseg().GetStrands().end())
479  strand_iter++;
480 
481  }
482 
483  if (align->GetSegs().GetDenseg().IsSetStarts()) align->SetSegs().SetDenseg().SetStarts().swap(starts);
484  if (align->GetSegs().GetDenseg().IsSetStrands()) align->SetSegs().SetDenseg().SetStrands().swap(strands);
485  }
486 
487  align->SetSegs().SetDenseg().SetDim(static_cast<CDense_seg::TDim>(ids.size()));
488  align->SetDim(static_cast<CSeq_align::TDim>(ids.size()));
489  align->SetSegs().SetDenseg().SetIds().swap(ids);
490  align->SetSegs().SetDenseg().RemovePureGapSegs(); // sets numsegs correctly
491  }
492  else if (align->IsSetSegs() && align->GetSegs().Which() == CSeq_align::C_Segs::e_Sparse &&
493  align->GetSegs().GetSparse().IsSetRows())
494  {
495  CSeq_align::C_Segs::TSparse::TRows rows;
496  CSeq_align::C_Segs::TSparse::TRow_scores row_scores;
497  CSeq_align::C_Segs::TSparse::TExt ext;
498  int i=0;
499  for (CSeq_align::C_Segs::TSparse::TRows::const_iterator d = align->GetSegs().GetSparse().GetRows().begin(); d != align->GetSegs().GetSparse().GetRows().end(); ++d)
500  {
501  bool found = false;
502  if ((*d)->IsSetFirst_id()) found = GetIdLabel((*d)->GetFirst_id(), labels, name, true);
503  if ((*d)->IsSetSecond_id()) found = found || GetIdLabel((*d)->GetSecond_id(), labels, name, true);
504  if (!found)
505  {
506  rows.push_back(*d);
507  if (align->GetSegs().GetSparse().IsSetRow_scores()) row_scores.push_back(align->GetSegs().GetSparse().GetRow_scores()[i]);
508  if (align->GetSegs().GetSparse().IsSetExt()) ext.push_back(align->GetSegs().GetSparse().GetExt()[i]);
509  }
510  i++;
511  }
512  align->SetSegs().SetSparse().SetRows().swap(rows);
513  if (align->GetSegs().GetSparse().IsSetRow_scores()) align->SetSegs().SetSparse().SetRow_scores().swap(row_scores);
514  if (align->GetSegs().GetSparse().IsSetExt()) align->SetSegs().SetSparse().SetExt().swap(ext);
515 
516  }
517 }
518 
519 void CRemoveSeqFromAlignDlg::ApplyToCSeq_entry (objects::CSeq_entry_Handle tse, CCmdComposite* composite, const vector<string> &names)
520 {
521  for ( CSeq_annot_CI it(tse); it ; ++it )
522  {
523  int deleted = 0;
524  int total = 0;
525  for (CAlign_CI align_ci(*it); align_ci; ++align_ci, ++total)
526  {
527  bool modified = false;
528  bool to_delete = false;
529  for (auto name : names)
530  to_delete |= RemoveIdLabel(align_ci.GetOriginalSeq_align(), name, modified);
531 
532  if (!to_delete && modified)
533  {
534  CRef<CSeq_align> edited_align(new CSeq_align());
535  edited_align->Assign(align_ci.GetOriginalSeq_align());
536  for (auto name : names)
537  ModifyAlign (edited_align,name);
538  if (edited_align->CheckNumRows() < 2)
539  to_delete = true;
540  else
541  {
542  CIRef<IEditCommand> cmd(new CCmdChangeAlign(align_ci.GetSeq_align_Handle(),*edited_align));
543  composite->AddCommand(*cmd);
544  }
545  }
546  if (to_delete)
547  {
548  CIRef<IEditCommand> cmdDelAlign(new CCmdDelSeq_align(align_ci.GetSeq_align_Handle()));
549  composite->AddCommand(*cmdDelAlign);
550  deleted++;
551  }
552  }
553  // If all aligns have been removed kill annot as well. See RemoveOneSequenceFromAlignment in sqnutil3.c
554  if (deleted == total && it->IsAlign())
555  {
556  CIRef<IEditCommand> cmdDelAnnot(new CCmdDelSeq_annot(*it));
557  composite->AddCommand(*cmdDelAnnot);
558  }
559  }
560 }
561 
562 
564 
565 
566 
567 
568 
569 
570 
571 
572 
573 
574 
575 
576 
577 
578 
579 
580 
581 
582 
583 
584 
585 
586 
CAlign_CI –.
Definition: align_ci.hpp:63
void AddCommand(IEditCommand &command)
static void ApplyToCSeq_entry(objects::CSeq_entry_Handle tse, CCmdComposite *composite, const vector< string > &names)
void SearchSeq_entry(objects::CSeq_entry_Handle tse, const CSeq_entry &se)
static void ModifyAlign(CRef< CSeq_align > align, const string name)
static bool GetIdsFromLocs(const CStd_seg::TLoc &locs, set< string > &labels, const string name="", bool detect=false, bool found=false)
wxBitmap GetBitmapResource(const wxString &name)
Retrieves bitmap resources.
static bool RemoveIdLabel(const CSeq_align &align, string name, bool &modified)
void CreateControls()
Creates the controls and sizers.
static bool ShowToolTips()
Should we show tooltips?
bool Create(wxWindow *parent, wxWindowID id=12000, const wxString &caption=_("Remove Sequences From Alignments"), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU|wxCLOSE_BOX|wxTAB_TRAVERSAL)
Creation.
void Init()
Initialises member variables.
objects::CSeq_entry_Handle m_TopSeqEntry
static bool GetIdsFromLoc(const CSeq_loc &loc, set< string > &labels, const string name="", bool detect=false, bool found=false)
wxIcon GetIconResource(const wxString &name)
Retrieves icon resources.
void GetAlignLabel(const CSeq_align &align)
TDim CheckNumRows(void) const
Validatiors.
Definition: Seq_align.cpp:73
CSeq_annot_CI –.
CSeq_entry_Handle –.
Definition: Seq_entry.hpp:56
iterator_bool insert(const value_type &val)
Definition: set.hpp:149
const_iterator begin() const
Definition: set.hpp:135
const_iterator end() const
Definition: set.hpp:136
#define _(proto)
Definition: ct_nlmzip_i.h:78
#define T(s)
Definition: common.h:230
TIDRefCont::const_iterator find_id(const TIDRefCont &cont, const IHitSeqId &id)
Definition: dense_ds.cpp:170
static CS_COMMAND * cmd
Definition: ct_dynamic.c:26
static const struct name_t names[]
static void Init(void)
Definition: cursor6.c:76
#define NULL
Definition: ncbistd.hpp:225
virtual void Assign(const CSerialObject &source, ESerialRecursionMode how=eRecursive)
Set object to copy of another one.
CSeq_entry_Handle GetSeq_entryHandle(CDataLoader *loader, const TBlobId &blob_id, EMissing action=eMissing_Default)
Get Seq-entry handle by its blob-id, with possible loading.
Definition: scope.cpp:113
CScope & GetScope(void) const
Get scope this handle belongs to.
#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 const char label[]
const TDenseg & GetDenseg(void) const
Get the variant data.
Definition: Seq_align_.cpp:153
const TExt & GetExt(void) const
Get the Ext member data.
vector< CRef< CSeq_loc > > TLoc
Definition: Std_seg_.hpp:93
const TGenomic_id & GetGenomic_id(void) const
Get the Genomic_id member data.
bool IsSetNumseg(void) const
number of segments here Check if a value has been assigned to Numseg data member.
Definition: Dense_seg_.hpp:446
E_Choice Which(void) const
Which variant is currently selected.
Definition: Seq_align_.hpp:691
bool IsSetStrands(void) const
Check if a value has been assigned to Strands data member.
Definition: Dense_seg_.hpp:568
const TStarts & GetStarts(void) const
Get the Starts member data.
Definition: Dense_seg_.hpp:530
const TProduct_id & GetProduct_id(void) const
Get the Product_id member data.
void SetSegs(TSegs &value)
Assign a value to Segs data member.
Definition: Seq_align_.cpp:310
vector< ENa_strand > TStrands
Definition: Dense_seg_.hpp:109
bool IsSetSegs(void) const
Check if a value has been assigned to Segs data member.
Definition: Seq_align_.hpp:909
void SetDim(TDim value)
Assign a value to Dim data member.
Definition: Seq_align_.hpp:865
vector< TSignedSeqPos > TStarts
Definition: Dense_seg_.hpp:107
vector< CRef< CSeq_id > > TIds
Definition: Dense_seg_.hpp:106
bool IsSetProduct_id(void) const
product is either protein or transcript (cDNA) Check if a value has been assigned to Product_id data ...
const TSpliced & GetSpliced(void) const
Get the variant data.
Definition: Seq_align_.cpp:219
const TPacked & GetPacked(void) const
Get the variant data.
Definition: Seq_align_.cpp:175
const TStd & GetStd(void) const
Get the variant data.
Definition: Seq_align_.hpp:752
const TIds & GetIds(void) const
Get the Ids member data.
const TDendiag & GetDendiag(void) const
Get the variant data.
Definition: Seq_align_.hpp:726
bool IsSetStarts(void) const
start OFFSETS in ids order within segs Check if a value has been assigned to Starts data member.
Definition: Dense_seg_.hpp:518
const TRow_scores & GetRow_scores(void) const
Get the Row_scores member data.
const TIds & GetIds(void) const
Get the Ids member data.
Definition: Dense_seg_.hpp:505
bool IsSetExt(void) const
index of extra items Check if a value has been assigned to Ext data member.
TNumseg GetNumseg(void) const
Get the Numseg member data.
Definition: Dense_seg_.hpp:465
const TSparse & GetSparse(void) const
Get the variant data.
Definition: Seq_align_.cpp:241
const TRows & GetRows(void) const
Get the Rows member data.
const TDisc & GetDisc(void) const
Get the variant data.
Definition: Seq_align_.cpp:197
const TStrands & GetStrands(void) const
Get the Strands member data.
Definition: Dense_seg_.hpp:580
const Tdata & Get(void) const
Get the member data.
const TSegs & GetSegs(void) const
Get the Segs member data.
Definition: Seq_align_.hpp:921
bool IsSetRow_scores(void) const
per-row scores Check if a value has been assigned to Row_scores data member.
bool IsSetRows(void) const
pairwise alignments constituting this multiple alignment Check if a value has been assigned to Rows d...
bool IsSetGenomic_id(void) const
Check if a value has been assigned to Genomic_id data member.
@ e_Equiv
equivalent sets of locations
Definition: Seq_loc_.hpp:106
@ 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
const TSet & GetSet(void) const
Get the variant data.
Definition: Seq_entry_.cpp:124
bool IsSet(void) const
Check if variant Set is selected.
Definition: Seq_entry_.hpp:263
bool IsAlign(void) const
Check if variant Align is selected.
Definition: Seq_annot_.hpp:635
bool IsSetData(void) const
Check if a value has been assigned to Data data member.
Definition: Seq_annot_.hpp:861
list< CRef< CSeq_align > > TAlign
Definition: Seq_annot_.hpp:194
const TAlign & GetAlign(void) const
Get the variant data.
Definition: Seq_annot_.hpp:641
const TData & GetData(void) const
Get the Data member data.
Definition: Seq_annot_.hpp:873
END_EVENT_TABLE()
int i
const struct ncbi::grid::netcache::search::fields::SIZE size
unsigned int a
Definition: ncbi_localip.c:102
static bool GetIds(const T &d, set< string > &labels, const string name="", bool detect=false, bool found=false)
static bool GetIdLabel(const CSeq_id &id, set< string > &labels, const string name="", bool detect=false, bool found=false)
static bool GetSeqId(const T &d, set< string > &labels, const string name="", bool detect=false, bool found=false)
#define ID_LISTCTRL_SEQ_ALIGN
#define FOR_EACH_SEQENTRY_ON_SEQSET(Itr, Var)
FOR_EACH_SEQENTRY_ON_SEQSET EDIT_EACH_SEQENTRY_ON_SEQSET.
wxString ToWxString(const string &s)
Definition: wx_utils.hpp:173
string ToStdString(const wxString &s)
Definition: wx_utils.hpp:161
Modified on Tue Jul 09 14:21:10 2024 by modify_doxy.py rev. 669887