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

Go to the SVN repository for this file.

1 /* $Id: single_sequence_panel.cpp 47485 2023-05-02 14:46:59Z 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: Andrea Asztalos
27 *
28 */
29 
30 #include <ncbi_pch.hpp>
32 #include <objmgr/seqdesc_ci.hpp>
33 #include <objmgr/bioseq_ci.hpp>
34 #include <objects/seq/Seq_inst.hpp>
35 #include <objects/seq/Bioseq.hpp>
36 #include <objects/seq/Seq_ext.hpp>
40 #include <objects/seq/MolInfo.hpp>
44 
45 
46 #include <wx/sizer.h>
47 #include <wx/textctrl.h>
48 #include <wx/choice.h>
49 #include <wx/stattext.h>
50 #include <wx/checkbox.h>
51 #include <wx/icon.h>
52 
54 
55 /*
56  * CSingleSequencePanel type definition
57  */
58 
59 IMPLEMENT_DYNAMIC_CLASS( CSingleSequencePanel, wxPanel )
60 
61 
62 /*
63  * CSingleSequencePanel event table definition
64  */
65 
66 BEGIN_EVENT_TABLE( CSingleSequencePanel, wxPanel )
67 
68 ////@begin CSingleSequencePanel event table entries
69  EVT_CHOICE(ID_SINGLESEQID, CSingleSequencePanel::OnChangeSeqId)
70 ////@end CSingleSequencePanel event table entries
71 
73 
74 
75 /*
76  * CSingleSequencePanel constructors
77  */
78 
80  : m_is_organelle(false)
81 {
82  Init();
83 }
84 
85 CSingleSequencePanel::CSingleSequencePanel( wxWindow* parent, objects::CSeq_entry_Handle seh, objects::CSubSource::ESubtype subtype, bool is_organelle,
86  const vector<objects::CBioSource::EGenome> &organelle_types,wxWindowID id, const wxPoint& pos, const wxSize& size, long style )
87  : m_Seh(seh), m_Subtype(subtype), m_is_organelle(is_organelle), m_organelle_types(organelle_types)
88 {
89  Init();
90  Create(parent, id, pos, size, style);
91 }
92 
93 
94 /*
95  * CSingleSequencePanel creator
96  */
97 
98 bool CSingleSequencePanel::Create( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style )
99 {
100 ////@begin CSingleSequencePanel creation
101  SetExtraStyle(wxWS_EX_VALIDATE_RECURSIVELY);
102  wxPanel::Create( parent, id, pos, size, style );
103 
104  CreateControls();
105  if (GetSizer())
106  {
107  GetSizer()->SetSizeHints(this);
108  }
109  Centre();
110 ////@end CSingleSequencePanel creation
111  return true;
112 }
113 
114 
115 /*
116  * CSingleSequencePanel destructor
117  */
118 
120 {
121 ////@begin CSingleSequencePanel destruction
122 ////@end CSingleSequencePanel destruction
123 }
124 
125 
126 /*
127  * Member initialisation
128  */
129 
131 {
132 ////@begin CSingleSequencePanel member initialisation
133  m_SeqId = NULL;
135  m_NameCtrl = NULL;
137  m_Complete = NULL;
138  m_Circular = NULL;
139 ////@end CSingleSequencePanel member initialisation
140 }
141 
142 
143 /*
144  * Control creation for CSingleSequencePanel
145  */
146 
148 {
149 ////@begin CSingleSequencePanel content construction
150  CSingleSequencePanel* itemPanel1 = this;
151 
152  wxBoxSizer* itemBoxSizer2 = new wxBoxSizer(wxVERTICAL);
153  itemPanel1->SetSizer(itemBoxSizer2);
154 
155  wxBoxSizer* itemBoxSizer1 = new wxBoxSizer(wxHORIZONTAL);
156  itemBoxSizer2->Add(itemBoxSizer1, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 0);
157 
158  wxArrayString m_SeqIdStrings;
159  m_SeqIdStrings.Add(wxT(""));
160  // populate seq-id strings
161  for (objects::CBioseq_CI bi(m_Seh, objects::CSeq_inst::eMol_na); bi; ++bi) {
162  string id_str = bi->GetSeqId()->AsFastaString();
163  m_SeqIdStrings.Add(ToWxString(id_str));
164  }
165 
166  m_SeqId = new wxChoice( itemPanel1, ID_SINGLESEQID, wxDefaultPosition, wxSize(130, -1), m_SeqIdStrings, 0 );
167  itemBoxSizer1->Add(m_SeqId, 0, wxALIGN_CENTER_VERTICAL|wxALL, 0);
168 
169  m_LengthLabel = new wxStaticText( itemPanel1, wxID_STATIC, wxEmptyString, wxDefaultPosition, wxSize(70, -1), wxALIGN_CENTRE);
170  itemBoxSizer1->Add(m_LengthLabel, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 5);
171 
172  if (m_is_organelle)
173  {
174  wxArrayString choices;
175  for (auto o : m_organelle_types)
176  {
177  choices.Add(wxString(objects::CBioSource::ENUM_METHOD_NAME(EGenome)()->FindName(o, true)));
178  }
179  m_OrganelleCtrl = new wxChoice(itemPanel1, ID_ORGANELLE_CHOICE, wxDefaultPosition, wxDefaultSize, choices, 0);
180 #ifdef __WXOSX_COCOA__
181  m_OrganelleCtrl->SetSelection(-1);
182 #endif
183  itemBoxSizer1->Add(m_OrganelleCtrl, 0, wxALIGN_CENTER_VERTICAL|wxALL, 0);
184  }
185  else
186  {
187 #ifdef __WXMSW__
188  m_NameCtrl = new wxTextCtrl(itemPanel1, ID_SEQNAMETEXTCTRL, wxEmptyString, wxDefaultPosition, wxSize(100, -1), 0);
189 #else
190  m_NameCtrl = new wxTextCtrl(itemPanel1, ID_SEQNAMETEXTCTRL, wxEmptyString, wxDefaultPosition, wxSize(120, -1), 0);
191 #endif
192 
193  itemBoxSizer1->Add(m_NameCtrl, 0, wxALIGN_CENTER_VERTICAL|wxALL, 0);
194  }
195 
196  itemBoxSizer1->Add(30, 5, 0, wxALIGN_CENTER_VERTICAL|wxALL, 0);
197 
198  m_Complete = new wxCheckBox( itemPanel1, ID_SEQCOMPLETECHK, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
199  m_Complete->SetValue(false);
200  itemBoxSizer1->Add(m_Complete, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 5);
201 
202  itemBoxSizer1->Add(30, 5, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 0);
203 
204  m_Circular = new wxCheckBox( itemPanel1, ID_SEQCIRCULARCHK, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
205  m_Circular->SetValue(false);
206  itemBoxSizer1->Add(m_Circular, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 5);
207 
208  itemBoxSizer1->Add(13, 5, 0, wxALIGN_CENTER_VERTICAL|wxALL, 0);
209 
210 ////@end CSingleSequencePanel content construction
211  if (m_Subtype == objects::CSubSource::eSubtype_plasmid_name) {
212  m_NameCtrl->SetToolTip(wxT("Plasmid names must begin with 'p'. However, use 'unnamed' if the name \
213 is not determined; use 'unnamed1' and 'unnamed2', etc(without spaces) \
214 if there are multiple plasmids whose names are not determined."));
215  } else if (m_Subtype == objects::CSubSource::eSubtype_chromosome) {
216  m_NameCtrl->SetToolTip(wxT("Use the community accepted values for the chromosome or \
217 linkage group name, eg 1 or IX or LG3"));
218  m_Complete->SetToolTip(wxT("This sequence represents the chromosome, although it may still have \
219 gaps or be missing telomere or centromere sequence."));
220  }
221 }
222 
223 
225 {
226  if (m_NameCtrl)
227  m_NameCtrl->Enable(value);
228 }
229 
230 
231 /*
232  * Should we show tooltips?
233  */
234 
236 {
237  return true;
238 }
239 
240 /*
241  * Get bitmap resources
242  */
243 
244 wxBitmap CSingleSequencePanel::GetBitmapResource( const wxString& name )
245 {
246  // Bitmap retrieval
247 ////@begin CSingleSequencePanel bitmap retrieval
248  wxUnusedVar(name);
249  return wxNullBitmap;
250 ////@end CSingleSequencePanel bitmap retrieval
251 }
252 
253 /*
254  * Get icon resources
255  */
256 
257 wxIcon CSingleSequencePanel::GetIconResource( const wxString& name )
258 {
259  // Icon retrieval
260 ////@begin CSingleSequencePanel icon retrieval
261  wxUnusedVar(name);
262  return wxNullIcon;
263 ////@end CSingleSequencePanel icon retrieval
264 }
265 
266 bool CSingleSequencePanel::NeedsRow(objects::CBioseq_Handle bh, objects::CSubSource::ESubtype subtype)
267 {
268  objects::CSeqdesc_CI di(bh, objects::CSeqdesc::e_Source);
269  if (di) {
270  const objects::CBioSource& src = di->GetSource();
271  if (subtype == objects::CSubSource::eSubtype_plasmid_name
272  && src.IsSetGenome() && src.GetGenome() == objects::CBioSource::eGenome_plasmid) {
273  return true;
274  } else if (subtype == objects::CSubSource::eSubtype_chromosome
275  && src.IsSetGenome() && src.GetGenome() == objects::CBioSource::eGenome_chromosome) {
276  return true;
277  }
278 
279  if (di->GetSource().IsSetSubtype()) {
280  for (auto s : di->GetSource().GetSubtype()) {
281  if (s->IsSetSubtype() && s->GetSubtype() == subtype &&
282  s->IsSetName() && !NStr::IsBlank(s->GetName())) {
283  return true;
284  }
285  }
286  }
287  }
288  return false;
289 }
290 
291 bool CSingleSequencePanel::NeedsOrganelleRow(objects::CBioseq_Handle bh, const vector<objects::CBioSource::EGenome> &organelle_types)
292 {
293  objects::CSeqdesc_CI di(bh, objects::CSeqdesc::e_Source);
294  if (di && di->GetSource().IsSetGenome()) {
295  auto it = find(organelle_types.begin(), organelle_types.end(), di->GetSource().GetGenome());
296  if (it != organelle_types.end())
297  return true;
298  }
299  return false;
300 }
301 
302 bool s_HasGaps(objects::CBioseq_Handle bh)
303 {
304  const objects::CBioseq& seq = *(bh.GetCompleteBioseq());
305  if (!seq.IsSetInst() || !seq.GetInst().IsSetExt() ||
306  !seq.GetInst().GetExt().IsDelta() ||
307  !seq.GetInst().GetExt().GetDelta().IsSet()) {
308  return false;
309  }
310 
311  bool found_gap = false;
312  for (auto it : seq.GetInst().GetExt().GetDelta().Get()) {
313  if (it->IsLiteral()) {
314  if (!it->GetLiteral().IsSetSeq_data()) {
315  found_gap = true;
316  break;
317  } else if (it->GetLiteral().GetSeq_data().IsGap()) {
318  found_gap = true;
319  break;
320  }
321  }
322  }
323 
324  return found_gap;
325 }
326 
327 
328 void CSingleSequencePanel::SetValue(objects::CBioseq_Handle bh)
329 {
330  m_Circular->SetValue(bh.IsSetInst_Topology() && bh.GetInst_Topology() == objects::CSeq_inst::eTopology_circular);
331 
332  m_LengthLabel->SetLabel(ToWxString(NStr::NumericToString(bh.GetBioseqLength())));
333 
334  bool is_complete = false;
335  objects::CSeqdesc_CI di(bh, objects::CSeqdesc::e_Source);
336  if (di && di->GetSource().IsSetSubtype()) {
337  const objects::CBioSource& src = di->GetSource();
338  if (m_Subtype == objects::CSubSource::eSubtype_chromosome && src.IsSetGenome() && src.GetGenome() == objects::CBioSource::eGenome_chromosome) {
339  is_complete = true;
340  }
341  if (m_NameCtrl) {
342  bool found_name = false;
343  for (auto s : src.GetSubtype()) {
344  if (s->IsSetSubtype() && s->GetSubtype() == m_Subtype &&
345  s->IsSetName() && !NStr::IsBlank(s->GetName())) {
346  m_NameCtrl->SetValue(ToWxString(s->GetName()));
347  found_name = true;
348  }
349  }
350  if (!found_name) {
351  m_NameCtrl->SetValue(wxT(""));
352  }
353  }
354  }
355  if (m_is_organelle && di->GetSource().IsSetGenome())
356  {
357  auto it = find(m_organelle_types.begin(), m_organelle_types.end(), di->GetSource().GetGenome());
358  if (it != m_organelle_types.end())
359  {
360  auto sel = std::distance(m_organelle_types.begin(), it);
361  m_OrganelleCtrl->SetSelection(static_cast<int>(sel));
362  }
363  }
364  if (m_Subtype == objects::CSubSource::eSubtype_plasmid_name || m_is_organelle) {
365  bool has_gaps = s_HasGaps(bh);
366  m_Complete->Enable(!has_gaps);
367  if (!has_gaps) {
368  objects::CSeqdesc_CI mi(bh, objects::CSeqdesc::e_Molinfo);
369  if (mi && mi->GetMolinfo().IsSetCompleteness() && mi->GetMolinfo().GetCompleteness() == objects::CMolInfo::eCompleteness_complete) {
370  is_complete = true;
371  }
372  }
373  }
374  m_Complete->SetValue(is_complete);
375 
376  m_SeqId->SetStringSelection(ToWxString(bh.GetSeqId()->AsFastaString()));
377 }
378 
379 
381 {
382  m_Circular->SetValue(false);
383  m_Complete->SetValue(false);
384  m_LengthLabel->SetLabel(wxT(""));
385  if (m_NameCtrl)
386  m_NameCtrl->SetValue(wxT(""));
387  if (m_OrganelleCtrl)
388  m_OrganelleCtrl->SetSelection(wxNOT_FOUND);
389  m_SeqId->SetSelection(0);
390 }
391 
392 
393 void CSingleSequencePanel::OnChangeSeqId(wxCommandEvent& event)
394 {
395  string seqid = GetSeqId();
396  bool found = false;
397  if (!seqid.empty()) {
398  CRef<objects::CSeq_id> id(new objects::CSeq_id(seqid));
399  objects::CBioseq_Handle bh = m_Seh.GetScope().GetBioseqHandle(*id);
400  if (bh) {
401  SetValue(bh);
402  found = true;
403  }
404  }
405  if (!found) {
406  ClearValue();
407  }
408 }
409 
411 {
412  string val;
413  if (m_NameCtrl)
414  val = ToStdString(m_NameCtrl->GetValue());
415  return val;
416 }
417 
419 {
420  string val;
421  if (m_OrganelleCtrl)
422  val = ToStdString(m_OrganelleCtrl->GetStringSelection());
423  return val;
424 }
425 
427 {
428  bool any_changes = false;
429  string seqid = GetSeqId();
430  if (!seqid.empty()) {
431  CRef<objects::CSeq_id> id(new objects::CSeq_id(seqid));
432  objects::CBioseq_Handle bh = m_Seh.GetScope().GetBioseqHandle(*id);
433 
434  // value
435  string val_name = GetModifierValue();
436  objects::CSeqdesc_CI oldsrc(bh, objects::CSeqdesc::e_Source);
437  if (oldsrc) {
438  // edit existing source descriptor
439  CRef<objects::CSeqdesc> new_src(new objects::CSeqdesc());
440  new_src->Assign(*oldsrc);
441  objects::CBioSource& bsrc = new_src->SetSource();
442 
443  if (bsrc.IsSetSubtype()) {
444  bool found = false;
445  auto sit = bsrc.SetSubtype().begin();
446  while (sit != bsrc.SetSubtype().end()) {
447  if ((*sit)->IsSetSubtype() && ((*sit)->GetSubtype() == m_Subtype || m_is_organelle)) {
448  found = true;
449  if (val_name.empty()) {
450  sit = bsrc.SetSubtype().erase(sit);
451  any_changes = true;
452  }
453  else {
454  if (!(*sit)->IsSetName() || !NStr::Equal((*sit)->GetName(), val_name)) {
455  (*sit)->SetName(val_name);
456  any_changes = true;
457  }
458  sit++;
459  }
460  }
461  else {
462  sit++;
463  }
464  }
465  if (!found && !val_name.empty()) {
466  bsrc.SetSubtype().push_back(CRef<objects::CSubSource>(new objects::CSubSource(m_Subtype, val_name)));
467  any_changes = true;
468  }
469  if (bsrc.GetSubtype().empty()) {
470  bsrc.ResetSubtype();
471  any_changes = true;
472  }
473  } else {
474  if (!val_name.empty()) {
475  // only need to make change if there is a value name where there wasn't one before
476  bsrc.SetSubtype().push_back(CRef<objects::CSubSource>(new objects::CSubSource(m_Subtype, val_name)));
477  any_changes = true;
478  }
479  }
480  // also set location
481  if (val_name.empty()) {
482  if (m_Subtype == objects::CSubSource::eSubtype_plasmid_name && new_src->GetSource().IsSetGenome() &&
483  new_src->GetSource().GetGenome() == objects::CBioSource::eGenome_plasmid) {
484  new_src->SetSource().ResetGenome();
485  any_changes = true;
486  }
487  } else {
488  if (m_Subtype == objects::CSubSource::eSubtype_plasmid_name) {
489  if (!new_src->GetSource().IsSetGenome() || new_src->GetSource().GetGenome() != objects::CBioSource::eGenome_plasmid) {
490  new_src->SetSource().SetGenome(objects::CBioSource::eGenome_plasmid);
491  any_changes = true;
492  }
493  }
494  }
496  {
497  int sel = m_OrganelleCtrl->GetSelection();
498  if (sel == wxNOT_FOUND)
499  new_src->SetSource().ResetGenome();
500  else
501  new_src->SetSource().SetGenome(m_organelle_types[sel]);
502  }
503  if (!oldsrc->Equals(*new_src)) {
504  CRef<CCmdChangeSeqdesc> chg(new CCmdChangeSeqdesc(oldsrc.GetSeq_entry_Handle(), *oldsrc, *new_src));
505  cmd.AddCommand(*chg);
506  any_changes = true;
507  }
508  } else if (!val_name.empty()) {
509  // create new source descriptor
510  CRef<objects::CSeqdesc> new_src(new objects::CSeqdesc());
511  new_src->SetSource().SetOrg();
512  CRef<objects::CSubSource> subsrc(new objects::CSubSource(m_Subtype, val_name));
513  new_src->SetSource().SetSubtype().push_back(subsrc);
514  if (m_Subtype == objects::CSubSource::eSubtype_plastid_name) {
515  new_src->SetSource().SetGenome(objects::CBioSource::eGenome_plasmid);
516  }
517  CIRef<IEditCommand> cmdAddDesc(new CCmdCreateDesc(bh.GetSeq_entry_Handle(), *new_src));
518  cmd.AddCommand(*cmdAddDesc);
519  any_changes = true;
520  } else if (m_is_organelle && m_OrganelleCtrl && m_OrganelleCtrl->GetSelection() != wxNOT_FOUND) {
521  // create new source descriptor
522  int sel = m_OrganelleCtrl->GetSelection();
523  CRef<objects::CSeqdesc> new_src(new objects::CSeqdesc());
524  new_src->SetSource().SetGenome(m_organelle_types[sel]);
525  CIRef<IEditCommand> cmdAddDesc(new CCmdCreateDesc(bh.GetSeq_entry_Handle(), *new_src));
526  cmd.AddCommand(*cmdAddDesc);
527  any_changes = true;
528  }
529 
530  if (m_Subtype == objects::CSubSource::eSubtype_plasmid_name || m_is_organelle) {
531  // completeness
532  objects::CSeqdesc_CI oldmol(bh, objects::CSeqdesc::e_Molinfo);
533  if (oldmol) {
534  bool current_completeness = (oldmol->GetMolinfo().IsSetCompleteness() && oldmol->GetMolinfo().GetCompleteness() == objects::CMolInfo::eCompleteness_complete);
535  if ((current_completeness && !IsComplete()) || (!current_completeness && IsComplete())) {
536  // edit existing molinfo descriptor
537  CRef<objects::CSeqdesc> new_mol(new objects::CSeqdesc());
538  new_mol->Assign(*oldmol);
539  if (IsComplete()) {
540  new_mol->SetMolinfo().SetCompleteness(objects::CMolInfo::eCompleteness_complete);
541  }
542  else {
543  new_mol->SetMolinfo().ResetCompleteness();
544  }
545  CRef<CCmdChangeSeqdesc> chg(new CCmdChangeSeqdesc(oldmol.GetSeq_entry_Handle(), *oldmol, *new_mol));
546  cmd.AddCommand(*chg);
547  any_changes = true;
548  }
549  } else {
550  if (IsComplete()) {
551  // create new molinfo descriptor
552  CRef<objects::CSeqdesc> new_mol(new objects::CSeqdesc());
553  new_mol->SetMolinfo().SetCompleteness(objects::CMolInfo::eCompleteness_complete);
554  CIRef<IEditCommand> cmdAddDesc(new CCmdCreateDesc(bh.GetSeq_entry_Handle(), *new_mol));
555  cmd.AddCommand(*cmdAddDesc);
556  any_changes = true;
557  }
558  }
559  }
560 
561 
562  // topology
563  bool currently_circular = (bh.IsSetInst_Topology() && bh.GetInst_Topology() == objects::CSeq_inst::eTopology_circular);
564  if ((currently_circular && !IsCircular()) || (!currently_circular && IsCircular())) {
565  CRef<objects::CSeq_inst> new_inst(new objects::CSeq_inst());
566  new_inst->Assign(bh.GetInst());
567  if (IsCircular()) {
568  new_inst->SetTopology(objects::CSeq_inst::eTopology_circular);
569  }
570  else {
571  new_inst->ResetTopology();
572  }
573 
574  CIRef<IEditCommand> chgInst(new CCmdChangeBioseqInst(bh, *new_inst));
575  cmd.AddCommand(*chgInst);
576  any_changes = true;
577  }
578  }
579  return any_changes;
580 }
581 
582 
583 bool CSingleSequencePanel::RemoveNamedValue(CCmdComposite& cmd, objects::CSubSource::ESubtype subtype, objects::CBioseq_Handle bh)
584 {
585  bool change_val = false;
586 
587  // take name off
588  objects::CSeqdesc_CI oldsrc(bh, objects::CSeqdesc::e_Source);
589  if (oldsrc && oldsrc->GetSource().IsSetSubtype()) {
590  // edit existing source descriptor
591  CRef<objects::CSeqdesc> new_src(new objects::CSeqdesc());
592  new_src->Assign(*oldsrc);
593  objects::CBioSource& bsrc = new_src->SetSource();
594 
595  auto sit = bsrc.SetSubtype().begin();
596  while (sit != bsrc.SetSubtype().end()) {
597  if ((*sit)->IsSetSubtype() && (*sit)->GetSubtype() == subtype) {
598  sit = bsrc.SetSubtype().erase(sit);
599  change_val = true;
600  }
601  else {
602  sit++;
603  }
604  }
605  if (bsrc.GetSubtype().empty()) {
606  bsrc.ResetSubtype();
607  change_val = true;
608  }
609 
610  if (change_val) {
611  CRef<CCmdChangeSeqdesc> chg(new CCmdChangeSeqdesc(oldsrc.GetSeq_entry_Handle(), *oldsrc, *new_src));
612  cmd.AddCommand(*chg);
613  }
614 
615  }
616  return change_val;
617 }
618 
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
wxIcon GetIconResource(const wxString &name)
Retrieves icon resources.
void OnChangeSeqId(wxCommandEvent &event)
objects::CSeq_entry_Handle m_Seh
static bool ShowToolTips()
Should we show tooltips?
void CreateControls()
Creates the controls and sizers.
void SetValue(objects::CBioseq_Handle bh)
objects::CSubSource::ESubtype m_Subtype
vector< objects::CBioSource::EGenome > m_organelle_types
bool Create(wxWindow *parent, wxWindowID id=ID_CSINGLESEQUENCEPANEL, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(400, 300), long style=wxTAB_TRAVERSAL)
Creation.
static bool NeedsRow(objects::CBioseq_Handle bh, objects::CSubSource::ESubtype subtype)
bool AddToUpdateCommand(CCmdComposite &cmd)
static bool NeedsOrganelleRow(objects::CBioseq_Handle bh, const vector< objects::CBioSource::EGenome > &organelle_types)
static bool RemoveNamedValue(CCmdComposite &cmd, objects::CSubSource::ESubtype subtype, objects::CBioseq_Handle bh)
void Init()
Initialises member variables.
wxBitmap GetBitmapResource(const wxString &name)
Retrieves bitmap resources.
CSingleSequencePanel()
Constructors.
static CS_COMMAND * cmd
Definition: ct_dynamic.c:26
#define false
Definition: bool.h:36
static void Init(void)
Definition: cursor6.c:76
#define NULL
Definition: ncbistd.hpp:225
#define ENUM_METHOD_NAME(EnumName)
Definition: serialbase.hpp:994
#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 bool IsBlank(const CTempString str, SIZE_TYPE pos=0)
Check if a string is blank (has no text).
Definition: ncbistr.cpp:106
static enable_if< is_arithmetic< TNumeric >::value||is_convertible< TNumeric, Int8 >::value, string >::type NumericToString(TNumeric value, TNumToStringFlags flags=0, int base=10)
Convert numeric value to string.
Definition: ncbistr.hpp:673
static bool Equal(const CTempString s1, SIZE_TYPE pos, SIZE_TYPE n, const char *s2, ECase use_case=eCase)
Test for equality of a substring with another string.
Definition: ncbistr.hpp:5384
END_EVENT_TABLE()
#define wxT(x)
Definition: muParser.cpp:41
const struct ncbi::grid::netcache::search::fields::SIZE size
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
bool s_HasGaps(objects::CBioseq_Handle bh)
wxString ToWxString(const string &s)
Definition: wx_utils.hpp:173
string ToStdString(const wxString &s)
Definition: wx_utils.hpp:161
Modified on Mon Apr 22 03:59:47 2024 by modify_doxy.py rev. 669887