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

Go to the SVN repository for this file.

1 /* $Id: Pssm.cpp 37548 2008-04-15 15:27:44Z camacho $
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  * Author: .......
27  *
28  * File Description:
29  * .......
30  *
31  * Remark:
32  * This code was originally generated by application DATATOOL
33  * using the following specifications:
34  * 'scoremat.asn'.
35  */
36 
37 // standard includes
38 #include <ncbi_pch.hpp>
39 
40 // generated includes
42 
43 // generated classes
44 
47 #include <objects/seq/Bioseq.hpp>
48 #include <objects/seq/Seq_inst.hpp>
49 #include <objects/seq/Seq_data.hpp>
51 
53 
54 BEGIN_objects_SCOPE // namespace ncbi::objects::
55 
56 // destructor
58 {
59 }
60 
63 {
64  SIZE_TYPE retval = 0;
65 
66  if ( !CanGetQuery() ||
67  !GetQuery().IsSeq() ||
68  !GetQuery().GetSeq().CanGetInst() ||
69  !GetQuery().GetSeq().GetInst().CanGetLength() ) {
70  return retval;
71  }
72  retval = GetQuery().GetSeq().GetInst().GetLength();
73  return retval;
74 }
75 
76 void
78 {
79  retval.Set().clear();
80  if ( !CanGetQuery() ||
81  !GetQuery().IsSeq() ||
82  !GetQuery().GetSeq().CanGetInst() ||
83  !GetQuery().GetSeq().GetInst().CanGetSeq_data() ) {
84  return;
85  }
86  const CSeq_data& seq_data = GetQuery().GetSeq().GetInst().GetSeq_data();
87  retval.Set().reserve(GetQueryLength());
88  if ( !seq_data.IsNcbistdaa() ) {
89  CSeq_data ncbistdaa;
90  CSeqportUtil::Convert(seq_data, &ncbistdaa, CSeq_data::e_Ncbistdaa);
91  copy(ncbistdaa.GetNcbistdaa().Get().begin(),
92  ncbistdaa.GetNcbistdaa().Get().end(),
93  back_inserter(retval.Set()));
94  } else {
95  copy(seq_data.GetNcbistdaa().Get().begin(),
96  seq_data.GetNcbistdaa().Get().end(),
97  back_inserter(retval.Set()));
98  }
99 }
100 
101 double
103 {
104  if ( !CanGetFinalData() || !GetFinalData().CanGetLambda() ) {
105  return kInvalidStat;
106  }
107  return GetFinalData().GetLambda();
108 }
109 
110 double
112 {
113  if ( !CanGetFinalData() || !GetFinalData().CanGetKappa() ) {
114  return kInvalidStat;
115  }
116  return GetFinalData().GetKappa();
117 }
118 
119 double
120 CPssm::GetH() const
121 {
122  if ( !CanGetFinalData() || !GetFinalData().CanGetH() ) {
123  return kInvalidStat;
124  }
125  return GetFinalData().GetH();
126 }
127 
128 double
130 {
131  if ( !CanGetFinalData() || !GetFinalData().CanGetLambdaUngapped() ) {
132  return kInvalidStat;
133  }
134  return GetFinalData().GetLambdaUngapped();
135 }
136 
137 double
139 {
140  if ( !CanGetFinalData() || !GetFinalData().CanGetKappaUngapped() ) {
141  return kInvalidStat;
142  }
143  return GetFinalData().GetKappaUngapped();
144 }
145 
146 double
148 {
149  if ( !CanGetFinalData() || !GetFinalData().CanGetHUngapped() ) {
150  return kInvalidStat;
151  }
152  return GetFinalData().GetHUngapped();
153 }
154 
155 const double CPssm::kInvalidStat = 0.0;
156 
157 void
158 CPssm::SetLambda(double val)
159 {
161 }
162 
163 void
164 CPssm::SetKappa(double val)
165 {
167 }
168 
169 void
170 CPssm::SetH(double val)
171 {
172  SetFinalData().SetH(val);
173 }
174 
175 void
177 {
179 }
180 
181 void
183 {
185 }
186 
187 void
189 {
191 }
192 
193 END_objects_SCOPE // namespace ncbi::objects::
194 
196 
197 /* Original file checksum: lines: 57, chars: 1711, CRC32: bcca969d */
User-defined methods of the data storage class.
User-defined methods of the data storage class.
CNCBIstdaa –.
Definition: NCBIstdaa.hpp:66
double GetH() const
Definition: Pssm.cpp:120
void SetHUngapped(double val)
Definition: Pssm.cpp:188
void SetH(double val)
Definition: Pssm.cpp:170
double GetKappa() const
Definition: Pssm.cpp:111
double GetKappaUngapped() const
Definition: Pssm.cpp:138
void GetQuerySequenceData(CNCBIstdaa &sequence) const
Retrieve the query sequence data in ncbistdaa format.
Definition: Pssm.cpp:77
void SetLambdaUngapped(double val)
Definition: Pssm.cpp:176
~CPssm(void)
Definition: Pssm.cpp:57
double GetLambdaUngapped() const
Definition: Pssm.cpp:129
static const double kInvalidStat
Definition: Pssm.hpp:71
double GetHUngapped() const
Definition: Pssm.cpp:147
double GetLambda() const
Definition: Pssm.cpp:102
void SetKappa(double val)
Definition: Pssm.cpp:164
SIZE_TYPE GetQueryLength() const
Return the query length or 0 if no query is available.
Definition: Pssm.cpp:62
void SetKappaUngapped(double val)
Definition: Pssm.cpp:182
void SetLambda(double val)
Definition: Pssm.cpp:158
static TSeqPos Convert(const CSeq_data &in_seq, CSeq_data *out_seq, CSeq_data::E_Choice to_code, TSeqPos uBeginIdx=0, TSeqPos uLength=0, bool bAmbig=false, Uint4 seed=17734276)
TPrim & Set(void)
Definition: serialbase.hpp:351
const TPrim & Get(void) const
Definition: serialbase.hpp:347
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
NCBI_NS_STD::string::size_type SIZE_TYPE
Definition: ncbistr.hpp:132
const TQuery & GetQuery(void) const
Get the Query member data.
Definition: Pssm_.hpp:772
void SetLambda(TLambda value)
Assign a value to Lambda data member.
TH GetH(void) const
Get the H member data.
TKappa GetKappa(void) const
Get the Kappa member data.
void SetKappaUngapped(TKappaUngapped value)
Assign a value to KappaUngapped data member.
void SetKappa(TKappa value)
Assign a value to Kappa data member.
const TFinalData & GetFinalData(void) const
Get the FinalData member data.
Definition: Pssm_.hpp:814
bool CanGetFinalData(void) const
Check if it is safe to call GetFinalData method.
Definition: Pssm_.hpp:808
void SetLambdaUngapped(TLambdaUngapped value)
Assign a value to LambdaUngapped data member.
void SetHUngapped(THUngapped value)
Assign a value to HUngapped data member.
THUngapped GetHUngapped(void) const
Get the HUngapped member data.
bool CanGetQuery(void) const
Check if it is safe to call GetQuery method.
Definition: Pssm_.hpp:766
TLambdaUngapped GetLambdaUngapped(void) const
Get the LambdaUngapped member data.
TKappaUngapped GetKappaUngapped(void) const
Get the KappaUngapped member data.
void SetH(TH value)
Assign a value to H data member.
TFinalData & SetFinalData(void)
Assign a value to FinalData data member.
Definition: Pssm_.cpp:121
TLambda GetLambda(void) const
Get the Lambda member data.
const TSeq & GetSeq(void) const
Get the variant data.
Definition: Seq_entry_.cpp:102
const TInst & GetInst(void) const
Get the Inst member data.
Definition: Bioseq_.hpp:336
bool IsNcbistdaa(void) const
Check if variant Ncbistdaa is selected.
Definition: Seq_data_.hpp:684
TLength GetLength(void) const
Get the Length member data.
Definition: Seq_inst_.hpp:659
const TNcbistdaa & GetNcbistdaa(void) const
Get the variant data.
Definition: Seq_data_.hpp:690
const TSeq_data & GetSeq_data(void) const
Get the Seq_data member data.
Definition: Seq_inst_.hpp:817
@ e_Ncbistdaa
consecutive codes for std aas
Definition: Seq_data_.hpp:113
void copy(Njn::Matrix< S > *matrix_, const Njn::Matrix< T > &matrix0_)
Definition: njn_matrix.hpp:613
Modified on Wed Apr 24 14:19:40 2024 by modify_doxy.py rev. 669887