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

Go to the SVN repository for this file.

1 /* $Id: remove_gene_xrefs.cpp 42430 2019-02-22 13:19:16Z 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>
31 #include <sstream>
35 #include <objmgr/feat_ci.hpp>
36 #include <objmgr/bioseq_ci.hpp>
41 #include <gui/objutils/label.hpp>
44 #include <objmgr/util/feature.hpp>
46 #include <gui/objutils/utils.hpp>
48 
50 
52 
53 
54 
55 IMPLEMENT_DYNAMIC_CLASS( CRemoveGeneXrefs, CBulkCmdDlg )
56 
57 
58 BEGIN_EVENT_TABLE( CRemoveGeneXrefs, CBulkCmdDlg )
59 
61 
63 {
64  Init();
65 }
66 
68  wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style )
69  : CBulkCmdDlg(wb)
70 {
71  Init();
72  Create(parent, id, caption, pos, size, style);
73 }
74 
75 
76 bool CRemoveGeneXrefs::Create( wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style )
77 {
78  SetExtraStyle(wxWS_EX_BLOCK_EVENTS);
79  CBulkCmdDlg::Create( parent, id, caption, pos, size, style );
80 
82  if (GetSizer())
83  {
84  GetSizer()->SetSizeHints(this);
85  }
86  Centre();
87 
88  return true;
89 }
90 
91 
93 {
94 }
95 
96 
97 /*!
98  * Member initialisation
99  */
100 
102 {
103  set<string> existing;
104  m_Types.clear();
105  m_Descriptions.clear();
106 
108  vector<const CFeatListItem *> feat_list = GetSortedFeatList(m_TopSeqEntry);
109  ITERATE(vector<const CFeatListItem *>, ft_it, feat_list) {
110  const CFeatListItem& item = **ft_it;
111  string desc = item.GetDescription();
112  int feat_type = item.GetType();
113  int feat_subtype = item.GetSubtype();
114  m_Types[pair<int,int>(feat_type,feat_subtype)] = desc;
115  if (existing.find(desc) == existing.end())
116  {
117  existing.insert(desc);
118  m_Descriptions.push_back(desc);
119  if (feat_subtype == CSeqFeatData::eSubtype_any)
120  m_SubtypeAnyFlag.push_back(true);
121  else
122  m_SubtypeAnyFlag.push_back(false);
123  }
124  }
125 
126  m_ListCtrl = NULL;
127  m_ErrorMessage = "No feature found";
128 }
129 
130 
131 
132 
134 {
135  CRemoveGeneXrefs* itemDialog1 = this;
136 
137  wxBoxSizer* itemBoxSizer2 = new wxBoxSizer(wxVERTICAL);
138  itemDialog1->SetSizer(itemBoxSizer2);
139 
140  wxBoxSizer* itemBoxSizer3 = new wxBoxSizer(wxHORIZONTAL);
141  itemBoxSizer2->Add(itemBoxSizer3, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
142 
143  m_ListCtrl = new wxListCtrl( itemDialog1, ID_REMOVE_GENE_XREFS_LISTCTRL, wxDefaultPosition, wxSize(250, 200), wxLC_REPORT );
144  itemBoxSizer3->Add(m_ListCtrl, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
145 
146  m_ListCtrl->InsertColumn(0," Feature",wxLIST_FORMAT_LEFT,237);
147 
148  for (unsigned int i=0; i<m_Descriptions.size(); i++)
149  m_ListCtrl->InsertItem(i,ToWxString(m_Descriptions[i]));
150 
151  wxBoxSizer* itemBoxSizer5 = new wxBoxSizer(wxHORIZONTAL);
152  itemBoxSizer2->Add(itemBoxSizer5, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
153 
154  wxBoxSizer* itemBoxSizer6 = new wxBoxSizer(wxVERTICAL);
155  itemBoxSizer5->Add(itemBoxSizer6, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
156 
157  wxStaticBox* itemStaticBoxSizer7Static = new wxStaticBox(itemDialog1, wxID_ANY, _("Remove Gene Xrefs that are"));
158  wxStaticBoxSizer* itemStaticBoxSizer7 = new wxStaticBoxSizer(itemStaticBoxSizer7Static, wxVERTICAL);
159  itemBoxSizer6->Add(itemStaticBoxSizer7, 0, wxALIGN_LEFT|wxALL, 5);
160 
161  m_Suppressing = new wxCheckBox( itemDialog1, ID_SUPPRESSING_CHECKBOX, _("Suppressing"), wxDefaultPosition, wxDefaultSize, 0 );
162  m_Suppressing->SetValue(false);
163  itemStaticBoxSizer7->Add(m_Suppressing, 0, wxALIGN_LEFT|wxALL, 5);
164 
165  m_Nonsuppressing = new wxCheckBox( itemDialog1, ID_NONSUPPRESSING_CHECKBOX, _("Non-Suppressing"), wxDefaultPosition, wxDefaultSize, 0 );
166  m_Nonsuppressing->SetValue(false);
167  itemStaticBoxSizer7->Add(m_Nonsuppressing, 0, wxALIGN_LEFT|wxALL, 5);
168 
169  m_Unnecessary = new wxCheckBox( itemDialog1, ID_UNNECESSARY_CHECKBOX, _("Unnecessary"), wxDefaultPosition, wxDefaultSize, 0 );
170  m_Unnecessary->SetValue(false);
171  itemStaticBoxSizer7->Add(m_Unnecessary, 0, wxALIGN_LEFT|wxALL, 5);
172 
173  wxStaticBox* itemStaticBoxSizer17Static = new wxStaticBox(itemDialog1, wxID_ANY, wxEmptyString);
174  wxStaticBoxSizer* itemStaticBoxSizer17 = new wxStaticBoxSizer(itemStaticBoxSizer17Static, wxHORIZONTAL);
175  itemBoxSizer2->Add(itemStaticBoxSizer17, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
176 
177  wxStaticText* itemStaticText4 = new wxStaticText( itemDialog1, wxID_STATIC, _("Where feature text"), wxDefaultPosition, wxDefaultSize, 0 );
178  itemStaticBoxSizer17->Add(itemStaticText4, 0, wxALIGN_TOP|wxALL, 5);
179 
180  m_StringConstraintPanel = new CStringConstraintPanel( itemDialog1, false, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 );
181  itemStaticBoxSizer17->Add(m_StringConstraintPanel, 0, wxALIGN_TOP|wxALL|wxFIXED_MINSIZE, 0);
183 
184 
185  COkCancelPanel *OkCancel = new COkCancelPanel( itemDialog1, ID_REMOVE_GENE_XREFS_OKCANCEL, wxDefaultPosition, wxSize(100, 100), 0 );
186  itemBoxSizer2->Add(OkCancel, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
187 }
188 
189 
190 /*!
191  * Should we show tooltips?
192  */
193 
195 {
196  return true;
197 }
198 
199 /*!
200  * Get bitmap resources
201  */
202 
203 wxBitmap CRemoveGeneXrefs::GetBitmapResource( const wxString& name )
204 {
205  // Bitmap retrieval
206  wxUnusedVar(name);
207  return wxNullBitmap;
208 }
209 
210 /*!
211  * Get icon resources
212  */
213 
214 wxIcon CRemoveGeneXrefs::GetIconResource( const wxString& name )
215 {
216  // Icon retrieval
217  wxUnusedVar(name);
218  return wxNullIcon;
219 }
220 
222 {
223  if (!f.IsSetXref()) {
224  return false;
225  }
226  bool any_removed = false;
227  CSeq_feat::TXref::iterator xit = f.SetXref().begin();
228  while (xit != f.SetXref().end()) {
229  if ((*xit)->IsSetData() && (*xit)->GetData().IsGene() &&
230  (*xit)->GetData().GetGene().IsSuppressed()) {
231  xit = f.SetXref().erase(xit);
232  any_removed = true;
233  } else {
234  ++xit;
235  }
236  }
237  if (any_removed) {
238  if (f.IsSetXref() && f.GetXref().empty()) {
239  f.ResetXref();
240  }
241  }
242  return any_removed;
243 }
244 
245 
246 static void s_RenderAccList(
247  stringstream& ostream, const CUser_field::TData::TStrs& item_data, const string& title)
248 {
249  string s(title);
250  if ( !s.empty() ) {
251  s += ": ";
252  }
253 
254  list<string> refseq;
255  list<string> non_refseq;
256  ITERATE (CUser_field::TData::TStrs, it, item_data) {
259  refseq.push_back(*it);
260  } else {
261  non_refseq.push_back(*it);
262  }
263  }
264 
265  string accs;
266  if (refseq.size()) {
267  accs += NStr::Join(refseq, ", ");
268  }
269 
270  if (non_refseq.size()) {
271  if ( !accs.empty() ) {
272  accs += ", ";
273  }
274  accs += NStr::Join(non_refseq, ", ");
275  }
276 
277  if ( !accs.empty() ) {
278  s += accs;
279  } else {
280  s += "<unknown>";
281  }
282 
283  list<string> lines;
284  NStr::Wrap(s, 78, lines);
285  if ( !lines.empty() ) {
286  ITERATE (list<string>, iter, lines) {
287  if (iter != lines.begin()) {
288  ostream << " " << *iter << endl;
289  } else {
290  ostream << *iter << endl;
291  }
292  }
293  }
294 }
295 
297  stringstream& ostream, const CSeq_feat& feat, CScope& /*scope*/)
298 {
299  if ( !feat.IsSetExt() && !feat.IsSetExts()) {
300  return;
301  }
302 
303  list< CConstRef<CUser_object> > objs;
304  if (feat.IsSetExt()) {
305  CConstRef<CUser_object> o(&feat.GetExt());
306  if (o->IsSetType() && o->GetType().IsStr() && o->GetType().GetStr() == "CombinedFeatureUserObjects") {
307  ITERATE (CUser_object::TData, it, o->GetData()) {
308  const CUser_field& field = **it;
309  CConstRef<CUser_object> sub_o(&field.GetData().GetObject());
310  objs.push_back(sub_o);
311  }
312  } else {
313  objs.push_back(o);
314  }
315  }
316  if (feat.IsSetExts()) {
317  copy(feat.GetExts().begin(), feat.GetExts().end(), back_inserter(objs));
318  }
319 
320  ITERATE (list< CConstRef<CUser_object> >, obj_it, objs) {
321  const CUser_object& obj = **obj_it;
322  if ( !obj.IsSetType() ||
323  !obj.GetType().IsStr() ||
324  obj.GetType().GetStr() != "ModelEvidence") {
325  continue;
326  }
327 
328  string s;
330 
331  ostream << endl;
332 
333  ///
334  /// generation method
335  string method;
336  ostream << "Model Generation Method: ";
337  f = obj.GetFieldRef("Method");
338  if (f) {
339  method = f->GetData().GetStr();
340  ostream << method;
341  } else {
342  ostream << "<unknown>";
343  }
344 
345  ostream << endl;
346 
347  ///
348  /// list of support
349  if (method == "Chainer" || method == "Gnomon") {
350 
351  ///
352  /// scan for multiple 'Core' entries
353  f = obj.GetFieldRef("Support");
354  if (f) {
355  string core;
356  ITERATE (CUser_field::TData::TFields, it, f->GetData().GetFields()) {
357  const CUser_field& this_f = **it;
358  if (this_f.GetLabel().GetStr() == "Core") {
359  if ( !core.empty() ) {
360  core += ", ";
361  }
362  core += this_f.GetData().GetStr();
363  }
364  }
365  if ( !core.empty() ) {
366  s = "Model Based On: ";
367  s += core;
368  ostream << s << endl;
369  }
370  }
371 
372  ///
373  /// supporting proteins
374  f = obj.GetFieldRef("Support.Proteins");
375  if (f) {
376  s_RenderAccList(ostream, f->GetData().GetStrs(), "Source Proteins");
377  }
378 
379  ///
380  /// supporting proteins
381  f = obj.GetFieldRef("Support.mRNAs");
382  if (f) {
383  s_RenderAccList(ostream, f->GetData().GetStrs(), "Source mRNAs");
384  }
385  }
386  }
387 }
388 
389 static void s_Render_SeqFeat(
390  stringstream& ostream, const objects::CSeq_feat& feat, objects::CScope& scope)
391 {
392  try {
393  string text;
394  /// start with the description text
395  CLabel::GetLabel( feat, &text, CLabel::eDescription, &scope );
396  ostream << text << endl;
397 
398  /// add information about the feature's location
399  TSeqRange range = feat.GetLocation().GetTotalRange();
400  ostream << "Total Range: ";
401  switch( sequence::GetStrand(feat.GetLocation(), &scope) ){
402  case eNa_strand_plus:
403  ostream << "(+) ";
404  break;
405  case eNa_strand_minus:
406  ostream << "(-) ";
407  break;
408  default:
409  break;
410  }
411 
412  ostream << NStr::IntToString(range.GetFrom() + 1, NStr::fWithCommas)
413  << " - "
414  << NStr::IntToString(range.GetTo() + 1, NStr::fWithCommas)
415  << endl;
416 
417  ostream << "Total Length: "
418  << NStr::IntToString(range.GetLength(), NStr::fWithCommas)
419  << endl;
420 
421  ostream << "Processed Length: "
422  << NStr::IntToString(sequence::GetLength(feat.GetLocation(), &scope),
424  << endl;
425 
426  if (feat.IsSetProduct()) {
427  try {
428  string prod_len_str;
429  CBioseq_Handle h = scope.GetBioseqHandle(feat.GetProduct());
430  if (h) {
431  ostream << "Product Length: "
434  << endl;
435  }
436  }
437  catch (CException&) {
438  }
439  }
440  ostream << endl;
441 
442  /// next, include the flat file text for this feature
443  CFlatFileConfig cfg;
444  cfg.SetNeverTranslateCDS();
445 
446  /// hack: search for this feature using CFeat_CI
447  /// it'd be better to use CMappedFeat instead of CSeq_feat
449  sel.IncludeFeatSubtype(feat.GetData().GetSubtype());
450 
451  CFeat_CI feat_it(scope, feat.GetLocation(), sel);
452  for (; feat_it ; ++feat_it) {
453  if (&feat_it->GetOriginalFeature() != &feat){
454  continue;
455  }
456  string s =
457  CFlatFileGenerator::GetSeqFeatText(*feat_it, scope, cfg);
458  string::size_type pos = s.find_first_not_of(" \n\r\t");
459  if( pos != string::npos ){
460  s.erase(0, pos);
461  }
462 
463  string::size_type lpos = string::npos;
464  do {
465  pos = lpos +1;
466  lpos = s.find_first_of("\n\r", pos );
467 
468  if( lpos == string::npos ){
469  text = s.substr( pos );
470  } else {
471  text = s.substr( pos, lpos - pos );
472  }
473  ostream << text << endl;
474 
475  } while( lpos != string::npos );
476  } // for
477 
478  /// lastly, add items relating to model evidence
479  s_Render_Feat_Evidence(ostream, feat, scope);
480  }
481  catch (CException&) {
482  }
483 }
484 
486 {
487  CRef<CCmdComposite> cmd( new CCmdComposite("Remove Gene Xrefs") );
489 
490  long item = -1;
491  if (m_ListCtrl && m_TopSeqEntry)
492  {
493  for ( ;; )
494  {
495  item = m_ListCtrl->GetNextItem(item, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED);
496  if ( item == -1 ) break;
497  string name = ToStdString(m_ListCtrl->GetItemText(item));
498  bool subtypeAnyFlag = m_SubtypeAnyFlag[item];
499  for (CFeat_CI feat (m_TopSeqEntry); feat; ++feat)
500  {
501  bool filter = false;
502  if (NStr::EqualNocase(name, "All"))
503  {
504  filter = true;
505  }
506  else if (subtypeAnyFlag)
507  {
508  int type = feat->GetOriginalFeature().GetData().Which();
509  int subtype = CSeqFeatData::eSubtype_any;
510  string desc = m_Types[pair<int,int>(type,subtype)];
511  if (desc == name)
512  filter = true;
513  }
514  else if (feat->GetOriginalFeature().CanGetData())
515  {
516  int type = feat->GetOriginalFeature().GetData().Which();
517  int subtype = feat->GetOriginalFeature().GetData().GetSubtype();
518  string desc = m_Types[pair<int,int>(type,subtype)];
519  if (desc == name)
520  filter = true;
521  }
522 
523  if (filter)
524  {
525  bool go = true;
526  if (constraint)
527  {
528  stringstream str;
529  CScope &scope = m_TopSeqEntry.GetScope();
530  s_Render_SeqFeat(str, feat->GetOriginalFeature(), scope);
531  go = constraint->DoesTextMatch(str.str());
532  }
533 
534  if (go)
535  {
536  const CSeq_feat& orig = feat->GetOriginalFeature();
537  CRef<CSeq_feat> new_feat(new CSeq_feat);
538  new_feat->Assign(orig);
539  bool modified = false;
540  if (m_Unnecessary->GetValue())
541  {
542  modified |= CCleanup::RemoveUnnecessaryGeneXrefs(*new_feat, m_TopSeqEntry.GetScope() );
543  }
544  if (m_Nonsuppressing->GetValue())
545  {
546  modified |= CCleanup::RemoveNonsuppressingGeneXrefs(*new_feat);
547  }
548  if (m_Suppressing->GetValue())
549  {
550  modified |= RemoveSuppressingGeneXrefs(*new_feat);
551  }
552  if (modified)
553  {
554  cmd->AddCommand(*CRef<CCmdChangeSeq_feat>(new CCmdChangeSeq_feat(feat->GetSeq_feat_Handle(), *new_feat)));
555  }
556  }
557  }
558  }
559  }
560  }
561  return cmd;
562 }
563 
565 {
566  CRef<CCmdComposite> cmd(new CCmdComposite("Remove All Gene Xrefs"));
567  for (CFeat_CI feat_ci(seh); feat_ci; ++feat_ci)
568  {
569  const CSeq_feat& orig = feat_ci->GetOriginalFeature();
570  CRef<CSeq_feat> new_feat(new CSeq_feat);
571  new_feat->Assign(orig);
572  bool modified = false;
573  EDIT_EACH_SEQFEATXREF_ON_SEQFEAT(xref, *new_feat)
574  {
575  if ((*xref)->IsSetData() && (*xref)->GetData().IsGene())
576  {
577  ERASE_SEQFEATXREF_ON_SEQFEAT(xref,*new_feat);
578  modified = true;
579  }
580  }
581  if (modified)
582  {
583  if (new_feat->IsSetXref() && new_feat->GetXref().empty())
584  new_feat->ResetXref();
585 
586  cmd->AddCommand(*CRef<CCmdChangeSeq_feat>(new CCmdChangeSeq_feat(feat_ci->GetSeq_feat_Handle(), *new_feat)));
587  }
588  }
589  return cmd;
590 }
591 
593 {
594  CRef<CCmdComposite> cmd(new CCmdComposite("Remove Unnecessary Gene Xrefs"));
595  for (CFeat_CI feat_ci(seh); feat_ci; ++feat_ci)
596  {
597  const CSeq_feat& orig = feat_ci->GetOriginalFeature();
598  CRef<CSeq_feat> new_feat(new CSeq_feat);
599  new_feat->Assign(orig);
600  bool modified = CCleanup::RemoveUnnecessaryGeneXrefs(*new_feat, seh.GetScope() );
601  if (modified)
602  {
603  cmd->AddCommand(*CRef<CCmdChangeSeq_feat>(new CCmdChangeSeq_feat(feat_ci->GetSeq_feat_Handle(), *new_feat)));
604  }
605  }
606  return cmd;
607 }
608 
610 {
611  CRef<CCmdComposite> cmd(new CCmdComposite("Remove Nonsuppressing Gene Xrefs"));
612  for (CFeat_CI feat_ci(seh); feat_ci; ++feat_ci)
613  {
614  const CSeq_feat& orig = feat_ci->GetOriginalFeature();
615  CRef<CSeq_feat> new_feat(new CSeq_feat);
616  new_feat->Assign(orig);
617  bool modified = CCleanup::RemoveNonsuppressingGeneXrefs(*new_feat);
618  if (modified)
619  {
620  cmd->AddCommand(*CRef<CCmdChangeSeq_feat>(new CCmdChangeSeq_feat(feat_ci->GetSeq_feat_Handle(), *new_feat)));
621  }
622  }
623  return cmd;
624 }
625 
627 {
628  CRef<CCmdComposite> cmd(new CCmdComposite("Remove Orphan Locus Gene Xrefs"));
629  for (CFeat_CI feat_ci(seh); feat_ci; ++feat_ci)
630  {
631  const CSeq_feat& orig = feat_ci->GetOriginalFeature();
632  CRef<CSeq_feat> new_feat(new CSeq_feat);
633  new_feat->Assign(orig);
634  CBioseq_Handle bsh;
635  CSeq_entry_Handle parent = feat_ci->GetSeq_feat_Handle().GetAnnot().GetParentEntry();
636  if (parent.IsSeq())
637  bsh = parent.GetSeq();
638  else
639  {
640  bsh = *CBioseq_CI(parent,CSeq_inst::eMol_na);
641  }
642  bool modified = CCleanup::RemoveOrphanLocusGeneXrefs(*new_feat, bsh);
643  if (modified)
644  {
645  cmd->AddCommand(*CRef<CCmdChangeSeq_feat>(new CCmdChangeSeq_feat(feat_ci->GetSeq_feat_Handle(), *new_feat)));
646  }
647  }
648  return cmd;
649 }
650 
652 {
653  CRef<CCmdComposite> cmd(new CCmdComposite("Remove Orphan Locus_tag Gene Xrefs"));
654  for (CFeat_CI feat_ci(seh); feat_ci; ++feat_ci)
655  {
656  const CSeq_feat& orig = feat_ci->GetOriginalFeature();
657  CRef<CSeq_feat> new_feat(new CSeq_feat);
658  new_feat->Assign(orig);
659  CBioseq_Handle bsh;
660  CSeq_entry_Handle parent = feat_ci->GetSeq_feat_Handle().GetAnnot().GetParentEntry();
661  if (parent.IsSeq())
662  bsh = parent.GetSeq();
663  else
664  {
665  bsh = *CBioseq_CI(parent,CSeq_inst::eMol_na);
666  }
667  bool modified = CCleanup::RemoveOrphanLocus_tagGeneXrefs(*new_feat, bsh);
668  if (modified)
669  {
670  cmd->AddCommand(*CRef<CCmdChangeSeq_feat>(new CCmdChangeSeq_feat(feat_ci->GetSeq_feat_Handle(), *new_feat)));
671  }
672  }
673  return cmd;
674 }
675 
676 
677 
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()
static bool RemoveOrphanLocus_tagGeneXrefs(CSeq_feat &f, CBioseq_Handle bsh)
Removes orphaned locus_tag Gene-xrefs.
Definition: cleanup.cpp:1013
static bool RemoveOrphanLocusGeneXrefs(CSeq_feat &f, CBioseq_Handle bsh)
Removes orphaned locus Gene-xrefs.
Definition: cleanup.cpp:965
static bool RemoveUnnecessaryGeneXrefs(CSeq_feat &f, CScope &scope)
Removes unnecessary Gene-xrefs.
Definition: cleanup.cpp:779
static bool RemoveNonsuppressingGeneXrefs(CSeq_feat &f)
Removes non-suppressing Gene-xrefs.
Definition: cleanup.cpp:828
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)
wxCheckBox * m_Suppressing
CRemoveGeneXrefs()
Constructors.
static CRef< CCmdComposite > RemoveNonsuppressing(CSeq_entry_Handle seh)
wxCheckBox * m_Nonsuppressing
wxBitmap GetBitmapResource(const wxString &name)
Retrieves bitmap resources.
~CRemoveGeneXrefs()
Destructor.
map< pair< int, int >, string > m_Types
static bool ShowToolTips()
Should we show tooltips?
vector< bool > m_SubtypeAnyFlag
CStringConstraintPanel * m_StringConstraintPanel
static CRef< CCmdComposite > RemoveOrphanLocus_tag(CSeq_entry_Handle seh)
static CRef< CCmdComposite > RemoveAll(CSeq_entry_Handle seh)
void Init()
Initialises member variables.
static CRef< CCmdComposite > RemoveUnnecessary(CSeq_entry_Handle seh)
virtual CRef< CCmdComposite > GetCommand()
bool Create(wxWindow *parent, wxWindowID id=14000, const wxString &caption=_("Remove Gene Xrefs"), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU|wxCLOSE_BOX|wxTAB_TRAVERSAL)
Creation.
static CRef< CCmdComposite > RemoveOrphanLocus(CSeq_entry_Handle seh)
wxCheckBox * m_Unnecessary
wxIcon GetIconResource(const wxString &name)
Retrieves icon resources.
void CreateControls()
Creates the controls and sizers.
bool RemoveSuppressingGeneXrefs(CSeq_feat &f)
vector< string > m_Descriptions
CScope –.
Definition: scope.hpp:92
CSeq_entry_Handle –.
namespace ncbi::objects::
Definition: Seq_feat.hpp:58
void SetStringSelection(const wxString &str)
CRef< edit::CStringConstraint > GetStringConstraint()
CConstRef< CUser_field > GetFieldRef(const string &str, const string &delim=".", NStr::ECase use_case=NStr::eCase) const
Definition: User_object.cpp:84
IWorkbench is the central interface in the application framework.
Definition: workbench.hpp:113
void clear()
Definition: map.hpp:169
iterator_bool insert(const value_type &val)
Definition: set.hpp:149
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
#define wxFIXED_MINSIZE
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
#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
virtual void Assign(const CSerialObject &source, ESerialRecursionMode how=eRecursive)
Set object to copy of another one.
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
EAccessionInfo
For IdentifyAccession (below)
Definition: Seq_id.hpp:220
@ eAcc_type_mask
Definition: Seq_id.hpp:247
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...
TSeqPos GetBioseqLength(void) const
TSeq GetSeq(void) const
CScope & GetScope(void) const
Get scope this handle belongs to.
CSeq_entry_Handle GetParentEntry(void) const
Get parent Seq-entry handle.
bool IsSeq(void) const
SAnnotSelector & IncludeFeatSubtype(TFeatSubtype subtype)
Include feature subtype in the search.
const CSeq_feat & GetOriginalFeature(void) const
Get original feature with unmapped location/product.
#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 string IntToString(int value, TNumToStringFlags flags=0, int base=10)
Convert int to string.
Definition: ncbistr.hpp:5084
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
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
bool IsSetXref(void) const
cite other relevant features Check if a value has been assigned to Xref data member.
Definition: Seq_feat_.hpp:1296
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 TXref & GetXref(void) const
Get the Xref member data.
Definition: Seq_feat_.hpp:1308
void ResetXref(void)
Reset Xref data member.
Definition: Seq_feat_.cpp:182
const TExt & GetExt(void) const
Get the Ext member data.
Definition: Seq_feat_.hpp:1219
@ 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
@ eMol_na
just a nucleic acid
Definition: Seq_inst_.hpp:113
where boath are integers</td > n< td ></td > n</tr > n< tr > n< td > tse</td > n< td > optional</td > n< td > String</td > n< td class=\"description\"> TSE option controls what blob is orig
END_EVENT_TABLE()
int i
static void text(MDB_val *v)
Definition: mdb_dump.c:62
static MDB_envinfo info
Definition: mdb_load.c:37
range(_Ty, _Ty) -> range< _Ty >
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
static void s_Render_SeqFeat(stringstream &ostream, const objects::CSeq_feat &feat, objects::CScope &scope)
USING_SCOPE(ncbi::objects)
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_SUPPRESSING_CHECKBOX
#define ID_UNNECESSARY_CHECKBOX
#define ID_REMOVE_GENE_XREFS_LISTCTRL
#define ID_REMOVE_GENE_XREFS_OKCANCEL
#define ID_NONSUPPRESSING_CHECKBOX
Utility macros and typedefs for exploring NCBI objects from seqfeat.asn.
#define ERASE_SEQFEATXREF_ON_SEQFEAT(Itr, Var)
ERASE_SEQFEATXREF_ON_SEQFEAT.
#define EDIT_EACH_SEQFEATXREF_ON_SEQFEAT(Itr, Var)
static static static wxID_ANY
SAnnotSelector –.
Definition: type.c:6
wxString ToWxString(const string &s)
Definition: wx_utils.hpp:173
string ToStdString(const wxString &s)
Definition: wx_utils.hpp:161
Modified on Wed May 01 14:22:15 2024 by modify_doxy.py rev. 669887