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

Go to the SVN repository for this file.

1 /* $Id: far_pointer_seq.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 #include <ncbi_pch.hpp>
30 
31 // For compilers that support precompilation, includes "wx/wx.h".
32 #include "wx/wxprec.h"
33 
34 #ifdef __BORLANDC__
35 #pragma hdrstop
36 #endif
37 
38 #ifndef WX_PRECOMP
39 #include "wx/wx.h"
40 #endif
41 
42 ////@begin includes
43 ////@end includes
45 #include <objmgr/scope.hpp>
46 #include <objmgr/bioseq_handle.hpp>
47 #include <objmgr/align_ci.hpp>
48 #include <objmgr/bioseq_ci.hpp>
49 #include <objmgr/seq_vector.hpp>
50 #include <objmgr/util/sequence.hpp>
54 
59 
62 
63 ////@begin XPM images
64 ////@end XPM images
65 
68 
69 /*
70  * CFarPointerSeq type definition
71  */
72 
73 IMPLEMENT_DYNAMIC_CLASS( CFarPointerSeq, wxDialog )
74 
75 
76 /*
77  * CFarPointerSeq event table definition
78  */
79 
80 BEGIN_EVENT_TABLE( CFarPointerSeq, wxDialog )
81 
82 ////@begin CFarPointerSeq event table entries
85 ////@end CFarPointerSeq event table entries
86 
88 
89 
90 /*
91  * CFarPointerSeq constructors
92  */
93 
95 {
96  Init();
97 }
98 
99 CFarPointerSeq::CFarPointerSeq( wxWindow* parent, CSeq_entry_Handle seh, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style )
100  : m_TopSeqEntry(seh)
101 {
102  Init();
103  Create(parent, id, caption, pos, size, style);
104 }
105 
106 
107 /*
108  * CFarPointerSeq creator
109  */
110 
111 bool CFarPointerSeq::Create( wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style )
112 {
113 ////@begin CFarPointerSeq creation
114  SetExtraStyle(wxWS_EX_BLOCK_EVENTS);
115  wxDialog::Create( parent, id, caption, pos, size, style );
116 
117  CreateControls();
118  if (GetSizer())
119  {
120  GetSizer()->SetSizeHints(this);
121  }
122  Centre();
123 ////@end CFarPointerSeq creation
124  return true;
125 }
126 
127 
128 /*
129  * CFarPointerSeq destructor
130  */
131 
133 {
134 ////@begin CFarPointerSeq destruction
135 ////@end CFarPointerSeq destruction
136 }
137 
138 
139 /*
140  * Member initialisation
141  */
142 
144 {
145 ////@begin CFarPointerSeq member initialisation
147 ////@end CFarPointerSeq member initialisation
148 }
149 
150 
151 /*
152  * Control creation for CFarPointerSeq
153  */
154 
156 {
157 ////@begin CFarPointerSeq content construction
158  // Generated by DialogBlocks, 07/01/2016 08:41:24 (unregistered)
159 
160  CFarPointerSeq* itemDialog1 = this;
161 
162  wxBoxSizer* itemBoxSizer2 = new wxBoxSizer(wxVERTICAL);
163  itemDialog1->SetSizer(itemBoxSizer2);
164 
165  string label_max;
166  vector<string> msgs;
167  vector<bool> checked;
168  wxArrayString choices;
169  for (CAlign_CI align_it(m_TopSeqEntry); align_it; ++align_it)
170  {
171  CSeq_align::TDim num_rows = align_it->CheckNumRows();
172  for (auto row = 0; row < num_rows; row++)
173  {
174  const CSeq_id& id = align_it->GetSeq_id(row);
175  string label;
176  id.GetLabel(&label, CSeq_id::eContent);
177  bool check(false);
178  bool disable(false);
179  string msg = GetMessageForId(id, label, check, disable);
180  if (!disable && !msg.empty())
181  m_errors[label] = msg;
182  checked.push_back(check);
183  m_disabled.push_back(disable);
184  m_labels.push_back(label);
185  msgs.push_back(msg);
186  if (label.size() > label_max.size())
187  label_max = label;
188  }
189  }
190 
191  wxGraphicsContext *gc = wxGraphicsContext::Create();
192  gc->SetFont(GetFont(), *wxBLACK);
193  for (size_t i = 0; i < m_labels.size(); i++)
194  {
195  string label = m_labels[i];
196  AddSpaces(label, label_max, gc);
197  choices.Add(wxString(label + msgs[i]));
198  }
199  delete gc;
200 
201  if (choices.IsEmpty())
202  NCBI_THROW( CException, eUnknown, "No alignment found" );
203 
204  m_CheckListBox = new wxCheckListBox( itemDialog1, ID_FARPOINTERSEQ_CHECKLISTBOX, wxDefaultPosition, wxDefaultSize, choices, wxLB_HSCROLL );
205  itemBoxSizer2->Add(m_CheckListBox, 1, wxGROW|wxALL, 5);
206  for (size_t i = 0; i < checked.size(); i++)
207  if (checked[i])
208  m_CheckListBox->Check(static_cast<unsigned>(i), true);
209 
210  wxBoxSizer* itemBoxSizer10 = new wxBoxSizer(wxHORIZONTAL);
211  itemBoxSizer2->Add(itemBoxSizer10, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
212 
213  wxButton* itemButton11 = new wxButton( itemDialog1, wxID_OK, _("Replace Selected Sequences"), wxDefaultPosition, wxDefaultSize, 0 );
214  itemBoxSizer10->Add(itemButton11, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
215 
216  wxButton* itemButton12 = new wxButton( itemDialog1, wxID_CANCEL, _("Cancel"), wxDefaultPosition, wxDefaultSize, 0 );
217  itemBoxSizer10->Add(itemButton12, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
218 
219  wxButton* itemButton13 = new wxButton( itemDialog1, ID_FARPOINTERSEQ_EXPORT, _("Export FarPointer Error Messages"), wxDefaultPosition, wxDefaultSize, 0 );
220  itemBoxSizer10->Add(itemButton13, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
221 
222 ////@end CFarPointerSeq content construction
223 }
224 
225 void CFarPointerSeq::AddSpaces(string &str, const string& label_max, wxGraphicsContext *gc)
226 {
227  wxDouble width;
228  wxDouble height;
229  wxDouble descent;
230  wxDouble externalLeading;
231  gc->GetTextExtent(wxString(str), &width, &height, &descent, &externalLeading);
232  wxDouble space_width;
233  gc->GetTextExtent(_(" "), &space_width, &height, &descent, &externalLeading);
234  wxDouble max_width;
235  gc->GetTextExtent(wxString(label_max), &max_width, &height, &descent, &externalLeading);
236  if (max_width >= width)
237  {
238  int add_spaces = int((max_width - width) / space_width) + 1;
239  str += string(add_spaces, ' ');
240  }
241 }
242 
243 void CFarPointerSeq::OnCheck(wxCommandEvent& event)
244 {
245  Freeze();
246  int i = event.GetInt();
247  if (m_disabled[i])
248  m_CheckListBox->Check(i, false);
249  else
250  event.Skip();
251  m_CheckListBox->EnsureVisible(i);
252  Thaw();
253 }
254 
255 void CFarPointerSeq::OnExport(wxCommandEvent& event)
256 {
257  string msg;
259  {
260  msg += i->first + "\t" + i->second + "\n";
261  }
262  if (msg.empty())
263  return;
264  CGenericReportDlgModal* report = new CGenericReportDlgModal(GetParent());
265  report->SetTitle(wxT("FarPointer Errors"));
266  report->SetText(wxString(msg));
267  report->ShowModal();
268 }
269 
271 {
272  CRef<CCmdComposite> cmd(new CCmdComposite("Far Pointer Sequence"));
273  CScope& scope = m_TopSeqEntry.GetScope();
274  wxArrayInt checked;
275  m_CheckListBox->GetCheckedItems(checked);
276 
277  for (CAlign_CI align_it(m_TopSeqEntry); align_it; ++align_it)
278  {
279  if (!align_it->IsSetSegs() || !align_it->GetSegs().IsDenseg() ||
280  !align_it->GetSegs().GetDenseg().IsSetIds())
281  continue;
282 
283  CRef<CSeq_align> new_align(new CSeq_align());
284  new_align->Assign(align_it.GetOriginalSeq_align());
285  CSeq_align::TDim num_rows = align_it->CheckNumRows();
286  bool modified(false);
287 
288  for (size_t j = 0; j < checked.GetCount(); j++)
289  {
290  int i = checked.Item(j);
291  string label = m_labels[i];
294  int offset = m_offset[bsh1];
295  bool flip_strand = m_flip_strand[bsh1];
296 
297  for (auto row = 0; row < num_rows; row++)
298  {
299  const CSeq_id& id = align_it->GetSeq_id(row);
300  CBioseq_Handle bsh = scope.GetBioseqHandle(id);
301 
302  if (bsh1 == bsh)
303  {
304  if (flip_strand)
305  {
306  ReverseRow(new_align->SetSegs().SetDenseg(), offset, row, num_rows);
307  }
308  else
309  {
310  new_align->OffsetRow(row, offset);
311  }
312  CRef<CSeq_id> new_id(new CSeq_id);
314  new_id->Assign(*best_idh.GetSeqId());
315  new_align->SetSegs().SetDenseg().SetIds()[row]->Assign(*new_id);
316  modified = true;
317  }
318  }
319  }
320 
321  if (modified)
322  {
323  new_align->SetSegs().SetDenseg().RemovePureGapSegs();
324  //new_align->SetSegs().SetDenseg().TrimEndGaps();
325  new_align->SetSegs().SetDenseg().Compact();
326  CIRef<IEditCommand> chgAlign( new CCmdChangeAlign( align_it.GetSeq_align_Handle(), *new_align ));
327  cmd->AddCommand(*chgAlign);
328  }
329  }
330 
331  for (size_t j = 0; j < checked.GetCount(); j++)
332  {
333  int i = checked.Item(j);
334  string label = m_labels[i];
336 
338  if (bssh && bssh.IsSetClass() && bssh.GetClass() == CBioseq_set::eClass_nuc_prot)
339  cmd->AddCommand(*CRef<CCmdDelBioseqSet>(new CCmdDelBioseqSet(bssh)));
340  else
341  cmd->AddCommand(*CRef<CCmdDelBioseq>(new CCmdDelBioseq(bsh1)));
342  }
343 
344  return cmd;
345 }
346 
347 void CFarPointerSeq::ReverseRow(CDense_seg &dense_seg, int offset, size_t row, CSeq_align::TDim num_rows)
348 {
349  //flip strands
350  if (!dense_seg.IsSetStrands())
351  {
352  dense_seg.SetStrands().resize(dense_seg.GetStarts().size(), eNa_strand_plus);
353  }
354 
355  for (size_t i = row; i < dense_seg.GetStrands().size(); i += num_rows)
356  {
357  switch (dense_seg.GetStrands()[i])
358  {
359  case eNa_strand_plus: dense_seg.SetStrands()[i] = eNa_strand_minus; break;
360  case eNa_strand_minus: dense_seg.SetStrands()[i] = eNa_strand_plus; break;
361  default: break;//do nothing if not + or -
362  }
363  }
364 
365  //reverse list o' starts
366  size_t j;
367  for (size_t i = row, j = 0; i < dense_seg.GetStarts().size() && j < dense_seg.GetLens().size(); i += num_rows, j++)
368  {
369  if (dense_seg.GetStarts()[i] >= 0)
370  {
371  dense_seg.SetStarts()[i] = offset - dense_seg.SetStarts()[i] - dense_seg.GetLens()[j] + 1;
372  }
373  }
374 }
375 
376 /*
377  * Should we show tooltips?
378  */
379 
381 {
382  return true;
383 }
384 
385 /*
386  * Get bitmap resources
387  */
388 
389 wxBitmap CFarPointerSeq::GetBitmapResource( const wxString& name )
390 {
391  // Bitmap retrieval
392 ////@begin CFarPointerSeq bitmap retrieval
393  wxUnusedVar(name);
394  return wxNullBitmap;
395 ////@end CFarPointerSeq bitmap retrieval
396 }
397 
398 /*
399  * Get icon resources
400  */
401 
402 wxIcon CFarPointerSeq::GetIconResource( const wxString& name )
403 {
404  // Icon retrieval
405 ////@begin CFarPointerSeq icon retrieval
406  wxUnusedVar(name);
407  return wxNullIcon;
408 ////@end CFarPointerSeq icon retrieval
409 }
410 
411 string CFarPointerSeq::GetMessageForId(const CSeq_id &id, string label, bool &check, bool &disable)
412 {
413  if (!NStr::StartsWith(label, "acc"))
414  {
415  disable = true;
416  return "Not a far pointer";
417  }
418  string orig_label(label);
419  CScope& scope = m_TopSeqEntry.GetScope();
420  CBioseq_Handle bsh1 = scope.GetBioseqHandle(id);
423  CBioseq_Handle bsh2;
424  try
425  {
426  bsh2 = scope.GetBioseqHandle(acc_id);
427  }
428  catch(CException &e) {} catch (exception &e) {}
429 
430 
431  if (!bsh1 || !bsh2)
432  {
433  disable = true;
434  return kEmptyStr;
435  }
436 
437  m_label_to_bsh1[orig_label] = bsh1;
438  m_label_to_bsh2[orig_label] = bsh2;
439 
441  try
442  {
443  align = RunBlast(bsh2, bsh1);
444  }
445  catch(CException &e) {} catch (exception &e) {}
446 
447 
448  return ValidateAlignment(align, bsh1, bsh2, check);
449 }
450 
452 {
453  CRef<CSeq_loc> query_seqloc = qh.GetRangeSeq_loc(0,0);
454  CRef<CSeq_loc> subject_seqloc = sh.GetRangeSeq_loc(0,0);
455  if (query_seqloc.IsNull() || subject_seqloc.IsNull())
456  {
458  }
459 
460  CScope &scope = sh.GetScope();
461  blast::SSeqLoc query_sl(*query_seqloc, scope);
462  blast::SSeqLoc subject_sl(*subject_seqloc, scope);
463  blast::CBl2Seq bl2seq(query_sl, subject_sl, blast::eMegablast);
464  blast::CBlastNucleotideOptionsHandle& opts = dynamic_cast<blast::CBlastNucleotideOptionsHandle&>(bl2seq.SetOptionsHandle());
465  opts.SetTraditionalMegablastDefaults();
466 // opts.SetFilterString("m L;R");
467  opts.SetMaskAtHash(true);
468  opts.SetDustFiltering(true);
469  //opts.SetRepeatFiltering(true);
470  opts.SetMismatchPenalty(-3); // to correspond to sequin default options, c++ defaults to -2.
471  //opts.GetOptions().DebugDumpText(cout, "BLAST Options", 0);
472 
473  vector< CRef<objects::CSeq_align_set> > res = bl2seq.Run();
474  CRef<CSeq_align_set> align = res.front();
475 
476  if (align && align->IsSet() && !align->Get().empty())
477  return (align->Get().front());
479 }
480 
481 
483 {
484  if (!align)
485  return("No alignment found!");
486 
487  string errors;
488 
489  TSeqPos length = bsh1.GetBioseqLength();
490 
491  int num_rows = align->CheckNumRows();
492  if (num_rows != 2)
493  return errors;
494 
495  int start1 = 0;
496  int stop1 = 0;
497  int start2 = 0;
498  int stop2 = 0;
499  int row1 = 0;
500  int row2 = 1;
501  bool flip_strand = (align->GetSeqStrand(0) != align->GetSeqStrand(1));
502  m_flip_strand[bsh1] = flip_strand;
503 
504  if (align->GetSeq_id(0).Match(*bsh1.GetSeqId()))
505  {
506  start1 = align->GetSeqStart(0);
507  stop1 = align->GetSeqStop(0);
508  start2 = align->GetSeqStart(1);
509  stop2 = align->GetSeqStop(1);
510  }
511  else if (align->GetSeq_id(1).Match(*bsh1.GetSeqId()))
512  {
513  start1 = align->GetSeqStart(1);
514  stop1 = align->GetSeqStop(1);
515  start2 = align->GetSeqStart(0);
516  stop2 = align->GetSeqStop(0);
517  swap(row1, row2);
518  }
519  else
520  return errors;
521 
522  if (!flip_strand)
523  m_offset[bsh1] = start2 - start1;
524  else
525  m_offset[bsh1] = stop2 + start1;
526 
527  int assem_len = 0;
528  if (stop1 > start1)
529  assem_len = stop1 - start1 + 1;
530  else
531  assem_len = start1 - stop1 + 1;
532 
533  string seq1;
534  const objects::CSeqVector seqvec( bsh1, objects::CBioseq_Handle::eCoding_Iupac, objects::eNa_strand_plus);
535  seqvec.GetSeqData(0, bsh1.GetBioseqLength(), seq1);
536  size_t beg = 0;
537  for (size_t i = 0; i < seq1.size(); i++)
538  {
539  if (seq1[i] == 'N')
540  beg++;
541  else
542  break;
543  }
544  size_t end = 0;
545  for (int i = length - 1; i >= 0; i--)
546  {
547  if (seq1[i] == 'N')
548  end++;
549  else
550  break;
551  }
552  size_t nctr = 0;
553  for (size_t i = 0; i < seq1.size(); i++)
554  {
555  if (seq1[i] == 'N')
556  nctr++;
557  }
558  nctr -= beg + end;
559 
560 
561  if (!align->IsSetSegs() || !align->GetSegs().IsDenseg() ||
562  !align->GetSegs().GetDenseg().IsSetStarts() || !align->GetSegs().GetDenseg().IsSetLens())
563  return errors;
564 
565  string seq2;
566  const objects::CSeqVector seqvec2( bsh2, objects::CBioseq_Handle::eCoding_Iupac, objects::eNa_strand_plus);
567  seqvec2.GetSeqData(0, bsh2.GetBioseqLength(), seq2);
568 
569  vector< TSignedSeqPos > starts(align->GetSegs().GetDenseg().GetStarts());
570  vector< TSeqPos > lens(align->GetSegs().GetDenseg().GetLens());
571  size_t num_segs = lens.size();
572  int gaps = 0;
573  int mismatches = 0;
574  int n = 0;
575  int matches = 0;
576  string tmp(seq1);
577  for (size_t seg = 0; seg < num_segs; ++seg)
578  {
579  TSignedSeqPos seg_start1 = starts[num_rows*seg+row1];
580  TSignedSeqPos seg_start2 = starts[num_rows*seg+row2];
581  TSeqPos len = lens[seg];
582 
583  if (seg_start1 < 0 || seg_start2 < 0)
584  {
585  gaps += len;
586  continue;
587  }
588  for (size_t i = 0; i < len; i++)
589  {
590  char a = seq1[i + seg_start1];
591  char b = seq2[i + seg_start2];
592  if (a != b)
593  {
594  if (a != 'N' && b != 'N')
595  mismatches++;
596  else
597  n++;
598  }
599  else
600  {
601  matches++;
602  }
603  tmp[i + seg_start1] = '+';
604  }
605  }
606  int uncovered_n = 0;
607  int uncovered_non_n = 0;
608  for (size_t i = 0; i < tmp.size(); i++)
609  {
610  if (tmp[i] == '+')
611  continue;
612  if (tmp[i] == 'N')
613  uncovered_n++;
614  else
615  uncovered_non_n++;
616  }
617 
618  if (gaps>0 || mismatches>0 || n > 0)
619  {
620  if (beg > 0 || end > 0)
621  {
622  errors += "The local sequence has " + NStr::ULongToString(beg + end) + " terminal N" + (beg+end > 1 ? "s. " : ". ");
623  }
624  if (nctr > 0)
625  {
626  errors += "The local sequence has " + NStr::ULongToString(nctr) + " internal N" + (nctr > 1 ? "s. " : ". ");
627  }
628  }
629 
630 
631  if (!errors.empty() && assem_len == length && gaps == 0 && mismatches == 0)
632  {
633  errors += "There are no other differences between the local and database sequences.";
634  return errors;
635  }
636 
637  if (assem_len < length)
638  {
639  errors += "The alignment to the database sequence does not cover all of the local sequence. ";
640 
641  if (uncovered_n != 0 && uncovered_non_n == 0)
642  {
643  errors += "The unaligned sequence consists only of Ns. ";
644  }
645  if (uncovered_non_n != 0)
646  {
647  errors += "There are non-N residues in the unaligned sequence. ";
648  }
649  }
650 
651  if (gaps > 0 || mismatches > 0 || n > 0)
652  {
653  errors += "The alignment to the database sequence has " + NStr::ULongToString(gaps) + " gap" + (gaps != 1 ? "s, " : ", ")
654  + NStr::ULongToString(mismatches) + " mismatch" + (mismatches != 1 ? "es, " : ", ")
655  + "and " + NStr::ULongToString(n) + " N-mismatch" + (mismatches != 1 ? "es. " : ". ");
656  }
657 
658  if (errors.empty())
659  {
660  check = true;
661  }
662  return errors;
663 }
664 
Declares the CBl2Seq (BLAST 2 Sequences) class.
Declares the CBlastNucleotideOptionsHandle class.
Definitions of special type used in BLAST.
@ eMegablast
Nucl-Nucl (traditional megablast)
Definition: blast_types.hpp:65
CAlign_CI –.
Definition: align_ci.hpp:63
CBioseq_Handle –.
CBioseq_set_Handle –.
wxIcon GetIconResource(const wxString &name)
Retrieves icon resources.
void AddSpaces(string &str, const string &label_max, wxGraphicsContext *gc)
map< CBioseq_Handle, int > m_offset
map< string, CBioseq_Handle > m_label_to_bsh1
void ReverseRow(CDense_seg &dense_seg, int offset, size_t row, CSeq_align::TDim num_rows)
string ValidateAlignment(CRef< objects::CSeq_align > align, CBioseq_Handle bsh1, CBioseq_Handle bsh2, bool &check)
string GetMessageForId(const CSeq_id &id, string label, bool &check, bool &disable)
bool Create(wxWindow *parent, wxWindowID id=wxID_ANY, const wxString &caption=_("Far Pointer Sequences"), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(400, 300), long style=wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU|wxCLOSE_BOX|wxTAB_TRAVERSAL)
Creation.
CRef< objects::CSeq_align > RunBlast(const CBioseq_Handle &sh, const CBioseq_Handle &qh)
vector< string > m_labels
map< CBioseq_Handle, bool > m_flip_strand
void OnCheck(wxCommandEvent &event)
CFarPointerSeq()
Constructors.
void OnExport(wxCommandEvent &event)
~CFarPointerSeq()
Destructor.
map< string, string > m_errors
map< string, CBioseq_Handle > m_label_to_bsh2
CRef< CCmdComposite > GetCommand()
static bool ShowToolTips()
Should we show tooltips?
wxBitmap GetBitmapResource(const wxString &name)
Retrieves bitmap resources.
void CreateControls()
Creates the controls and sizers.
void Init()
Initialises member variables.
CSeq_entry_Handle m_TopSeqEntry
wxCheckListBox * m_CheckListBox
vector< bool > m_disabled
void SetText(const wxString &text)
CScope –.
Definition: scope.hpp:92
void OffsetRow(TDim row, TSignedSeqPos offset)
Offset row's coords.
Definition: Seq_align.cpp:1332
CSeq_entry_Handle –.
const_iterator begin() const
Definition: map.hpp:151
const_iterator end() const
Definition: map.hpp:152
Definition: map.hpp:338
#define _(proto)
Definition: ct_nlmzip_i.h:78
USING_SCOPE(objects)
#define ID_FARPOINTERSEQ_EXPORT
#define ID_FARPOINTERSEQ_CHECKLISTBOX
static CS_COMMAND * cmd
Definition: ct_dynamic.c:26
static void Init(void)
Definition: cursor6.c:76
#define check(s)
Definition: describecol2.c:21
static const char * str(char *buf, int n)
Definition: stats.c:84
static char tmp[3200]
Definition: utf8.c:42
int offset
Definition: replacements.h:160
unsigned int TSeqPos
Type for sequence locations and lengths.
Definition: ncbimisc.hpp:875
int TSignedSeqPos
Type for signed sequence position.
Definition: ncbimisc.hpp:887
void swap(NCBI_NS_NCBI::pair_base_member< T1, T2 > &pair1, NCBI_NS_NCBI::pair_base_member< T1, T2 > &pair2)
Definition: ncbimisc.hpp:1508
string
Definition: cgiapp.hpp:687
#define NULL
Definition: ncbistd.hpp:225
#define NCBI_THROW(exception_class, err_code, message)
Generic macro to throw an exception, given the exception class, error code and message string.
Definition: ncbiexpt.hpp:704
virtual void Assign(const CSerialObject &source, ESerialRecursionMode how=eRecursive)
Set object to copy of another one.
virtual void Assign(const CSerialObject &source, ESerialRecursionMode how=eRecursive)
Optimized implementation of CSerialObject::Assign, which is not so efficient.
Definition: Seq_id.cpp:318
CConstRef< CSeq_id > GetSeqId(void) const
@ fParse_Default
By default in ParseIDs and IsValid, allow raw parsable non-numeric accessions and plausible local acc...
Definition: Seq_id.hpp:102
@ eContent
Untagged human-readable accession or the like.
Definition: Seq_id.hpp:605
const CSeq_id & GetId(const CSeq_loc &loc, CScope *scope)
If all CSeq_ids embedded in CSeq_loc refer to the same CBioseq, returns the first CSeq_id found,...
@ eGetId_Best
return the "best" gi (uses FindBestScore(), with CSeq_id::CalculateScore() as the score function
Definition: sequence.hpp:101
CBioseq_Handle GetBioseqHandle(const CSeq_id &id)
Get bioseq handle by seq-id.
Definition: scope.cpp:95
TClass GetClass(void) const
CBioseq_set_Handle GetParentBioseq_set(void) const
Return a handle for the parent Bioseq-set, or null handle.
TSeqPos GetBioseqLength(void) const
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 IsSetClass(void) const
CScope & GetScope(void) const
Get scope this handle belongs to.
CScope & GetScope(void) const
Get scope this handle belongs to.
CRef< CSeq_loc > GetRangeSeq_loc(TSeqPos start, TSeqPos stop, ENa_strand strand=eNa_strand_unknown) const
Return CSeq_loc referencing the given range and strand on the bioseq If start == 0,...
bool IsNull(void) const THROWS_NONE
Check if pointer is null – same effect as Empty().
Definition: ncbiobj.hpp:735
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
#define kEmptyStr
Definition: ncbistr.hpp:123
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
static string ULongToString(unsigned long value, TNumToStringFlags flags=0, int base=10)
Convert unsigned long to string.
Definition: ncbistr.hpp:5150
static void TrimPrefixInPlace(string &str, const CTempString prefix, ECase use_case=eCase)
Trim prefix from a string (in-place)
Definition: ncbistr.cpp:3242
static const char label[]
bool IsSetStrands(void) const
Check if a value has been assigned to Strands data member.
Definition: Dense_seg_.hpp:568
const TStarts & GetStarts(void) const
Get the Starts member data.
Definition: Dense_seg_.hpp:530
void SetSegs(TSegs &value)
Assign a value to Segs data member.
Definition: Seq_align_.cpp:310
const TLens & GetLens(void) const
Get the Lens member data.
Definition: Dense_seg_.hpp:555
TStarts & SetStarts(void)
Assign a value to Starts data member.
Definition: Dense_seg_.hpp:536
TStrands & SetStrands(void)
Assign a value to Strands data member.
Definition: Dense_seg_.hpp:586
bool IsSet(void) const
Check if a value has been assigned to data member.
const TStrands & GetStrands(void) const
Get the Strands member data.
Definition: Dense_seg_.hpp:580
const Tdata & Get(void) const
Get the member data.
@ eNa_strand_plus
Definition: Na_strand_.hpp:66
@ eNa_strand_minus
Definition: Na_strand_.hpp:67
@ eClass_nuc_prot
nuc acid and coded proteins
Definition: Bioseq_set_.hpp:99
unsigned int
A callback function used to compare two keys in a database.
Definition: types.hpp:1210
END_EVENT_TABLE()
int i
yy_size_t n
int len
#define wxT(x)
Definition: muParser.cpp:41
const struct ncbi::grid::netcache::search::fields::SIZE size
unsigned int a
Definition: ncbi_localip.c:102
Definition of SSeqLoc structure.
#define row(bind, expected)
Definition: string_bind.c:73
Modified on Tue May 21 10:58:20 2024 by modify_doxy.py rev. 669887