NCBI C++ ToolKit
src
gui
packages
pkg_alignment
splign_params.cpp
Go to the documentation of this file.
Go to the SVN repository for this file.
1
/* $Id: splign_params.cpp 47464 2023-04-20 00:19:10Z evgeniev $
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: Roman Katargin
27
*
28
* File Description:
29
*
30
*/
31
32
#include <
ncbi_pch.hpp
>
33
34
#include <
gui/objutils/registry.hpp
>
35
36
#include <
gui/packages/pkg_alignment/splign_params.hpp
>
37
38
BEGIN_NCBI_SCOPE
39
40
CSplignParams::CSplignParams
()
41
{
42
Init
();
43
}
44
CSplignParams::CSplignParams
(
const
CSplignParams
&
data
)
45
{
46
Init
();
47
Copy
(
data
);
48
}
49
CSplignParams::~CSplignParams
()
50
{
51
}
52
void
CSplignParams::operator=
(
const
CSplignParams
&
data
)
53
{
54
Copy
(
data
);
55
}
56
bool
CSplignParams::operator==
(
const
CSplignParams
&
data
)
const
57
{
58
////@begin CSplignParams equality operator
59
if
(!(
m_CompPenalty
==
data
.m_CompPenalty))
return
false
;
60
if
(!(
m_DiscType
==
data
.m_DiscType))
return
false
;
61
if
(!(
m_EndGapDetect
==
data
.m_EndGapDetect))
return
false
;
62
if
(!(
m_MaxGenomicExtent
==
data
.m_MaxGenomicExtent))
return
false
;
63
if
(!(
m_MaxIntron
==
data
.m_MaxIntron))
return
false
;
64
if
(!(
m_MinCompIdentity
==
data
.m_MinCompIdentity))
return
false
;
65
if
(!(
m_MinExonIdentity
==
data
.m_MinExonIdentity))
return
false
;
66
if
(!(
m_PolyADetect
==
data
.m_PolyADetect))
return
false
;
67
if
(!(
m_cDNA_strand
==
data
.m_cDNA_strand))
return
false
;
68
////@end CSplignParams equality operator
69
return
true
;
70
}
71
void
CSplignParams::Copy
(
const
CSplignParams
&
data
)
72
{
73
////@begin CSplignParams copy function
74
m_CompPenalty
=
data
.m_CompPenalty;
75
m_DiscType
=
data
.m_DiscType;
76
m_EndGapDetect
=
data
.m_EndGapDetect;
77
m_MaxGenomicExtent
=
data
.m_MaxGenomicExtent;
78
m_MaxIntron
=
data
.m_MaxIntron;
79
m_MinCompIdentity
=
data
.m_MinCompIdentity;
80
m_MinExonIdentity
=
data
.m_MinExonIdentity;
81
m_PolyADetect
=
data
.m_PolyADetect;
82
m_cDNA_strand
=
data
.m_cDNA_strand;
83
////@end CSplignParams copy function
84
}
85
void
CSplignParams::Init
()
86
{
87
////@begin CSplignParams member initialisation
88
m_CompPenalty
= 0.55;
89
m_DiscType
= 0;
90
m_EndGapDetect
=
true
;
91
m_MaxGenomicExtent
= 35000;
92
m_MaxIntron
= 1200000;
93
m_MinCompIdentity
= 0.5;
94
m_MinExonIdentity
= 0.75;
95
m_PolyADetect
=
true
;
96
m_cDNA_strand
= 0;
97
////@end CSplignParams member initialisation
98
}
99
100
static
const
char
101
*
kcDNA_strandTag
=
"cDNA strand"
,
102
*
kEndGapDetectTag
=
"EndGap Detection"
,
103
*
kMinCompIdentityTag
=
"Min compartment identity"
,
104
*
kMinExonIdentityTag
=
"Min exon identity"
,
105
*
kMaxGenomicExtentTag
=
"Maximum Genomic Extent"
,
106
*
kCompPenaltyTag
=
"Compartment penalty"
,
107
*
kPolyADetectTag
=
"PolyA Detection"
,
108
*
kMaxIntron
=
"MaxIntron"
,
109
*
kDiscType
=
"DiskType"
;
110
111
112
void
CSplignParams::SaveSettings
()
const
113
{
114
if
(!
m_RegPath
.empty()) {
115
CGuiRegistry
& gui_reg =
CGuiRegistry::GetInstance
();
116
CRegistryWriteView
view = gui_reg.
GetWriteView
(
m_RegPath
);
117
118
view.
Set
(
kcDNA_strandTag
,
m_cDNA_strand
);
119
view.
Set
(
kEndGapDetectTag
,
m_EndGapDetect
);
120
view.
Set
(
kPolyADetectTag
,
m_PolyADetect
);
121
view.
Set
(
kMinCompIdentityTag
,
m_MinCompIdentity
);
122
view.
Set
(
kMinExonIdentityTag
,
m_MinExonIdentity
);
123
view.
Set
(
kMaxGenomicExtentTag
, (
int
)
m_MaxGenomicExtent
);
124
view.
Set
(
kCompPenaltyTag
,
m_CompPenalty
);
125
view.
Set
(
kMaxIntron
, (
int
)
m_MaxIntron
);
126
view.
Set
(
kDiscType
,
m_DiscType
);
127
}
128
}
129
130
void
CSplignParams::LoadSettings
()
131
{
132
if
(!
m_RegPath
.empty()) {
133
CGuiRegistry
& gui_reg =
CGuiRegistry::GetInstance
();
134
CRegistryReadView
view = gui_reg.
GetReadView
(
m_RegPath
);
135
136
m_cDNA_strand
= view.
GetInt
(
kcDNA_strandTag
,
m_cDNA_strand
);
137
m_EndGapDetect
= view.
GetBool
(
kEndGapDetectTag
,
m_EndGapDetect
);
138
m_PolyADetect
= view.
GetBool
(
kPolyADetectTag
,
m_PolyADetect
);
139
m_MinCompIdentity
= view.
GetReal
(
kMinCompIdentityTag
,
m_MinCompIdentity
);
140
m_MinExonIdentity
= view.
GetReal
(
kMinExonIdentityTag
,
m_MinExonIdentity
);
141
m_MaxGenomicExtent
= view.
GetInt
(
kMaxGenomicExtentTag
,
static_cast<
int
>
(
m_MaxGenomicExtent
));
142
m_CompPenalty
= view.
GetReal
(
kCompPenaltyTag
,
m_CompPenalty
);
143
m_MaxIntron
= view.
GetInt
(
kMaxIntron
,
static_cast<
int
>
(
m_MaxIntron
));
144
m_DiscType
= view.
GetInt
(
kDiscType
,
m_DiscType
);
145
}
146
}
147
148
void
CSplignParams::DebugDump
(
CDebugDumpContext
ddc,
unsigned
int
/*depth*/
)
const
149
{
150
ddc.
SetFrame
(
"CSplignParams"
);
151
152
ddc.
Log
(
"cDNA strand"
,
m_cDNA_strand
);
153
ddc.
Log
(
"End Gap Detect"
,
m_EndGapDetect
);
154
ddc.
Log
(
"PolyA Detect"
,
m_PolyADetect
);
155
ddc.
Log
(
"Min Comp Identity"
,
m_MinCompIdentity
);
156
ddc.
Log
(
"Min Exon Identity"
,
m_MinExonIdentity
);
157
ddc.
Log
(
"Max Genomic Extent"
,
m_MaxGenomicExtent
);
158
ddc.
Log
(
"Comp Penalty"
,
m_CompPenalty
);
159
ddc.
Log
(
"Max Intron"
,
m_MaxIntron
);
160
ddc.
Log
(
"Disc Type"
,
m_DiscType
);
161
162
//ddc.Log( "",
163
//SConstScopedObject m_GenomicSeq;
164
//TConstScopedObjects m_cDNASeqs;
165
}
166
167
168
END_NCBI_SCOPE
CDebugDumpContext
Definition:
ddumpable.hpp:72
CDebugDumpContext::SetFrame
void SetFrame(const string &frame)
Definition:
ddumpable.cpp:137
CDebugDumpContext::Log
void Log(const string &name, const char *value, CDebugDumpFormatter::EValueType type=CDebugDumpFormatter::eValue, const string &comment=kEmptyStr)
Definition:
ddumpable.cpp:151
CGuiRegistry
Definition:
registry.hpp:43
CGuiRegistry::GetWriteView
CRegistryWriteView GetWriteView(const string §ion)
get a read-write view at a particular level.
Definition:
registry.cpp:462
CGuiRegistry::GetInstance
static CGuiRegistry & GetInstance()
access the application-wide singleton
Definition:
registry.cpp:400
CGuiRegistry::GetReadView
CRegistryReadView GetReadView(const string §ion) const
get a read-only view at a particular level.
Definition:
registry.cpp:428
CRegistryReadView
class CRegistryReadView provides a nested hierarchical view at a particular key.
Definition:
reg_view.hpp:58
CRegistryReadView::GetInt
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
CRegistryReadView::GetReal
double GetReal(const string &key, double default_val=0) const
Definition:
reg_view.cpp:235
CRegistryReadView::GetBool
bool GetBool(const string &key, bool default_val=false) const
Definition:
reg_view.cpp:241
CRegistryWriteView
Definition:
reg_view.hpp:138
CRegistryWriteView::Set
void Set(const string &key, int val)
access a named key at this level, with no recursion
Definition:
reg_view.cpp:533
CSplignParams
Definition:
splign_params.hpp:54
data
char data[12]
Definition:
iconv.c:80
CSplignParams::Copy
void Copy(const CSplignParams &data)
Definition:
splign_params.cpp:71
CSplignParams::CSplignParams
CSplignParams()
Definition:
splign_params.cpp:40
CSplignParams::operator==
bool operator==(const CSplignParams &data) const
Definition:
splign_params.cpp:56
CSplignParams::Init
void Init()
Definition:
splign_params.cpp:85
CSplignParams::m_RegPath
string m_RegPath
Definition:
splign_params.hpp:121
CSplignParams::m_cDNA_strand
int m_cDNA_strand
Definition:
splign_params.hpp:118
CSplignParams::m_MaxGenomicExtent
long m_MaxGenomicExtent
Definition:
splign_params.hpp:113
CSplignParams::m_MaxIntron
long m_MaxIntron
Definition:
splign_params.hpp:114
CSplignParams::m_PolyADetect
bool m_PolyADetect
Definition:
splign_params.hpp:117
CSplignParams::m_CompPenalty
double m_CompPenalty
Definition:
splign_params.hpp:110
CSplignParams::operator=
void operator=(const CSplignParams &data)
Definition:
splign_params.cpp:52
CSplignParams::LoadSettings
virtual void LoadSettings()
Definition:
splign_params.cpp:130
CSplignParams::DebugDump
virtual void DebugDump(CDebugDumpContext ddc, unsigned int depth) const
Definition:
splign_params.cpp:148
CSplignParams::m_MinCompIdentity
double m_MinCompIdentity
Definition:
splign_params.hpp:115
CSplignParams::m_MinExonIdentity
double m_MinExonIdentity
Definition:
splign_params.hpp:116
CSplignParams::SaveSettings
virtual void SaveSettings() const
Definition:
splign_params.cpp:112
CSplignParams::m_DiscType
int m_DiscType
Definition:
splign_params.hpp:111
CSplignParams::m_EndGapDetect
bool m_EndGapDetect
Definition:
splign_params.hpp:112
CSplignParams::~CSplignParams
~CSplignParams()
Definition:
splign_params.cpp:49
END_NCBI_SCOPE
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition:
ncbistl.hpp:103
BEGIN_NCBI_SCOPE
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition:
ncbistl.hpp:100
ncbi_pch.hpp
registry.hpp
kDiscType
static const char * kDiscType
Definition:
splign_params.cpp:109
kPolyADetectTag
static const char * kPolyADetectTag
Definition:
splign_params.cpp:107
kMaxIntron
static const char * kMaxIntron
Definition:
splign_params.cpp:108
kCompPenaltyTag
static const char * kCompPenaltyTag
Definition:
splign_params.cpp:106
kMinExonIdentityTag
static const char * kMinExonIdentityTag
Definition:
splign_params.cpp:104
kMaxGenomicExtentTag
static const char * kMaxGenomicExtentTag
Definition:
splign_params.cpp:105
kMinCompIdentityTag
static const char * kMinCompIdentityTag
Definition:
splign_params.cpp:103
kEndGapDetectTag
static const char * kEndGapDetectTag
Definition:
splign_params.cpp:102
kcDNA_strandTag
static const char * kcDNA_strandTag
Definition:
splign_params.cpp:101
splign_params.hpp
Generated by
1.9.0
Modified on Fri Sep 20 14:57:03 2024 by modify_doxy.py rev. 669887