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

Go to the SVN repository for this file.

1 /* $Id: extend_cds_to_stop.cpp 47479 2023-05-02 13:24:02Z ucko $
2  * ===========================================================================
3  *
4  * PUBLIC DOMAIN NOTICE
5  * National Center for Biotechnology Information
6  *
7  * This software/database is a "United States Government Work" under the
8  * terms of the United States Copyright Act. It was written as part of
9  * the author's official duties as a United States Government employee and
10  * thus cannot be copyrighted. This software/database is freely available
11  * to the public for use. The National Library of Medicine and the U.S.
12  * Government have not placed any restriction on its use or reproduction.
13  *
14  * Although all reasonable efforts have been taken to ensure the accuracy
15  * and reliability of the software and data, the NLM and the U.S.
16  * Government do not and cannot warrant the performance or results that
17  * may be obtained by using this software or data. The NLM and the U.S.
18  * Government disclaim all warranties, express or implied, including
19  * warranties of performance, merchantability or fitness for any particular
20  * purpose.
21  *
22  * Please cite the author in any work or product based on this material.
23  *
24  * ===========================================================================
25  *
26  * Authors: Igor Filippov
27  */
28 
29 
30 #include <ncbi_pch.hpp>
31 
32 ////@begin includes
33 ////@end includes
34 
35 #include <wx/stattext.h>
36 #include <wx/msgdlg.h>
37 
39 #include <objmgr/seq_vector.hpp>
40 #include <objmgr/util/sequence.hpp>
48 
49 ////@begin XPM images
50 ////@end XPM images
51 
53 
55 
56 /*!
57  * CExtendCDSToStop type definition
58  */
59 
60 IMPLEMENT_DYNAMIC_CLASS( CExtendCDSToStop, CBulkCmdDlg )
61 
62 
63 /*!
64  * CExtendCDSToStop event table definition
65  */
66 
67 BEGIN_EVENT_TABLE( CExtendCDSToStop, CBulkCmdDlg )
68 
69 ////@begin CExtendCDSToStop event table entries
70 ////@end CExtendCDSToStop event table entries
71 
73 
74 
75 /*!
76  * CExtendCDSToStop constructors
77  */
78 
80 {
81  Init();
82 }
83 
84 CExtendCDSToStop::CExtendCDSToStop( wxWindow* parent, IWorkbench* wb, 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 /*!
93  * CExtendCDSToStop creator
94  */
95 
96 bool CExtendCDSToStop::Create( wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style )
97 {
98 ////@begin CExtendCDSToStop creation
99  SetExtraStyle(wxWS_EX_BLOCK_EVENTS);
100  CBulkCmdDlg::Create( parent, id, caption, pos, size, style );
101 
102  CreateControls();
103  if (GetSizer())
104  {
105  GetSizer()->SetSizeHints(this);
106  }
107  Centre();
108 ////@end CExtendCDSToStop creation
109  return true;
110 }
111 
112 
113 /*!
114  * CExtendCDSToStop destructor
115  */
116 
118 {
119 ////@begin CExtendCDSToStop destruction
120 ////@end CExtendCDSToStop destruction
121 }
122 
123 
124 /*!
125  * Member initialisation
126  */
127 
129 {
130 ////@begin CExtendCDSToStop member initialisation
131  m_OkCancel = NULL;
132 ////@end CExtendCDSToStop member initialisation
133  m_ErrorMessage = "";
136  m_ExtendmRNA = NULL;
137  m_ResetGenes = NULL;
139 }
140 
141 
142 /*!
143  * Control creation for CExtendCDSToStop
144  */
145 
147 {
148 ////@begin CExtendCDSToStop content construction
149  CExtendCDSToStop* itemCBulkCmdDlg1 = this;
150 
151  wxBoxSizer* itemBoxSizer2 = new wxBoxSizer(wxVERTICAL);
152  itemCBulkCmdDlg1->SetSizer(itemBoxSizer2);
153 
154 
155  m_ExtendProtFeats = new wxCheckBox( itemCBulkCmdDlg1, wxID_ANY, _("Extend Protein Features"), wxDefaultPosition, wxDefaultSize, 0 );
156  m_ExtendProtFeats->SetValue(true);
157  itemBoxSizer2->Add(m_ExtendProtFeats, 0, wxALIGN_LEFT|wxALL, 5);
158 
159  m_Retranslate = new wxCheckBox( itemCBulkCmdDlg1, wxID_ANY, _("Retranslate Coding Regions for Extended Proteins"), wxDefaultPosition, wxDefaultSize, 0 );
160  m_Retranslate->SetValue(true);
161  itemBoxSizer2->Add(m_Retranslate, 0, wxALIGN_LEFT|wxALL, 5);
162 
163  m_ExtendmRNA = new wxCheckBox( itemCBulkCmdDlg1, wxID_ANY, _("Extend Associated mRNA Features"), wxDefaultPosition, wxDefaultSize, 0 );
164  m_ExtendmRNA->SetValue(false);
165  itemBoxSizer2->Add(m_ExtendmRNA, 0, wxALIGN_LEFT|wxALL, 5);
166 
167  m_ResetGenes = new wxCheckBox( itemCBulkCmdDlg1, wxID_ANY, _("Reset Genes"), wxDefaultPosition, wxDefaultSize, 0 );
168  m_ResetGenes->SetValue(true);
169  itemBoxSizer2->Add(m_ResetGenes, 0, wxALIGN_LEFT|wxALL, 5);
170 
171 
172 
173  m_OkCancel = new COkCancelPanel( itemCBulkCmdDlg1, wxID_ANY, wxDefaultPosition, wxSize(100, 100), 0 );
174  itemBoxSizer2->Add(m_OkCancel, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
175 
176 ////@end CExtendCDSToStop content construction
177 }
178 
179 
180 /*!
181  * Should we show tooltips?
182  */
183 
185 {
186  return true;
187 }
188 
189 /*!
190  * Get bitmap resources
191  */
192 
193 wxBitmap CExtendCDSToStop::GetBitmapResource( const wxString& name )
194 {
195  // Bitmap retrieval
196 ////@begin CExtendCDSToStop bitmap retrieval
197  wxUnusedVar(name);
198  return wxNullBitmap;
199 ////@end CExtendCDSToStop bitmap retrieval
200 }
201 
202 /*!
203  * Get icon resources
204  */
205 
206 wxIcon CExtendCDSToStop::GetIconResource( const wxString& name )
207 {
208  // Icon retrieval
209 ////@begin CExtendCDSToStop icon retrieval
210  wxUnusedVar(name);
211  return wxNullIcon;
212 ////@end CExtendCDSToStop icon retrieval
213 }
214 
215 
216 
217 
219 {
220  return m_ErrorMessage;
221 }
222 
223 
225 {
227  if (!m_TopSeqEntry)
228  return cmd;
229  cmd.Reset(new CCmdComposite("Extend CDS To Stop Codon"));
230  CScope& scope = m_TopSeqEntry.GetScope();
231  bool modified = false;
232 
234  {
235  const CSeq_loc& loc = fi->GetLocation();
236  CBioseq_Handle bsh = scope.GetBioseqHandle(loc);
237  if (!bsh)
238  continue;
239  const CSeq_feat& cds = fi->GetOriginalFeature();
240  if (cds.IsSetExcept_text() && NStr::Find(cds.GetExcept_text(), "RNA editing") != string::npos)
241  {
242  continue;
243  }
244  CRef<CSeq_feat> new_feat(new CSeq_feat());
245  new_feat->Assign(cds);
246 
247  const CGenetic_code* code = NULL;
248  if (cds.IsSetData() && cds.GetData().IsCdregion() && cds.GetData().GetCdregion().IsSetCode()) {
249  code = &(cds.GetData().GetCdregion().GetCode());
250  }
251 
252  size_t stop = loc.GetStop(eExtreme_Biological);
253  // figure out if we have a partial codon at the end
254  size_t orig_len = sequence::GetLength(loc, &scope);
255  size_t len = orig_len;
256  if (cds.IsSetData() && cds.GetData().IsCdregion() && cds.GetData().GetCdregion().IsSetFrame()) {
257  CCdregion::EFrame frame = cds.GetData().GetCdregion().GetFrame();
258  if (frame == CCdregion::eFrame_two) {
259  len -= 1;
260  } else if (frame == CCdregion::eFrame_three) {
261  len -= 2;
262  }
263  }
264  size_t mod = len % 3;
265  CRef<CSeq_loc> vector_loc(new CSeq_loc());
266  vector_loc->SetInt().SetId().Assign(*(loc.GetId()));
267 
268  if (loc.IsSetStrand() && loc.GetStrand() == eNa_strand_minus) {
269  vector_loc->SetInt().SetFrom(0);
270  vector_loc->SetInt().SetTo(static_cast<CSeq_interval::TTo>(stop + mod - 1 + 3));
271  vector_loc->SetStrand(eNa_strand_minus);
272  } else {
273  vector_loc->SetInt().SetFrom(static_cast<CSeq_interval::TFrom>(stop - mod + 1 - 3));
274  vector_loc->SetInt().SetTo(bsh.GetInst_Length() - 1);
275  }
276 
277  CSeqVector seq(*vector_loc, scope, CBioseq_Handle::eCoding_Iupac);
278  // reserve our space
279  const size_t usable_size = seq.size();
280 
281  // get appropriate translation table
282  const CTrans_table & tbl =
285 
286  // main loop through bases
287  CSeqVector::const_iterator start = seq.begin();
288 
289  size_t i;
290  size_t k;
291  int state = 0;
292  size_t length = usable_size / 3;
293 
294  CRef<CSeq_loc> new_loc(NULL);
295 
296  for (i = 0; i < length; ++i)
297  {
298  // loop through one codon at a time
299  for (k = 0; k < 3; ++k, ++start)
300  {
301  state = tbl.NextCodonState(state, *start);
302  }
303 
304  if (tbl.GetCodonResidue (state) == '*')
305  {
306  if (i == 0)
307  break;
308  CSeq_loc_CI it(loc);
309  it.SetPos(it.GetSize() - 1);
310  CConstRef<CSeq_loc> this_loc = it.GetRangeAsSeq_loc();
311 
312  CRef<CSeq_loc> last_interval(new CSeq_loc());
313  size_t this_start = this_loc->GetStart(eExtreme_Positional);
314  size_t this_stop = this_loc->GetStop(eExtreme_Positional);
315  size_t extension = ((i + 1) * 3) - mod - 3;
316  last_interval->SetInt().SetId().Assign(*(this_loc->GetId()));
317  if (this_loc->IsSetStrand() && this_loc->GetStrand() == eNa_strand_minus)
318  {
319  last_interval->SetStrand(eNa_strand_minus);
320  last_interval->SetInt().SetFrom(static_cast<CSeq_interval::TFrom>(this_start - extension));
321  last_interval->SetInt().SetTo(static_cast<CSeq_interval::TTo>(this_stop));
322  }
323  else
324  {
325  last_interval->SetInt().SetFrom(static_cast<CSeq_interval::TFrom>(this_start));
326  last_interval->SetInt().SetTo(static_cast<CSeq_interval::TTo>(this_stop + extension));
327  }
328 
329  CRef<CSeq_loc> new_loc = sequence::Seq_loc_Add(loc, *last_interval, CSeq_loc::fMerge_All|CSeq_loc::fSort, &scope);
330  new_loc->SetPartialStop(false, eExtreme_Biological);
332  new_feat->SetLocation().Assign(*new_loc);
334  cmd->AddCommand(*CRef<CCmdChangeSeq_feat>(new CCmdChangeSeq_feat(fi->GetSeq_feat_Handle(), *new_feat)));
335  CRef<CCmdComposite> retranslate = RetranslateCDSCommand(scope, *new_feat);
336  if (retranslate)
337  cmd->AddCommand(*retranslate);
338  if (m_ResetGenes->GetValue())
339  ResetGenes(cmd, *fi, last_interval, scope);
340  if (m_ExtendmRNA->GetValue())
341  ExtendmRNA(cmd, *fi, last_interval, scope);
342  modified = true;
343  break;
344  }
345  }
346  }
347  if (!modified)
348  cmd.Reset();
349  return cmd;
350 }
351 
353 {
355 
356  // feature must be cds
357  if (!cds.IsSetData() && !cds.GetData().IsCdregion()) {
358  return empty;
359  }
360 
361  // Use Cdregion.Product to get handle to protein bioseq
362  CBioseq_Handle prot_bsh = scope.GetBioseqHandle(cds.GetProduct());
363 
364  if (!prot_bsh) {
365  return empty;
366  }
367  // Should be a protein!
368  if (!prot_bsh.IsProtein())
369  {
370  return empty;
371  }
372 
373  // Make a copy of existing CSeq_inst
374  CRef<objects::CSeq_inst> new_inst(new objects::CSeq_inst());
375  new_inst->Assign(prot_bsh.GetInst());
376 
377  // Make edits to the CSeq_inst copy
378  //CRef<CBioseq> new_protein_bioseq;
379  if (new_inst->IsSetSeq_data())
380  {
381  new_inst->ResetSeq_data();
382  }
383 
384  // Generate new protein sequence data and length
385  string prot;
386  CSeqTranslator::Translate(cds, scope, prot);
387  if (NStr::EndsWith(prot, "*"))
388  {
389  prot = prot.substr(0, prot.length() - 1);
390  }
391  new_inst->ResetExt();
392  new_inst->SetRepr(objects::CSeq_inst::eRepr_raw);
393  new_inst->SetSeq_data().SetNcbieaa().Set(prot);
394  new_inst->SetLength(TSeqPos(prot.length()));
395  new_inst->SetMol(CSeq_inst::eMol_aa);
396 
397 
398  CRef<CCmdComposite> cmd(new CCmdComposite("Retranslate CDS"));
399 
400  if (m_Retranslate->GetValue())
401  {
402  // Update protein sequence data and length
403  CRef<CCmdChangeBioseqInst> chgInst (new CCmdChangeBioseqInst(prot_bsh, *new_inst));
404  cmd->AddCommand(*chgInst);
405 
406  // change molinfo on bioseq
407  CRef<CCmdComposite> synch_molinfo = GetSynchronizeProductMolInfoCommand(scope, cds);
408  if (synch_molinfo)
409  {
410  cmd->AddCommand(*synch_molinfo);
411  }
412  }
413 
414  if (m_ExtendProtFeats->GetValue())
415  {
416  // If protein feature exists, update it
418  CFeat_CI prot_feat_ci(prot_bsh, sel);
419  for ( ; prot_feat_ci; ++prot_feat_ci ) {
420  CRef<CSeq_feat> new_feat(new CSeq_feat());
421  new_feat->Assign(prot_feat_ci->GetOriginalFeature());
422 
423  if ( new_feat->CanGetLocation() &&
424  new_feat->GetLocation().IsInt() &&
425  new_feat->GetLocation().GetInt().CanGetTo() )
426  {
427  new_feat->SetLocation().SetInt().SetTo(new_inst->GetLength() - 1);
428 
430 
431  CIRef<IEditCommand> chgFeat(new CCmdChangeSeq_feat(*prot_feat_ci,
432  *new_feat));
433  cmd->AddCommand(*chgFeat);
434  }
435  }
436  }
437 
438  return cmd;
439 }
440 
441 
442 void CExtendCDSToStop::ResetGenes(CRef<CCmdComposite> cmd, const objects::CMappedFeat& feat, CRef<CSeq_loc> add, CScope &scope)
443 {
444  objects::CSeq_feat_Handle gene = objects::feature::GetBestGeneForCds(feat).GetSeq_feat_Handle();
445  if (gene)
446  {
447  CRef<objects::CSeq_feat> new_gene(new CSeq_feat);
448  new_gene->Assign(*gene.GetOriginalSeq_feat());
449  const objects::CSeq_loc& gene_loc = gene.GetLocation();
450  CRef<CSeq_loc> new_loc = sequence::Seq_loc_Add(gene_loc, *add, CSeq_loc::fMerge_All|CSeq_loc::fSort, &scope);
452 
453  CRef<objects::CSeq_loc> new_gene_loc(new objects::CSeq_loc);
454  CRef<objects::CSeq_id> id(new objects::CSeq_id);
455  id->Assign(*gene_loc.GetId());
456  CRef<objects::CSeq_interval> new_int(new objects::CSeq_interval(*id, range.GetFrom(), range.GetTo(), gene_loc.GetStrand()));
457  new_gene_loc->SetInt(*new_int);
458  new_gene_loc->SetPartialStart(gene_loc.IsPartialStart(eExtreme_Biological), objects::eExtreme_Biological);
459  new_gene_loc->SetPartialStop(false, objects::eExtreme_Biological);
460  new_gene->SetLocation().Assign(*new_gene_loc);
461  new_gene->SetPartial(new_gene->GetLocation().IsPartialStart(eExtreme_Positional) || new_gene->GetLocation().IsPartialStop(eExtreme_Positional));
462  cmd->AddCommand(*CRef< CCmdChangeSeq_feat >(new CCmdChangeSeq_feat(gene,*new_gene)));
463  }
464 }
465 
466 void CExtendCDSToStop::ExtendmRNA(CRef<CCmdComposite> cmd, const objects::CMappedFeat& feat, CRef<CSeq_loc> add, CScope &scope)
467 {
468  objects::CSeq_feat_Handle mrna = objects::feature::GetBestMrnaForCds(feat).GetSeq_feat_Handle();
469  if (mrna)
470  {
471  CRef<objects::CSeq_feat> new_mrna(new CSeq_feat);
472  new_mrna->Assign(*mrna.GetOriginalSeq_feat());
473  const objects::CSeq_loc& mrna_loc = mrna.GetLocation();
474  CRef<CSeq_loc> new_loc = sequence::Seq_loc_Add(mrna_loc, *add, CSeq_loc::fMerge_All|CSeq_loc::fSort, &scope);
475  new_loc->SetPartialStart(mrna_loc.IsPartialStart(eExtreme_Biological), objects::eExtreme_Biological);
477  new_mrna->SetLocation().Assign(*new_loc);
478  new_mrna->SetPartial(new_mrna->GetLocation().IsPartialStart(eExtreme_Positional) || new_mrna->GetLocation().IsPartialStop(eExtreme_Positional));
479  cmd->AddCommand(*CRef< CCmdChangeSeq_feat >(new CCmdChangeSeq_feat(mrna,*new_mrna)));
480  }
481 }
482 
484 
@ eExtreme_Positional
numerical value
Definition: Na_strand.hpp:63
@ eExtreme_Biological
5' and 3'
Definition: Na_strand.hpp:62
CLocalRange< TOffset > TRange
define for the fundamental building block of sequence ranges
Definition: base.hpp:115
bool AdjustProteinFeaturePartialsToMatchCDS(CSeq_feat &new_prot, const CSeq_feat &cds)
AdjustProteinFeaturePartialsToMatchCDS A function to change an existing MolInfo to match a coding reg...
Definition: cds_fix.cpp:398
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)
bool GetTopLevelSeqEntryAndProcessor()
wxIcon GetIconResource(const wxString &name)
Retrieves icon resources.
CExtendCDSToStop()
Constructors.
virtual CRef< CCmdComposite > GetCommand()
wxBitmap GetBitmapResource(const wxString &name)
Retrieves bitmap resources.
~CExtendCDSToStop()
Destructor.
COkCancelPanel * m_OkCancel
virtual string GetErrorMessage()
void CreateControls()
Creates the controls and sizers.
CRef< CCmdComposite > RetranslateCDSCommand(CScope &scope, CSeq_feat &cds)
void ResetGenes(CRef< CCmdComposite > cmd, const objects::CMappedFeat &feat, CRef< CSeq_loc > add, CScope &scope)
static bool ShowToolTips()
Should we show tooltips?
wxCheckBox * m_ExtendProtFeats
void ExtendmRNA(CRef< CCmdComposite > cmd, const objects::CMappedFeat &feat, CRef< CSeq_loc > add, CScope &scope)
wxCheckBox * m_Retranslate
bool Create(wxWindow *parent, wxWindowID id=10268, const wxString &caption=_("Extend Proteins to Stop Codons"), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(900, 500), long style=wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU|wxCLOSE_BOX|wxTAB_TRAVERSAL)
Creation.
void Init()
Initialises member variables.
CFeat_CI –.
Definition: feat_ci.hpp:64
static const CTrans_table & GetTransTable(int id)
CScope –.
Definition: scope.hpp:92
CSeqVector –.
Definition: seq_vector.hpp:65
namespace ncbi::objects::
Definition: Seq_feat.hpp:58
Seq-loc iterator class – iterates all intervals from a seq-loc in the correct order.
Definition: Seq_loc.hpp:453
char GetCodonResidue(int state) const
static int NextCodonState(int state, unsigned char ch)
IWorkbench is the central interface in the application framework.
Definition: workbench.hpp:113
#define _(proto)
Definition: ct_nlmzip_i.h:78
USING_SCOPE(ncbi::objects)
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 NULL
Definition: ncbistd.hpp:225
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
TRange GetTotalRange(void) const
Definition: Seq_loc.hpp:913
TSeqPos GetStart(ESeqLocExtremes ext) const
Return start and stop positions of the seq-loc.
Definition: Seq_loc.cpp:915
CConstRef< CSeq_loc > GetRangeAsSeq_loc(void) const
Get seq-loc for the current iterator position.
Definition: Seq_loc.cpp:2585
void SetInt(TInt &v)
Definition: Seq_loc.hpp:983
bool IsSetStrand(EIsSetStrand flag=eIsSetStrand_Any) const
Check if strand is set for any/all part(s) of the seq-loc depending on the flag.
Definition: Seq_loc.cpp:858
void SetPos(size_t pos)
Set iterator's position.
Definition: Seq_loc.cpp:2642
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
size_t GetSize(void) const
Get number of ranges.
Definition: Seq_loc.cpp:2636
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
CMappedFeat GetBestMrnaForCds(const CMappedFeat &cds_feat, CFeatTree *feat_tree=0, const SAnnotSelector *base_sel=0)
Definition: feature.cpp:3341
CMappedFeat GetBestGeneForCds(const CMappedFeat &cds_feat, CFeatTree *feat_tree=0, const SAnnotSelector *base_sel=0, CFeatTree::EBestGeneType lookup_type=CFeatTree::eBestGene_TreeOnly)
Definition: feature.cpp:3321
TSeqPos GetLength(const CSeq_id &id, CScope *scope)
Get sequence length if scope not null, else return max possible TSeqPos.
CRef< CSeq_loc > Seq_loc_Add(const CSeq_loc &loc1, const CSeq_loc &loc2, CSeq_loc::TOpFlags flags, CScope *scope)
Add two seq-locs.
static void Translate(const string &seq, string &prot, const CGenetic_code *code, bool include_stop=true, bool remove_trailing_X=false, bool *alt_start=NULL, bool is_5prime_complete=true, bool is_3prime_complete=true)
Translate a string using a specified genetic code.
Definition: sequence.cpp:4095
CBioseq_Handle GetBioseqHandle(const CSeq_id &id)
Get bioseq handle by seq-id.
Definition: scope.cpp:95
bool IsProtein(void) const
TInst_Length GetInst_Length(void) const
const TInst & GetInst(void) const
@ eCoding_Iupac
Set coding to printable coding (Iupacna or Iupacaa)
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
TSeqPos size(void) const
Definition: seq_vector.hpp:291
const_iterator begin(void) const
Definition: seq_vector.hpp:298
#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 EndsWith(const CTempString str, const CTempString end, ECase use_case=eCase)
Check if a string ends with a specified suffix value.
Definition: ncbistr.hpp:5430
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
bool IsSetData(void) const
the specific data Check if a value has been assigned to Data data member.
Definition: Seq_feat_.hpp:913
bool IsSetCode(void) const
genetic code used Check if a value has been assigned to Code data member.
Definition: Cdregion_.hpp:700
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
TFrame GetFrame(void) const
Get the Frame member data.
Definition: Cdregion_.hpp:534
const TData & GetData(void) const
Get the Data member data.
Definition: Seq_feat_.hpp:925
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
const TCode & GetCode(void) const
Get the Code member data.
Definition: Cdregion_.hpp:712
bool CanGetLocation(void) const
Check if it is safe to call GetLocation method.
Definition: Seq_feat_.hpp:1111
const TCdregion & GetCdregion(void) const
Get the variant data.
const TProduct & GetProduct(void) const
Get the Product member data.
Definition: Seq_feat_.hpp:1096
bool IsSetFrame(void) const
Check if a value has been assigned to Frame data member.
Definition: Cdregion_.hpp:509
@ eFrame_three
reading frame
Definition: Cdregion_.hpp:98
bool CanGetTo(void) const
Check if it is safe to call GetTo method.
bool IsInt(void) const
Check if variant Int is selected.
Definition: Seq_loc_.hpp:528
const TInt & GetInt(void) const
Get the variant data.
Definition: Seq_loc_.cpp:194
@ eNa_strand_minus
Definition: Na_strand_.hpp:67
END_EVENT_TABLE()
int i
int len
range(_Ty, _Ty) -> range< _Ty >
constexpr bool empty(list< Ts... >) noexcept
const struct ncbi::grid::netcache::search::fields::SIZE size
Int mod(Int i, Int j)
Definition: njn_integer.hpp:67
#define fi
static static static wxID_ANY
SAnnotSelector –.
Definition: inftrees.h:24
CRef< CCmdComposite > GetSynchronizeProductMolInfoCommand(objects::CScope &scope, const objects::CSeq_feat &cds)
Modified on Sat May 25 14:15:43 2024 by modify_doxy.py rev. 669887