NCBI C++ ToolKit
gene_model_config.hpp
Go to the documentation of this file.

Go to the SVN repository for this file.

1 #ifndef GUI_WIDGETS_SEQ_GRAPHIC___GENE_MODEL_CONFIG__HPP
2 #define GUI_WIDGETS_SEQ_GRAPHIC___GENE_MODEL_CONFIG__HPP
3 
4 /* $Id: gene_model_config.hpp 46313 2021-03-16 13:11:19Z shkeda $
5  * ===========================================================================
6  *
7  * PUBLIC DOMAIN NOTICE
8  * National Center for Biotechnology Information
9  *
10  * This software/database is a "United States Government Work" under the
11  * terms of the United States Copyright Act. It was written as part of
12  * the author's official duties as a United States Government employee and
13  * thus cannot be copyrighted. This software/database is freely available
14  * to the public for use. The National Library of Medicine and the U.S.
15  * Government have not placed any restriction on its use or reproduction.
16  *
17  * Although all reasonable efforts have been taken to ensure the accuracy
18  * and reliability of the software and data, the NLM and the U.S.
19  * Government do not and cannot warrant the performance or results that
20  * may be obtained by using this software or data. The NLM and the U.S.
21  * Government disclaim all warranties, express or implied, including
22  * warranties of performance, merchantability or fitness for any particular
23  * purpose.
24  *
25  * Please cite the author in any work or product based on this material.
26  *
27  * ===========================================================================
28  *
29  * Authors: Liangshou Wu
30  *
31  * File Description:
32  *
33  */
34 
35 #include <corelib/ncbiobj.hpp>
38 
39 
41 
42 class CCdsConfig;
43 class CSeqGraphicConfig;
44 class CBoundaryParams;
45 
46 class CGeneModelConfig : public CObject
47 {
48 public:
49  /// style on how to merge RNAs and CDSs.
50  enum EMergeStyle {
51  eMerge_No, ///< show all feature individually
52  eMerge_Pairs, ///< merge each transcript and CDS pair
53  eMerge_All, ///< merge all transcripts and CDSs
54  eMerge_OneLine ///< merge into one line
55  /// if there are transcripts and/or CDSs, show only
56  /// transcripts and CDSs, and merge them into one bar (prefix
57  /// the gene label to RNA and CDS label. If there is no RNA or
58  /// CDS feature, show exon features only. If there is no exon
59  /// feature, show gene bar.
60  };
61 
62 
63  static const string& StyleValueToStr(CGeneModelConfig::EMergeStyle style);
64  static EMergeStyle StyleStrToValue(const string& style);
65 
66 
67  /// rendering options on how to render features overall.
68  /// each option corresponds to one or more settings.
70  eOption_GeneOnly, ///< show gene bar only
71  eOption_MergeAll, ///< merge all RNAs and CDSs, show exons, no gene bar
72  eOption_MergePairs, ///< merge each RNA and CDS pair, show exons, no gene bar
73  eOption_ShowAllButGenes, ///< show all RNAs, CDSs and exons, no gene bar
74  eOption_ShowAll, ///< show all features individually
75  eOption_SingleLine, ///< merge all RNAs and CDSs into one line
77  };
78 
80  static ERenderingOption OptionStrToValue(const string& option);
81 
84  , m_ShowGenes(true)
85  , m_ShowRNAs(true)
86  , m_ShowCDSs(true)
87  , m_ShowExons(true)
88  , m_ShowVDJCs(true)
95  , m_LandmarkFeatLimit(200)
97  , m_HighlightMode(0)
98  {}
99 
101  const string& reg_path, const string& profile);
102  // For gene model track settings we actually don't need the
103  // CSeqGraphicConfig, and it's a burden to initialize it and
104  // pass through here. So we introduce lightweight load. SV-2343
105  void LoadSettingsPartial(const string& reg_path, const string& profile);
107  const string& reg_path, const string& profile) const;
108 
109  void UpdateSettings(const CSGConfigUtils::TKeyValuePairs& settings);
110  string SaveSettingsAsString(const string& preset_style) const;
111 
112 
113  /// @name layout settings.
114  /// @{
115  bool m_ShowLMGeneLabel; ///< landmark gene labels.
120  bool m_ShowVDJCs; ///< show VDJ_segments and C_region
121  bool m_ShowGeneProducts; ///< feature histogram on a gene.
122  bool m_ShowCDSProductFeats; ///< CDS associated protein features.
123  bool m_ShowNtRuler; ///< Show nucleotide ruler
124  bool m_ShowAaRuler; ///< Show protein ruler
125  bool m_ShowHistogram; ///< show gene distribution histogram.
126  bool m_ShowLabel = true; ///< Show labels
127  string m_CDSProfile; ///< cds setting profile
128  EMergeStyle m_MergeStyle; ///< the way on how to merge CDSs and RNAs.
129  /// @}
130 
134 
135  bool m_HideNonCoding = false; ///< Hide transcripts without associated CDS
136  bool m_HideModels = false; ///< Hide Model RefSeqs
137  bool m_CCDSOnly = false; ///< Show only CCDS variants
138  bool m_SelectOnly = false; ///< Show only Select/MANE variants
139 
142 };
143 
144 
146 
147 #endif // GUI_WIDGETS_SEQ_GRAPHIC___GENE_MODEL_CONFIG__HPP
IBoundaryParams.
bool m_CCDSOnly
Show only CCDS variants.
bool m_ShowCDSProductFeats
CDS associated protein features.
bool m_ShowGeneProducts
feature histogram on a gene.
bool m_ShowNtRuler
Show nucleotide ruler.
EMergeStyle m_MergeStyle
the way on how to merge CDSs and RNAs.
static ERenderingOption OptionStrToValue(const string &option)
static const string & OptionValueToStr(CGeneModelConfig::ERenderingOption option)
static EMergeStyle StyleStrToValue(const string &style)
bool m_ShowAaRuler
Show protein ruler.
bool m_SelectOnly
Show only Select/MANE variants.
void SaveSettings(CConstRef< CSeqGraphicConfig > g_conf, const string &reg_path, const string &profile) const
void UpdateSettings(const CSGConfigUtils::TKeyValuePairs &settings)
bool m_HideNonCoding
Hide transcripts without associated CDS.
void LoadSettingsPartial(const string &reg_path, const string &profile)
void LoadSettings(CConstRef< CSeqGraphicConfig > g_conf, const string &reg_path, const string &profile)
bool m_ShowVDJCs
show VDJ_segments and C_region
CRef< CBoundaryParams > m_GeneBoxConfig
bool m_ShowHistogram
show gene distribution histogram.
ERenderingOption
rendering options on how to render features overall.
@ eOption_SingleLine
merge all RNAs and CDSs into one line
@ eOption_MergeAll
merge all RNAs and CDSs, show exons, no gene bar
@ eOption_ShowAll
show all features individually
@ eOption_MergePairs
merge each RNA and CDS pair, show exons, no gene bar
@ eOption_ShowAllButGenes
show all RNAs, CDSs and exons, no gene bar
@ eOption_GeneOnly
show gene bar only
string SaveSettingsAsString(const string &preset_style) const
string m_CDSProfile
cds setting profile
static const string & StyleValueToStr(CGeneModelConfig::EMergeStyle style)
CRef< CCdsConfig > m_CdsConfig
EMergeStyle
style on how to merge RNAs and CDSs.
@ eMerge_OneLine
merge into one line
@ eMerge_Pairs
merge each transcript and CDS pair
@ eMerge_All
merge all transcripts and CDSs
@ eMerge_No
show all feature individually
bool m_ShowLMGeneLabel
landmark gene labels.
bool m_HideModels
Hide Model RefSeqs.
bool m_ShowLabel
Show labels.
CObject –.
Definition: ncbiobj.hpp:180
#define true
Definition: bool.h:35
#define false
Definition: bool.h:36
#define option
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
Portable reference counted smart and weak pointers using CWeakRef, CRef, CObject and CObjectEx.
Modified on Wed May 15 15:06:22 2024 by modify_doxy.py rev. 669887