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

Go to the SVN repository for this file.

1 /* $Id: correct_genes_dialog.cpp 45101 2020-05-29 20:53:24Z asztalos $
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: Colleen Bollin
27  */
28 
29 
30 #include <ncbi_pch.hpp>
31 
32 ////@begin includes
33 ////@end includes
34 
36 #include <objmgr/feat_ci.hpp>
48 
49 ////@begin XPM images
50 ////@end XPM images
51 
53 
55 
56 
57 /*!
58  * CCorrectGenesDialog type definition
59  */
60 
61 IMPLEMENT_DYNAMIC_CLASS( CCorrectGenesDialog, CBulkCmdDlg )
62 
63 
64 /*!
65  * CCorrectGenesDialog event table definition
66  */
67 
68 BEGIN_EVENT_TABLE( CCorrectGenesDialog, CBulkCmdDlg )
69 
70 ////@begin CCorrectGenesDialog event table entries
71 ////@end CCorrectGenesDialog event table entries
72 
74 
75 
76 /*!
77  * CCorrectGenesDialog constructors
78  */
79 
81 {
82  Init();
83 }
84 
85 CCorrectGenesDialog::CCorrectGenesDialog( wxWindow* parent, IWorkbench* wb, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style )
86 : CBulkCmdDlg(wb)
87 {
88  Init();
89  Create(parent, id, caption, pos, size, style);
90 }
91 
92 
93 /*!
94  * CCorrectGenesDialog creator
95  */
96 
97 bool CCorrectGenesDialog::Create( wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style )
98 {
99 ////@begin CCorrectGenesDialog creation
100  SetExtraStyle(wxWS_EX_BLOCK_EVENTS);
101  CBulkCmdDlg::Create( parent, id, caption, pos, size, style );
102 
103  CreateControls();
104  if (GetSizer())
105  {
106  GetSizer()->SetSizeHints(this);
107  }
108  Centre();
109 ////@end CCorrectGenesDialog creation
110  return true;
111 }
112 
113 
114 /*!
115  * CCorrectGenesDialog destructor
116  */
117 
119 {
120 ////@begin CCorrectGenesDialog destruction
121 ////@end CCorrectGenesDialog destruction
122 }
123 
124 
125 /*!
126  * Member initialisation
127  */
128 
130 {
131 ////@begin CCorrectGenesDialog member initialisation
134  m_Log = NULL;
137  m_Constraint = NULL;
138  m_OkCancel = NULL;
139 ////@end CCorrectGenesDialog member initialisation
140 }
141 
142 
143 /*!
144  * Control creation for CCorrectGenesDialog
145  */
146 
148 {
149 ////@begin CCorrectGenesDialog content construction
150  CCorrectGenesDialog* itemCBulkCmdDlg1 = this;
151 
152  wxBoxSizer* itemBoxSizer2 = new wxBoxSizer(wxVERTICAL);
153  itemCBulkCmdDlg1->SetSizer(itemBoxSizer2);
154 
155  m_MatchInterval = new wxCheckBox( itemCBulkCmdDlg1, ID_CHECKBOX10, _("Set gene interval to match"), wxDefaultPosition, wxDefaultSize, 0 );
156  m_MatchInterval->SetValue(true);
157  itemBoxSizer2->Add(m_MatchInterval, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
158 
159  m_MatchStrand = new wxCheckBox( itemCBulkCmdDlg1, ID_CHECKBOX11, _("Set gene strand to match"), wxDefaultPosition, wxDefaultSize, 0 );
160  m_MatchStrand->SetValue(true);
161  itemBoxSizer2->Add(m_MatchStrand, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
162 
163  m_Log = new wxCheckBox( itemCBulkCmdDlg1, ID_CHECKBOX12, _("Log gene changes"), wxDefaultPosition, wxDefaultSize, 0 );
164  m_Log->SetValue(false);
165  itemBoxSizer2->Add(m_Log, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
166 
167  wxArrayString m_FeatureChoiceStrings;
168  m_FeatureChoiceStrings.Add(_("&CDS"));
169  m_FeatureChoiceStrings.Add(_("&mRNA"));
170  m_FeatureChoiceStrings.Add(_("&ncRNA"));
171  m_FeatureChoiceStrings.Add(_("&rRNA"));
172  m_FeatureChoiceStrings.Add(_("&tRNA"));
173  m_FeatureChoice = new wxRadioBox( itemCBulkCmdDlg1, ID_RADIOBOX3, wxEmptyString, wxDefaultPosition, wxDefaultSize, m_FeatureChoiceStrings, 1, wxRA_SPECIFY_ROWS );
174  m_FeatureChoice->SetSelection(0);
175  itemBoxSizer2->Add(m_FeatureChoice, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
176 
177  m_OnlySelected = new wxCheckBox( itemCBulkCmdDlg1, ID_CHECKBOX13, _("Correct only selected feature-gene pair"), wxDefaultPosition, wxDefaultSize, 0 );
178  m_OnlySelected->SetValue(false);
179  itemBoxSizer2->Add(m_OnlySelected, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
180 
182  m_Constraint = new CConstraintPanel( itemCBulkCmdDlg1, m_TopSeqEntry);
183  itemBoxSizer2->Add(m_Constraint, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
184 
185  m_OkCancel = new COkCancelPanel( itemCBulkCmdDlg1, ID_WINDOW14, wxDefaultPosition, wxSize(100, 100), 0 );
186  itemBoxSizer2->Add(m_OkCancel, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
187 
188 ////@end CCorrectGenesDialog content construction
190 }
191 
192 
193 /*!
194  * Should we show tooltips?
195  */
196 
198 {
199  return true;
200 }
201 
202 /*!
203  * Get bitmap resources
204  */
205 
206 wxBitmap CCorrectGenesDialog::GetBitmapResource( const wxString& name )
207 {
208  // Bitmap retrieval
209 ////@begin CCorrectGenesDialog bitmap retrieval
210  wxUnusedVar(name);
211  return wxNullBitmap;
212 ////@end CCorrectGenesDialog bitmap retrieval
213 }
214 
215 /*!
216  * Get icon resources
217  */
218 
219 wxIcon CCorrectGenesDialog::GetIconResource( const wxString& name )
220 {
221  // Icon retrieval
222 ////@begin CCorrectGenesDialog icon retrieval
223  wxUnusedVar(name);
224  return wxNullIcon;
225 ////@end CCorrectGenesDialog icon retrieval
226 }
227 
228 
230 {
232  m_Error = "";
233 
234  CScope& scope = m_TopSeqEntry.GetScope();
235 
236  string report_msg = "";
237  // which features to correct?
238  if (m_OnlySelected->GetValue()) {
239  vector<CConstRef<CSeq_feat> > list = x_GetSelectedPair();
240  if (!list.empty()) {
241  CBioseq_Handle bsh = scope.GetBioseqHandle(list[0]->GetLocation());
242  string seq_id = "";
244  CRef<CSeq_feat> new_gene(new CSeq_feat());
245  new_gene->Assign(*list[0]);
246  string this_msg = x_CorrectOnePair(*(list[1]), *new_gene, seq_id, scope);
247  if (NStr::IsBlank(this_msg)) {
248  m_Error = "No change!";
249  } else {
250  cmd.Reset(new CCmdComposite("Correct Genes"));
251  CSeq_feat_Handle orig_gene = scope.GetSeq_featHandle(*(list[0]));
252  cmd->AddCommand(*CRef<CCmdChangeSeq_feat>(new CCmdChangeSeq_feat(orig_gene,*new_gene)));
253  if (m_Log->GetValue()) {
254  report_msg = this_msg;
255  }
256  }
257  }
258  } else {
259  vector<CConstRef<CSeq_feat> > constrained = x_GetConstrainedList();
260  bool same_strand = !m_MatchStrand->GetValue();
261  vector<CSeq_feat_Handle> feats;
262  ITERATE(vector<CConstRef<CSeq_feat> >, it, constrained)
263  {
265  if (!fh)
266  continue;
267  feats.push_back(fh);
268  }
270  set<CSeq_feat_Handle> used_genes;
271  x_FindExactMatches(feats, scope, same_strand, feat_to_genes, used_genes);
272  x_FindNonExactMatches(feats, scope, same_strand, feat_to_genes, used_genes);
273 
274  ITERATE(vector<CConstRef<CSeq_feat> >, it, constrained) {
276  if (!fh)
277  continue;
278  CBioseq_Handle bsh = scope.GetBioseqHandle((*it)->GetLocation());
279  string seq_id;
281  vector<CSeq_feat_Handle> &genes = feat_to_genes[fh];
282  for (size_t ii = 0; ii < genes.size(); ii++)
283  {
284  CRef<CSeq_feat> new_gene(new CSeq_feat());
285  new_gene->Assign(*(genes[ii].GetOriginalSeq_feat()));
286  string this_msg = x_CorrectOnePair(**it, *new_gene, seq_id, scope);
287  if (NStr::IsBlank(this_msg)) {
288  m_Error = "No change!";
289  } else {
290  if (!cmd) {
291  cmd.Reset(new CCmdComposite("Correct Genes"));
292  }
293  cmd->AddCommand(*CRef<CCmdChangeSeq_feat>(new CCmdChangeSeq_feat(genes[ii],*new_gene)));
294  if (m_Log->GetValue()) {
295  report_msg += this_msg;
296  }
297  }
298  }
299  if (genes.empty())
300  {
301  string cds_label = edit::GetTextObjectDescription(**it, scope);
302  report_msg += "No gene found for " + cds_label + "\n";
303  }
304  }
305  }
306 
307  if (m_Log->GetValue() && !NStr::IsBlank(report_msg)) {
309  report->SetTitle(wxT("Gene Change Log"));
310  report->SetText(ToWxString(report_msg));
311  report->Show(true);
312  }
313 
314  return cmd;
315 }
316 
317 
319 {
320  return m_Error;
321 }
322 
323 
325 {
326  bool changed = false;
327  if (cds.GetStrand() == eNa_strand_other)
328  return changed;
329 
330  CRef<CSeq_loc> interval(new CSeq_loc);
331  interval->SetInt().SetFrom(cds.GetStart(eExtreme_Positional));
332  interval->SetInt().SetTo(cds.GetStop(eExtreme_Positional));
333  interval->SetStrand(cds.GetStrand());
334  CRef<CSeq_id> id(new CSeq_id);
335  id->Assign(*cds.GetId());
336  interval->SetInt().SetId(*id);
339 
340 
341  if (sequence::Compare(gene.GetLocation(), *interval, scope) != sequence::eSame ||
344  {
345  changed = true;
346  gene.SetLocation().Assign(*interval);
349  gene.SetPartial(true);
350  } else {
351  gene.ResetPartial();
352  }
353  }
354  return changed;
355 }
356 
357 
359 {
360  bool changed = false;
361 
362  ENa_strand cds_strand = cds.GetStrand();
363  ENa_strand gene_strand = gene.GetStrand();
364 
365  if (cds_strand == eNa_strand_minus && gene_strand != eNa_strand_minus) {
367  changed = true;
368  } else if (cds_strand != eNa_strand_minus && gene_strand == eNa_strand_minus) {
369  gene.ResetStrand();
370  changed = true;
371  }
372 
373  return changed;
374 }
375 
376 
377 string CCorrectGenesDialog::x_CorrectOnePair(const CSeq_feat& cds, CSeq_feat& gene, const string& seq_label, CScope& scope)
378 {
379  string log_msg;
380  string gene_label = edit::GetTextObjectDescription(gene, scope);
381  string cds_label = edit::GetTextObjectDescription(cds, scope);
382 
383  if (gene.IsSetExcept() && gene.GetExcept() && gene.IsSetExcept_text() && gene.GetExcept_text() == "trans-splicing")
384  {
385  log_msg = "Sequence " + seq_label + ": "+gene_label+" is a trans-spliced gene\n";
386  return log_msg;
387  }
388 
389  if (m_MatchInterval->GetValue()) {
390  if (x_CorrectPairInterval(cds.GetLocation(), gene, &scope)) {
391 
392 
393  log_msg = "Sequence " + seq_label + ":" + gene_label + " reset to ";
394  if (cds.GetData().IsCdregion()) {
395  log_msg += "CDS";
396  } else {
397  log_msg += "mRNA";
398  }
399  log_msg += " interval (" + cds_label + ")\n";
400  }
401  }
402  if (m_MatchStrand->GetValue()) {
403  if (x_CorrectPairStrand(cds.GetLocation(), gene.SetLocation())) {
404  log_msg += "Sequence " + seq_label + ":" + gene_label + " strand set to match ";
405  if (cds.GetData().IsCdregion()) {
406  log_msg += "CDS";
407  } else {
408  log_msg += "mRNA";
409  }
410  log_msg += " (" + cds_label + ")\n";
411  }
412  }
413 
414  return log_msg;
415 }
416 
417 
418 vector<CConstRef<CSeq_feat> > CCorrectGenesDialog::x_GetSelectedPair()
419 {
420  vector<CConstRef<CSeq_feat> > list;
421 
424  if (!sel_srv) {
425  m_Error = "Can't find selection service!";
426  return list;
427  }
428  sel_srv->GetActiveObjects(objects);
429  if (objects.empty())
430  {
432  }
433  if (objects.empty()) {
434  m_Error = "No objects selected!";
435  return list;
436  }
438  CConstRef<CSeq_feat> other(NULL);
440  const CSeq_feat* f = dynamic_cast<const CSeq_feat*>(it->object.GetPointer());
441  if (f) {
442  if (f->GetData().IsGene()) {
443  if (gene) {
444  m_Error = "More than one gene feature is selected!";
445  return list;
446  } else {
447  gene.Reset(f);
448  }
449  } else {
450  if (other) {
451  m_Error = "More than one non-gene feature is selected!";
452  return list;
453  } else {
454  other.Reset(f);
455  }
456  }
457  }
458  }
459  if (!gene || !other) {
460  m_Error = "Must select one gene and one other feature!";
461  return list;
462  }
463  list.push_back(gene);
464  list.push_back(other);
465  return list;
466 }
467 
468 
469 vector<CConstRef<CSeq_feat> > CCorrectGenesDialog::x_GetConstrainedList()
470 {
471  vector<CConstRef<CSeq_feat> > constrained;
472  // want to get a list of the features of the selected type that match the constraint
473  CRef<CMiscSeqTableColumn> col(new CMiscSeqTableColumn("location"));
474 
475  CFieldNamePanel* constraint_field_panel = m_Constraint->GetFieldNamePanel();
476  string constraint_field;
477  string constraint_field_type = m_Constraint->GetFieldType();
478  if (constraint_field_panel)
479  constraint_field = constraint_field_panel->GetFieldName();
480 
481  if (NStr::IsBlank(constraint_field)) {
482  constraint_field = constraint_field_type;
483  } else {
484  if (NStr::StartsWith(constraint_field_type, "RNA") && NStr::Find(constraint_field, "RNA") == NPOS ) {
485  constraint_field = "RNA " + constraint_field;
486  }
487  }
489 
490  col->SetConstraint(constraint_field, string_constraint);
491  vector<CConstRef<CObject> > objs = col->GetObjects(m_TopSeqEntry, constraint_field, string_constraint);
493  if (m_FeatureChoice->GetSelection() == 1) {
495  } else if (m_FeatureChoice->GetSelection() == 2) {
497  } else if (m_FeatureChoice->GetSelection() == 3) {
499  } else if (m_FeatureChoice->GetSelection() == 4) {
501  }
502 
503  ITERATE(vector<CConstRef<CObject> >, it, objs) {
504  const CSeq_feat* f = dynamic_cast<const CSeq_feat*>((*it).GetPointer());
505  if (f && f->IsSetData() && f->GetData().GetSubtype() == match) {
506  CConstRef<CSeq_feat> ref(f);
507  constrained.push_back(ref);
508  }
509  }
510  return constrained;
511 }
512 
513 
514 bool CCorrectGenesDialog::x_TestGeneForFeature(const CSeq_loc& gene_loc, const CSeq_loc& feat_loc, CScope& scope, bool same_strand, bool& exact, TSeqPos& diff)
515 {
516  exact = false;
517  // unless we plan to correct to same strand, only look at locations on same strand
518  if (same_strand) {
519  ENa_strand feat_strand = feat_loc.GetStrand();
520  ENa_strand gene_strand = gene_loc.GetStrand();
521  if (feat_strand == eNa_strand_minus && gene_strand != eNa_strand_minus) {
522  return false;
523  } else if (feat_strand != eNa_strand_minus && gene_strand == eNa_strand_minus) {
524  return false;
525  }
526  }
527  sequence::ECompare cmp = sequence::Compare(gene_loc, feat_loc, &scope);
528  if (cmp == sequence::eSame) {
529  exact = true;
530  return true;
532 
536  diff = sequence::GetCoverage(*loc3, &scope);
537  return true;
538  } else {
539  return false;
540  }
541 }
542 
543 
544 void CCorrectGenesDialog::x_FindExactMatches(const vector<CSeq_feat_Handle> &feats, CScope& scope, bool same_strand,
545  map<CSeq_feat_Handle, vector<CSeq_feat_Handle> > &feat_to_genes, set<CSeq_feat_Handle> &used_genes)
546 {
547  for (const auto &feat : feats)
548  {
549  const CSeq_loc &loc = feat.GetLocation();
550  CBioseq_Handle bsh = scope.GetBioseqHandle(loc);
551  if (!bsh)
552  {
553  continue;
554  }
555 
556  for (CFeat_CI gene(bsh, CSeqFeatData::eSubtype_gene); gene; ++gene)
557  {
558  if (used_genes.find(*gene) != used_genes.end())
559  continue;
560  bool exact = false;
561  TSeqPos diff = INT_MAX;
562  if (x_TestGeneForFeature(gene->GetLocation(), loc, scope, same_strand, exact, diff))
563  {
564  if (exact)
565  {
566  feat_to_genes[feat].push_back(*gene);
567  used_genes.insert(*gene);
568  }
569  }
570  }
571  }
572 }
573 
574 void CCorrectGenesDialog::x_FindNonExactMatches(const vector<CSeq_feat_Handle> &feats, CScope& scope, bool same_strand,
575  map<CSeq_feat_Handle, vector<CSeq_feat_Handle> > &feat_to_genes, set<CSeq_feat_Handle> &used_genes)
576 {
578  for (const auto &feat : feats)
579  {
580  if (feat_to_genes.find(feat) != feat_to_genes.end())
581  continue;
582  const CSeq_loc &loc = feat.GetLocation();
583  CBioseq_Handle bsh = scope.GetBioseqHandle(loc);
584  if (!bsh)
585  {
586  continue;
587  }
588 
589  for (CFeat_CI gene(bsh, CSeqFeatData::eSubtype_gene); gene; ++gene)
590  {
591  if (used_genes.find(*gene) != used_genes.end())
592  continue;
593  bool exact = false;
594  TSeqPos diff = INT_MAX;
595  if (x_TestGeneForFeature(gene->GetLocation(), loc, scope, same_strand, exact, diff))
596  {
597  if (exact)
598  {
599  diff = 0;
600  }
601  dist_to_feat_to_genes[diff][feat].push_back(*gene);
602  }
603  }
604  }
605  for (const auto &it : dist_to_feat_to_genes)
606  {
607  for (const auto &f_to_g : it.second)
608  {
609  const CSeq_feat_Handle feat = f_to_g.first;
610  if (feat_to_genes.find(feat) != feat_to_genes.end())
611  continue;
612  for (const auto &gene : f_to_g.second)
613  {
614  if (used_genes.find(gene) != used_genes.end())
615  continue;
616  feat_to_genes[feat].push_back(gene);
617  used_genes.insert(gene);
618  }
619  }
620  }
621 }
622 
623 
625 
626 
@ eExtreme_Positional
numerical value
Definition: Na_strand.hpp:63
@ eExtreme_Biological
5' and 3'
Definition: Na_strand.hpp:62
@ eFieldType_CDSGeneProt
Definition: aecr_frame.hpp:153
CBioseq_Handle –.
@ eContent
Definition: Bioseq.hpp:103
void GetLabel(string *label, ELabelType type, bool worst=false) const
Definition: Bioseq.cpp:202
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)
IWorkbench * m_Workbench
bool GetTopLevelSeqEntryAndProcessor()
void SetSelection(int page)
string GetFieldType(void) const
CFieldNamePanel * GetFieldNamePanel(void)
CRef< edit::CStringConstraint > GetStringConstraint(void)
wxIcon GetIconResource(const wxString &name)
Retrieves icon resources.
void Init()
Initialises member variables.
bool Create(wxWindow *parent, wxWindowID id=10416, const wxString &caption=_("Correct Genes"), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(400, 300), long style=wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU|wxCLOSE_BOX|wxTAB_TRAVERSAL)
Creation.
CCorrectGenesDialog()
Constructors.
CConstraintPanel * m_Constraint
bool x_TestGeneForFeature(const CSeq_loc &gene_loc, const CSeq_loc &feat_loc, CScope &scope, bool same_strand, bool &exact, TSeqPos &diff)
vector< CConstRef< CSeq_feat > > x_GetConstrainedList()
string x_CorrectOnePair(const CSeq_feat &cds, CSeq_feat &gene, const string &seq_label, CScope &scope)
bool x_CorrectPairStrand(const CSeq_loc &cds, CSeq_loc &gene)
void x_FindNonExactMatches(const vector< CSeq_feat_Handle > &feats, CScope &scope, bool same_strand, map< CSeq_feat_Handle, vector< CSeq_feat_Handle > > &feat_to_genes, set< CSeq_feat_Handle > &used_genes)
static bool ShowToolTips()
Should we show tooltips?
void CreateControls()
Creates the controls and sizers.
bool x_CorrectPairInterval(const CSeq_loc &cds, CSeq_feat &gene, CScope *scope)
virtual CRef< CCmdComposite > GetCommand()
wxBitmap GetBitmapResource(const wxString &name)
Retrieves bitmap resources.
vector< CConstRef< CSeq_feat > > x_GetSelectedPair()
virtual string GetErrorMessage()
void x_FindExactMatches(const vector< CSeq_feat_Handle > &feats, CScope &scope, bool same_strand, map< CSeq_feat_Handle, vector< CSeq_feat_Handle > > &feat_to_genes, set< CSeq_feat_Handle > &used_genes)
CFeat_CI –.
Definition: feat_ci.hpp:64
virtual string GetFieldName(const bool subfield=false)=0
Returns the name of the field as selected in the panel.
void SetText(const wxString &text)
void SetConstraint(string field, CRef< objects::edit::CStringConstraint > string_constraint)
vector< CConstRef< CObject > > GetObjects(objects::CBioseq_Handle bsh)
CScope –.
Definition: scope.hpp:92
CSeq_feat_Handle –.
namespace ncbi::objects::
Definition: Seq_feat.hpp:58
IWorkbench is the central interface in the application framework.
Definition: workbench.hpp:113
Definition: map.hpp:338
Definition: set.hpp:45
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
USING_SCOPE(ncbi::objects)
#define ID_RADIOBOX3
#define ID_CHECKBOX13
#define ID_CHECKBOX12
#define ID_CHECKBOX11
#define ID_WINDOW14
#define ID_CHECKBOX10
#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
unsigned int TSeqPos
Type for sequence locations and lengths.
Definition: ncbimisc.hpp:875
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
Definition: ncbimisc.hpp:815
#define NON_CONST_ITERATE(Type, Var, Cont)
Non constant version of ITERATE macro.
Definition: ncbimisc.hpp:822
#define NULL
Definition: ncbistd.hpp:225
CIRef< T > GetServiceByType()
retrieves a typed reference to a service, the name of C++ type is used as the name of the service.
Definition: service.hpp:91
vector< SConstScopedObject > TConstScopedObjects
Definition: objects.hpp:65
virtual void Assign(const CSerialObject &source, ESerialRecursionMode how=eRecursive)
Set object to copy of another one.
bool IsPartialStart(ESeqLocExtremes ext) const
check start or stop of location for e_Lim fuzz
Definition: Seq_loc.cpp:3222
ENa_strand GetStrand(void) const
Get the location's strand.
Definition: Seq_loc.cpp:882
TSeqPos GetStart(ESeqLocExtremes ext) const
Return start and stop positions of the seq-loc.
Definition: Seq_loc.cpp:915
void SetInt(TInt &v)
Definition: Seq_loc.hpp:983
const CSeq_id * GetId(void) const
Get the id of the location return NULL if has multiple ids or no id at all.
Definition: Seq_loc.hpp:941
void ResetStrand(void)
Reset the strand on this location.
Definition: Seq_loc.cpp:5221
void SetPartialStart(bool val, ESeqLocExtremes ext)
set / remove e_Lim fuzz on start or stop (lt/gt - indicating partial interval)
Definition: Seq_loc.cpp:3280
void SetStrand(ENa_strand strand)
Set the strand for all of the location's ranges.
Definition: Seq_loc.cpp:5196
void SetPartialStop(bool val, ESeqLocExtremes ext)
Definition: Seq_loc.cpp:3313
bool IsPartialStop(ESeqLocExtremes ext) const
Definition: Seq_loc.cpp:3251
TSeqPos GetStop(ESeqLocExtremes ext) const
Definition: Seq_loc.cpp:963
@ fMerge_All
Definition: Seq_loc.hpp:331
sequence::ECompare Compare(const CSeq_loc &loc1, const CSeq_loc &loc2, CScope *scope)
Returns the sequence::ECompare containment relationship between CSeq_locs.
TSeqPos GetCoverage(const CSeq_loc &loc, CScope *scope)
Get number of unique bases in the location.
CRef< CSeq_loc > Seq_loc_Subtract(const CSeq_loc &loc1, const CSeq_loc &loc2, CSeq_loc::TOpFlags flags, CScope *scope)
Subtract the second seq-loc from the first one.
ECompare
CRef< CSeq_loc > Seq_loc_Add(const CSeq_loc &loc1, const CSeq_loc &loc2, CSeq_loc::TOpFlags flags, CScope *scope)
Add two seq-locs.
@ eContains
First CSeq_loc contains second.
@ eOverlap
CSeq_locs overlap.
@ eSame
CSeq_locs contain each other.
@ eContained
First CSeq_loc contained by second.
CBioseq_Handle GetBioseqHandle(const CSeq_id &id)
Get bioseq handle by seq-id.
Definition: scope.cpp:95
CSeq_feat_Handle GetSeq_featHandle(const CSeq_feat &feat, EMissing action=eMissing_Default)
Definition: scope.cpp:200
@ eMissing_Null
Definition: scope.hpp:157
CConstRef< CBioseq > GetCompleteBioseq(void) const
Get the complete bioseq.
void Reset(void)
Reset reference object.
Definition: ncbiobj.hpp:1439
#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
#define NPOS
Definition: ncbistr.hpp:133
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 bool StartsWith(const CTempString str, const CTempString start, ECase use_case=eCase)
Check if a string starts with a specified prefix value.
Definition: ncbistr.hpp:5412
void ResetPartial(void)
Reset Partial data member.
Definition: Seq_feat_.hpp:955
void SetLocation(TLocation &value)
Assign a value to Location data member.
Definition: Seq_feat_.cpp:131
bool IsCdregion(void) const
Check if variant Cdregion is selected.
void SetPartial(TPartial value)
Assign a value to Partial data member.
Definition: Seq_feat_.hpp:971
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 IsSetExcept(void) const
something funny about this? Check if a value has been assigned to Except data member.
Definition: Seq_feat_.hpp:990
const TExcept_text & GetExcept_text(void) const
Get the Except_text member data.
Definition: Seq_feat_.hpp:1405
bool IsSetExcept_text(void) const
explain if except=TRUE Check if a value has been assigned to Except_text data member.
Definition: Seq_feat_.hpp:1393
TExcept GetExcept(void) const
Get the Except member data.
Definition: Seq_feat_.hpp:1009
ENa_strand
strand of nucleic acid
Definition: Na_strand_.hpp:64
@ eNa_strand_other
Definition: Na_strand_.hpp:70
@ eNa_strand_minus
Definition: Na_strand_.hpp:67
END_EVENT_TABLE()
void GetViewObjects(IWorkbench *workbench, TConstScopedObjects &objects)
#define wxT(x)
Definition: muParser.cpp:41
const struct ncbi::grid::netcache::search::fields::SIZE size
double f(double x_, const double &y_)
Definition: njn_root.hpp:188
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
string GetTextObjectDescription(const CSeq_feat &sf, CScope &scope)
wxString ToWxString(const string &s)
Definition: wx_utils.hpp:173
Modified on Mon Jun 17 05:04:28 2024 by modify_doxy.py rev. 669887