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

Go to the SVN repository for this file.

1 /* $Id: track_config_manager.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, Victor Joukov
27  *
28  */
29 
30 
31 #include <ncbi_pch.hpp>
32 
34 #include <gui/objects/TextBox.hpp>
36 
39 
41 //#include <gui/widgets/seq_graphic/seqgraphic_utils.hpp>
42 
64 
66 #include <gui/utils/track_info.hpp>
67 #include <gui/objutils/utils.hpp>
70 
71 #include <corelib/ncbi_url.hpp>
72 
73 #include <limits.h>
74 
77 
78 #define MAX_LEVEL numeric_limits<int>::max()
79 
80 
82 {
85 }
86 
87 
89 {
90  // register layout track factories
92  new CSequenceTrackFactory());
94  new CGeneModelFactory());
96  new CFeatureTrackFactory());
100  new CScaffoldTrackFactory());
102  new CComponentTrackFactory());
104  new CAlignmentTrackFactory());
106  new CGraphTrackFactory());
108  new CTrackContainerFactory());
110  new CGraphOverlayFactory());
120  new CVarTrackFactory());
122  new CVcfTrackFactory());
127 
128  // register data source extensions
130  new CSGSequenceDSType());
132  new CSGSegmentMapDSType());
134  new CSGFeatureDSType());
136  new CVcfFeatureDSType());
138  new CSGAlignmentDSType());
140  new CSGGraphDSType());
142  new CSGTraceGraphDSType());
144  new CFeaturePanelDSType());
146  new CSFTransDSType());
148  new CEpigenomicsDSType());
149 
150  // register non-ASN1 track data extensions
152  new CVcfTrackDataFactory());
153 
156 }
157 
158 
159 const ILayoutTrackFactory*
161 {
162  // dump all registered factories
163  /*
164  string sFactoriesList;
165  for(const auto& factory: m_Factories) {
166  sFactoriesList += ", " + factory.first;
167  }
168  cerr << sFactoriesList << endl;
169  */
170 // LOG_POST(Trace << "<<<< looking for factory for key: " << key);
172  if (f_iter != m_Factories.end()) {
173 // LOG_POST(Trace << ">>>> found at address: " << f_iter->second << ", factory class name: " << typeid(*f_iter->second).name());
174  return f_iter->second;
175  }
176 // LOG_POST(Trace << ">>>> not found");
177  return NULL;
178 }
179 
180 
181 list<string>
183 {
184  list<string> ttypes;
186  ttypes.push_back(it->first);
187  }
188  return ttypes;
189 }
190 
191 
192 void
194 {
195 
196  CDisplayOptionsBundle::TOptions& bundle_options = bundle.SetOptions();
197  CDisplayOptionsBundle::TTracks& bundle_tracks = bundle.SetTracks();
198 
200  if (f_iter == m_Factories.end()) return;
201  const ITrackConfigurable* factory = dynamic_cast<const ITrackConfigurable*>(f_iter->second.GetPointer());
202  if (factory) {
203  CRef<CTrackConfigSet> configs;
204  TKeyValuePairs settings;
205  configs = factory->GetSettings("Default", settings, nullptr);
206  ITERATE(CTrackConfigSet::Tdata, it, configs->Get()) {
207  CRef<CTrackConfig> config = *it;
208 
210  track->SetKey(key);
211  CDisplayTrack::TOptions& options = track->SetOptions();
212 
213  if (config->IsSetSubkey()) {
214  track->SetSubkey(config->GetSubkey());
215  }
216  if (config->IsSetHelp()) {
217  track->SetHelp(config->GetHelp());
218  }
219  if (config->IsSetLegend_text()) {
220  track->SetLegend_text(config->GetLegend_text());
221  }
222  if (config->IsSetChoice_list()) {
223  ITERATE(CTrackConfig::TChoice_list, it, config->GetChoice_list()) {
224  const CChoice& choice = **it;
226  option->SetType("enum");
227  option->SetKey(choice.GetName());
228  // label
229  if (choice.IsSetDisplay_name()) {
230  option->SetLabel(choice.GetDisplay_name());
231  }
232  // help
233  if (choice.IsSetHelp()) {
234  option->SetHelp(choice.GetHelp());
235  }
236  if (choice.IsSetOptional()) {
237  option->SetOptional(choice.GetOptional());
238  }
239 
240  if (choice.IsSetConditions()) {
241  for (const auto& c : choice.GetConditions()) {
242  auto cond = Ref(new CConditional);
243  cond->Assign(*c);
244  option->SetConditions().push_back(cond);
245  }
246  }
247 
248  CDisplayOption::TValues& values = option->SetValues();
249  ITERATE(CChoice::TValues, it1, choice.GetValues()) {
250  const CChoiceItem& item = **it1;
252  value->SetKey(item.GetName());
253  if (item.IsSetDisplay_name()) {
254  value->SetLabel(item.GetDisplay_name());
255  }
256  if (item.IsSetHelp()) {
257  value->SetHelp(item.GetHelp());
258  }
259  if (item.IsSetLegend_text()
260  && !item.GetLegend_text().empty()) {
261  value->SetLegend(item.GetLegend_text());
262  }
263  if (item.IsSetOptional()) {
264  value->SetOptional(item.GetOptional());
265  }
266  values.push_back(value);
267  }
268  option->SetDflt(choice.GetCurr_value());
269  int optnum = static_cast<int>(bundle_options.size());
270  options.push_back(optnum);
271  bundle_options.push_back(option);
272  }
273  }
274  if (config->IsSetCheck_boxes()) {
275  ITERATE(CTrackConfig::TCheck_boxes, it, config->GetCheck_boxes()) {
276  const CCheckBox& check_box = **it;
278  option->SetType("bool");
279  option->SetKey(check_box.GetName());
280  // label
281  if (check_box.IsSetDisplay_name()) {
282  option->SetLabel(check_box.GetDisplay_name());
283  }
284  // help
285  if (check_box.IsSetHelp()) {
286  option->SetHelp(check_box.GetHelp());
287  }
288  if (check_box.IsSetOptional()) {
289  option->SetOptional(check_box.GetOptional());
290  }
291 
292  if (check_box.IsSetConditions()) {
293  for (const auto& c : check_box.GetConditions()) {
294  auto cond = Ref(new CConditional);
295  cond->Assign(*c);
296  option->SetConditions().push_back(cond);
297  }
298  }
299 
300  // legend ?? add to DisplayOption
301  option->SetDflt(check_box.GetValue() ? "true" : "false");
302  int optnum = static_cast<int>(bundle_options.size());
303  options.push_back(optnum);
304  bundle_options.push_back(option);
305  }
306  }
307  if (config->IsSetText_boxes()) {
308  ITERATE(CTrackConfig::TText_boxes, it, config->GetText_boxes()) {
309  const CTextBox& text_box = **it;
311  option->SetType("text");
312  option->SetKey(text_box.GetName());
313  // label
314  if (text_box.IsSetDisplay_name()) {
315  option->SetLabel(text_box.GetDisplay_name());
316  }
317  // help
318  if (text_box.IsSetHelp()) {
319  option->SetHelp(text_box.GetHelp());
320  }
321 
322  if (text_box.IsSetOptional()) {
323  option->SetOptional(text_box.GetOptional());
324  }
325 
326  if (text_box.IsSetConditions()) {
327  for (const auto& c : text_box.GetConditions()) {
328  auto cond = Ref(new CConditional);
329  cond->Assign(*c);
330  option->SetConditions().push_back(cond);
331  }
332  }
333 
334  // legend ?? add to DisplayOption
335  option->SetDflt(text_box.GetValue());
336  int optnum = static_cast<int>(bundle_options.size());
337  options.push_back(optnum);
338  bundle_options.push_back(option);
339  }
340  }
341  if (config->IsSetRange_controls()) {
342  for (const auto& rc : config->GetRange_controls()) {
344  option->SetType("object");
345  string name;
346  if (rc->CanGetName())
347  name = rc->GetName();
348  if (!NStr::EndsWith(name, "range", NStr::eNocase))
349  name += "range";
350  option->SetKey(name);
351  if (rc->IsSetDisplay_name())
352  option->SetLabel(rc->GetDisplay_name());
353  if (rc->IsSetHelp())
354  option->SetHelp(rc->GetHelp());
355  if (rc->IsSetConditions()) {
356  for (const auto& c : rc->GetConditions()) {
357  auto cond = Ref(new CConditional);
358  cond->Assign(*c);
359  option->SetConditions().push_back(cond);
360  }
361  }
362  if (rc->IsSetOptional()) {
363  option->SetOptional(rc->GetOptional());
364  }
365  int optnum = static_cast<int>(bundle_options.size());
366  options.push_back(optnum);
367  bundle_options.push_back(option);
368  }
369  }
370 
371  if (config->IsSetHidden_settings()) {
372  ITERATE(CTrackConfig::THidden_settings, it, config->GetHidden_settings()) {
373  const CHiddenSetting& hs = **it;
375  option->SetType("hidden");
376  option->SetKey(hs.GetName());
377  option->SetDflt(hs.GetValue());
378  int optnum = static_cast<int>(bundle_options.size());
379  options.push_back(optnum);
380  bundle_options.push_back(option);
381  }
382  }
383  bundle_tracks.push_back(track);
384  }
385  }
386 }
387 
388 
390 CTrackConfigManager::GetTrackDisplayOptions(const list<string>& keys) const
391 {
393  ITERATE(list<string>, it, keys) {
394  x_AppendKeyDisplayOptions(*it, *bundle);
395  }
396  return bundle;
397 }
398 
399 
402 {
403  if (level == -1) level = 0;
405  if (iter == m_KnownAnnots.end()) {
406  level = MAX_LEVEL;
407  iter = m_KnownAnnots.find(level);
408  _ASSERT(iter != m_KnownAnnots.end());
409  }
410 
411  return iter->second;
412 }
413 
414 
416  const CTempTrackProxy* t_proxy,
417  const string& track_name) const
418 {
419  bool is_naa = CSeqUtils::IsNAA(track_name);
420 
421  if ( p_proxy->GetShown() ) {
422  if (is_naa) {
423  const CTrackProxy* temp_proxy =
424  dynamic_cast<const CTrackProxy*>(p_proxy);
425  if (temp_proxy) {
426  const CTrackProxy::TAnnots& annots = temp_proxy->GetAnnots();
427  if (find(annots.begin(), annots.end(), track_name) != annots.end() ||
428  (!annots.empty() && annots.front() == "NA*")) {
429  return true;
430  }
431  }
432  } else {
433  if (nullptr != t_proxy)
434  return t_proxy->GetShown();
435  return true;
436  }
437  }
438 
439  return false;
440 }
441 
442 
444 {
445  // sort the tracks according to the order of both
446  // annotation list in the track proxy and NAAs.
447  // if there is any conflict, the former order is prefered.
448  // we only sort the tracks under some special cases,
449  // mainly for cgi mode, to avoid frustrating users.
450  // annot list contain more than one annot and at least
451  // one of them is NAA, or NAAs is not empty.
452  CTrackContainer* con_track =
453  dynamic_cast<CTrackContainer*>(t_proxy->GetTrack());
454  if ( !con_track || con_track->GetSubtrackProxies().size() < 2 ) {
455  return; // no need to sort
456  }
457 
458  typedef pair<string, bool> TAnnotStatus;
459  list<TAnnotStatus> all_tracks;
460 
461  // honor the track order in track's annot list over m_NAAs list
462  const CTrackProxy* full_track = dynamic_cast<const CTrackProxy*>(t_proxy);
463  if (full_track) {
464  ITERATE (CTrackProxy::TAnnots, iter, full_track->GetAnnots()) {
465  string name = *iter;
468  if (type == CSeqUtils::eAnnot_Other ||
470  NStr::ReplaceInPlace(name, ".", "_");
471  all_tracks.push_back(TAnnotStatus(name, false));
472  }
473  }
474  }
475 
476  if ( !all_tracks.empty() ) {
477  // If no specific order has been specified for Unnamed annotatioin,
478  // we always put it as the first track
479  list<TAnnotStatus>::iterator t_iter = all_tracks.begin();
480  while (t_iter != all_tracks.end() && !CSeqUtils::IsUnnamed(t_iter->first)) {
481  ++t_iter;
482  }
483  if (t_iter == all_tracks.end()) {
484  all_tracks.push_front(TAnnotStatus(CSeqUtils::GetUnnamedAnnot(), false));
485  }
486 
487  vector<int> old_orders;
488 
489  // mark the tracks that are in track container and save there old orders
490  ITERATE (TTrackProxies, iter, con_track->GetSubtrackProxies()) {
491  const string& name = (*iter)->GetName();
492  NON_CONST_ITERATE (list<TAnnotStatus>, tt_iter, all_tracks) {
493  if (tt_iter->first == name) {
494  old_orders.push_back((*iter)->GetOrder());
495  tt_iter->second = true;
496  break;
497  }
498  }
499  }
500 
501  // remove the tracks that are not in track container from all_tracks
502  t_iter = all_tracks.begin();
503  while (t_iter != all_tracks.end()) {
504  if ( !t_iter->second ) {
505  t_iter = all_tracks.erase(t_iter);
506  } else {
507  ++t_iter;
508  }
509  }
510 
511  if (all_tracks.size() > old_orders.size()) {
512  all_tracks.pop_front();
513  }
514 
515  NON_CONST_ITERATE (TTrackProxies, iter, con_track->GetSubtrackProxies()) {
516  int idx = 0;
517  t_iter = all_tracks.begin();
518  while (t_iter != all_tracks.end() &&
519  t_iter->first != (*iter)->GetName()) {
520  ++idx;
521  ++t_iter;
522  }
523  if (t_iter != all_tracks.end()) {
524  (*iter)->SetOrder(old_orders[idx]);
525  }
526  }
528  con_track->SortChildTracksByOrder();
529  }
530 }
531 
532 static
533 void s_ParseOptionalSettings(const string& optional_settings, set<string>& options2hide, set<string>& options2show)
534 {
535  vector<string> key_values;
536  CTrackUtils::TokenizeWithEscape(optional_settings, ",", key_values, true);
537  for (const auto& opt : key_values) {
538  if (opt.empty())
539  continue;
540  try {
541  if (NStr::StartsWith(opt, "-")) {
542  options2hide.insert(opt.substr(1));
543  } else if (NStr::StartsWith(opt, "+")) {
544  options2show.insert(opt.substr(1));
545  } else {
546  options2show.insert(opt);
547  }
548  } catch (exception& e) {
549  ERR_POST(Error << e.what());
550  }
551  }
552 }
553 
554 /// help struct for storing track settings
556 {
557  typedef vector<STrackSettings> TTrackConfig;
559  typedef vector<string> TSubTracks;
560 
561  static void ParseSettings(
562  const CTrackConfigManager::TTrackSettingsSet& settings_set,
564  {
565  ITERATE (CTrackConfigManager::TTrackSettingsSet, iter, settings_set) {
566  const CTrackConfigManager::TTrackSettings& track = *iter;
568  if (s_iter == iter->end()) continue;
569 
570  STrackSettings settings;
571  s_iter = track.begin();
572  while (s_iter != track.end()) {
573  const string& k_str = s_iter->first;
574  if (NStr::EqualNocase(k_str, "key")) {
575  settings.m_Key = s_iter->second;
576  } else if (NStr::EqualNocase(k_str, "original_key")) {
577  settings.m_OriginalKey = s_iter->second;
578  } else if (NStr::EqualNocase(k_str, "subkey")) {
579  settings.m_Subkey = s_iter->second;
580  } else if (NStr::EqualNocase(k_str, "name")) {
581  settings.m_Name = CTrackUtils::RemoveEscape(s_iter->second);
582  } else if (NStr::EqualNocase(k_str, "id")) {
583  settings.m_Id = CTrackUtils::RemoveEscape(s_iter->second);
584  } else if (NStr::EqualNocase(k_str, "dbname")) {
585  settings.m_DB = s_iter->second;
586  } else if (NStr::EqualNocase(k_str, "data_key")) {
587  settings.m_DataKey = s_iter->second;
588  } else if (NStr::EqualNocase(k_str, "order")) {
589  try {
590  settings.m_Order = NStr::StringToInt(s_iter->second);
591  } catch (CException&) {
592  // ignore
593  }
594  } else if (NStr::EqualNocase(k_str, "shown")) {
595  try {
596  settings.m_Shown = NStr::StringToBool(s_iter->second);
597  } catch (CException&) {
598  // ignore
599  }
600  } else if (NStr::EqualNocase(k_str, "category")) {
601  settings.m_Category = s_iter->second;
602  } else if (NStr::EqualNocase(k_str, "subcategory")) {
603  settings.m_Subcategory = s_iter->second;
604  } else if (NStr::EqualNocase(k_str, "setting_group")) {
605  vector<string> tokens;
606  CTrackUtils::TokenizeWithEscape(s_iter->second, "|", tokens, true);
607  if (tokens.size() > 0) {
608  settings.m_SettingGroup = NStr::TruncateSpaces(tokens[0]);
609  if (tokens.size() > 1) {
610  try {
611  settings.m_UseGroupDefault =
613  } catch (CException&) {
614  // ignore it
615  }
616  }
617  }
618  } else if (NStr::EqualNocase(k_str, "filter")) {
619  settings.m_Filter = s_iter->second;
620  } else if (NStr::EqualNocase(k_str, "sort_by")) {
621  settings.m_SortBy = s_iter->second;
622  } else if (NStr::EqualNocase(k_str, "display_name")) {
623  settings.m_DispName = CTrackUtils::RemoveEscape(s_iter->second);
624  } else if (NStr::EqualNocase(k_str, "annots")) {
625  CTrackUtils::TokenizeWithEscape(s_iter->second, "|", settings.m_Annots, true);
626  } else if (NStr::EqualNocase(k_str, "comments")) {
627  settings.m_Comments = s_iter->second;
628  } else if (NStr::EqualNocase(k_str, "highlights")) {
629  settings.m_Highlights = s_iter->second;
630  } else if (NStr::EqualNocase(k_str, "highlights_color")) {
631  settings.m_HighlightsColor = s_iter->second;
632  } else if (NStr::EqualNocase(k_str, "help")) {
633  settings.m_Help = s_iter->second;
634  } else if (NStr::EqualNocase(k_str, "show_title")) {
635  try {
636  settings.m_ShowTitle = NStr::StringToBool(s_iter->second);
637  } catch (CException&) {
638  // ignore
639  }
640  } else if (NStr::EqualNocase(k_str, "is_private")) {
641  try {
642  settings.m_isPrivate = NStr::StringToBool(s_iter->second);
643  } catch (CException&) {
644  // ignore
645  }
646  } else if (NStr::EqualNocase(k_str, "remote_data")) {
647  settings.m_RemoteData = s_iter->second;
648  } else if (NStr::EqualNocase(k_str, "seq_data_key")) {
649  settings.m_SeqDataKey = s_iter->second;
650  } else if (NStr::EqualNocase(k_str, "stored_scale") || NStr::EqualNocase(k_str, "is_scaled")) {
651  settings.m_StoredScale = s_iter->second;
652  settings.m_Profile["stored_scale"] = s_iter->second;
653  } else if (NStr::EqualNocase(k_str, "subtracks")) {
654  CTrackUtils::TokenizeWithEscape(s_iter->second, "|", settings.m_SubTracks, true);
655  } else if (NStr::EqualNocase(k_str, "uid")) {
656  settings.m_UId = s_iter->second;
657  } else if (NStr::EqualNocase(k_str, "batch")) {
658  settings.m_Batch = s_iter->second;
659  } else if (NStr::EqualNocase(k_str, "is_source_assembly_query")) {
660  settings.m_sExtraInfo += string(settings.m_sExtraInfo.empty() ? "" : ";") + k_str + string("=") + s_iter->second;
661  } else if (NStr::EqualNocase(k_str, "remote_path")) {
662  settings.m_RemotePath = s_iter->second;
663  } else if (NStr::EqualNocase(k_str, "rmt_mapped_id")) {
664  settings.m_RemoteId = s_iter->second;
665  } else if (NStr::EqualNocase(k_str, "big_data_index")) {
666  settings.m_BigDataIndex = s_iter->second;
667  } else if (NStr::EqualNocase(k_str, "hub_id")) {
668  settings.m_HubId = s_iter->second;
669  } else if (NStr::EqualNocase(k_str, "optional_settings")) {
670  s_ParseOptionalSettings(s_iter->second, settings.m_Options2Hide, settings.m_Options2Show);
671  }
673  try {
674  settings.m_ErrorStatus.m_ErrorSeverity = NStr::StringToInt(s_iter->second);
675  } catch (CException&) { /* ignore*/ }
677  try {
678  settings.m_ErrorStatus.m_ErrorCode = NStr::StringToInt(s_iter->second);
679  } catch (CException&) { /* ignore*/ }
681  settings.m_ErrorStatus.m_ShortErrorMsg = s_iter->second;
683  settings.m_ErrorStatus.m_ErrorMsg = s_iter->second;
684  } else {
685  settings.m_Profile[k_str] = s_iter->second;
686  }
687  ++s_iter;
688  }
689  config.push_back(settings);
690  }
691  }
692 
693  static string CreateProfileString(const TProfile& profile)
694  {
695  string profile_str = kEmptyStr;
696  bool first = true;
697  ITERATE (TProfile, iter, profile) {
699  // skip temporary/internal profile strings
700  continue;
701  }
702  if (first) first = false;
703  else profile_str += ",";
704  profile_str += iter->first + ":" + iter->second;
705  }
706  return profile_str;
707  }
708 
709 
710  string m_Key;
712  string m_Subkey;
713  string m_Name;
714  string m_Id;
715  string m_DB;
716  string m_DataKey;
717  string m_Category;
720  bool m_UseGroupDefault = false;
721  string m_Filter;
722  string m_SortBy;
723  string m_DispName;
724  int m_Order = -1;
725  bool m_Shown = true;
726  string m_Help;
727 
730  string m_Comments;
731  string m_Highlights;
733  bool m_ShowTitle = true;
735  bool m_isPrivate = false;
738  string m_UId;
739  string m_Batch;
740  string m_RemotePath;
741  string m_sExtraInfo;
742  string m_RemoteData;
743  string m_RemoteId;
744  string m_SeqDataKey;
746  string m_HubId;
749 };
750 
751 
752 static
753 bool s_IsStdTrack(const string& track_id)
754 {
756 }
757 
758 /// The matching logic is 'vague' due to the fact that the
759 /// user-provided 'tracks' may be ambiguous. For example,
760 /// only the track type (and subtype) is specified. We need to
761 /// consider several information to decide if two tracks match.
762 /// @param exact_annot_match if true, the two tracks must show
763 /// the exactly same set of annotations in order to match. Otherwise,
764 /// the two tracks will be considered as 'matched' if src_track
765 /// has no annotatioin specified.
766 static bool s_TrackMatch(
767  const STrackSettings& src_track,
768  const CTempTrackProxy& target_track,
769  bool exact_annot_match = true)
770 {
771  const CTrackProxy* t_track = dynamic_cast<const CTrackProxy*>(&target_track);
772  if ( !t_track ) return false;
773 
774  // special hook for a breakpoint
775 // if(t_track->GetId() == "T1472211" && src_track.m_Id == t_track->GetId()) {
776 // cerr << "T1472211" << endl;
777 // }
778 
779  if (!src_track.m_Id.empty() && (!t_track->GetId().empty() || !s_IsStdTrack(src_track.m_Id))) {
780  // if track id is not "[R]STD", it's a TMS based id and is a unique track identifier
781  // Ignore the annotation field.
782  if (t_track->GetId() != src_track.m_Id)
783  return false;
784 
785  if (!src_track.m_Filter.empty()) {
786  if (t_track->GetFilter() != src_track.m_Filter)
787  return false;
788  }
789 
790  if (!src_track.m_Key.empty()) {
791  if (t_track->GetKey() != src_track.m_Key)
792  return false;
793  }
794 
795  return true;
796  }
797 
798  if ( !src_track.m_Name.empty() ) {
799  // Track name used to be a unique identifier before ID was introduced.
800  // Ignore the annotation field.
801  return src_track.m_Name == t_track->GetName();
802  }
803 
804  if (src_track.m_Key == t_track->GetKey() && src_track.m_Subkey == t_track->GetSubkey()) {
805  if ( !exact_annot_match && src_track.m_Annots.empty()) {
806  return true;
807  }
808 
809  // otherwise the annotations specified have to be completely matched
810  if (src_track.m_Annots.size() == t_track->GetAnnots().size()) {
811  CTrackProxy::TAnnots annots1 = src_track.m_Annots;
812  CTrackProxy::TAnnots annots2 = t_track->GetAnnots();
813  std::sort(annots1.begin(), annots1.end());
814  std::sort(annots2.begin(), annots2.end());
815  return std::equal(annots1.begin(), annots1.end(), annots2.begin());
816  }
817  }
818  return false;
819 }
820 
821 
822 /// Helper function to find a matched track from a list of tracks
823 /// for a given source track. It returns the first that makes
824 /// the exact match.
825 static CTrackConfigManager::TTrackProxies::iterator
828 {
829  CTrackConfigManager::TTrackProxies::iterator iter = track_list.begin();
830  for(; iter != track_list.end(); ++iter) {
831 // cerr << "Matching " << src_track.m_Id << "/" << src_track.m_Key << "/" << src_track.m_Subkey << "/" << src_track.m_Filter << "/ and " <<
832 // (*iter)->GetId() << "/" << (*iter)->GetKey() << "/" << (*iter)->GetSubkey() << "/" << (*iter)->GetFilter() << "/" << endl;
833  if (s_TrackMatch(src_track, **iter, true)) break;
834  }
835  return iter;
836 }
837 
838 
839 
841  CTrackProxy& track, const STrackSettings& s,
842  int order, bool update_annots = true)
843 {
844  if (!s.m_Name.empty()) {
845  track.SetName(s.m_Name);
846  }
847  // update other feature list
848  if (track.GetOrder() < 0 && !s.m_Subkey.empty()) {
849  track.SetSubkey(s.m_Subkey);
850  // assign a name if in case it is not named.
851  if (track.GetName().empty()) {
852  track.SetName(s.m_Subkey);
853  }
854  }
855 
856  track.SetShown(s.m_Shown);
857  if (order >= 0) {
858  track.SetOrder(order);
859  }
860  if (!s.m_Help.empty()) {
861  track.SetHelp(s.m_Help);
862  }
863  track.SetKey(s.m_Key);
864  track.SetOriginalKey(s.m_OriginalKey);
865  if (!s.m_Profile.empty()) {
867  }
868  if (update_annots && !s.m_Annots.empty()) {
869  track.SetAnnots(s.m_Annots);
870  }
871  track.SetErrorStatus(s.m_ErrorStatus);
872  if (!s.m_Category.empty()) {
873  track.SetCategory(s.m_Category);
874  }
875  if (!s.m_Subcategory.empty()) {
876  track.SetSubcategory(s.m_Subcategory);
877  }
878  if (!s.m_SettingGroup.empty()) {
880  }
882 
883  if (!s.m_Filter.empty()) {
884  track.SetFilter(s.m_Filter);
885  }
886  if (!s.m_SortBy.empty()) {
887  track.SetSortBy(s.m_SortBy);
888  }
889  if (!s.m_DispName.empty()) {
890  track.SetDisplayName(s.m_DispName);
891  }
892  if (!s.m_Id.empty()) {
893  track.SetId(s.m_Id);
894  }
895  if (!s.m_DB.empty()) {
896  track.SetDB(s.m_DB);
897  }
898  if (!s.m_DataKey.empty()) {
899  track.SetDataKey(s.m_DataKey);
900  }
901 
902  track.SetComments(s.m_Comments);
903  track.SetHighlights(s.m_Highlights);
905  track.SetShowTitle(s.m_ShowTitle);
906  track.SetIsPrivate(s.m_isPrivate);
907  track.SetStoredScale(s.m_StoredScale);
908  track.SetUId(s.m_UId);
909  track.SetSubTracks() = s.m_SubTracks;
910  track.SetBatch(s.m_Batch);
911  track.SetExtraInfo(s.m_sExtraInfo);
912  track.SetRemotePath(s.m_RemotePath);
913 
914  if (!s.m_RemoteData.empty()) {
915  track.SetRemoteData(s.m_RemoteData);
916  }
917  if (!s.m_RemoteId.empty()) {
918  track.SetRemoteId(s.m_RemoteId);
919  }
920  if (!s.m_SeqDataKey.empty()) {
921  track.SetSeqDataKey(s.m_SeqDataKey);
922  }
923  if (!s.m_BigDataIndex.empty()) {
925  }
926  if (!s.m_HubId.empty()) {
927  track.SetHubId(s.m_HubId);
928  }
929 
932 }
933 
934 
935 //
936 //subtrackid format ID_x
937 // where x is
938 // 's' shown
939 // 'h' hidden
940 // 'm' marked/highlighted
941 
942 static void s_ParseSubTrackId(const string& subtrack_id, string& track_id, string& track_attr)
943 {
944  size_t pos = subtrack_id.find_last_of('_');
945  if (pos != string::npos) {
946  track_id = subtrack_id.substr(0, pos);
947  track_attr = subtrack_id.substr(pos + 1);
948  } else {
949  track_id = subtrack_id;
950  track_attr.clear();
951  }
952 }
953 
955 {
956  // build indexes
957  NON_CONST_ITERATE(TTrackProxies, iter, t_settings) {
958  CTrackProxy* track = dynamic_cast<CTrackProxy*>(iter->GetPointer());
959  if (!track->GetId().empty()) {
960  m_IdIndex.emplace(track->GetId(), track);
961  }
962  if (!track->GetAnnots().empty()) {
963  m_AnnotIndex.emplace(track->GetAnnots().front(), track);
964  }
965  if (!track->GetUId().empty()) {
966  m_UidIndex.emplace(track->GetUId(), track);
967  }
968  }
969 }
970 
972 {
973  string tr_id = track_id;
974  size_t pos = track_id.find_last_of('_');
975  if (pos != string::npos)
976  tr_id = track_id.substr(0, pos);
977 
978  auto it = m_IdIndex.find(tr_id);
979  if (it != m_IdIndex.end())
980  return Ref(it->second);
981  it = m_AnnotIndex.find(tr_id);
982  if (it != m_AnnotIndex.end())
983  return Ref(it->second);
984  it = m_UidIndex.find(tr_id);
985  if (it != m_UidIndex.end())
986  return Ref(it->second);
987  return CRef<CTrackProxy>(0);
988 
989 }
990 
991 // currently relevant for graph overlays only
993 {
994  vector<CTrackProxy*> overlays;
996  CTrackProxy* track = dynamic_cast<CTrackProxy*>(iter->GetPointer());
997  if (track->GetKey() == "graph_overlay") {
998  overlays.push_back(track);
999  }
1000  }
1001  if (overlays.empty())
1002  return;
1003  CTrackConfigManager::CTrackIndex track_index(t_settings);
1004  NON_CONST_ITERATE (vector<CTrackProxy*>, parent_it, overlays) {
1005  (*parent_it)->GetChildren().clear();
1006  ITERATE(CTrackProxy::TSubTracks, subtr_it, (*parent_it)->GetSubTracks()) {
1007  string track_id, track_attr;
1008  s_ParseSubTrackId(*subtr_it, track_id, track_attr);
1009  auto t_proxy = track_index.FindTrackById(track_id);
1010  if (t_proxy) {
1011  CRef<CTempTrackProxy> subtrack_proxy(new CTrackProxy(*t_proxy));
1012  subtrack_proxy->SetShown(track_attr != "hidden");
1013  subtrack_proxy->SetUId(*subtr_it);
1014  if (subtrack_proxy->GetSource().empty()) {
1015  subtrack_proxy->SetSource(NStr::Join(t_proxy->GetAnnots(), "-"));
1016  }
1017  (*parent_it)->GetChildren().push_back(subtrack_proxy);
1018  }
1019  }
1020  }
1021 }
1022 
1023 
1024 
1025 
1027  const TTrackSettingsSet& in_settings)
1028 {
1029  // in_settings: the input track list (and settings) that we want
1030  // to apply to the existing track list
1031  // t_settings: an existing track list which we want to update
1032 
1033  // what we want to achieve:
1034  // 1. only show the tracks presented in the in_settings
1035  // 2. keep the original settings not presented in the input track
1036  // settings for a given track
1037  // 3. insert the tracks not present in the original track list
1038  // 4. show them in the order presented in the input list
1039  //
1040  // what we will do to achieve above:
1041  // 1. Reset the track on/off state
1042  // 2. Update the track settings in the original track list that
1043  // also present in the input track list. The potential updated
1044  // settings include track on/off state, annot list, and
1045  // track-specific settings. Track order is not updated at
1046  // this point.
1047  // Put the tracks that present in both the input track list and
1048  // the original track list in a new list acording to the track
1049  // order in the input track list. For track that presents only
1050  // in the input track list, create a track proxy for them and
1051  // add them into the bottom of the oringal track list, and put
1052  // it in the newly created track list accordingly.
1053  // 3. Go through the updated original track list, create a order list
1054  // for the tracks that are set to on.
1055  // 4. Go through the newly created track list, update the track
1056  // order ids using the stored order list.
1057  // 5. Sort the tracks.
1058 
1059  // first, turn all track off
1060  NON_CONST_ITERATE (TTrackProxies, iter, t_settings) {
1061  (*iter)->SetShown(false);
1062  }
1063 
1065  STrackSettings::ParseSettings(in_settings, config);
1067  int last_id = t_settings.back()->GetOrder();
1068 
1069  // second, update the track settings
1070  TTrackProxies show_list;
1072 // cerr << "CTrackConfigManager::AlignTrackConfig()" << endl;
1073  TTrackProxies::iterator t_iter = s_FindMatchedTrack(*iter, t_settings);
1074 
1075  CRef<CTrackProxy> track;
1076  int order = -1;
1077  if (t_iter != t_settings.end()) {
1078 // cerr << "yesmatch!" << endl;
1079  track.Reset(dynamic_cast<CTrackProxy*>(t_iter->GetPointer()));
1080  } else {
1081 // cerr << "nomatch!" << endl;
1082  track.Reset(new CTrackProxy());
1083  t_settings.push_back(CRef<CTempTrackProxy>(track.GetPointer()));
1084  if (iter->m_Order >= 0) {
1085  order = iter->m_Order;
1086  } else {
1087  order = ++last_id;
1088  }
1089  }
1090  s_InitTrackFromSettings(*track, *iter, order);
1091 
1092  if (iter->m_Shown) {
1093  show_list.push_back(CRef<CTempTrackProxy>(track.GetPointer()));
1094  }
1095  }
1096 
1097  vector<int> order_list;
1098  NON_CONST_ITERATE (TTrackProxies, iter, t_settings) {
1099  CTrackProxy* track = dynamic_cast<CTrackProxy*>(iter->GetPointer());
1100  if (track->GetShown()) {
1101  order_list.push_back(track->GetOrder());
1102  }
1103  }
1104 
1105  // make sure track order in both the input tracks and original track
1106  // settings are preserved in favor of input tracks order if there is a conflict.
1107  _ASSERT(order_list.size() == show_list.size());
1108  size_t idx = 0;
1109  NON_CONST_ITERATE (TTrackProxies, iter, show_list) {
1110  (*iter)->SetOrder(order_list[idx++]);
1111  }
1112 
1113  // sort the tracks
1115 
1116  s_ResolveSubTracks(t_settings);
1117 
1118 }
1119 
1121  const TTrackSettingsSet& in_settings,
1122  EAnnotMerge merge)
1123 {
1125  STrackSettings::ParseSettings(in_settings, config);
1127  int last_id = t_settings.back()->GetOrder();
1128 
1130 // cerr << "CTrackConfigManager::MergeTrackConfig()" << endl;
1131  TTrackProxies::iterator t_iter = s_FindMatchedTrack(*iter, t_settings);
1132 
1133  CRef<CTrackProxy> track;
1134  int order = -1;
1135  if (t_iter != t_settings.end()) {
1136 // cerr << "yesmatch!" << endl;
1137  track.Reset(dynamic_cast<CTrackProxy*>(t_iter->GetPointer()));
1138  } else {
1139 // cerr << "nomatch!" << endl;
1140  track.Reset(new CTrackProxy());
1141  t_settings.push_back(CRef<CTempTrackProxy>(track.GetPointer()));
1142  if (iter->m_Order >= 0) {
1143  order = iter->m_Order;
1144  } else {
1145  order = ++last_id;
1146  }
1147  }
1148  bool was_on = track->GetShown();
1149  s_InitTrackFromSettings(*track, *iter, order, false);
1150 
1151  if ( !iter->m_Annots.empty() ) {
1152  if (merge == eAnnot_Merge) {
1153  if ( !was_on ) {
1154  track->SetAnnots(iter->m_Annots);
1155  } else if (!track->GetAnnots().empty() ) {
1156  CTrackProxy::TAnnots annots = track->GetAnnots();
1157  copy(iter->m_Annots.begin(), iter->m_Annots.end(), back_inserter(annots));
1158  track->SetAnnots(annots);
1159  } else {
1160  track->SetAnnots(iter->m_Annots);
1161  }
1162  } else if (merge == eAnnot_Replace) {
1163  track->SetAnnots(iter->m_Annots);
1164  }
1165  }
1166  }
1167  s_ResolveSubTracks(t_settings);
1168 }
1169 
1170 
1172  const TTrackSettingsSet& in_settings,
1173  int order_offset)
1174 {
1175  // what we want to achieve:
1176  // 1. only show the tracks presented
1177  // 2. keep the original settings not presented in the track
1178  // settings for a given track
1179  // 3. show them in the order presented in the input list
1180  //
1181  // what we will do to achieve above:
1182  // 1. Reset the track order ids with a large number (max_id)
1183  // 2. Replace the track settings for a given track (in order)
1184  // from the input in_settings. The track order will
1185  // be the sequence order number in the list
1186  // 3. Sort the tracks by order
1187  // 4. Remove all tracks whose track order is equal to the max_order
1188 
1189 
1190  const int max_order = INT_MAX;
1191 
1192  // reset track order
1193  NON_CONST_ITERATE (TTrackProxies, iter, t_settings) {
1194  (*iter)->SetOrder(max_order);
1195  }
1196 
1197  // replace the track settings
1198  int order = order_offset;
1200  STrackSettings::ParseSettings(in_settings, config);
1202  if (order == max_order)
1203  break;
1204 // cerr << "CTrackConfigManager::SetTrackConfig()" << endl;
1205  TTrackProxies::iterator t_iter = s_FindMatchedTrack(*iter, t_settings);
1206 
1207  CRef<CTrackProxy> track;
1208  if (t_iter != t_settings.end()) {
1209 // cerr << "yesmatch!" << endl;
1210  track.Reset(dynamic_cast<CTrackProxy*>(t_iter->GetPointer()));
1211  } else {
1212 // cerr << "nomatch!" << endl;
1213  track.Reset(new CTrackProxy());
1214  t_settings.push_back(CRef<CTempTrackProxy>(track.GetPointer()));
1215  }
1216  s_InitTrackFromSettings(*track, *iter, order++);
1217  }
1218 
1219  // sort the tracks
1221  // remove the rest of tracks
1222  TTrackProxies::iterator t_iter = t_settings.begin();
1223  while (t_iter != t_settings.end() && (*t_iter)->GetOrder() < max_order) {
1224  ++t_iter;
1225  }
1226  t_settings.erase(t_iter, t_settings.end());
1227 
1228  s_ResolveSubTracks(t_settings);
1229 
1230 }
1231 
1232 void CTrackConfigManager::CreateDisplayName(const CAnnotMetaData* metadata, const CTempTrackProxy& temp_proxy, string& display_name) const
1233 {
1234 
1235  const string& annot_name = temp_proxy.GetSource();
1236 
1237  // get annotation meta-data if exists
1238  const CAnnotMetaData* meta_data = metadata;
1239  if (meta_data == 0) {
1241  TAnnotMetaDataList::const_iterator iter = md_list.find(annot_name);
1242  if (iter != md_list.end()) {
1243  meta_data = iter->second;
1244  }
1245  }
1246 
1247  if (!temp_proxy.GetDisplayName().empty()) {
1248  display_name = temp_proxy.GetDisplayName();
1249  } else if (meta_data && !meta_data->m_Title.empty()) {
1250  display_name = meta_data->m_Title;
1251  } else if (!CSeqUtils::IsUnnamed(annot_name)) {
1252  if (annot_name.find(display_name) != string::npos) {
1253  display_name = annot_name;
1254  } else if (display_name.find(annot_name) == string::npos) {
1255  // prevent ugly names starting with "SV-Anon" from appearing
1257  display_name.clear();
1258  }
1259  if (!display_name.empty())
1260  display_name += " - ";
1261  display_name += annot_name;
1262  }
1263  }
1264  if (!NStr::StartsWith(display_name, "(H)") && !NStr::StartsWith(display_name, "(R)") && !NStr::StartsWith(display_name, "(U)")) {
1265  if (NStr::StartsWith(temp_proxy.GetId(), 'R')) {
1266  display_name = "(R) " + display_name;
1267  }
1268  else if (NStr::StartsWith(temp_proxy.GetId(), 'U')) {
1269  display_name = "(U) " + display_name;
1270  }
1271  else {
1272  for (const auto &annot : temp_proxy.GetAnnots()) {
1273  if (!NStr::StartsWith(annot, "http", NStr::eNocase) && !NStr::StartsWith(annot, "ftp", NStr::eNocase))
1274  continue;
1275 
1276  CUrl url(annot);
1277  string host = url.GetHost();
1278  NStr::ToLower(host);
1279  if (host == "ftp.ncbi.nlm.nih.gov")
1280  continue;
1281 
1282  display_name = "(R) " + display_name;
1283  break;
1284  }
1285  }
1286  }
1287 }
1288 
1290 {
1291  const auto& options2hide = temp_proxy.GetOptions2Hide();
1292  const auto& options2show = temp_proxy.GetOptions2Show();
1293 
1294  if (config.IsSetChoice_list()) {
1295  config.SetChoice_list().remove_if([&](CRef<CChoice>& choice){
1296  const string& choice_name = choice->GetName();
1297  if (choice->IsSetOptional() && choice->GetOptional()) {
1298  if (options2show.count(choice_name) == 0)
1299  return true;
1300  }
1301  if (options2hide.count(choice_name) > 0)
1302  return true;
1303  choice->SetValues().remove_if([&](CRef<CChoiceItem>& choice_item) {
1304  string item_name = choice_name;
1305  item_name += ".";
1306  item_name += choice_item->GetName();
1307  if (choice_item->IsSetOptional() && choice_item->GetOptional()) {
1308  if (options2show.count(item_name) == 0)
1309  return true;
1310  }
1311  return options2hide.count(item_name) > 0;
1312  });
1313  return choice->GetValues().empty();
1314  });
1315  }
1316  if (config.IsSetCheck_boxes()) {
1317  config.SetCheck_boxes().remove_if([&](CRef<CCheckBox>& cb){
1318  const string& cb_name = cb->GetName();
1319  if (cb->IsSetOptional() && cb->GetOptional()) {
1320  if (options2show.count(cb_name) == 0)
1321  return true;
1322  }
1323  return options2hide.count(cb_name) > 0;
1324  });
1325  }
1326 
1327  /*
1328  choice-list SET OF Choice OPTIONAL,
1329  check-boxes SET OF CheckBox OPTIONAL,
1330  range-controls SET OF RangeControl OPTIONAL,
1331  */
1332 }
1333 
1334 
1337  CSeqGraphicConfig& g_config,
1338  const string& title_base) const
1339 {
1340  CRef<CCategoryConfig> cat_config = g_config.GetCategoryConfig();
1341 
1342  const CTrackProxy* proxy = dynamic_cast<const CTrackProxy*>(temp_proxy);
1343  CRef<CLayoutTrack> track(temp_proxy->GetTrack());
1344  _ASSERT(track);
1345 
1346  // disconnect the track from its track proxy to use all settings
1347  // from the track proxy instead of the track
1348  temp_proxy->SetTrack(NULL);
1349 
1350  const string& key = track->GetTypeInfo().GetId();
1351  const ILayoutTrackFactory* factory = GetTrackFactory(key);
1352  _ASSERT(factory);
1353 
1354  // extract track profile and settings
1355  TKeyValuePairs settings;
1356  string profile = temp_proxy->GetTrackProfile();
1357  CSGConfigUtils::ParseProfileString(profile, settings);
1358 
1359  TKeyValuePairs::const_iterator p_iter = settings.find("profile");
1360  if (p_iter != settings.end()) {
1361  profile = p_iter->second;
1362  } else if ( !settings.empty() || profile.empty()) {
1363  profile = "Default";
1364  }
1365 
1366  const string& annot_name = temp_proxy->GetSource();
1367 
1368  // get annotation meta-data if exists
1369  const CAnnotMetaData* meta_data = NULL;
1370  {{
1372  TAnnotMetaDataList::const_iterator iter = md_list.find(annot_name);
1373  if (iter != md_list.end()) {
1374  meta_data = iter->second;
1375  }
1376  }}
1377 
1378  // link the track with proxy again in case it is needed for
1379  // retrieving track settings
1380  temp_proxy->SetTrack(track.GetPointer());
1381 
1382  // create track-specific settings
1384  const ITrackConfigurable* conf_factory =
1385  dynamic_cast<const ITrackConfigurable*>(factory);
1386  if (conf_factory) {
1387  CRef<CTrackConfigSet> configs =
1388  conf_factory->GetSettings(profile, settings, temp_proxy);
1389  if ( !configs->Get().empty() ) {
1390  config = configs->Set().front();
1391  }
1392  } else {
1393  config.Reset(new CTrackConfig);
1394  config->SetHelp() = factory->GetThisTypeInfo().GetDescr();
1395  }
1396 
1397  if ( !config ) {
1398  return config;
1399  }
1400 
1401  // add 'comments' settings if any
1402  if ( !temp_proxy->GetComments().empty() ) {
1403  typedef vector<string> TCommentPos;
1404  TCommentPos cmt_pos;
1405  CTrackUtils::TokenizeWithEscape(temp_proxy->GetComments(), "|", cmt_pos, true);
1406  TCommentPos::const_iterator iter = cmt_pos.begin();
1407  while (iter != cmt_pos.end()) {
1408  const string& label = *iter;
1409  if (++iter != cmt_pos.end()) {
1410  config->SetComments().push_back(
1412  ++iter;
1413  }
1414  }
1415  }
1416 
1417  // add 'highlights' settings if any
1418  if ( !temp_proxy->GetHighlights().empty() ) {
1419  typedef vector<string> THighlights;
1420  THighlights hls;
1421  CTrackUtils::TokenizeWithEscape(temp_proxy->GetHighlights(), "|", hls, true);
1422  ITERATE(THighlights, h_iter, hls) {
1423  string hl = NStr::TruncateSpaces(*h_iter);
1424  if (!hl.empty()) {
1425  config->SetHighlights().push_back(hl);
1426  }
1427  }
1428  }
1429 
1430  // add 'highlights_color' settings if any
1431  if (!temp_proxy->GetHighlightsColor().empty()) {
1432  config->SetHighlights_color(temp_proxy->GetHighlightsColor());
1433  }
1434 
1435  if ( !temp_proxy->GetShowTitle() ) {
1436  // By default, we always show title. So we only need to
1437  // set the flag when it is not shown
1438  config->SetShow_title(false);
1439  }
1440  config->SetIs_private(temp_proxy->GetIsPrivate());
1441  if(!temp_proxy->GetRemoteData().empty()) {
1442  config->SetRemote_data(temp_proxy->GetRemoteData());
1443  }
1444 
1445  if(!temp_proxy->GetRemoteId().empty()) {
1446  config->SetRmt_mapped_id(temp_proxy->GetRemoteId());
1447  }
1448 
1449  if(!temp_proxy->GetSeqDataKey().empty()) {
1450  config->SetSeq_data_key(temp_proxy->GetSeqDataKey());
1451  }
1452  if(!temp_proxy->GetBatch().empty()) {
1453  config->SetBatch(temp_proxy->GetBatch());
1454  }
1455  if(!temp_proxy->GetExtraInfo().empty()) {
1456  config->SetExtra_info(temp_proxy->GetExtraInfo());
1457  }
1458  if(!temp_proxy->GetStoredScale().empty()) {
1459  config->SetStored_scale(temp_proxy->GetStoredScale());
1460  }
1461  if (!temp_proxy->GetHelp().empty()) {
1462  config->SetHelp(temp_proxy->GetHelp());
1463  }
1464  // use annotation description for track help if exists
1465  if (meta_data && !meta_data->m_Descr.empty() && temp_proxy->GetHelp().empty()) {
1466  config->SetHelp() = NStr::Replace(meta_data->m_Descr, "\n", "<br/>");
1467  }
1468  // initialize track name and display name (title)
1469  config->SetName(temp_proxy->GetName());
1470  string display_name = title_base;
1471  CreateDisplayName(meta_data, *temp_proxy, display_name);
1472  config->SetDisplay_name(display_name);
1473  /*
1474 
1475  if (!temp_proxy->GetDisplayName().empty()) {
1476  config->SetDisplay_name() = temp_proxy->GetDisplayName();
1477  } else if (meta_data && !meta_data->m_Title.empty()) {
1478  config->SetDisplay_name() = meta_data->m_Title;
1479  } else if (CSeqUtils::IsUnnamed(annot_name)) {
1480  config->SetDisplay_name() = title_base;
1481  } else if (annot_name.find(title_base) != string::npos) {
1482  config->SetDisplay_name() = annot_name;
1483  } else if (title_base.find(annot_name) == string::npos) {
1484  config->SetDisplay_name() = title_base + " - " + annot_name;
1485  } else {
1486  config->SetDisplay_name() = title_base;
1487  }
1488  */
1489 
1490  // initialize track key (track type) and subkey (subtype)
1491  config->SetKey() = key;
1492  config->SetOrder() = temp_proxy->GetOrder();
1493  string subkey = "";
1494  if (proxy) {
1495  if ( !proxy->GetSubkey().empty() ) {
1496  subkey = config->SetSubkey() = proxy->GetSubkey();
1497  }
1498  } else {
1499  const CFeatureTrack* f_track =
1500  dynamic_cast<const CFeatureTrack*>(track.GetPointer());
1501  if (f_track) {
1502  const CFeatList& feats(*CSeqFeatData::GetFeatList());
1503  config->SetSubkey() =
1504  feats.GetStoragekey(f_track->GetFeatSubtype());
1505  }
1506  }
1507 
1508  // initialize track category and subcategory
1509  // We set category and subcat in the following priority order:
1510  // - setting from track proxy
1511  // - xClass from meta-data
1512  // - track type and subtype
1513  string cat_name = temp_proxy->GetCategory();
1514  string sub_cat_name = temp_proxy->GetSubcategory();
1515  if (cat_name.empty()) {
1516  if (meta_data && !meta_data->m_xClass.empty()) {
1517  cat_name = meta_data->m_xClass;
1518  //if ( !meta_data->m_Provider.empty() ) {
1519  // sub_cat_name = meta_data->m_Provider;
1520  //}
1521  } else {
1523  cat_name = "Graphs";
1524  } else if (key == CFeatureTrackFactory::GetTypeInfo().GetId()) {
1525  if (subkey.find("RNA") != string::npos ||
1526  subkey.find("exon") != string::npos) {
1527  cat_name = "Genes";
1528  } else {
1529  cat_name = "Features";
1530  sub_cat_name = title_base;
1531  }
1532  } else if (key == CGeneModelFactory::GetTypeInfo().GetId()) {
1533  cat_name = "Genes";
1534  } else if (key == CAlignmentTrackFactory::GetTypeInfo().GetId()) {
1535  cat_name = "Alignments";
1536  } else {
1537  cat_name = "Others";
1538  }
1539  }
1540  }
1541 
1542 
1543  CRef<CCategory> cat;
1544  CRef<CCategory> sub_cat;
1545  if (cat_config) {
1546  cat = cat_config->GetCategory(cat_name);
1547  sub_cat = cat_config->GetSubcategory(cat_name, sub_cat_name);
1548  }
1549  if ( !cat ) {
1550  cat = CTrackConfigUtils::CreateCategory(cat_name, cat_name, "", 10000);
1551  }
1552  config->SetCategory(*cat);
1553 
1554  if ( !sub_cat && !sub_cat_name.empty() ) {
1555  sub_cat = CTrackConfigUtils::CreateCategory(sub_cat_name, sub_cat_name, "", 100);
1556  }
1557 
1558  if (sub_cat) {
1559  config->SetSubcategory(*sub_cat);
1560  }
1561 
1562  if ( !temp_proxy->GetSettingGroup().empty() ) {
1563  config->SetSetting_group() = temp_proxy->GetSettingGroup();
1564  }
1565 
1566  // fill in other track information.
1567  if ( !temp_proxy->GetFilter().empty() ) {
1568  config->SetFilter() = temp_proxy->GetFilter();
1569  }
1570  if ( !temp_proxy->GetSortBy().empty() ) {
1571  config->SetSort_by() = temp_proxy->GetSortBy();
1572  }
1573  if ( !temp_proxy->GetId().empty() ) {
1574  config->SetId(temp_proxy->GetId());
1575  }
1576  if (proxy && !proxy->GetDB().empty() ) {
1577  config->SetDbname(proxy->GetDB());
1578  }
1579  if (proxy && !proxy->GetDataKey().empty() ) {
1580  config->SetData_key(proxy->GetDataKey());
1581  }
1582 
1583  config->SetShown() = temp_proxy->GetShown();
1584  config->SetAnnots().push_back(annot_name);
1585 
1586  if (!temp_proxy->GetUId().empty())
1587  config->SetUId(temp_proxy->GetUId());
1588 
1589  if (!temp_proxy->GetSubTracks().empty()) {
1590  config->SetSubTracks() = temp_proxy->GetSubTracks();
1591  }
1592 
1593  if (!temp_proxy->GetBigDataIndex().empty()) {
1594  config->SetBig_data_index() = temp_proxy->GetBigDataIndex();
1595  }
1596 
1597  if (!temp_proxy->GetHubId().empty()) {
1598  config->SetHub_id(temp_proxy->GetHubId());
1599  }
1600 
1601  s_ProcessOptionalSettings(*temp_proxy, *config);
1602 
1603  return config;
1604 }
1605 
1606 
1608 {
1609  typedef vector< CIRef<ILayoutTrackFactory> > TTrackFactoryVec;
1610  TTrackFactoryVec factories;
1613 
1614  ITERATE (TTrackFactoryVec, iter, factories) {
1615  m_Factories[(*iter)->GetThisTypeInfo().GetId()] = *iter;
1616  }
1617 }
1618 
1619 /*
1620 CRef<CTrackProxy> CTrackConfigManager::FindTrackByUId(const string& uid)
1621 {
1622  if (m_UIds.count(uid) != 0)
1623  return m_UIds[uid];
1624  return CRef<CTrackProxy>(0);
1625 
1626 }
1627 */
1629 {
1630  const string& featKey = CFeatureTrackFactory::GetTypeInfo().GetId();
1631  for (auto& p : proxies) {
1632  if (p->GetKey() == featKey)
1633  subkeys.insert(p->GetSubkey());
1634  }
1635 }
1636 
1638 {
1639  int subtype = item.GetSubtype();
1640 
1641  return subtype != CSeqFeatData::eSubtype_any &&
1642  subtype != CSeqFeatData::eSubtype_variation &&
1644  !CDataTrackUtils::IsGeneModelFeature(item.GetType(), subtype);
1645 }
1646 
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
CAggregateFeatureTrackFactory.
CAlignmentTrackFactory.
static const CTrackTypeInfo & GetTypeInfo()
CAllOtherFeaturesTrackFactory.
Data structure for holding meta information for an annotaion.
Definition: annot_info.hpp:85
CRef< objects::CCategory > GetCategory(const string &cat_name)
CRef< objects::CCategory > GetSubcategory(const string &cat_name, const string &sub_cat)
CCheckBox –.
Definition: CheckBox.hpp:66
CChoiceItem –.
Definition: ChoiceItem.hpp:66
CChoice –.
Definition: Choice.hpp:66
CComponentTrackFactory.
CConditional –.
Definition: Conditional.hpp:66
CConstRef –.
Definition: ncbiobj.hpp:1266
CDisplayOptionValue –.
CDisplayOption –.
CDisplayOptionsBundle –.
CDisplayTrack –.
CEpigenomicsDSType - Epigenomics data source type.
CEpigenomicsTrackFactory.
CExtensionDeclaration - static declaration helper.
CFeatListItem - basic configuration data for one "feature" type.
int GetSubtype() const
int GetType() const
CConfigurableItems - a static list of items that can be configured.
string GetStoragekey(int type, int subtype) const
Get the key used to store this type of feature.
CFeaturePanelDSType.
CFeatureTrackFactory.
static const CTrackTypeInfo & GetTypeInfo()
CFeatureTrack –.
int GetFeatSubtype() const
CGeneModelFactory.
static const CTrackTypeInfo & GetTypeInfo()
CTrackContainerFactory.
CGraphTrackFactory.
static const CTrackTypeInfo & GetTypeInfo()
CHiddenSetting –.
virtual const CTrackTypeInfo & GetTypeInfo() const =0
CSFTransDSType - Six-frames translation data source type.
static void ParseProfileString(const string &profile_str, TKeyValuePairs &settings)
CSGFeatureDSType.
Definition: feature_ds.hpp:156
CSGGraphDSType.
CSGFeatureDSType.
CSGTraceGraphDSType.
CScaffoldTrackFactory.
CSegmentMapTrackFactory.
static const CFeatList * GetFeatList()
CRef< CCategoryConfig > GetCategoryConfig()
CSeqTableGraphTrackFactory.
CSequenceTrackFactory.
CSixFramesTransTrackFactory.
File Description:
const string & GetSeqDataKey() const
void SetHubId(const string &hub_id)
void SetShown(bool shown)
void SetRemoteId(const string &remote_id)
void SetRemoteData(const string &remote_data)
const string & GetSubkey() const
const string & GetHelp() const
void SetName(const string &name)
void SetCategory(const string &cat)
const string & GetUId() const
const string & GetCategory() const
vector< string > TAnnots
const string & GetDisplayName() const
const string & GetBatch() const
const string & GetRemoteId() const
const string & GetSortBy() const
bool GetShowTitle() const
void SetTrack(CLayoutTrack *track)
Associated any track already?.
void SetSource(const string &src)
void SetFilter(const string &filter)
const string & GetBigDataIndex() const
void SetHighlights(const string &hl_str)
void SetId(const string &id)
const string & GetKey() const
void SetHelp(const string &help)
void SetComments(const string &comment_str)
void SetUId(const string &uid)
vector< string > TSubTracks
const string & GetHighlightsColor() const
void SetHighlightsColor(const string &hl_str)
const string & GetHighlights() const
void SetTrackProfile(const string &profile)
const TAnnots & GetAnnots() const
void SetKey(const string &key)
static const string kAnonTrackName
CTempTrackProxy class implementation.
void SetSettingGroup(const string &name)
const set< string > & GetOptions2Hide() const
void SetSubcategory(const string &scat)
const string & GetExtraInfo() const
void SetBigDataIndex(const string &big_data_index)
void SetBatch(const string &batch)
const string & GetId() const
const string & GetTrackProfile() const
void SetSortBy(const string &sort_by)
void SetIsPrivate(bool flag)
void SetOptions2Show(const set< string > &options2show)
bool GetIsPrivate() const
void SetOrder(int order)
CTempTrackProxy class implementation.
TSubTracks & SetSubTracks()
void SetRemotePath(const string &remote_path)
void SetSeqDataKey(const string &seq_data_key)
const string & GetStoredScale() const
const set< string > & GetOptions2Show() const
void SetAnnots(const TAnnots &annots)
const string & GetName() const
void SetDisplayName(const string &name)
const string & GetHubId() const
void SetOptions2Hide(const set< string > &options2hide)
const string & GetComments() const
const CLayoutTrack * GetTrack() const
const TSubTracks & GetSubTracks() const
const string & GetSource() const
const string & GetSettingGroup() const
void SetUseGroupDefault(bool flag)
void SetShowTitle(bool flag)
void SetExtraInfo(const string &sExtraInfo)
const string & GetSubcategory() const
void SetErrorStatus(const TTrackErrorStatus &ErrorStatus)
void SetStoredScale(const string &stored_scale)
const string & GetFilter() const
void SetSubkey(const string &sub_key)
const string & GetRemoteData() const
CTextBox –.
Definition: TextBox.hpp:66
CTraceGraphTrackFactory.
helper class to faciliatet subtrack processing build pseudo compound track index and provides find me...
CTrackIndex(TTrackProxies &t_settings)
CRef< CTrackProxy > FindTrackById(const string &track_id)
CTempTrackProxy::TTrackProxies TTrackProxies
static void SetTrackConfig(TTrackProxies &t_settings, const TTrackSettingsSet &in_settings, int order_offset=0)
Reset the track configuration with input settings.
list< TTrackSettings > TTrackSettingsSet
const ILayoutTrackFactory * GetTrackFactory(const string &key) const
const TAnnotMetaDataList & GetKnownAnnots(int level) const
Get known annotation based on level number.
void CreateDisplayName(const CAnnotMetaData *meta_data, const CTempTrackProxy &temp_proxy, string &display_name) const
void AlignTrackConfig(TTrackProxies &t_settings, const TTrackSettingsSet &in_settings)
list< string > GetTrackTypes() const
static bool ValidFeatureTrack(const objects::CFeatListItem &item)
void MergeTrackConfig(TTrackProxies &t_settings, const TTrackSettingsSet &settings_set, EAnnotMerge merge)
Merge with the existing track configuration.
static void GetUsedFeatureKeys(set< string > &subkeys, const TTrackProxies &proxies)
CRef< objects::CTrackConfig > CreateTrackConfig(CTempTrackProxy *temp_proxy, CSeqGraphicConfig &g_config, const string &title_base) const
Create configuration for a give track proxy.
TKnownAnnotMap m_KnownAnnots
Complete list of known annotations with meta-data.
static void AdjustTrackOrder(CTempTrackProxy *t_proxy)
bool OnShownList(const CTempTrackProxy *p_proxy, const CTempTrackProxy *t_proxy, const string &track_name) const
ILayoutTrackFactory::TAnnotMetaDataList TAnnotMetaDataList
CConstRef< objects::CDisplayOptionsBundle > GetTrackDisplayOptions(const list< string > &keys) const
void x_AppendKeyDisplayOptions(const string &key, objects::CDisplayOptionsBundle &bundle) const
static CRef< objects::CCategory > CreateCategory(const string &name, const string &disp_name, const string &help, int order)
static CRef< objects::CComment > CreateComment(const string &label, const string &pos_str)
CTrackConfig –.
Definition: TrackConfig.hpp:66
CTrackContainerFactory.
CTrackContainer - a track container in the form of layout track.
const TTrackProxies & GetSubtrackProxies() const
CTrackContainer inline methods.
CTrackProxy data structure contains information about the position of a track in its parent scope,...
void SetDataKey(const string &key)
void SetOriginalKey(const string &key)
const string & GetDB() const
const string & GetDataKey() const
void SetDB(const string &db)
const string & GetDescr() const
const string & GetId() const
CUrl –.
Definition: ncbi_url.hpp:353
CVarTrackFactory.
Definition: dbvar_track.hpp:89
CSGFeatureDSType.
Definition: vcf_ds.hpp:158
CVcfTrackFactory.
Definition: vcf_track.hpp:105
ILayoutTrackFactory.
virtual const CTrackTypeInfo & GetThisTypeInfo() const =0
ITrackConfigurable interface for tracks that are configurable.
virtual CRef< objects::CTrackConfigSet > GetSettings(const string &profile, const TKeyValuePairs &settings, const CTempTrackProxy *track_proxy) const =0
const_iterator begin() const
Definition: map.hpp:151
const_iterator end() const
Definition: map.hpp:152
bool empty() const
Definition: map.hpp:149
const_iterator find(const key_type &key) const
Definition: map.hpp:153
iterator_bool insert(const value_type &val)
Definition: set.hpp:149
#define md_list
Definition: compat-1.3.h:2037
URL parsing classes.
struct config config
static DLIST_TYPE *DLIST_NAME() first(DLIST_LIST_TYPE *list)
Definition: dlist.tmpl.h:46
#define option
#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
string
Definition: cgiapp.hpp:687
#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
void Error(CExceptionArgs_Base &args)
Definition: ncbiexpt.hpp:1197
static bool IsNAA(const string &annot, bool isStrict=false)
check if a given annotation is a named annotation accession[.version][number] when isSctrict == false...
Definition: utils.cpp:796
string m_xClass
annotation category
Definition: annot_info.hpp:105
static const string & GetUnnamedAnnot()
Get the commonly used symbol representing a unnnamed annotation.
Definition: utils.hpp:531
string m_Descr
annotation description (or comment)
Definition: annot_info.hpp:103
static bool IsGeneModelFeature(int type, int subtype)
Does feature belong to gene model track Gene, RNA, cdregion, exon, C_region, and VDJ segments.
Definition: na_utils.cpp:190
static bool IsUnnamed(const string &annot)
check if a given annotation is a unnamed annotation.
Definition: utils.hpp:525
string m_Title
annotation title
Definition: annot_info.hpp:102
#define EXT_POINT__NONASN_TRACK_DATA_FACTORY
static TAnnotNameType NameTypeStrToValue(const string &type)
Definition: utils.cpp:140
EAnnotationNameType
flags for classifying annotation names.
Definition: utils.hpp:132
@ eAnnot_Unnamed
unnamed annotation
Definition: utils.hpp:133
@ eAnnot_Other
any given named annots
Definition: utils.hpp:136
TErrorCode m_ErrorCode
Definition: track_info.hpp:98
static const string kStdTrackId
prefix for STD (as opposed to TMS) tracks
Definition: track_info.hpp:140
void GetExtensionAsInterface(const string &ext_point_id, vector< CIRef< I > > &interfaces)
GetExtensionAsInterface() is a helper function that extracts all extensions implementing the specifie...
static const string cTrackSettingKey_ErrorShortMsg
if present contains the short error message
Definition: track_info.hpp:135
static const string cTrackSettingKey_ErrorMsg
if present contains the error message
Definition: track_info.hpp:137
static const string cTrackSettingKey_ErrorSeverity
if present and set to anything, but CHTMLActiveArea::eErrorSeverity_NoError, do not attempt to load t...
Definition: track_info.hpp:131
static string RemoveEscape(const string &str)
remove escape characters ('\') used for escaping special characters in track settings values
Definition: track_info.cpp:318
static const string kRStdTrackId
prefix for Remote STD (as opposed to TMS) tracks
Definition: track_info.hpp:143
static const string cTrackSettingKey_PrivatePrefix
some internal reserved track setting keys that are used for internal communication always start with ...
Definition: track_info.hpp:129
TErrorSeverity m_ErrorSeverity
Definition: track_info.hpp:97
static void TokenizeWithEscape(const string &str, const string &delim, vector< string > &tokens, bool remove_escape=false)
Tokenize a string using the delim.
Definition: track_info.cpp:352
static const string cTrackSettingKey_ErrorCode
if present contains the error code
Definition: track_info.hpp:133
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,...
CRef< C > Ref(C *object)
Helper functions to get CRef<> and CConstRef<> objects.
Definition: ncbiobj.hpp:2015
TObjectType * GetPointer(void) THROWS_NONE
Get pointer,.
Definition: ncbiobj.hpp:998
void Reset(void)
Reset reference object.
Definition: ncbiobj.hpp:773
#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
#define kEmptyStr
Definition: ncbistr.hpp:123
static int StringToInt(const CTempString str, TStringToNumFlags flags=0, int base=10)
Convert string to int.
Definition: ncbistr.cpp:630
static bool EndsWith(const CTempString str, const CTempString end, ECase use_case=eCase)
Check if a string ends with a specified suffix value.
Definition: ncbistr.hpp:5430
static string Join(const TContainer &arr, const CTempString &delim)
Join strings using the specified delimiter.
Definition: ncbistr.hpp:2697
static string & Replace(const string &src, const string &search, const string &replace, string &dst, SIZE_TYPE start_pos=0, SIZE_TYPE max_replace=0, SIZE_TYPE *num_replace=0)
Replace occurrences of a substring within a string.
Definition: ncbistr.cpp:3314
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 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
static string & ReplaceInPlace(string &src, const string &search, const string &replace, SIZE_TYPE start_pos=0, SIZE_TYPE max_replace=0, SIZE_TYPE *num_replace=0)
Replace occurrences of a substring within a string.
Definition: ncbistr.cpp:3405
static string TruncateSpaces(const string &str, ETrunc where=eTrunc_Both)
Truncate spaces in a string.
Definition: ncbistr.cpp:3186
static string & ToLower(string &str)
Convert string to lower case – string& version.
Definition: ncbistr.cpp:405
@ eNocase
Case insensitive compare.
Definition: ncbistr.hpp:1206
const string & GetHost(void) const
Definition: ncbi_url.hpp:411
static const char label[]
bool IsSetLegend_text(void) const
Check if a value has been assigned to Legend_text data member.
bool IsSetHelp(void) const
Check if a value has been assigned to Help data member.
Definition: Choice_.hpp:565
bool IsSetOptional(void) const
Check if a value has been assigned to Optional data member.
Definition: TextBox_.hpp:640
const TName & GetName(void) const
Get the Name member data.
Definition: TextBox_.hpp:417
const TCurr_value & GetCurr_value(void) const
Get the Curr_value member data.
Definition: Choice_.hpp:458
bool IsSetOptional(void) const
Check if a value has been assigned to Optional data member.
Definition: CheckBox_.hpp:645
TOptions & SetOptions(void)
Assign a value to Options data member.
bool IsSetOptional(void) const
Check if a value has been assigned to Optional data member.
TOptional GetOptional(void) const
Get the Optional member data.
Definition: CheckBox_.hpp:664
TOptional GetOptional(void) const
Get the Optional member data.
list< CRef< CDisplayOption > > TOptions
TOptional GetOptional(void) const
Get the Optional member data.
Definition: TextBox_.hpp:659
const TConditions & GetConditions(void) const
Get the Conditions member data.
Definition: TextBox_.hpp:699
const TValue & GetValue(void) const
Get the Value member data.
Definition: TextBox_.hpp:464
list< CRef< CDisplayOptionValue > > TValues
const Tdata & Get(void) const
Get the member data.
bool IsSetDisplay_name(void) const
Check if a value has been assigned to Display_name data member.
bool IsSetConditions(void) const
Check if a value has been assigned to Conditions data member.
Definition: Choice_.hpp:659
const THelp & GetHelp(void) const
Get the Help member data.
list< CRef< CChoiceItem > > TValues
Definition: Choice_.hpp:96
list< CRef< CTextBox > > TText_boxes
list< CRef< CDisplayTrack > > TTracks
bool IsSetDisplay_name(void) const
Check if a value has been assigned to Display_name data member.
Definition: Choice_.hpp:518
const TName & GetName(void) const
Get the Name member data.
Definition: Choice_.hpp:411
const THelp & GetHelp(void) const
Get the Help member data.
Definition: Choice_.hpp:577
bool IsSetDisplay_name(void) const
Check if a value has been assigned to Display_name data member.
Definition: TextBox_.hpp:499
TValue GetValue(void) const
Get the Value member data.
Definition: CheckBox_.hpp:479
Tdata & Set(void)
Assign a value to data member.
list< CRef< CTrackConfig > > Tdata
const TDisplay_name & GetDisplay_name(void) const
Get the Display_name member data.
Definition: TextBox_.hpp:511
bool IsSetHelp(void) const
Check if a value has been assigned to Help data member.
Definition: CheckBox_.hpp:551
bool IsSetHelp(void) const
Check if a value has been assigned to Help data member.
const TDisplay_name & GetDisplay_name(void) const
Get the Display_name member data.
Definition: Choice_.hpp:530
const TName & GetName(void) const
Get the Name member data.
Definition: CheckBox_.hpp:419
list< int > TOptions
bool IsSetDisplay_name(void) const
Check if a value has been assigned to Display_name data member.
Definition: CheckBox_.hpp:504
const TName & GetName(void) const
Get the Name member data.
bool IsSetConditions(void) const
Check if a value has been assigned to Conditions data member.
Definition: CheckBox_.hpp:692
list< CRef< CChoice > > TChoice_list
list< CRef< CCheckBox > > TCheck_boxes
const TDisplay_name & GetDisplay_name(void) const
Get the Display_name member data.
bool IsSetConditions(void) const
Check if a value has been assigned to Conditions data member.
Definition: TextBox_.hpp:687
const TDisplay_name & GetDisplay_name(void) const
Get the Display_name member data.
Definition: CheckBox_.hpp:516
const TName & GetName(void) const
Get the Name member data.
const TLegend_text & GetLegend_text(void) const
Get the Legend_text member data.
const TConditions & GetConditions(void) const
Get the Conditions member data.
Definition: Choice_.hpp:671
const TConditions & GetConditions(void) const
Get the Conditions member data.
Definition: CheckBox_.hpp:704
TOptional GetOptional(void) const
Get the Optional member data.
Definition: Choice_.hpp:631
bool IsSetOptional(void) const
Check if a value has been assigned to Optional data member.
Definition: Choice_.hpp:612
const THelp & GetHelp(void) const
Get the Help member data.
Definition: TextBox_.hpp:558
bool IsSetHelp(void) const
Check if a value has been assigned to Help data member.
Definition: TextBox_.hpp:546
list< CRef< CHiddenSetting > > THidden_settings
TTracks & SetTracks(void)
Assign a value to Tracks data member.
const TValue & GetValue(void) const
Get the Value member data.
const TValues & GetValues(void) const
Get the Values member data.
Definition: Choice_.hpp:505
const THelp & GetHelp(void) const
Get the Help member data.
Definition: CheckBox_.hpp:563
#define EXT_POINT__SEQGRAPHIC_LAYOUT_TRACK_FACTORY
FeaturePanel uses the following extension point to obtain registered seqgraphic track factories (inst...
if(yy_accept[yy_current_state])
constexpr auto sort(_Init &&init)
constexpr bool empty(list< Ts... >) noexcept
const struct ncbi::grid::netcache::search::fields::KEY key
const struct ncbi::grid::netcache::search::fields::SUBKEY subkey
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
void copy(Njn::Matrix< S > *matrix_, const Njn::Matrix< T > &matrix0_)
Definition: njn_matrix.hpp:613
#define EXT_POINT__PROJECT_ITEM_EXTENSION
#define EXT_POINT__SEQGRAPHIC_DATA_SOURCE_TYPE
ISGDataSourceManager uses the following extension point to obtain registered seqgraphic data source f...
static bool s_CompareCRefs(const CRef< CTempTrackProxy > &t1, const CRef< CTempTrackProxy > &t2)
help struct for storing track settings
TTrackErrorStatus m_ErrorStatus
CSGConfigUtils::TKeyValuePairs TProfile
vector< STrackSettings > TTrackConfig
set< string > m_Options2Show
vector< string > TSubTracks
static void ParseSettings(const CTrackConfigManager::TTrackSettingsSet &settings_set, TTrackConfig &config)
static string CreateProfileString(const TProfile &profile)
set< string > m_Options2Hide
CTrackProxy::TAnnots m_Annots
Definition: type.c:6
#define _ASSERT
USING_SCOPE(objects)
void s_ResolveSubTracks(CTrackConfigManager::TTrackProxies &t_settings)
#define MAX_LEVEL
void s_InitTrackFromSettings(CTrackProxy &track, const STrackSettings &s, int order, bool update_annots=true)
static void s_ParseOptionalSettings(const string &optional_settings, set< string > &options2hide, set< string > &options2show)
static CTrackConfigManager::TTrackProxies::iterator s_FindMatchedTrack(const STrackSettings &src_track, CTrackConfigManager::TTrackProxies &track_list)
Helper function to find a matched track from a list of tracks for a given source track.
static bool s_IsStdTrack(const string &track_id)
static bool s_TrackMatch(const STrackSettings &src_track, const CTempTrackProxy &target_track, bool exact_annot_match=true)
The matching logic is 'vague' due to the fact that the user-provided 'tracks' may be ambiguous.
static void s_ParseSubTrackId(const string &subtrack_id, string &track_id, string &track_attr)
void s_ProcessOptionalSettings(CTempTrackProxy &temp_proxy, CTrackConfig &config)
Modified on Wed Apr 17 13:08:34 2024 by modify_doxy.py rev. 669887