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

Go to the SVN repository for this file.

1 /* $Id: remove_features_dlg.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 #include <sstream>
35 #include <objmgr/scope.hpp>
37 #include <objmgr/feat_ci.hpp>
38 #include <objmgr/seq_annot_ci.hpp>
39 #include <objmgr/bioseq_ci.hpp>
41 #include <objmgr/util/feature.hpp>
45 #include <gui/objutils/utils.hpp>
48 //#include <corelib/perf_log.hpp>
49 //#include <gui/utils/log_performance.hpp>
50 
51 //#include <gui/widgets/text_widget/draw_styled_text.hpp>
52 #include <gui/objutils/label.hpp>
57 
58 
59 #include <wx/button.h>
60 #include <wx/statbox.h>
61 #include <wx/msgdlg.h>
62 
63 ////@begin XPM images
64 ////@end XPM images
65 
67 
68 
69 
70 IMPLEMENT_DYNAMIC_CLASS( CRemoveFeaturesDlg, CBulkCmdDlg )
71 
72 
73 BEGIN_EVENT_TABLE( CRemoveFeaturesDlg, CBulkCmdDlg )
74 
75 
77 
79 {
80  Init();
81 }
82 
84  wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style )
85  : CBulkCmdDlg(wb)
86 {
87  Init();
88  Create(parent, id, caption, pos, size, style);
89 }
90 
91 
92 bool CRemoveFeaturesDlg::Create( wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style )
93 {
94  SetExtraStyle(wxWS_EX_BLOCK_EVENTS);
95  CBulkCmdDlg::Create( parent, id, caption, pos, size, style );
96 
98  if (GetSizer())
99  {
100  GetSizer()->SetSizeHints(this);
101  }
102  Centre();
103 
104  SetSize(wxSize(280, 750));
105  return true;
106 }
107 
108 
110 {
111 }
112 
113 
114 /*!
115  * Member initialisation
116  */
117 
119 {
120  set<string> existing;
121  m_Types.clear();
122  m_Descriptions.clear();
123 
125  vector<const CFeatListItem *> feat_list = GetSortedFeatList(m_TopSeqEntry);
126  ITERATE(vector<const CFeatListItem *>, ft_it, feat_list) {
127  const CFeatListItem& item = **ft_it;
128  string desc = item.GetDescription();
129  int feat_type = item.GetType();
130  int feat_subtype = item.GetSubtype();
131  m_Types[pair<int,int>(feat_type,feat_subtype)] = desc;
132  if (existing.find(desc) == existing.end())
133  {
134  existing.insert(desc);
135  m_Descriptions.push_back(desc);
136  if (feat_subtype == CSeqFeatData::eSubtype_any)
137  m_SubtypeAnyFlag.push_back(true);
138  else
139  m_SubtypeAnyFlag.push_back(false);
140  }
141  }
142 
143  m_ListCtrl = NULL;
144  m_TopSeqEntry.Reset();
145  m_ErrorMessage = "No feature found";
146 }
147 
148 
149 
150 
152 {
153  CRemoveFeaturesDlg* itemDialog1 = this;
154 
155  wxBoxSizer* itemBoxSizer2 = new wxBoxSizer(wxVERTICAL);
156  itemDialog1->SetSizer(itemBoxSizer2);
157 
158  wxBoxSizer* itemBoxSizer3 = new wxBoxSizer(wxHORIZONTAL);
159  itemBoxSizer2->Add(itemBoxSizer3, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
160 
161  m_ListCtrl = new wxListCtrl( itemDialog1, ID_LISTCTRL_FTR, wxDefaultPosition, wxSize(250, 200), wxLC_REPORT );
162  itemBoxSizer3->Add(m_ListCtrl, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
163 
164  m_ListCtrl->InsertColumn(0," Feature",wxLIST_FORMAT_LEFT,237);
165 
166  for (unsigned int i=0; i<m_Descriptions.size(); i++)
167  m_ListCtrl->InsertItem(i,ToWxString(m_Descriptions[i]));
168 
169  wxBoxSizer* itemBoxSizer5 = new wxBoxSizer(wxHORIZONTAL);
170  itemBoxSizer2->Add(itemBoxSizer5, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
171 
172  wxBoxSizer* itemBoxSizer6 = new wxBoxSizer(wxVERTICAL);
173  itemBoxSizer5->Add(itemBoxSizer6, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
174 
175  wxStaticBox* itemStaticBoxSizer7Static = new wxStaticBox(itemDialog1, wxID_ANY, _("Optional String Constraint"));
176  wxStaticBoxSizer* itemStaticBoxSizer7 = new wxStaticBoxSizer(itemStaticBoxSizer7Static, wxVERTICAL);
177  itemBoxSizer6->Add(itemStaticBoxSizer7, 0, wxALIGN_LEFT|wxALL, 5);
178 
179  m_RadioButton = new wxRadioButton( itemDialog1, ID_REMOVE_FEATURES_RADIOBUTTON, _("Remove When Text Is Present"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP );
180  m_RadioButton->SetValue(true);
181  itemStaticBoxSizer7->Add(m_RadioButton, 0, wxALIGN_LEFT|wxALL, 5);
182 
183  wxRadioButton* itemRadioButton9 = new wxRadioButton( itemDialog1, ID_REMOVE_FEATURES_RADIOBUTTON1, _("Remove When Text Is Not Present"));
184  itemRadioButton9->SetValue(false);
185  itemStaticBoxSizer7->Add(itemRadioButton9, 0, wxALIGN_LEFT|wxALL, 5);
186 
187  m_TextCtrl = new wxTextCtrl( itemDialog1, ID_REMOVE_FEATURES_TEXTCTRL, wxEmptyString, wxDefaultPosition, wxSize(237, -1), 0 );
188  itemStaticBoxSizer7->Add(m_TextCtrl, 0, wxALIGN_LEFT|wxALL, 5);
189 
190  m_CheckBox = new wxCheckBox( itemDialog1, ID_REMOVE_FEATURES_CHECKBOX, _("Case Insensitive"), wxDefaultPosition, wxDefaultSize, 0 );
191  m_CheckBox->SetValue(false);
192  itemStaticBoxSizer7->Add(m_CheckBox, 0, wxALIGN_LEFT|wxALL, 5);
193 
194  wxStaticBox* itemStaticBoxSizer15Static = new wxStaticBox(itemDialog1, wxID_ANY, _("Optional Seq-id Constraint"));
195  wxStaticBoxSizer* itemStaticBoxSizer15 = new wxStaticBoxSizer(itemStaticBoxSizer15Static, wxVERTICAL);
196  itemBoxSizer6->Add(itemStaticBoxSizer15, 0, wxALIGN_LEFT|wxALL, 5);
197 
198  m_RadioButton_id = new wxRadioButton( itemDialog1, ID_REMOVE_FEATURES_RADIOBUTTON2, _("Remove When Text Is Present"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP );
199  m_RadioButton_id->SetValue(true);
200  itemStaticBoxSizer15->Add(m_RadioButton_id, 0, wxALIGN_LEFT|wxALL, 5);
201 
202  wxRadioButton* itemRadioButton16 = new wxRadioButton( itemDialog1, ID_REMOVE_FEATURES_RADIOBUTTON3, _("Remove When Text Is Not Present"));
203  itemRadioButton16->SetValue(false);
204  itemStaticBoxSizer15->Add(itemRadioButton16, 0, wxALIGN_LEFT|wxALL, 5);
205 
206  m_TextCtrl_id = new wxTextCtrl( itemDialog1, ID_REMOVE_FEATURES_TEXTCTRL1, wxEmptyString, wxDefaultPosition, wxSize(237, -1), 0 );
207  itemStaticBoxSizer15->Add(m_TextCtrl_id, 0, wxALIGN_LEFT|wxALL, 5);
208 
209  m_CheckBox_id = new wxCheckBox( itemDialog1, ID_REMOVE_FEATURES_CHECKBOX1, _("Case Insensitive"), wxDefaultPosition, wxDefaultSize, 0 );
210  m_CheckBox->SetValue(false);
211  itemStaticBoxSizer15->Add(m_CheckBox_id, 0, wxALIGN_LEFT|wxALL, 5);
212 
213  wxStaticBox* itemStaticBoxSizer17Static = new wxStaticBox(itemDialog1, wxID_ANY, _("Optional Location Constraint"));
214  wxStaticBoxSizer* itemStaticBoxSizer17 = new wxStaticBoxSizer(itemStaticBoxSizer17Static, wxVERTICAL);
215  itemBoxSizer6->Add(itemStaticBoxSizer17, 0, wxALIGN_LEFT|wxALL, 5);
216 
217  wxArrayString strands,types;
218  strands.Add(wxT("Any Strand"));
219  strands.Add(wxT("Plus Strand"));
220  strands.Add(wxT("Minus Strand"));
221  types.Add(wxT("Nucleotide and protein sequences"));
222  types.Add(wxT("Nucleotide sequences only"));
223  types.Add(wxT("Protein sequences only"));
224 
225  m_ChoiceStrand = new wxChoice(itemDialog1, ID_REMOVE_FEATURES_CHOICE1, wxDefaultPosition, wxDefaultSize, strands,0,wxDefaultValidator,"Strand");
226  m_ChoiceStrand->SetSelection(0);
227  itemStaticBoxSizer17->Add(m_ChoiceStrand, 0, wxALIGN_LEFT|wxALL, 5);
228  m_ChoiceType = new wxChoice(itemDialog1, ID_REMOVE_FEATURES_CHOICE2, wxDefaultPosition, wxDefaultSize, types,0,wxDefaultValidator,"Type");
229  m_ChoiceType->SetSelection(0);
230  itemStaticBoxSizer17->Add(m_ChoiceType, 0, wxALIGN_LEFT|wxALL, 5);
231 
232  COkCancelPanel *OkCancel = new COkCancelPanel( itemDialog1, ID_REMOVE_FEATURES_OKCANCEL, wxDefaultPosition, wxSize(100, 100), 0 );
233  itemBoxSizer2->Add(OkCancel, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
234 }
235 
236 
237 /*!
238  * Should we show tooltips?
239  */
240 
242 {
243  return true;
244 }
245 
246 /*!
247  * Get bitmap resources
248  */
249 
250 wxBitmap CRemoveFeaturesDlg::GetBitmapResource( const wxString& name )
251 {
252  // Bitmap retrieval
253  wxUnusedVar(name);
254  return wxNullBitmap;
255 }
256 
257 /*!
258  * Get icon resources
259  */
260 
261 wxIcon CRemoveFeaturesDlg::GetIconResource( const wxString& name )
262 {
263  // Icon retrieval
264  wxUnusedVar(name);
265  return wxNullIcon;
266 }
267 
269 {
270  long item = -1;
271  CRef<CCmdComposite> cmd( new CCmdComposite("Remove Features") );
272  bool modified = false;
273  if (m_ListCtrl && m_TopSeqEntry)
274  {
275  m_CountProteins = 0;
277  GetProductToCDSMap(m_TopSeqEntry.GetScope(), product_to_cds);
278 
279 
281  bool remove_orphans = true;
282  m_RemoveProteins = true;
283 
284  for ( ;; )
285  {
286  item = m_ListCtrl->GetNextItem(item, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED);
287  if ( item == -1 ) break;
288  string name = ToStdString(m_ListCtrl->GetItemText(item));
289  bool subtypeAnyFlag = m_SubtypeAnyFlag[item];
290  ApplyToCSeq_entry (m_TopSeqEntry, cmd, name, subtypeAnyFlag, modified, product_to_cds);
291  }
292 
293  if (remove_orphans)
294  {
296  cmd->AddCommand(*cmd_remove_orphans);
297  modified = true;
298  }
299  }
300 
301  if (modified)
302  return cmd;
303  else
304  {
306  return empty;
307  }
308 }
309 
310 static void s_RenderAccList(
311  stringstream& ostream, const CUser_field::TData::TStrs& item_data, const string& title)
312 {
313  string s(title);
314  if ( !s.empty() ) {
315  s += ": ";
316  }
317 
318  list<string> refseq;
319  list<string> non_refseq;
320  ITERATE (CUser_field::TData::TStrs, it, item_data) {
323  refseq.push_back(*it);
324  } else {
325  non_refseq.push_back(*it);
326  }
327  }
328 
329  string accs;
330  if (refseq.size()) {
331  accs += NStr::Join(refseq, ", ");
332  }
333 
334  if (non_refseq.size()) {
335  if ( !accs.empty() ) {
336  accs += ", ";
337  }
338  accs += NStr::Join(non_refseq, ", ");
339  }
340 
341  if ( !accs.empty() ) {
342  s += accs;
343  } else {
344  s += "<unknown>";
345  }
346 
347  list<string> lines;
348  NStr::Wrap(s, 78, lines);
349  if ( !lines.empty() ) {
350  ITERATE (list<string>, iter, lines) {
351  if (iter != lines.begin()) {
352  ostream << " " << *iter << endl;
353  } else {
354  ostream << *iter << endl;
355  }
356  }
357  }
358 }
359 
361  stringstream& ostream, const CSeq_feat& feat, CScope& /*scope*/)
362 {
363  if ( !feat.IsSetExt() && !feat.IsSetExts()) {
364  return;
365  }
366 
367  list< CConstRef<CUser_object> > objs;
368  if (feat.IsSetExt()) {
369  CConstRef<CUser_object> o(&feat.GetExt());
370  if (o->IsSetType() && o->GetType().IsStr() && o->GetType().GetStr() == "CombinedFeatureUserObjects") {
371  ITERATE (CUser_object::TData, it, o->GetData()) {
372  const CUser_field& field = **it;
373  CConstRef<CUser_object> sub_o(&field.GetData().GetObject());
374  objs.push_back(sub_o);
375  }
376  } else {
377  objs.push_back(o);
378  }
379  }
380  if (feat.IsSetExts()) {
381  copy(feat.GetExts().begin(), feat.GetExts().end(), back_inserter(objs));
382  }
383 
384  ITERATE (list< CConstRef<CUser_object> >, obj_it, objs) {
385  const CUser_object& obj = **obj_it;
386  if ( !obj.IsSetType() ||
387  !obj.GetType().IsStr() ||
388  obj.GetType().GetStr() != "ModelEvidence") {
389  continue;
390  }
391 
392  string s;
394 
395  ostream << endl;
396 
397  ///
398  /// generation method
399  string method;
400  ostream << "Model Generation Method: ";
401  f = obj.GetFieldRef("Method");
402  if (f) {
403  method = f->GetData().GetStr();
404  ostream << method;
405  } else {
406  ostream << "<unknown>";
407  }
408 
409  ostream << endl;
410 
411  ///
412  /// list of support
413  if (method == "Chainer" || method == "Gnomon") {
414 
415  ///
416  /// scan for multiple 'Core' entries
417  f = obj.GetFieldRef("Support");
418  if (f) {
419  string core;
420  ITERATE (CUser_field::TData::TFields, it, f->GetData().GetFields()) {
421  const CUser_field& this_f = **it;
422  if (this_f.GetLabel().GetStr() == "Core") {
423  if ( !core.empty() ) {
424  core += ", ";
425  }
426  core += this_f.GetData().GetStr();
427  }
428  }
429  if ( !core.empty() ) {
430  s = "Model Based On: ";
431  s += core;
432  ostream << s << endl;
433  }
434  }
435 
436  ///
437  /// supporting proteins
438  f = obj.GetFieldRef("Support.Proteins");
439  if (f) {
440  s_RenderAccList(ostream, f->GetData().GetStrs(), "Source Proteins");
441  }
442 
443  ///
444  /// supporting proteins
445  f = obj.GetFieldRef("Support.mRNAs");
446  if (f) {
447  s_RenderAccList(ostream, f->GetData().GetStrs(), "Source mRNAs");
448  }
449  }
450  }
451 }
452 
453 static void s_Render_SeqFeat(
454  stringstream& ostream, const objects::CSeq_feat& feat, objects::CScope& scope)
455 {
456  try {
457  string text;
458  /// start with the description text
459  CLabel::GetLabel( feat, &text, CLabel::eDescription, &scope );
460  ostream << text << endl;
461 
462  /// add information about the feature's location
463  TSeqRange range = feat.GetLocation().GetTotalRange();
464  ostream << "Total Range: ";
465  switch( sequence::GetStrand(feat.GetLocation(), &scope) ){
466  case eNa_strand_plus:
467  ostream << "(+) ";
468  break;
469  case eNa_strand_minus:
470  ostream << "(-) ";
471  break;
472  default:
473  break;
474  }
475 
476  ostream << NStr::IntToString(range.GetFrom() + 1, NStr::fWithCommas)
477  << " - "
478  << NStr::IntToString(range.GetTo() + 1, NStr::fWithCommas)
479  << endl;
480 
481  ostream << "Total Length: "
482  << NStr::IntToString(range.GetLength(), NStr::fWithCommas)
483  << endl;
484 
485  ostream << "Processed Length: "
486  << NStr::IntToString(sequence::GetLength(feat.GetLocation(), &scope),
488  << endl;
489 
490  if (feat.IsSetProduct()) {
491  try {
492  string prod_len_str;
493  CBioseq_Handle h = scope.GetBioseqHandle(feat.GetProduct());
494  if (h) {
495  ostream << "Product Length: "
498  << endl;
499  }
500  }
501  catch (CException&) {
502  }
503  }
504  ostream << endl;
505 
506  /// next, include the flat file text for this feature
507  CFlatFileConfig cfg;
508  cfg.SetNeverTranslateCDS();
509 
510  /// hack: search for this feature using CFeat_CI
511  /// it'd be better to use CMappedFeat instead of CSeq_feat
513  sel.IncludeFeatSubtype(feat.GetData().GetSubtype());
514 
515  CFeat_CI feat_it(scope, feat.GetLocation(), sel);
516  for (; feat_it ; ++feat_it) {
517  if (&feat_it->GetOriginalFeature() != &feat){
518  continue;
519  }
520  string s =
521  CFlatFileGenerator::GetSeqFeatText(*feat_it, scope, cfg);
522  string::size_type pos = s.find_first_not_of(" \n\r\t");
523  if( pos != string::npos ){
524  s.erase(0, pos);
525  }
526 
527  string::size_type lpos = string::npos;
528  do {
529  pos = lpos +1;
530  lpos = s.find_first_of("\n\r", pos );
531 
532  if( lpos == string::npos ){
533  text = s.substr( pos );
534  } else {
535  text = s.substr( pos, lpos - pos );
536  }
537  ostream << text << endl;
538 
539  } while( lpos != string::npos );
540  } // for
541 
542  /// lastly, add items relating to model evidence
543  s_Render_Feat_Evidence(ostream, feat, scope);
544  }
545  catch (CException&) {
546  }
547 }
548 
549 void CRemoveFeaturesDlg::ApplyToCSeq_entry (objects::CSeq_entry_Handle tse, CCmdComposite* composite, string name, bool subtypeAnyFlag, bool &modified,
550  map<objects::CBioseq_Handle, set<objects::CSeq_feat_Handle> > &product_to_cds) // see SeqEntryConstrainedFeaturesCallback
551 {
553  set<CSeq_id_Handle> set_of_proteins;
554  CFeat_CI feat (tse);
555  while (feat)
556  {
557  bool filter = false;
558  if (NStr::EqualNocase(name, "All"))
559  {
560  filter = true;
561  }
562  else if (subtypeAnyFlag)
563  {
564  int type = feat->GetOriginalFeature().GetData().Which();
565  int subtype = CSeqFeatData::eSubtype_any;
566  string desc = m_Types[pair<int,int>(type,subtype)];
567  if (desc == name)
568  filter = true;
569  }
570  else if (feat->GetOriginalFeature().CanGetData())
571  {
572  int type = feat->GetOriginalFeature().GetData().Which();
573  int subtype = feat->GetOriginalFeature().GetData().GetSubtype();
574  string desc = m_Types[pair<int,int>(type,subtype)];
575  if (desc == name)
576  filter = true;
577  }
578 
579  if (filter)
580  {
581  bool go = true;
582  if (m_TextCtrl->GetLineLength(0) > 0)
583  {
584  go = false;
585  stringstream str;
586  //str << MSerial_AsnText << feat->GetOriginalFeature();
587  CScope &scope = tse.GetScope();
588  s_Render_SeqFeat(str, feat->GetOriginalFeature(), scope);
589  string pattern = m_TextCtrl->GetLineText(0).ToStdString();
590  bool match(false);
591  if (m_CheckBox->GetValue())
592  match = NStr::FindNoCase(str.str(), pattern) != NPOS;
593  else
594  match = NStr::Find(str.str(), pattern) != NPOS;
595  if (match && m_RadioButton->GetValue()) go = true;
596  else if (!match && !m_RadioButton->GetValue()) go = true;
597  }
598  if (go && m_TextCtrl_id->GetLineLength(0) > 0)
599  {
600  go = false;
601  string pattern = m_TextCtrl_id->GetLineText(0).ToStdString();
602  bool match = false;
603  bool no_case = m_CheckBox_id->GetValue();
604 
605  CBioseq_Handle bsh = tse.GetScope().GetBioseqHandle(feat->GetLocation());
606  if (bsh && bsh.IsSetId())
607  {
608  for (CBioseq_Handle::TId::const_iterator idh = bsh.GetId().begin(); idh != bsh.GetId().end(); ++idh)
609  {
610  string str;
611  try
612  {
613  CConstRef<CSeq_id> id = idh->GetSeqId();
614  id->GetLabel(&str);
615  } catch(const CException&) {}
616  if (!str.empty())
617  {
618  if (no_case)
619  match = NStr::FindNoCase(str, pattern) != NPOS;
620  else
621  match = NStr::Find(str, pattern) != NPOS;
622  if (match)
623  break;
624  }
625  }
626  }
627  if (match && m_RadioButton_id->GetValue()) go = true;
628  else if (!match && !m_RadioButton_id->GetValue()) go = true;
629  }
630 
631  if (go && m_ChoiceStrand->GetSelection()>0)
632  {
633  go = false;
634  int n = m_ChoiceStrand->GetSelection();
635  wxString strand = m_ChoiceStrand->GetString(n);
636  if (strand == wxT("Plus Strand") && feat->GetOriginalFeature().IsSetLocation() && feat->GetOriginalFeature().GetLocation().GetStrand() == eNa_strand_plus) go = true;
637  if (strand == wxT("Minus Strand") && feat->GetOriginalFeature().IsSetLocation() && feat->GetOriginalFeature().GetLocation().GetStrand() == eNa_strand_minus) go = true;
638  }
639 
640  if (go && m_ChoiceType->GetSelection()>0)
641  {
642  go = false;
643  int n = m_ChoiceType->GetSelection();
644  wxString type = m_ChoiceType->GetString(n);
645  if (type == wxT("Nucleotide sequences only") && feat->GetOriginalFeature().IsSetLocation())
646  {
647  CBioseq_Handle bsh = tse.GetScope().GetBioseqHandle(feat->GetLocation());
648  if (bsh.IsNa())
649  go = true;
650  }
651  if (type == wxT("Protein sequences only") && feat->GetOriginalFeature().IsSetLocation())
652  {
653  CBioseq_Handle bsh = tse.GetScope().GetBioseqHandle(feat->GetLocation());
654  if (bsh.IsAa())
655  go = true;
656  }
657  }
658  if (go)
659  {
661  if (fh)
662  {
664  {
665  CSeq_id_Handle id = GetProductId(fh);
666  if (id)
667  set_of_proteins.insert(id);
668  }
669  else
670  {
672  stored_commands[feat->GetSeq_feat()] = cmd;
673  composite->AddCommand(*cmd);
674  modified = true;
675  }
676  }
677  }
678  }
679  ++feat;
680  }
681  m_CountProteins = set_of_proteins.size();
682 }
683 
684 
686 {
687  CSeq_id_Handle id;
688  CBioseq_Handle this_seq = fh.GetScope().GetBioseqHandle(fh.GetLocationId());
689  CSeq_entry_Handle top_parent = this_seq.GetSeq_entry_Handle();
690  if (this_seq && top_parent && fh.IsSetProduct())
691  {
692  if (!validator::IsFarLocation(fh.GetProduct(), top_parent) && fh.GetProductId())
693  {
694  CBioseq_Handle product = fh.GetScope().GetBioseqHandle(*(fh.GetProductId().GetSeqId()));
695 
696  if (product && product.IsProtein() && product.GetSeqId())
697  {
698  id = CSeq_id_Handle::GetHandle(*product.GetSeqId());
699  }
700  }
701  }
702  return id;
703 }
704 
706 {
707  set<CSeq_id_Handle> set_of_proteins;
708  CBioseq_CI bi(seh, objects::CSeq_inst::eMol_na);
709  while (bi)
710  {
711  CFeat_CI it(*bi);
712  while (it)
713  {
714  objects::CSeq_feat_Handle fh = it->GetSeq_feat_Handle();
715  CSeq_id_Handle id = GetProductId(fh);
716  if (id)
717  set_of_proteins.insert(id);
718  ++it;
719  }
720  ++bi;
721  }
722  return static_cast<int>(set_of_proteins.size());
723 }
724 
725 int CRemoveFeaturesDlg::CountOrphanedProteins(objects::CSeq_entry_Handle seh)
726 {
727  int num = 0;
728  if (seh)
729  {
730  set<CBioseq_Handle> proteins;
731  for (CFeat_CI fi(seh); fi; ++fi)
732  {
733  if ( fi->IsSetProduct())
734  {
735  CBioseq_Handle prot_bsh = fi->GetScope().GetBioseqHandle(fi->GetProduct());
736  if (prot_bsh && prot_bsh.IsProtein())
737  {
738  proteins.insert(prot_bsh);
739  }
740  }
741  }
742  objects::CBioseq_CI b_iter(seh, objects::CSeq_inst::eMol_aa);
743  for ( ; b_iter ; ++b_iter )
744  {
745  CBioseq_Handle bsh = *b_iter;
746  if (proteins.find(bsh) == proteins.end())
747  {
748  num++;
749  }
750  }
751  }
752  return num;
753 }
754 
755 void CRemoveFeaturesDlg::AskUser(int num_proteins, int num_orphans, bool &remove_proteins, bool &remove_orphans)
756 {
757  remove_proteins = false;
758  remove_orphans = false;
759  if (num_proteins + num_orphans == 0)
760  return;
761 
762  if (num_orphans == 0)
763  {
764  remove_proteins = true;
765  return;
766  }
767  if (num_proteins == 0)
768  {
769  remove_orphans = true;
770  return;
771  }
772  remove_proteins = true;
773  remove_orphans = true;
774 }
775 
777 {
778  wxBusyCursor wait;
779 // CLogPerformance perfLog("RemoveAllFeatures");
780  // CStopWatch sw(CStopWatch::eStart);
781  bool remove_proteins = true;
782  bool remove_orphans = true;
783  size_t count = 0;
784  CRef<CCmdComposite> cmd = GetDeleteAllFeaturesCommand (seh, count, remove_proteins);
785  if (remove_orphans)
786  {
788  cmd->AddCommand(*cmd_remove_orphans);
789  }
790  if (count > 0) {
791  processor->Execute(cmd);
792  } else {
793  wxMessageBox(_("No features found!"), wxT("Error"),
794  wxOK | wxICON_ERROR, NULL);
795  }
796 // perfLog.Post(CRequestStatus::e200_Ok);
797  // sw.Stop();
798  // wxMessageBox(wxString(sw.AsSmartString()));
799 }
800 
801 void CRemoveFeaturesDlg::RemoveDuplicateFeatures (objects::CSeq_entry_Handle tse, ICommandProccessor* processor)
802 {
803  bool remove_proteins = true;
804  bool remove_orphans = true;
805 
807  GetProductToCDSMap(tse.GetScope(), product_to_cds);
808  CRef<CCmdComposite> cmd( new CCmdComposite("Remove Duplicate Features") );
809  bool modified = false;
810  set< CSeq_feat_Handle > deleted_feats;
811  for (CFeat_CI feat1(tse); feat1; ++feat1)
812  {
813  for (CFeat_CI feat2(tse.GetScope(),feat1->GetLocation()); feat2; ++feat2)
814  {
815  if (feat1->GetSeq_feat_Handle() < feat2->GetSeq_feat_Handle() &&
816  deleted_feats.find(feat1->GetSeq_feat_Handle()) == deleted_feats.end() &&
817  deleted_feats.find(feat2->GetSeq_feat_Handle()) == deleted_feats.end()) {
818  validator::EDuplicateFeatureType dup_type = validator::IsDuplicate(feat1->GetSeq_feat_Handle(), feat2->GetSeq_feat_Handle());
820  cmd->AddCommand(*GetDeleteFeatureCommand(feat2->GetSeq_feat_Handle(), remove_proteins, product_to_cds));
821  deleted_feats.insert(feat2->GetSeq_feat_Handle());
822  modified = true;
823  }
824  }
825  }
826  }
827  if (remove_orphans)
828  {
830  cmd->AddCommand(*cmd_remove_orphans);
831  modified = true;
832  }
833  if (modified)
834  {
835  processor->Execute(cmd);
836  }
837 }
838 
840 {
841  CRef<CCmdComposite> cmd( new CCmdComposite("Remove Orphaned Proteins") );
842  if (seh)
843  {
844  set<CBioseq_Handle> proteins;
846  {
847  if (fi->IsSetProduct())
848  {
849  CBioseq_Handle prot_bsh = fi->GetScope().GetBioseqHandle(fi->GetProduct());
850  if (prot_bsh && prot_bsh.IsProtein())
851  {
852  proteins.insert(prot_bsh);
853  }
854  }
855  }
856  objects::CBioseq_CI b_iter(seh, objects::CSeq_inst::eMol_aa);
857  for ( ; b_iter ; ++b_iter )
858  {
859  CBioseq_Handle bsh = *b_iter;
860  if (proteins.find(bsh) == proteins.end())
861  {
862  cmd->AddCommand(*CRef<CCmdDelBioseqInst>(new CCmdDelBioseqInst(bsh)));
863  }
864  }
865  }
866  return cmd;
867 }
868 
869 /*
870  * CAskToRemoveOrphansAndProteins type definition
871  */
872 
873 IMPLEMENT_DYNAMIC_CLASS( CAskToRemoveOrphansAndProteins, wxDialog )
874 
875 
876 /*
877  * CAskToRemoveOrphansAndProteins event table definition
878  */
879 
880 BEGIN_EVENT_TABLE( CAskToRemoveOrphansAndProteins, wxDialog )
881 
882 ////@begin CAskToRemoveOrphansAndProteins event table entries
883 ////@end CAskToRemoveOrphansAndProteins event table entries
884 
886 
887 
888 /*
889  * CAskToRemoveOrphansAndProteins constructors
890  */
891 
893 {
894  Init();
895 }
896 
897 CAskToRemoveOrphansAndProteins::CAskToRemoveOrphansAndProteins( wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style )
898 {
899  Init();
900  Create(parent, id, caption, pos, size, style);
901 }
902 
903 
904 /*
905  * CAskToRemoveOrphansAndProteins creator
906  */
907 
908 bool CAskToRemoveOrphansAndProteins::Create( wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style )
909 {
910 ////@begin CAskToRemoveOrphansAndProteins creation
911  SetExtraStyle(wxWS_EX_BLOCK_EVENTS);
912  wxDialog::Create( parent, id, caption, pos, size, style );
913 
914  CreateControls();
915  if (GetSizer())
916  {
917  GetSizer()->SetSizeHints(this);
918  }
919  Centre();
920 ////@end CAskToRemoveOrphansAndProteins creation
921  return true;
922 }
923 
924 
925 /*
926  * CAskToRemoveOrphansAndProteins destructor
927  */
928 
930 {
931 ////@begin CAskToRemoveOrphansAndProteins destruction
932 ////@end CAskToRemoveOrphansAndProteins destruction
933 }
934 
935 
936 /*
937  * Member initialisation
938  */
939 
941 {
942 ////@begin CAskToRemoveOrphansAndProteins member initialisation
943  m_Proteins = NULL;
944  m_Orphans = NULL;
945 ////@end CAskToRemoveOrphansAndProteins member initialisation
946 }
947 
948 
949 /*
950  * Control creation for CAskToRemoveOrphansAndProteins
951  */
952 
954 {
955 ////@begin CAskToRemoveOrphansAndProteins content construction
956  // Generated by DialogBlocks, 19/01/2016 10:45:51 (unregistered)
957 
958  CAskToRemoveOrphansAndProteins* itemDialog1 = this;
959 
960  wxBoxSizer* itemBoxSizer2 = new wxBoxSizer(wxVERTICAL);
961  itemDialog1->SetSizer(itemBoxSizer2);
962 
963  m_Proteins = new wxCheckBox( itemDialog1, ID_RMVPROTEINS_CHECKBOX, _("Remove proteins orphaned due to deleted features? "), wxDefaultPosition, wxDefaultSize, 0 );
964  m_Proteins->SetValue(true);
965  itemBoxSizer2->Add(m_Proteins, 0, wxALIGN_LEFT|wxALL, 5);
966 
967  m_Orphans = new wxCheckBox( itemDialog1, ID_RMVPROTEINS_CHECKBOX1, _("Remove previously orphaned proteins? "), wxDefaultPosition, wxDefaultSize, 0 );
968  m_Orphans->SetValue(true);
969  itemBoxSizer2->Add(m_Orphans, 0, wxALIGN_LEFT|wxALL, 5);
970 
971  wxBoxSizer* itemBoxSizer5 = new wxBoxSizer(wxHORIZONTAL);
972  itemBoxSizer2->Add(itemBoxSizer5, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
973 
974  wxButton* itemButton6 = new wxButton( itemDialog1, wxID_OK, _("Accept"), wxDefaultPosition, wxDefaultSize, 0 );
975  itemBoxSizer5->Add(itemButton6, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
976 
977  wxButton* itemButton7 = new wxButton( itemDialog1, wxID_CANCEL, _("Cancel"), wxDefaultPosition, wxDefaultSize, 0 );
978  itemBoxSizer5->Add(itemButton7, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
979 
980 ////@end CAskToRemoveOrphansAndProteins content construction
981 }
982 
983 
984 /*
985  * Should we show tooltips?
986  */
987 
989 {
990  return true;
991 }
992 
993 /*
994  * Get bitmap resources
995  */
996 
998 {
999  // Bitmap retrieval
1000 ////@begin CAskToRemoveOrphansAndProteins bitmap retrieval
1001  wxUnusedVar(name);
1002  return wxNullBitmap;
1003 ////@end CAskToRemoveOrphansAndProteins bitmap retrieval
1004 }
1005 
1006 /*
1007  * Get icon resources
1008  */
1009 
1011 {
1012  // Icon retrieval
1013 ////@begin CAskToRemoveOrphansAndProteins icon retrieval
1014  wxUnusedVar(name);
1015  return wxNullIcon;
1016 ////@end CAskToRemoveOrphansAndProteins icon retrieval
1017 }
1018 
1019 
void Init()
Initialises member variables.
wxIcon GetIconResource(const wxString &name)
Retrieves icon resources.
void CreateControls()
Creates the controls and sizers.
static bool ShowToolTips()
Should we show tooltips?
wxBitmap GetBitmapResource(const wxString &name)
Retrieves bitmap resources.
bool Create(wxWindow *parent, wxWindowID id=wxID_ANY, const wxString &caption=_("Warning"), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(400, 300), long style=wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU|wxCLOSE_BOX|wxTAB_TRAVERSAL)
Creation.
CBioseq_CI –.
Definition: bioseq_ci.hpp:69
CBioseq_Handle –.
objects::CSeq_entry_Handle m_TopSeqEntry
bool Create(wxWindow *parent, wxWindowID id, const wxString &title, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxDEFAULT_FRAME_STYLE, const wxString &name=wxFrameNameStr)
string m_ErrorMessage
bool GetTopLevelSeqEntryAndProcessor()
void AddCommand(IEditCommand &command)
CFeatListItem - basic configuration data for one "feature" type.
int GetSubtype() const
string GetDescription() const
int GetType() const
CFeat_CI –.
Definition: feat_ci.hpp:64
CFlatFileConfig & SetNeverTranslateCDS(bool val=true)
static string GetSeqFeatText(const CMappedFeat &feat, CScope &scope, const CFlatFileConfig &cfg, CRef< feature::CFeatTree > ftree=null)
static void RemoveDuplicateFeatures(objects::CSeq_entry_Handle tse, ICommandProccessor *processor)
static int CountProteinsBeforeRemoval(objects::CSeq_entry_Handle seh)
static void RemoveAllFeatures(CSeq_entry_Handle seh, ICommandProccessor *processor)
virtual CRef< CCmdComposite > GetCommand()
map< pair< int, int >, string > m_Types
CRemoveFeaturesDlg()
Constructors.
static bool ShowToolTips()
Should we show tooltips?
vector< bool > m_SubtypeAnyFlag
void Init()
Initialises member variables.
void CreateControls()
Creates the controls and sizers.
static CSeq_id_Handle GetProductId(objects::CSeq_feat_Handle fh)
wxRadioButton * m_RadioButton_id
wxIcon GetIconResource(const wxString &name)
Retrieves icon resources.
static CRef< CCmdComposite > RemoveOrphansRenormalizeNucProtSets(objects::CSeq_entry_Handle seh)
wxBitmap GetBitmapResource(const wxString &name)
Retrieves bitmap resources.
bool Create(wxWindow *parent, wxWindowID id=11000, const wxString &caption=_("Remove Features"), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU|wxCLOSE_BOX|wxTAB_TRAVERSAL)
Creation.
void ApplyToCSeq_entry(objects::CSeq_entry_Handle tse, CCmdComposite *composite, string name, bool subtypeAnyFlag, bool &modified, map< objects::CBioseq_Handle, set< objects::CSeq_feat_Handle > > &product_to_cds)
wxRadioButton * m_RadioButton
~CRemoveFeaturesDlg()
Destructor.
static int CountOrphanedProteins(objects::CSeq_entry_Handle seh)
vector< string > m_Descriptions
static void AskUser(int num_proteins, int num_orphans, bool &remove_proteins, bool &remove_orphans)
CScope –.
Definition: scope.hpp:92
ESubtype GetSubtype(void) const
CSeq_entry_Handle –.
CSeq_feat_Handle –.
namespace ncbi::objects::
Definition: Seq_feat.hpp:58
CConstRef< CUser_field > GetFieldRef(const string &str, const string &delim=".", NStr::ECase use_case=NStr::eCase) const
Definition: User_object.cpp:84
Undo/Redo interface for editing operations.
virtual void Execute(IEditCommand *command, wxWindow *window=0)=0
IWorkbench is the central interface in the application framework.
Definition: workbench.hpp:113
void clear()
Definition: map.hpp:169
Definition: map.hpp:338
iterator_bool insert(const value_type &val)
Definition: set.hpp:149
size_type size() const
Definition: set.hpp:132
const_iterator find(const key_type &key) const
Definition: set.hpp:137
const_iterator end() const
Definition: set.hpp:136
#define _(proto)
Definition: ct_nlmzip_i.h:78
static CS_COMMAND * cmd
Definition: ct_dynamic.c:26
static void Init(void)
Definition: cursor6.c:76
static const char * str(char *buf, int n)
Definition: stats.c:84
static const struct type types[]
Definition: type.c:22
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
Definition: ncbimisc.hpp:815
#define NULL
Definition: ncbistd.hpp:225
static objects::SAnnotSelector GetAnnotSelector(TAnnotFlags flags=0)
request an annotation selector for a given type
Definition: utils.cpp:167
vector< const objects::CFeatListItem * > GetSortedFeatList(objects::CSeq_entry_Handle seh, size_t max=numeric_limits< size_t >::max())
static void GetLabel(const CObject &obj, string *label, ELabelType type=eDefault)
Definition: label.cpp:140
@ eDescription
Definition: label.hpp:68
static EAccessionInfo IdentifyAccession(const CTempString &accession, TParseFlags flags=fParse_AnyRaw)
Deduces information from a bare accession a la WHICH_db_accession; may report false negatives on prop...
Definition: Seq_id.cpp:1634
void GetLabel(string *label, ELabelType type=eDefault, TLabelFlags flags=fLabel_Default) const
Append a label for this Seq-id to the supplied string.
Definition: Seq_id.cpp:2040
EAccessionInfo
For IdentifyAccession (below)
Definition: Seq_id.hpp:220
static CSeq_id_Handle GetHandle(const CSeq_id &id)
Normal way of getting a handle, works for any seq-id.
@ eAcc_type_mask
Definition: Seq_id.hpp:247
ENa_strand GetStrand(void) const
Get the location's strand.
Definition: Seq_loc.cpp:882
TSeqPos GetLength(const CSeq_id &id, CScope *scope)
Get sequence length if scope not null, else return max possible TSeqPos.
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...
CBioseq_Handle GetBioseqHandle(const CSeq_id &id)
Get bioseq handle by seq-id.
Definition: scope.cpp:95
TSeqPos GetBioseqLength(void) const
bool IsAa(void) const
CSeq_entry_Handle GetSeq_entry_Handle(void) const
Get parent Seq-entry handle.
CConstRef< CSeq_id > GetSeqId(void) const
Get id which can be used to access this bioseq handle Throws an exception if none is available.
bool IsProtein(void) const
CScope & GetScope(void) const
Get scope this handle belongs to.
bool IsSetId(void) const
bool IsNa(void) const
const TId & GetId(void) const
SAnnotSelector & IncludeFeatSubtype(TFeatSubtype subtype)
Include feature subtype in the search.
const CSeq_loc & GetLocation(void) const
const CSeq_feat & GetOriginalFeature(void) const
Get original feature with unmapped location/product.
const CSeq_feat_Handle & GetSeq_feat_Handle(void) const
Get original feature handle.
Definition: mapped_feat.hpp:71
CConstRef< CSeq_feat > GetSeq_feat(void) const
Get current seq-feat.
#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 SIZE_TYPE FindNoCase(const CTempString str, const CTempString pattern, SIZE_TYPE start, SIZE_TYPE end, EOccurrence which=eFirst)
Find the pattern in the specified range of a string using a case insensitive search.
Definition: ncbistr.cpp:2993
#define NPOS
Definition: ncbistr.hpp:133
static string IntToString(int value, TNumToStringFlags flags=0, int base=10)
Convert int to string.
Definition: ncbistr.hpp:5084
static SIZE_TYPE Find(const CTempString str, const CTempString pattern, ECase use_case=eCase, EDirection direction=eForwardSearch, SIZE_TYPE occurrence=0)
Find the pattern in the string.
Definition: ncbistr.cpp:2891
static string Join(const TContainer &arr, const CTempString &delim)
Join strings using the specified delimiter.
Definition: ncbistr.hpp:2697
static bool EqualNocase(const CTempString s1, SIZE_TYPE pos, SIZE_TYPE n, const char *s2)
Case-insensitive equality of a substring with another string.
Definition: ncbistr.hpp:5353
static void Wrap(const string &str, SIZE_TYPE width, IWrapDest &dest, TWrapFlags flags, const string *prefix, const string *prefix1)
Definition: ncbistr.cpp:5347
@ fWithCommas
Use commas as thousands separator.
Definition: ncbistr.hpp:254
const TStr & GetStr(void) const
Get the variant data.
bool IsStr(void) const
Check if variant Str is selected.
Definition: Object_id_.hpp:291
bool IsSetType(void) const
type of object within class Check if a value has been assigned to Type data member.
const TData & GetData(void) const
Get the Data member data.
vector< CRef< CUser_field > > TFields
const TStr & GetStr(void) const
Get the variant data.
Definition: Object_id_.hpp:297
const TData & GetData(void) const
Get the Data member data.
const TObject & GetObject(void) const
Get the variant data.
const TLabel & GetLabel(void) const
Get the Label member data.
const TType & GetType(void) const
Get the Type member data.
vector< CStringUTF8 > TStrs
vector< CRef< CUser_field > > TData
E_Choice Which(void) const
Which variant is currently selected.
const TExts & GetExts(void) const
Get the Exts member data.
Definition: Seq_feat_.hpp:1477
bool IsSetExt(void) const
user defined structure extension Check if a value has been assigned to Ext data member.
Definition: Seq_feat_.hpp:1207
const TLocation & GetLocation(void) const
Get the Location member data.
Definition: Seq_feat_.hpp:1117
const TData & GetData(void) const
Get the Data member data.
Definition: Seq_feat_.hpp:925
bool CanGetData(void) const
Check if it is safe to call GetData method.
Definition: Seq_feat_.hpp:919
bool IsSetExts(void) const
set of extensions; will replace 'ext' field Check if a value has been assigned to Exts data member.
Definition: Seq_feat_.hpp:1465
const TExt & GetExt(void) const
Get the Ext member data.
Definition: Seq_feat_.hpp:1219
bool IsSetLocation(void) const
feature made from Check if a value has been assigned to Location data member.
Definition: Seq_feat_.hpp:1105
@ eNa_strand_plus
Definition: Na_strand_.hpp:66
@ eNa_strand_minus
Definition: Na_strand_.hpp:67
@ e_Other
for historical reasons, 'other' = 'refseq'
Definition: Seq_id_.hpp:104
END_EVENT_TABLE()
int i
yy_size_t n
static void text(MDB_val *v)
Definition: mdb_dump.c:62
static MDB_envinfo info
Definition: mdb_load.c:37
#define wxT(x)
Definition: muParser.cpp:41
range(_Ty, _Ty) -> range< _Ty >
constexpr bool empty(list< Ts... >) noexcept
const struct ncbi::grid::netcache::search::fields::SIZE size
void copy(Njn::Matrix< S > *matrix_, const Njn::Matrix< T > &matrix0_)
Definition: njn_matrix.hpp:613
double f(double x_, const double &y_)
Definition: njn_root.hpp:188
EDuplicateFeatureType IsDuplicate(const CSeq_feat_Handle &f1, const CSeq_feat_Handle &f2, bool check_partials=false, bool case_sensitive=false)
Reports how two features duplicate each other.
Definition: utilities.cpp:1838
bool IsFarLocation(const CSeq_loc &loc, const CSeq_entry_Handle &seh)
Definition: utilities.cpp:159
EDuplicateFeatureType
Definition: utilities.hpp:191
@ eDuplicate_Duplicate
Definition: utilities.hpp:193
@ eDuplicate_DuplicateDifferentTable
Definition: utilities.hpp:195
static int match(register const pcre_uchar *eptr, register const pcre_uchar *ecode, const pcre_uchar *mstart, int offset_top, match_data *md, eptrblock *eptrb, unsigned int rdepth)
Definition: pcre_exec.c:513
#define fi
static void s_Render_SeqFeat(stringstream &ostream, const objects::CSeq_feat &feat, objects::CScope &scope)
static void s_RenderAccList(stringstream &ostream, const CUser_field::TData::TStrs &item_data, const string &title)
static void s_Render_Feat_Evidence(stringstream &ostream, const CSeq_feat &feat, CScope &)
#define ID_RMVPROTEINS_CHECKBOX
#define ID_LISTCTRL_FTR
#define ID_REMOVE_FEATURES_RADIOBUTTON
#define ID_REMOVE_FEATURES_CHECKBOX1
#define ID_REMOVE_FEATURES_CHECKBOX
#define ID_REMOVE_FEATURES_TEXTCTRL1
#define ID_REMOVE_FEATURES_RADIOBUTTON2
#define ID_REMOVE_FEATURES_OKCANCEL
#define ID_REMOVE_FEATURES_RADIOBUTTON1
#define ID_REMOVE_FEATURES_CHOICE2
#define ID_REMOVE_FEATURES_CHOICE1
#define ID_REMOVE_FEATURES_TEXTCTRL
#define ID_REMOVE_FEATURES_RADIOBUTTON3
#define ID_RMVPROTEINS_CHECKBOX1
static static static wxID_ANY
SAnnotSelector –.
Definition: type.c:6
void GetProductToCDSMap(objects::CScope &scope, map< objects::CBioseq_Handle, set< objects::CSeq_feat_Handle > > &product_to_cds)
CRef< CCmdComposite > GetDeleteAllFeaturesCommand(objects::CSeq_entry_Handle seh, size_t &count, bool remove_proteins=true)
CRef< CCmdComposite > GetDeleteFeatureCommand(const objects::CSeq_feat_Handle &fh, bool remove_proteins=true)
wxString ToWxString(const string &s)
Definition: wx_utils.hpp:173
string ToStdString(const wxString &s)
Definition: wx_utils.hpp:161
Modified on Thu Apr 25 08:21:58 2024 by modify_doxy.py rev. 669887