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

Go to the SVN repository for this file.

1 /* $Id: sequence_track.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: Liangshou Wu
27  *
28  * File Description:
29  *
30  */
31 
32 #include <ncbi_pch.hpp>
33 
43 
44 #include <gui/opengl/irender.hpp>
45 #include <gui/utils/rgba_color.hpp>
46 #include <gui/objutils/tooltip.hpp>
47 #include <gui/objutils/label.hpp>
49 #include <gui/objutils/utils.hpp>
51 
53 #include <objects/seq/Seqdesc.hpp>
54 #include <objects/seq/Seq_ext.hpp>
55 #include <objects/seq/Map_ext.hpp>
57 
58 #include <objmgr/seqdesc_ci.hpp>
59 #include <objmgr/util/sequence.hpp>
61 
64 
65 ///////////////////////////////////////////////////////////////////////////////
66 /// CSequenceTrack
67 ///////////////////////////////////////////////////////////////////////////////
68 
69 static const int kSeqTooltipLength = 15;
70 static const int kBarHeight = 10;
71 static const TModelUnit kGapBarHeight = 3.0;
72 
73 static const string kDefProfile = "Default";
74 static const string kBaseKey = "GBPlugins.SeqGraphicSequenceBar";
75 static const string kShowLabelKey = "ShowLabel";
76 static const string kColorGapsKey = "ColorGaps";
77 
79  "A horizontal bar representing the \
80 currently viewed top sequence in a zoomed-out view, and overlaid with sequence \
81 letters in a zoomed-in view at sequence level. For nucleotide sequences, both \
82 the original sequence and the complementary sequence may be shown with two \
83 horizontal bars.");
84 
86  CRenderingContext* r_cntx,
87  CSGSegmentMapDS* seg_map_ds)
88  : CDataTrack(r_cntx)
89  , m_SeqDS(seq_ds)
90  , m_SegMapDS(seg_map_ds)
91  , m_ShowLabel(true)
92  , m_ColorGapsKey(true)
93  , m_ShowSegMap(false)
94  , m_SegMapJobCompleted(false)
95 {
96  if (m_SegMapDS) {
98  }
101 
102  // initialize the sequence label
103  string title = "Sequence ";
104  title += m_SeqDS->GetAcc_Best();
105 
106  string extra = m_SeqDS->GetTitle();
107  if ( !extra.empty() ) {
108  title += ": ";
109  title += extra;
110  }
111  SetTitle(title);
112 
113  // left is always 0, and right is always the sequence length.
114  SetLeft(0.0);
116 
117  m_Location.Reset(new CSeq_loc());
118  m_Location->SetInt().SetFrom(0);
119  m_Location->SetInt().SetTo(m_SeqDS->GetSequenceLength() - 1);
120  m_Location->SetInt().SetId().Assign(*m_SeqDS->GetBestIdHandle().GetSeqId());
121 
122  const CBioseq::TInst& inst = m_SeqDS->GetBioseqHandle().GetInst();
123  if (inst.CanGetExt() && inst.GetExt().IsMap()) {
124  ITERATE (CMap_ext::Tdata, iter, inst.GetExt().GetMap().Get()) {
125  const CSeq_feat& feat = **iter;
126  if (feat.GetData().IsRsite() && feat.GetLocation().IsPacked_pnt()) {
127  CRef<CRsitesGlyph> glyph(new CRsitesGlyph(feat));
128  glyph->SetRenderingContext(r_cntx);
129  glyph->SetParent(this);
130  m_Rsites.push_back(glyph);
131  }
132  }
133  }
134 
135  //TTrackAttrFlags attr = fShowAlways | fFullTrack | fShowTitle | fCollapsible;
136  //SetTrackAttr(attr);
137 }
138 
139 
141 {
142  return m_SeqDS->GetSeqVector();
143 }
144 
145 
147 {
148  CRef<CSeqGlyph> glyph;
149  if (IsIn(p)) {
150  glyph.Reset(this);
151  }
152  return glyph;
153 }
154 
155 
157 {
158  bool consumed = CLayoutTrack::OnLeftDblClick(p);
159 
160  if ( !consumed ) {
161  TModelPoint pp(p);
162  x_World2Local(pp);
163  TModelUnit t_h = x_GetTBHeight();
164 
165  if (pp.Y() > t_h) {
167  consumed = true;
168  }
169  }
170 
171  return consumed;
172 }
173 
174 
175 bool CSequenceTrack::NeedTooltip(const TModelPoint& p, ITooltipFormatter& tt, string& t_title) const
176 {
177  // shortcut
178  if ( !x_HasVisibleRsite() ) return true;
179 
180  TModelPoint pp(p);
181  x_World2Local(pp);
182  TModelUnit t_h = x_GetTBHeight();
183 
184  if (pp.Y() < t_h) return true;
185 
186  TModelUnit b_h = x_GetBarHeight();
187  if (pp.Y() < t_h + t_h - 2.0) return true;
188 
189  bool show_complement =
190  GetSeqVector().IsNucleotide() && m_Context->WillSeqLetterFit();
191  if (show_complement && pp.Y() < t_h + b_h * 2.0 - 2.0) {
192  return true;
193  }
194 
195  ITERATE (TRsites, iter, m_Rsites) {
196  if ((*iter)->NeedTooltip(p, tt, t_title)) return true;
197  }
198 
199  return false;
200 }
201 
202 
203 void CSequenceTrack::GetTooltip(const TModelPoint& p, ITooltipFormatter& tt, string& t_title) const
204 {
205  CLayoutTrack::GetTooltip(p, tt, t_title);
206  if ( !tt.IsEmpty() ) {
207  return;
208  }
209 
211  tt.AddRow(sequence::CDeflineGenerator().GenerateDefline(bsh));
212  if (tt.IsEmpty()) {
213  tt.AddRow(m_SeqDS->GetAcc_Best());
214  }
215 
216  string tmp;
217  try {
219 
220  tt.AddRow("Organism:", tmp, 0);
221  } catch (CException&) {
222  /// ignore
223  }
224 
225  /// add RefGeneTracking validation status
226  if (m_SeqDS->IsRefSeq()) {
227  CSeqdesc_CI desc_ci(bsh, CSeqdesc::e_User);
228  while (desc_ci) {
229  const CUser_object& obj = desc_ci->GetUser();
230  if (obj.GetType().IsStr() && obj.GetType().GetStr() == "RefGeneTracking") {
231  CConstRef<CUser_field> u_field = obj.GetFieldRef("Status");
232  if (u_field && u_field->GetData().IsStr()) {
233  tt.AddRow("RefSeq Status:", u_field->GetData().GetStr(),0);
234  break;
235  }
236  }
237  ++desc_ci;
238  }
239  }
240 
241  // add portion specific to the current mouse position
242  TModelPoint pp(p);
243  x_World2Local(pp);
244  TModelUnit t_h = x_GetTBHeight();
245 
246  if (pp.Y() < t_h) {
247  return;
248  }
249 
250  TModelUnit b_h = x_GetBarHeight();
251  bool show_complement =
252  GetSeqVector().IsNucleotide() && m_Context->WillSeqLetterFit();
253  bool on_complement = false;
254  if (show_complement && pp.Y() > t_h + b_h) {
255  on_complement = true;
256  }
257 
258  int seq_p = int(pp.X());
259 
260  tmp = NStr::UIntToString(seq_p + 1, NStr::fWithCommas); // 1 based
261  if (on_complement) {
262  tmp += " (Complementary Strand)";
263  } else {
264  tmp += " (Direct Strand)";
265  }
266  tt.AddRow("Position:", tmp, 0);
267 
268  if (seq_p < 0 || seq_p > (int)(m_SeqDS->GetSequenceLength() - 1)) {
269  return;
270  }
271 
272  CSeqVector_CI seq_vec_it(GetSeqVector(), seq_p);
273  if (seq_vec_it.IsInGap())
274  {
275  tmp = "gap";
276  string length;
277  CConstRef<CSeq_literal> gap = seq_vec_it.GetGapSeq_literal();
278  if (gap)
279  {
280  if (gap->IsSetLength())
281  length = " (" + NStr::UIntToString(gap->GetLength(), NStr::fWithCommas) + ")";
282  if (gap->IsSetSeq_data() && gap->GetSeq_data().IsGap() && gap->GetSeq_data().GetGap().IsSetType() && gap->GetSeq_data().GetGap().GetType() == CSeq_gap::eType_contamination)
283  tmp = "Contamination " + tmp;
284  else if (gap->IsSetFuzz() && gap->GetFuzz().IsLim() && gap->GetFuzz().GetLim() == CInt_fuzz::eLim_unk)
285  tmp = "Unknown " + tmp;
286  else
287  tmp = "Known " + tmp;
288  }
289  tt.AddRow(tmp, length, 0);
290  if (gap && gap->IsSetSeq_data() && gap->GetSeq_data().IsGap() && gap->GetSeq_data().GetGap().IsSetLinkage_evidence())
291  {
292  for (const auto &ev : gap->GetSeq_data().GetGap().GetLinkage_evidence())
293  {
294  if (ev->IsSetType())
295  {
296  tmp = CLinkage_evidence::ENUM_METHOD_NAME(EType)()->FindName(ev->GetType(), true);
297  tt.AddRow("Linkage evidence: ", tmp, 0);
298  }
299  }
300  }
301  }
302 
303  try {
304  tmp.clear();
305  TSeqPos left = max(seq_p - kSeqTooltipLength, 0);
306  TSeqPos right = min(seq_p + kSeqTooltipLength,
307  (int)(m_SeqDS->GetSequenceLength() - 1));
308 
309  m_SeqDS->GetSequence(left, right, tmp);
310  if (on_complement) {
312  0, static_cast<TSeqPos>(tmp.length()), tmp);
313  }
314  if ( !tmp.empty() ) {
315  tmp.insert(tmp.begin() + (seq_p - left + 1), ']');
316  tmp.insert(tmp.begin() + (seq_p - left), '[');
317  tt.AddRow(tmp);
318  }
319  }
320  catch (CException&) {
321  /// ignore errors
322  }
323 }
324 
325 
327 {
328  if (p_areas == nullptr)
329  return nullptr;
330  bool seq_fit = m_Context->WillSeqLetterFit();
331  // draw complementary sequence for nucleotide seq when showing sequence
332  if (GetSeqVector().IsNucleotide() && seq_fit) {
333  CHTMLActiveArea area;
335  area.m_Flags =
341 
342  TModelUnit top = x_GetTBHeight();
343  area.m_Bounds.SetBottom(area.m_Bounds.Top() + GetHeight());
344  area.m_Bounds.SetTop(area.m_Bounds.Top() + top);
345  area.m_Signature = "Sequence strand";
346  area.m_ParentId = GetId();
347  p_areas->push_back(area);
348  }
349 
350  // add HTML active areas for restriction sites
351 
352  if (!m_Rsites.empty()) {
353  TAreaVector rsite_areas;
354  rsite_areas.reserve(m_Rsites.size());
355  for (const auto& rsite : m_Rsites) {
356  rsite->GetHTMLActiveAreas(&rsite_areas);
357  }
358  // html areas need parent_id to be set otherwise tooltip will not be shown
359  for (auto& a : rsite_areas) {
360  a.m_ParentId = GetId();
361  p_areas->push_back(a);
362  }
363  }
364 
365  return CLayoutTrack::InitHTMLActiveArea(p_areas);
366 }
367 
368 
370 {
371  return m_TypeInfo;
372 }
373 
374 
376 {
378 }
379 
380 
382 {
384 }
385 
386 
387 const objects::CSeq_loc& CSequenceTrack::GetLocation(void) const
388 {
389  return *m_Location;
390 }
391 
392 
394 {
395  return CConstRef<CObject>(m_Location->GetId());
396 }
397 
398 
400 {
401  objs.push_back(CConstRef<CObject>(m_Location->GetId()));
402 }
403 
404 
406 {
407  return m_Location->GetId() == obj.GetPointer();
408 }
409 
410 
412 {
414 }
415 
416 
418 {
419  static TIntervals v;
420  return v;
421 }
422 
423 
425 {
426  if (!m_Context) {
427  return;
428  }
429 
430  bool seq_fit = m_Context->WillSeqLetterFit();
431  TModelUnit top = x_GetTBHeight();
433  TModelUnit gaps_bar_h = x_GetGapsBarHeight();
434  const TModelRange& vr = m_Context->GetVisibleRange();
435  TModelRect rcm(vr.GetFrom(), top + h + gaps_bar_h, vr.GetTo(), top);
436 
437  bool show_complement = GetSeqVector().IsNucleotide() && seq_fit;
438  bool show_strand = show_complement && m_gConfig->GetShowComments();
439 
440  // draw direct sequence
441  x_RenderSequence(rcm, seq_fit, true, show_strand);
442 
443  // draw complementary sequence for nucleotide seq when showing sequence
444  if (show_complement) {
445  rcm.Offset(0.0, h);
446  x_RenderSequence(rcm, seq_fit, false, show_strand);
447  }
448  if (x_ShowSegMap())
449  m_Group.Draw();
450 
451  ITERATE (TRsites, iter, m_Rsites) {
452  (*iter)->Draw();
453  }
454 }
455 
456 
458 {
459  return false;
460 }
461 
462 
463 void CSequenceTrack::x_RenderGaps(const TModelRect& rcm, TSeqPos from, TSeqPos to, bool show3d) const
464 {
466  return;
467 
468  CLogPerformance perfLog("CSequenceTrack::x_RenderGap");
469  perfLog.AddParameter ("description", "Rendering gaps");
470 
471  IRender& gl = GetGl();
472  // CSeqMap_CI it(m_SeqDS->GetBioseqHandle(), objects::CSeqMap::fFindGap, CRange<TSeqPos>(from, to));
473  CSeqVector_CI seq_vec_it(GetSeqVector(), from);
474  CSeqMap_CI it = seq_vec_it.GetCurrentSeqMap_CI();
475 
476  while(it)
477  {
478  const TSeqPos start = it.GetPosition();
479  const TSeqPos end = min(to, it.GetEndPosition());
480  if (start > to)
481  break;
482  if (it.GetType() == objects::CSeqMap::eSeqGap)
483  {
484  CRgbaColor c("purple");
486  if (gap)
487  {
488  if (gap->IsSetSeq_data() && gap->GetSeq_data().IsGap() && gap->GetSeq_data().GetGap().IsSetType() && gap->GetSeq_data().GetGap().GetType() == CSeq_gap::eType_contamination)
489  {
490  c = CRgbaColor("yellow");
491  }
492  else if (gap->IsSetFuzz() && gap->GetFuzz().IsLim() && gap->GetFuzz().GetLim() == CInt_fuzz::eLim_unk)
493  {
494  c = CRgbaColor("red");
495  c.Darken(0.5);
496  }
497  }
498  if (m_gConfig->GetColorTheme() == "Greyscale")
499  c = c.GetGreyscale();
500  if (!m_ColorGapsKey)
501  c = CRgbaColor("black");
502  if (show3d)
503  {
504  if (x_ShowSegMap())
505  {
506  gl.ColorC(c);
507  m_Context->DrawQuad(start, rcm.Bottom() - 2, end, m_ColorGapsKey ? rcm.Top() : rcm.Top() + 2);
508  }
509  else
510  {
511  m_Context->Draw3DQuad(start, rcm.Bottom() - 2, end, rcm.Top() + 2, c, true);
512  }
513  }
514  else
515  {
516  gl.ColorC(c);
517  m_Context->DrawQuad(start, rcm.Bottom() - 2, end + 0.25, rcm.Top() + 2);
518  }
519  }
520  ++it;
521  }
522 
523  perfLog.Post(CRequestStatus::e200_Ok);
524 }
525 
527  bool seq_fit,
528  bool direct,
529  bool show_strand) const
530 {
531  IRender& gl = GetGl();
532 
533  if ( !seq_fit ) {
534  m_Context->Draw3DQuad(rcm.Left(), rcm.Bottom() - 2, rcm.Right(), rcm.Top() + 2 + x_GetGapsBarHeight(), m_SeqBarColor, true);
536  } else {
537  // Draw actual sequence if resolution permits
538  gl.ColorC(m_SeqBarColor);
539  m_Context->DrawQuad(rcm.Left(), rcm.Bottom() - 2, rcm.Right(),
540  rcm.Top() + 2);
541 
542  TSeqPos from = m_Context->GetVisSeqFrom();
543  TSeqPos to = m_Context->GetVisSeqTo();
544 
545  try {
546  string seq_str;
547  const CSeqVector& s_vec = GetSeqVector();
548  s_vec.GetSeqData(from, to, seq_str);
549  x_RenderGaps(rcm, from, to, false);
550 
551  if (!direct) {
553  0, static_cast<TSeqPos>(seq_str.length()), seq_str);
554  }
555 
556  gl.ColorC(m_SeqColor);
557  TModelUnit height = gl.TextHeight(m_SeqFont);
558  TModelUnit fs = height + 2;
559 
560  char bases[2];
561  bases[1] = '\0';
562 
563  for (TSeqPos bp = 0; bp != seq_str.length(); bp++) {
564  bases[0] = seq_str[bp];
565  TModelUnit xM = from + bp + 0.5;
566  TModelUnit yM = rcm.Top() + fs + 1;
567  m_Context->TextOut(m_SeqFont.GetPointer(), bases, xM, yM, true);
568  }
569  }
570  catch (CException&) {
571  /// ignore exceptions from this - the only code that throws from
572  /// above is sequence retrieval
573  }
574  }
575 
576  if (show_strand) {
577  TModelUnit x = direct ? rcm.Left(): rcm.Right();
578  TModelUnit y = direct ? rcm.Top() + 4.0 : rcm.Bottom() - 4.0;
579  gl.ColorC(m_StrandColor);
580  m_Context->Draw5Prime(x, y, direct, 12.0, 12.0);
581  }
582 }
583 
584 
585 void CSequenceTrack::x_LoadSettings(const string& preset_style,
586  const TKeyValuePairs& settings)
587 {
589  if ( !g_conf ) {
590  return;
591  }
592  if ( !m_SeqFont ) {
594  }
595 
596  if (preset_style.empty()) {
598  } else {
599  SetProfile(preset_style);
600  }
601 
603 
604  // load settings basic settings for squence track
605  CRegistryReadView view =
607  m_ShowLabel = view.GetBool(kShowLabelKey, true);
608  m_ColorGapsKey = view.GetBool(kColorGapsKey, true);
609  m_ShowSegMap = view.GetBool("ShowSegmentMap", false);
610 
611  ITERATE (TKeyValuePairs, iter, settings) {
612  try {
613  if (NStr::EqualNocase(iter->first, kShowLabelKey)) {
614  m_ShowLabel = NStr::StringToBool(iter->second);
615  }
616  if (NStr::EqualNocase(iter->first, kColorGapsKey)) {
617  m_ColorGapsKey = NStr::StringToBool(iter->second);
618  }
619  } catch (CException&) {
620  LOG_POST(Warning << "CSequenceTrack::x_LoadSettings() invalid settings - "
621  << iter->first << ":" << iter->second);
622  }
623  }
624 
627  CSGConfigUtils::GetFont(view, "SeqFontFace", "SeqFontSize", *m_SeqFont);
628 
629  // restriction sites
630  // LOG_POST(Info << "loading rsite settings pre");
631  if ( !m_Rsites.empty() ) {
632  int rs_w = view.GetInt("RsiteWidth", 8);
633  int rs_h = view.GetInt("RsiteHeight", 6);
634  // LOG_POST(Info << "loading rsite settings");
635  NON_CONST_ITERATE (TRsites, s_iter, m_Rsites) {
636  (*s_iter)->SetSiteWidth(rs_w);
637  (*s_iter)->SetSiteHeight(rs_h);
638  }
639  }
640 
643  CSGConfigUtils::GetColor(view, "Sequence", m_SeqColor);
644  CSGConfigUtils::GetColor(view, "SequenceBar", m_SeqBarColor);
645  CSGConfigUtils::GetColor(view, "SequenceStrand", m_StrandColor);
646 
647  // restriction sites
648  if ( !m_Rsites.empty() ) {
649  CRgbaColor rs_color;
650  CSGConfigUtils::GetColor(view, "RsiteColor", rs_color);
651  NON_CONST_ITERATE (TRsites, s_iter, m_Rsites) {
652  (*s_iter)->SetSiteColor(rs_color);
653  }
654  }
655 
656  // load settings for segment map
658  "GBPlugins.SeqGraphicComponentMap", GetProfile(), m_gConfig->GetColorTheme(), kDefProfile);
659  for (int i = 0; i < 5; ++i) {
660  m_SegMapColors.push_back(CRgbaColor());
661  }
667 
669 }
670 
671 
672 void CSequenceTrack::x_SaveSettings(const string& preset_style)
673 {
674  TKeyValuePairs settings;
675 
676  if ( !preset_style.empty() ) {
677  settings["profile"] = preset_style;
678  }
682 }
683 
684 
686 {
687  m_SegMapJobCompleted = false;
688  if (x_ShowSegMap()) {
691  const CSeqVector& seq_vec = GetSeqVector();
693  } else {
695  }
696 }
697 
698 
700 {
701  m_SegMapDS->ClearJobID(notify.GetJobID());
702  m_SegMapJobCompleted = true;
703  SetMsg("");
704  m_Group.Clear();
705  CRef<CObject> res_obj = notify.GetResult();
706  CSGJobResult* result = dynamic_cast<CSGJobResult*>(&*res_obj);
707  if (result && result->m_ObjectList.size() == 1) {
708  CSegmentSmearGlyph* seg_map =
709  dynamic_cast<CSegmentSmearGlyph*>(result->m_ObjectList.front().GetPointer());
710  seg_map->SetHeight(x_GetBarHeight());
711  seg_map->SetColorCode(m_SegMapColors);
712  seg_map->SetRenderingContext(m_Context);
713  seg_map->SetParent(this);
714  m_Group.PushBack(seg_map);
715  x_UpdateLayout();
716  } else {
717  LOG_POST(Error << "CSequenceTrack::x_OnJobCompleted() "
718  "failed to load segment map.");
719  }
720 }
721 
722 
723 void CSequenceTrack::x_SaveConfiguration(const string& preset_style) const
724 {
726  if ( !g_conf ) {
727  return;
728  }
729 
731  CRegistryWriteView view =
735 
737  registry, kBaseKey, preset_style, g_conf->GetSizeLevel(), kDefProfile);
738  CSGConfigUtils::SetFont(view, "SeqFontFace", "SeqFontSize", *m_SeqFont);
739 
741  registry, kBaseKey, preset_style, g_conf->GetColorTheme(), kDefProfile);
742  CSGConfigUtils::SetColor(view, "Sequence", m_SeqColor);
743  CSGConfigUtils::SetColor(view, "SequenceBar", m_SeqBarColor);
744  CSGConfigUtils::SetColor(view, "SequenceStrand", m_StrandColor);
745 }
746 
747 
749 {
750  IRender& gl = GetGl();
751 
753  if ( m_Context->WillSeqLetterFit() ) {
754  h += 4.0 + gl.TextHeight(m_SeqFont);
755  } else {
756  h += kBarHeight;
757  }
758  return h;
759 }
760 
761 inline
763 {
764  TModelUnit gaps_bar_h{ 0.0 };
765  if (GetSeqVector().IsNucleotide() && m_ColorGapsKey && x_ShowSegMap())
766  gaps_bar_h = kGapBarHeight;
767 
768  return gaps_bar_h;
769 }
770 
772 {
774  if (m_Expanded) {
775 
776  TModelUnit gaps_bar_h = x_GetGapsBarHeight();
777 
778  m_Group.SetTop(gaps_bar_h);
780  (*iter)->Update(true);
781  (*iter)->SetTop(GetHeight());
782  }
783 
785  if (GetSeqVector().IsNucleotide() && m_Context->WillSeqLetterFit()) {
786  SetHeight(GetHeight() + 2 * h);
787  } else {
788  SetHeight(GetHeight() + h + gaps_bar_h);
789  }
790 
791 
793  (*iter)->Update(true);
794  (*iter)->SetTop(GetHeight());
795  }
796 
797  if (x_HasVisibleRsite()) {
798  SetHeight(GetHeight() + m_Rsites.front()->GetHeight());
799  }
800  }
801 }
802 
803 
805 {
806  return (m_SegMapDS && !m_Context->WillSeqLetterFit());
807 }
808 
809 
811 {
812  ITERATE (TRsites, iter, m_Rsites) {
813  if ((*iter)->HasVisibleRsite()) return true;
814  }
815 
816  return false;
817 }
818 
819 
820 ///////////////////////////////////////////////////////////////////////////////
821 /// CSequenceTrackFactory
822 ///////////////////////////////////////////////////////////////////////////////
825  ISGDataSourceContext* ds_context,
826  CRenderingContext* r_cntx,
827  const SExtraParams& params,
828  const TAnnotMetaDataList& src_annots) const
829 {
830  // LOG_POST("<<<<");
831  TTrackMap tracks;
833  ds_context->GetDS(typeid(CSGSequenceDSType).name(), object);
834  CSGSequenceDS* seq_ds = dynamic_cast<CSGSequenceDS*>(ds1.GetPointer());
835 
836  // LOG_POST("Getting segment map DS");
837  CIRef<ISGDataSource> ds2 = ds_context->GetDS(typeid(CSGSegmentMapDSType).name(), object);
838  CSGSegmentMapDS* seg_map_ds = dynamic_cast<CSGSegmentMapDS*>(ds2.GetPointer());
839  // LOG_POST("done");
840 
841  TAnnotNameTitleMap annots;
843  if (!params.m_Annots.empty()) try {
844  if (!src_annots.empty()) {
845  GetMatchedAnnots(src_annots, params, annots);
846  }
847 
848  if (annots.empty()) {
849  // LOG_POST("Creating a seq-table annot selector and retrieving annot names");
852  sel.SetResolveDepth(0); // SeqgMap is expected to be found on the top level only, GB-5507
853  seg_map_ds->GetAnnotNames(sel, r_cntx->GetVisSeqRange(), annots);
854  // LOG_POST("done");
855  }
856  } catch (CException& e) {
857  ERR_POST(Error << e.GetMsg());
858  } catch (exception& e) {
859  ERR_POST(Error << e.what());
860  }
861  if (annots.empty()) {
862  bool is_chromosome =
863  CSGUtils::IsChromosome(seq_ds->GetBioseqHandle(), seq_ds->GetScope());
865  if ((is_chromosome && !seg_map_ds->HasSegmentMap(1, range)) ||
866  !seg_map_ds->HasSegmentMap(0, range)) {
867  seg_map_ds = NULL;
868  }
869  } else {
870  // there should be only one if any
871  seg_map_ds->SetAnnot(annots.begin()->first);
872  }
873  } else {
874  if ( !params.m_Annots.empty() ) {
875  // there should be only one if any
876  annots.insert(TAnnotNameTitleMap::value_type(params.m_Annots[0], ""));
877  seg_map_ds->SetAnnot(annots.begin()->first);
878  }
879  }
880 
881  // LOG_POST("Creating CSequenceTrack");
882  tracks[annots.empty() ? "Sequence" : annots.begin()->first] =
883  CRef<CLayoutTrack>(new CSequenceTrack(seq_ds, r_cntx, seg_map_ds));
884  // LOG_POST("done");
885  // LOG_POST(">>>>");
886 
887  return tracks;
888 }
889 
891  const TAnnotMetaDataList& src_annots,
892  const ILayoutTrackFactory::SExtraParams& params,
893  TAnnotNameTitleMap& out_annots) const
894 {
895  if (!params.m_Annots.empty())
896  ILayoutTrackFactory::GetMatchedAnnots(src_annots, params.m_Annots, "seq-table", "", out_annots);
897 }
898 
899 
901 {
903 }
904 
905 
907 {
909 }
910 
911 
914  const TKeyValuePairs& settings,
915  const CTempTrackProxy* track_proxy) const
916 {
917  CRef<CTrackConfigSet> config_set(new CTrackConfigSet);
918  // create a track configure
920  config_set->Set().push_back(config);
921  config->SetHelp() = GetThisTypeInfo().GetDescr();
922  config->SetLegend_text("anchor_8");
923 
924  if (track_proxy) {
925  const CSequenceTrack* track =
926  dynamic_cast<const CSequenceTrack*>(track_proxy->GetTrack());
927  if (track && track->m_SegMapDS &&
928  (track->m_ShowSegMap || !track->m_SegMapDS->GetAnnot().empty())) {
929  config->SetHelp() = "The sequence bar is colored by the source \
930 sequence and to generate that base. <br>Blue=finished sequence<br>\
931 Orange=draft sequence<br>Green=WGS<br>Gray=Other<br>Black=Gap";
932  }
933  }
934 
936  CRegistryReadView view =
938  bool show_label = view.GetBool(kShowLabelKey, false);
939  bool color_gaps = view.GetBool(kColorGapsKey, false);
940 
941  ITERATE (TKeyValuePairs, iter, settings) {
942  try {
943  if (NStr::EqualNocase(iter->first, kShowLabelKey)) {
944  show_label = NStr::StringToBool(iter->second);
945  }
946  if (NStr::EqualNocase(iter->first, kColorGapsKey)) {
947  color_gaps = NStr::StringToBool(iter->second);
948  }
949  } catch (CException&) {
950  LOG_POST(Warning << "CSequenceTrack::x_LoadSettings() invalid settings - "
951  << iter->first << ":" << iter->second);
952  }
953  }
954 
955 
956  // setting for label (on/off)
957  config->SetCheck_boxes().push_back(
959  kShowLabelKey, "Show Label", "Show/hide sequence track title", "", show_label));
960  config->SetCheck_boxes().push_back(
962  kColorGapsKey, "Color gaps by type", "purple = gap of known length, red = gap of unknown length, yellow = contamination", "", color_gaps));
963 
964  return config_set;
965 }
966 
967 
User-defined methods of the data storage class.
User-defined methods of the data storage class.
CAppJobNotification Notification send by CAppJobEventTranslator.
CBioseq_Handle –.
CDataTrack - a abstract base class for layout tracks which need to deal with background data retrieva...
Definition: data_track.hpp:55
void x_UpdateLayout()
Definition: data_track.hpp:127
CRef< CSimpleLayout > m_Simple
void SetLayoutPolicy(ILayoutPolicy *policy)
Set policy on how to deploy the layout of its children.
static CGuiRegistry & GetInstance()
access the application-wide singleton
Definition: registry.cpp:400
@ fNoTooltip
do not request and show tooltip
@ fNoPin
tooltip is not pinnable
@ fNoHighlight
no highlighting on mouse over
@ fSequence
sequence track flag
@ fNoSelection
the object can't be selected
int m_Flags
area flags, will need to replace m_Type
string m_ParentId
parent entity idendifier, such as track_id
void PushBack(CSeqGlyph *obj)
Append a layout object to the end.
TObjectList & SetChildren()
virtual void x_UpdateBoundingBox()
Update the bounding box assuming children's sizes are fixed if any.
void SetShowTitle(bool flag)
virtual void GetTooltip(const TModelPoint &p, ITooltipFormatter &tt, string &t_title) const
Get the tooltip if available.
bool m_Expanded
is this track in expanded state
void SetTitle(const string &label, const string &default_title=NcbiEmptyString)
virtual bool OnLeftDblClick(const TModelPoint &p)
bool GetShowTitle() const
ILayoutTrackHost * m_LTHost
Top level host owning the tracks.
const string & GetId() const
const string & GetProfile() const
TModelUnit x_GetTBHeight() const
Get title bar height including margin.
void SetMsg(const string &msg)
CConstRef< CSeqGraphicConfig > x_GetGlobalConfig() const
Method for getting global configuration from rendering context.
void SetProfile(const string &preset_style)
CLayoutTrack inline method implmentation.
CRef< CSeqGraphicConfig > m_gConfig
global configuration.
virtual CHTMLActiveArea * InitHTMLActiveArea(TAreaVector *p_areas) const
Initialize the HTML active area for a track.
void AddParameter(const std::string &name, const std::string &value)
void Post(CRequestStatus::ECode status=CRequestStatus::e200_Ok)
static string GetSeqLocSignature(const objects::CSeq_loc &loc, objects::CScope *scope)
void GetLabel(string *label) const
Definition: Org_ref.cpp:57
CRef –.
Definition: ncbiobj.hpp:618
class CRegistryReadView provides a nested hierarchical view at a particular key.
Definition: reg_view.hpp:58
int GetInt(const string &key, int default_val=0) const
access a named key at this level, with no recursion
Definition: reg_view.cpp:230
bool GetBool(const string &key, bool default_val=false) const
Definition: reg_view.cpp:241
void Set(const string &key, int val)
access a named key at this level, with no recursion
Definition: reg_view.cpp:533
CRenderingContext offers the basic context and utility methods for rendering layout objects in featur...
void TextOut(const CGlTextureFont *font, const char *text, TModelUnit x, TModelUnit y, bool center, bool adjust_flip=true) const
const TSeqRange & GetVisSeqRange() const
const TModelRange & GetVisibleRange() const
TSeqPos GetVisSeqTo() const
void DrawQuad(const TModelRect &rc, bool border=false) const
const TModelUnit & GetScale() const
bool WillSeqLetterFit() const
is it enougth space to sequence letters.
TSeqPos GetVisSeqFrom() const
void Draw3DQuad(TModelUnit x1, TModelUnit y1, TModelUnit x2, TModelUnit y2, const CRgbaColor &color, bool border=false) const
void Draw5Prime(TModelUnit x, TModelUnit y, bool direct, TModelUnit size_h, TModelUnit size_v) const
class CRgbaColor provides a simple abstraction for managing colors.
Definition: rgba_color.hpp:58
A glyph representing a list of restriction sites stored in one seq-feat.
static CRegistryReadView GetSizeReadView(const CGuiRegistry &reg, const string &base_key, const string &sect, const string &key, const string &def_sect="")
static void GetFont(const CRegistryReadView &view, const string &face_key, const string &size_key, CGlTextureFont &f)
static string ComposeProfileString(const TKeyValuePairs &settings)
static CRegistryReadView GetColorReadView(const CGuiRegistry &reg, const string &base_key, const string &sect, const string &key, const string &def_sect="")
Create a read view specifically for 'Color' section.
static CRegistryReadView GetReadView(const CGuiRegistry &reg, const string &base_key, const string &curr_key, const string &def_key1="", const string &def_key2="", const string &def_key3="")
read/readwrite view creation helper methods.
static CRegistryWriteView GetWriteView(CGuiRegistry &reg, const string &base_key, const string &curr_key, const string &def_key1="", const string &def_key2="", const string &def_key3="")
static CRegistryWriteView GetColorRWView(CGuiRegistry &reg, const string &base_key, const string &sect, const string &key, const string &def_sect="")
static CRegistryWriteView GetSizeRWView(CGuiRegistry &reg, const string &base_key, const string &sect, const string &key, const string &def_sect="")
static void SetColor(CRegistryWriteView &view, const string &key, const CRgbaColor &color)
static void GetColor(const CRegistryReadView &view, const string &key, CRgbaColor &color)
static void SetFont(CRegistryWriteView &view, const string &face_key, const string &size_key, const CGlTextureFont &f)
void SetJobListener(CEventHandler *listener)
Set JobDispatcher listener.
virtual void ClearJobID(TJobID job_id)
virtual void DeleteAllJobs()
Remove waiting jobs from queue or cancel the unfinished jobs.
CSGJobResult – the data structure holding the seqgraphic job results.
CSGFeatureDSType.
CSGSegmentMapDS.
void SetAnnot(const string &annot)
CSGFeatureDS inline methods.
const string & GetAnnot() const
static bool GetEnabled()
Indicates if the segment map is enabled.
void LoadSegmentSmear(const TSeqRange &range, TModelUnit scale, const objects::CSeqVector *seq_vec=nullptr)
Used in sequence track for showing segment color.
bool HasSegmentMap(int level, const TSeqRange &range) const
Query if there is segment maps for given level.
void GetAnnotNames(objects::SAnnotSelector &sel, const TSeqRange &range, TAnnotNameTitleMap &names) const
objects::CScope & GetScope(void) const
Get the scope from the handle.
TSeqPos GetSequenceLength() const
const objects::CSeqVector & GetSeqVector(void) const
string GetTitle() const
objects::CBioseq_Handle GetBioseqHandle(void) const
Get the underlying bioseq handle.
void GetSequence(TSeqPos from, TSeqPos to, string &buffer) const
retrieve a string representing the IUPAC characters for the sequence [from to].
string GetAcc_Best() const
this is more suitable for display purposes since the returned string will not always be good to recon...
objects::CSeq_id_Handle GetBestIdHandle() const
static bool IsChromosome(const objects::CBioseq_Handle &handle, objects::CScope &scope)
void SetColorCode(const TColorCode &colors)
CSegmentSmearGlyph inline methods.
void x_InitHTMLActiveArea(CHTMLActiveArea &area) const
initialize the basic information for a given active area.
Definition: seq_glyph.cpp:380
CRenderingContext * m_Context
the rendering context
Definition: seq_glyph.hpp:346
virtual void SetHeight(TModelUnit h)
Definition: seq_glyph.hpp:650
void SetParent(CSeqGlyph *p)
Definition: seq_glyph.hpp:670
bool IsIn(const TModelPoint &p) const
Hit test for points in PARENT COORD.
Definition: seq_glyph.hpp:569
virtual void SetWidth(TModelUnit w)
Definition: seq_glyph.hpp:646
virtual void SetLeft(TModelUnit l)
Definition: seq_glyph.hpp:654
virtual TModelUnit GetHeight() const
Definition: seq_glyph.hpp:587
virtual void SetTop(TModelUnit b)
Definition: seq_glyph.hpp:658
void Draw() const
render the layout.
Definition: seq_glyph.cpp:92
vector< CHTMLActiveArea > TAreaVector
Definition: seq_glyph.hpp:84
void x_World2Local(TModelPoint &p) const
Transform the coordiante from world coord. to local coord.
Definition: seq_glyph.hpp:722
list< CRef< CSeqGlyph > > TObjects
Definition: seq_glyph.hpp:85
void SetRenderingContext(CRenderingContext *context)
Set the rendering context.
Definition: seq_glyph.hpp:684
const string & GetSizeLevel() const
int GetObjectSpace() const
bool GetShowComments() const
const string & GetColorTheme() const
static SIZE_TYPE Complement(const string &src, TCoding src_coding, TSeqPos pos, TSeqPos length, string &dst)
Iterator over CSeqMap.
Definition: seq_map_ci.hpp:252
@ e_Iupacna
Definition: sequtil.hpp:47
CSeqVector –.
Definition: seq_vector.hpp:65
namespace ncbi::objects::
Definition: Seq_feat.hpp:58
CSeqdesc_CI –.
Definition: seqdesc_ci.hpp:65
virtual string GetExtensionLabel() const
returns a displayable label for this extension ( please capitalize the key words - "My Extension" )
virtual void GetMatchedAnnots(const TAnnotMetaDataList &src_annots, const ILayoutTrackFactory::SExtraParams &params, TAnnotNameTitleMap &out_annots) const
virtual const CTrackTypeInfo & GetThisTypeInfo() const
virtual CRef< objects::CTrackConfigSet > GetSettings(const string &profile, const TKeyValuePairs &settings, const CTempTrackProxy *track_proxy) const
virtual TTrackMap CreateTracks(SConstScopedObject &object, ISGDataSourceContext *ds_context, CRenderingContext *r_cntx, const SExtraParams &params=SExtraParams(), const TAnnotMetaDataList &src_annots=TAnnotMetaDataList()) const
create a layout track based on input object and extra parameters.
virtual string GetExtensionIdentifier() const
returns the unique human-readable identifier for the extension the id should use lowercase letters se...
CSequenceTrack – the layout track for holding and visualizing a molecule sequence superimposed by com...
vector< CRef< CRsitesGlyph > > TRsites
list of restriction sites
CRgbaColor m_SeqBarColor
sequence bar color.
virtual void x_LoadSettings(const string &preset_style, const TKeyValuePairs &settings)
load the track settings.
CRef< CGlTextureFont > m_SeqFont
font
virtual CConstRef< CObject > GetObject(TSeqPos pos) const
access our core component - we wrap an object(s) of some sort.
virtual CRef< CSeqGlyph > HitTest(const TModelPoint &p)
Hit testing.
virtual bool x_Empty() const
virtual const IObjectBasedGlyph::TIntervals & GetIntervals(void) const
access sub-intervals (if any).
const objects::CSeqVector & GetSeqVector() const
virtual CHTMLActiveArea * InitHTMLActiveArea(TAreaVector *p_areas) const
Initialize the HTML active area for a track.
virtual bool HasObject(CConstRef< CObject > obj) const
check if the wrapped object(s) is the one.
bool x_HasVisibleRsite() const
virtual void x_SaveSettings(const string &preset_style)
save part of settings to a profile string.
virtual void x_OnJobCompleted(CAppJobNotification &notify)
TModelUnit x_GetBarHeight() const
Get the sequence bar height.
virtual bool NeedTooltip(const TModelPoint &p, ITooltipFormatter &tt, string &t_title) const
Check if need to show tooltip.
virtual string GetSignature() const
return signature for this glyph.
CRgbaColor m_StrandColor
sequence strand color.
virtual const CTrackTypeInfo & GetTypeInfo() const
void x_RenderGaps(const TModelRect &rcm, TSeqPos from, TSeqPos to, bool show3d) const
bool m_ShowSegMap
superimpose segment map.
CSegmentSmearGlyph::TColorCode m_SegMapColors
color codes for segment map.
TModelUnit x_GetGapsBarHeight() const
Get the height of the gaps bar, drown on top of the segment map.
CRef< CSGSequenceDS > m_SeqDS
CRgbaColor m_SeqColor
sequence text color.
CRef< objects::CSeq_loc > m_Location
bool x_ShowSegMap() const
virtual void x_RenderContent() const
The content rendering must be implemented in the derived layout tracks.
virtual void x_UpdateData()
update track content.
CRef< CSGSegmentMapDS > m_SegMapDS
void x_SaveConfiguration(const string &preset_style) const
save all track settings to the configuration file.
virtual bool OnLeftDblClick(const TModelPoint &p)
CSequenceTrack(CSGSequenceDS *seq_ds, CRenderingContext *r_cntx, CSGSegmentMapDS *seg_map_ds=NULL)
virtual CRef< CSGGenBankDS > GetDataSource()
Method for accessing the data source.
virtual void x_UpdateBoundingBox()
Update the bounding box assuming children's sizes are fixed if any.
void x_RenderSequence(const TModelRect &rcm, bool seq_fit, bool direct, bool show_strand) const
Render a sequence bar and the sequence if fits.
static CTrackTypeInfo m_TypeInfo
virtual void GetTooltip(const TModelPoint &p, ITooltipFormatter &tt, string &t_title) const
Get the tooltip if available.
virtual void GetObjects(vector< CConstRef< CObject > > &objs) const
retrieve CObjects corresponding to this CSeqGlyph.
virtual const objects::CSeq_loc & GetLocation(void) const
access the position of this object.
bool m_ShowLabel
show sequence label.
File Description:
const CLayoutTrack * GetTrack() const
CTrackConfigSet –.
static CRef< objects::CCheckBox > CreateCheckBox(const string &name, const string &disp_n, const string &help_text, const string &legend_txt, bool value, bool optional=false)
Definition: layout_conf.hpp:96
CTrackConfig –.
Definition: TrackConfig.hpp:66
CTrackTypeInfo - holds description of a layout track type.
const string & GetDescr() const
const string & GetId() const
CConstRef< CUser_field > GetFieldRef(const string &str, const string &delim=".", NStr::ECase use_case=NStr::eCase) const
Definition: User_object.cpp:84
static void GetMatchedAnnots(const TAnnotMetaDataList &src_annots, const vector< string > &target_annots, const string &annot_type, const string &track_type, TAnnotNameTitleMap &out_annots)
Help function to find matched annotations.
virtual void LTH_ZoomOnRange(const TSeqRange &range)=0
notifies the host we need to zoom on to a range.
vector< TSeqRange > TIntervals
ISGDSManager is seqgraphic data source manage that serves as an data source context.
virtual CIRef< ISGDataSource > GetDS(const string &type, SConstScopedObject &object)=0
Get a seqgraphic data source instance of the specified type.
primitive interface to arrange tabular data in the tooltips
Definition: tooltip.hpp:55
const_iterator begin() const
Definition: map.hpp:151
iterator_bool insert(const value_type &val)
Definition: map.hpp:165
bool empty() const
Definition: map.hpp:149
static CMemoryRegistry registry
Definition: cn3d_tools.cpp:81
struct config config
#define true
Definition: bool.h:35
#define false
Definition: bool.h:36
static char tmp[3200]
Definition: utf8.c:42
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
#define ERR_POST(message)
Error posting with file, line number information but without error codes.
Definition: ncbidiag.hpp:186
#define LOG_POST(message)
This macro is deprecated and it's strongly recomended to move in all projects (except tests) to macro...
Definition: ncbidiag.hpp:226
void Error(CExceptionArgs_Base &args)
Definition: ncbiexpt.hpp:1197
const string & GetMsg(void) const
Get message string.
Definition: ncbiexpt.cpp:461
void Warning(CExceptionArgs_Base &args)
Definition: ncbiexpt.hpp:1191
virtual const char * what(void) const noexcept
Standard report (includes full backlog).
Definition: ncbiexpt.cpp:342
static objects::SAnnotSelector GetAnnotSelector(TAnnotFlags flags=0)
request an annotation selector for a given type
Definition: utils.cpp:167
GLdouble TModelUnit
Definition: gltypes.hpp:48
T X() const
Definition: glpoint.hpp:59
void SetBottom(T bottom)
Definition: glrect.hpp:113
T Top() const
Definition: glrect.hpp:84
T Bottom() const
Definition: glrect.hpp:82
void Offset(T d_x, T d_y)
Definition: glrect.hpp:186
IRender & GetGl()
convenience function for getting current render manager
T Right() const
Definition: glrect.hpp:83
virtual TModelUnit TextHeight(const CGlTextureFont *font) const =0
T Left() const
Definition: glrect.hpp:81
T Y() const
Definition: glpoint.hpp:60
virtual void ColorC(const CRgbaColor &c)=0
Set current color (glColor{3,4}{f,d}{v,})
void SetTop(T top)
Definition: glrect.hpp:115
void Darken(float scale)
Definition: rgba_color.cpp:472
virtual void AddRow(const string &sContents="", unsigned colspan=2)=0
add a row with a cell, spanning across all columns
CRef< CObject > GetResult() const
returns non-null pointer only if Completed or Running and has temporary results available
CRgbaColor GetGreyscale() const
Returns the greyscale equivalent of the current color.
Definition: rgba_color.cpp:481
virtual bool IsEmpty() const =0
Indicates if the tooltip is empty.
#define ENUM_METHOD_NAME(EnumName)
Definition: serialbase.hpp:994
const COrg_ref & GetOrg_ref(const CBioseq_Handle &handle)
Return the org-ref associated with a given sequence.
Definition: sequence.cpp:264
TSeqPos GetEndPosition(void) const
return end position of current segment in sequence (exclusive)
Definition: seq_map_ci.hpp:679
CConstRef< CSeq_literal > GetGapSeq_literal(void) const
returns gap Seq-data object ref returns null if it's not a gap or an unspecified gap
SAnnotSelector & SetResolveDepth(int depth)
SetResolveDepth sets the limit of subsegment resolution in searching annotations.
CSeqMap::ESegmentType GetType(void) const
Definition: seq_map_ci.hpp:651
SAnnotSelector & SetAnnotType(TAnnotType type)
Set annotation type (feat, align, graph)
TSeqPos GetPosition(void) const
return position of current segment in sequence
Definition: seq_map_ci.hpp:665
CConstRef< CSeq_literal > GetRefGapLiteral(void) const
return CSeq_literal with gap data, or null if either the segment is not a gap, or an unspecified gap
Definition: seq_map_ci.cpp:292
const CSeqMap_CI & GetCurrentSeqMap_CI() const
bool IsInGap(void) const
true if current position of CSeqVector_CI is inside of sequence gap
void GetSeqData(TSeqPos start, TSeqPos stop, string &buffer) const
Fill the buffer string with the sequence data for the interval [start, stop).
Definition: seq_vector.cpp:304
TObjectType * GetPointer(void) const THROWS_NONE
Get pointer,.
Definition: ncbiobj.hpp:1684
TObjectType * GetPointer(void) THROWS_NONE
Get pointer,.
Definition: ncbiobj.hpp:998
void Reset(void)
Reset reference object.
Definition: ncbiobj.hpp:773
CRange< TSeqPos > TSeqRange
typedefs for sequence ranges
Definition: range.hpp:419
static TThisType GetWhole(void)
Definition: range.hpp:272
#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 StringToBool(const CTempString str)
Convert string to bool.
Definition: ncbistr.cpp:2821
static const string BoolToString(bool value)
Convert bool to string.
Definition: ncbistr.cpp:2815
static string UIntToString(unsigned int value, TNumToStringFlags flags=0, int base=10)
Convert UInt to string.
Definition: ncbistr.hpp:5109
static bool EqualNocase(const CTempString s1, SIZE_TYPE pos, SIZE_TYPE n, const char *s2)
Case-insensitive equality of a substring with another string.
Definition: ncbistr.hpp:5353
@ fWithCommas
Use commas as thousands separator.
Definition: ncbistr.hpp:254
TTo GetTo(void) const
Get the To member data.
Definition: Range_.hpp:269
TFrom GetFrom(void) const
Get the From member data.
Definition: Range_.hpp:222
const TStr & GetStr(void) const
Get the variant data.
bool IsStr(void) const
Check if variant Str is selected.
Definition: Object_id_.hpp:291
const TData & GetData(void) const
Get the Data member data.
bool IsStr(void) const
Check if variant Str is selected.
const TStr & GetStr(void) const
Get the variant data.
Definition: Object_id_.hpp:297
const TType & GetType(void) const
Get the Type member data.
@ eLim_unk
unknown
Definition: Int_fuzz_.hpp:210
Tdata & Set(void)
Assign a value to data member.
bool IsRsite(void) const
Check if variant Rsite is selected.
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 IsPacked_pnt(void) const
Check if variant Packed_pnt is selected.
Definition: Seq_loc_.hpp:546
bool IsMap(void) const
Check if variant Map is selected.
Definition: Seq_ext_.hpp:330
const TUser & GetUser(void) const
Get the variant data.
Definition: Seqdesc_.cpp:384
const Tdata & Get(void) const
Get the member data.
Definition: Map_ext_.hpp:164
const TMap & GetMap(void) const
Get the variant data.
Definition: Seq_ext_.cpp:158
list< CRef< CSeq_feat > > Tdata
Definition: Map_ext_.hpp:89
const TExt & GetExt(void) const
Get the Ext member data.
Definition: Seq_inst_.hpp:838
bool CanGetExt(void) const
Check if it is safe to call GetExt method.
Definition: Seq_inst_.hpp:832
@ e_User
user defined object
Definition: Seqdesc_.hpp:124
@ eType_contamination
Definition: Seq_gap_.hpp:99
unsigned int
A callback function used to compare two keys in a database.
Definition: types.hpp:1210
int i
range(_Ty, _Ty) -> range< _Ty >
unsigned int a
Definition: ncbi_localip.c:102
T max(T x_, T y_)
T min(T x_, T y_)
USING_SCOPE(objects)
static const TModelUnit kGapBarHeight
static const string kColorGapsKey
static const int kBarHeight
static const string kDefProfile
static const string kShowLabelKey
static const int kSeqTooltipLength
CSequenceTrack.
static const string kBaseKey
extra parameter for initializing a track.
TAnnots m_Annots
particular annotations the track will be looking at.
SAnnotSelector –.
else result
Definition: token2.c:20
Modified on Wed Apr 24 14:17:24 2024 by modify_doxy.py rev. 669887