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 47499 2023-05-30 14:55:12Z 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: 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  for (size_t i = row, j = 0; i < dense_seg.GetStarts().size() && j < dense_seg.GetLens().size(); i += num_rows, j++)
367  {
368  if (dense_seg.GetStarts()[i] >= 0)
369  {
370  dense_seg.SetStarts()[i] = offset - dense_seg.SetStarts()[i] - dense_seg.GetLens()[j] + 1;
371  }
372  }
373 }
374 
375 /*
376  * Should we show tooltips?
377  */
378 
380 {
381  return true;
382 }
383 
384 /*
385  * Get bitmap resources
386  */
387 
388 wxBitmap CFarPointerSeq::GetBitmapResource( const wxString& name )
389 {
390  // Bitmap retrieval
391 ////@begin CFarPointerSeq bitmap retrieval
392  wxUnusedVar(name);
393  return wxNullBitmap;
394 ////@end CFarPointerSeq bitmap retrieval
395 }
396 
397 /*
398  * Get icon resources
399  */
400 
401 wxIcon CFarPointerSeq::GetIconResource( const wxString& name )
402 {
403  // Icon retrieval
404 ////@begin CFarPointerSeq icon retrieval
405  wxUnusedVar(name);
406  return wxNullIcon;
407 ////@end CFarPointerSeq icon retrieval
408 }
409 
410 string CFarPointerSeq::GetMessageForId(const CSeq_id &id, string label, bool &check, bool &disable)
411 {
412  if (!NStr::StartsWith(label, "acc"))
413  {
414  disable = true;
415  return "Not a far pointer";
416  }
417  string orig_label(label);
418  CScope& scope = m_TopSeqEntry.GetScope();
419  CBioseq_Handle bsh1 = scope.GetBioseqHandle(id);
422  CBioseq_Handle bsh2;
423  try
424  {
425  bsh2 = scope.GetBioseqHandle(acc_id);
426  }
427  catch(const CException&) {} catch (const exception&) {}
428 
429 
430  if (!bsh1 || !bsh2)
431  {
432  disable = true;
433  return kEmptyStr;
434  }
435 
436  m_label_to_bsh1[orig_label] = bsh1;
437  m_label_to_bsh2[orig_label] = bsh2;
438 
440  try
441  {
442  align = RunBlast(bsh2, bsh1);
443  }
444  catch (const CException&) {} catch (const exception&) {}
445 
446 
447  return ValidateAlignment(align, bsh1, bsh2, check);
448 }
449 
451 {
452  CRef<CSeq_loc> query_seqloc = qh.GetRangeSeq_loc(0,0);
453  CRef<CSeq_loc> subject_seqloc = sh.GetRangeSeq_loc(0,0);
454  if (query_seqloc.IsNull() || subject_seqloc.IsNull())
455  {
457  }
458 
459  CScope &scope = sh.GetScope();
460  blast::SSeqLoc query_sl(*query_seqloc, scope);
461  blast::SSeqLoc subject_sl(*subject_seqloc, scope);
462  blast::CBl2Seq bl2seq(query_sl, subject_sl, blast::eMegablast);
463  blast::CBlastNucleotideOptionsHandle& opts = dynamic_cast<blast::CBlastNucleotideOptionsHandle&>(bl2seq.SetOptionsHandle());
464  opts.SetTraditionalMegablastDefaults();
465 // opts.SetFilterString("m L;R");
466  opts.SetMaskAtHash(true);
467  opts.SetDustFiltering(true);
468  //opts.SetRepeatFiltering(true);
469  opts.SetMismatchPenalty(-3); // to correspond to sequin default options, c++ defaults to -2.
470  //opts.GetOptions().DebugDumpText(cout, "BLAST Options", 0);
471 
472  vector< CRef<objects::CSeq_align_set> > res = bl2seq.Run();
473  CRef<CSeq_align_set> align = res.front();
474 
475  if (align && align->IsSet() && !align->Get().empty())
476  return (align->Get().front());
478 }
479 
480 
482 {
483  if (!align)
484  return("No alignment found!");
485 
486  string errors;
487 
488  TSeqPos length = bsh1.GetBioseqLength();
489 
490  int num_rows = align->CheckNumRows();
491  if (num_rows != 2)
492  return errors;
493 
494  int start1 = 0;
495  int stop1 = 0;
496  int start2 = 0;
497  int stop2 = 0;
498  int row1 = 0;
499  int row2 = 1;
500  bool flip_strand = (align->GetSeqStrand(0) != align->GetSeqStrand(1));
501  m_flip_strand[bsh1] = flip_strand;
502 
503  if (align->GetSeq_id(0).Match(*bsh1.GetSeqId()))
504  {
505  start1 = align->GetSeqStart(0);
506  stop1 = align->GetSeqStop(0);
507  start2 = align->GetSeqStart(1);
508  stop2 = align->GetSeqStop(1);
509  }
510  else if (align->GetSeq_id(1).Match(*bsh1.GetSeqId()))
511  {
512  start1 = align->GetSeqStart(1);
513  stop1 = align->GetSeqStop(1);
514  start2 = align->GetSeqStart(0);
515  stop2 = align->GetSeqStop(0);
516  swap(row1, row2);
517  }
518  else
519  return errors;
520 
521  if (!flip_strand)
522  m_offset[bsh1] = start2 - start1;
523  else
524  m_offset[bsh1] = stop2 + start1;
525 
526  int assem_len = 0;
527  if (stop1 > start1)
528  assem_len = stop1 - start1 + 1;
529  else
530  assem_len = start1 - stop1 + 1;
531 
532  string seq1;
533  const objects::CSeqVector seqvec( bsh1, objects::CBioseq_Handle::eCoding_Iupac, objects::eNa_strand_plus);
534  seqvec.GetSeqData(0, bsh1.GetBioseqLength(), seq1);
535  size_t beg = 0;
536  for (size_t i = 0; i < seq1.size(); i++)
537  {
538  if (seq1[i] == 'N')
539  beg++;
540  else
541  break;
542  }
543  size_t end = 0;
544  for (int i = length - 1; i >= 0; i--)
545  {
546  if (seq1[i] == 'N')
547  end++;
548  else
549  break;
550  }
551  size_t nctr = 0;
552  for (size_t i = 0; i < seq1.size(); i++)
553  {
554  if (seq1[i] == 'N')
555  nctr++;
556  }
557  nctr -= beg + end;
558 
559 
560  if (!align->IsSetSegs() || !align->GetSegs().IsDenseg() ||
561  !align->GetSegs().GetDenseg().IsSetStarts() || !align->GetSegs().GetDenseg().IsSetLens())
562  return errors;
563 
564  string seq2;
565  const objects::CSeqVector seqvec2( bsh2, objects::CBioseq_Handle::eCoding_Iupac, objects::eNa_strand_plus);
566  seqvec2.GetSeqData(0, bsh2.GetBioseqLength(), seq2);
567 
568  vector< TSignedSeqPos > starts(align->GetSegs().GetDenseg().GetStarts());
569  vector< TSeqPos > lens(align->GetSegs().GetDenseg().GetLens());
570  size_t num_segs = lens.size();
571  int gaps = 0;
572  int mismatches = 0;
573  int n = 0;
574  int matches = 0;
575  string tmp(seq1);
576  for (size_t seg = 0; seg < num_segs; ++seg)
577  {
578  TSignedSeqPos seg_start1 = starts[num_rows*seg+row1];
579  TSignedSeqPos seg_start2 = starts[num_rows*seg+row2];
580  TSeqPos len = lens[seg];
581 
582  if (seg_start1 < 0 || seg_start2 < 0)
583  {
584  gaps += len;
585  continue;
586  }
587  for (size_t i = 0; i < len; i++)
588  {
589  char a = seq1[i + seg_start1];
590  char b = seq2[i + seg_start2];
591  if (a != b)
592  {
593  if (a != 'N' && b != 'N')
594  mismatches++;
595  else
596  n++;
597  }
598  else
599  {
600  matches++;
601  }
602  tmp[i + seg_start1] = '+';
603  }
604  }
605  int uncovered_n = 0;
606  int uncovered_non_n = 0;
607  for (size_t i = 0; i < tmp.size(); i++)
608  {
609  if (tmp[i] == '+')
610  continue;
611  if (tmp[i] == 'N')
612  uncovered_n++;
613  else
614  uncovered_non_n++;
615  }
616 
617  if (gaps>0 || mismatches>0 || n > 0)
618  {
619  if (beg > 0 || end > 0)
620  {
621  errors += "The local sequence has " + NStr::ULongToString(beg + end) + " terminal N" + (beg+end > 1 ? "s. " : ". ");
622  }
623  if (nctr > 0)
624  {
625  errors += "The local sequence has " + NStr::ULongToString(nctr) + " internal N" + (nctr > 1 ? "s. " : ". ");
626  }
627  }
628 
629 
630  if (!errors.empty() && assem_len == length && gaps == 0 && mismatches == 0)
631  {
632  errors += "There are no other differences between the local and database sequences.";
633  return errors;
634  }
635 
636  if ((TSeqPos)assem_len < length)
637  {
638  errors += "The alignment to the database sequence does not cover all of the local sequence. ";
639 
640  if (uncovered_n != 0 && uncovered_non_n == 0)
641  {
642  errors += "The unaligned sequence consists only of Ns. ";
643  }
644  if (uncovered_non_n != 0)
645  {
646  errors += "There are non-N residues in the unaligned sequence. ";
647  }
648  }
649 
650  if (gaps > 0 || mismatches > 0 || n > 0)
651  {
652  errors += "The alignment to the database sequence has " + NStr::ULongToString(gaps) + " gap" + (gaps != 1 ? "s, " : ", ")
653  + NStr::ULongToString(mismatches) + " mismatch" + (mismatches != 1 ? "es, " : ", ")
654  + "and " + NStr::ULongToString(n) + " N-mismatch" + (mismatches != 1 ? "es. " : ". ");
655  }
656 
657  if (errors.empty())
658  {
659  check = true;
660  }
661  return errors;
662 }
663 
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:690
#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:5406
static string ULongToString(unsigned long value, TNumToStringFlags flags=0, int base=10)
Convert unsigned long to string.
Definition: ncbistr.hpp:5144
static void TrimPrefixInPlace(string &str, const CTempString prefix, ECase use_case=eCase)
Trim prefix from a string (in-place)
Definition: ncbistr.cpp:3233
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
static SLJIT_INLINE sljit_ins msg(sljit_gpr r, sljit_s32 d, sljit_gpr x, sljit_gpr b)
Definition of SSeqLoc structure.
#define row(bind, expected)
Definition: string_bind.c:73
Modified on Fri Sep 20 14:57:00 2024 by modify_doxy.py rev. 669887