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

Go to the SVN repository for this file.

1 /* $Id: coiled_coil.hpp 33815 2007-05-04 17:18:18Z kazimird $
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: Josh Cherry
27  *
28  * File Description: Prediction of coiled coil regions of proteins
29  * according to Lupas et al., 1991 (PMID 2031185)
30  *
31  */
32 
33 
34 #ifndef ALGO_SEQUENCE___COILED_COIL__HPP
35 #define ALGO_SEQUENCE___COILED_COIL__HPP
36 
37 #include <corelib/ncbistd.hpp>
39 #include <objmgr/seq_vector.hpp>
40 #include <vector>
41 #include <algorithm>
42 
44 
46 {
47 public:
48  /// For each sequence position, compute the best
49  /// coiled coil score, and the corresponding frame,
50  /// using a window of length win_len (article uses 28).
51  /// For char containers, seq must be in ncbistdaa.
52  static void ComputeScores(const string& seq, vector<double>& scores,
53  vector<unsigned int>& frames,
54  TSeqPos win_len = 28);
55 
56  static void ComputeScores(const vector<char>& seq, vector<double>& scores,
57  vector<unsigned int>& frames,
58  TSeqPos win_len = 28);
59 
60  static void ComputeScores(const objects::CSeqVector& seq,
61  vector<double>& scores,
62  vector<unsigned int>& frames,
63  TSeqPos win_len = 28);
64 
65  /// convert a score to a probability of being a coiled coil
66  static double ScoreToProb(double score);
67  /// score to probability for a whole vector
68  static void ScoreToProb(const vector<double>& scores,
69  vector<double>& probs);
70 
71  /// predict CC regions from sequence;
72  /// return top score
73  static double PredictRegions(const vector<char>& seq,
74  vector<CRef<objects::CSeq_loc> >& regions,
75  vector<double>& max_scores,
76  TSeqPos win_len = 28);
77 
78  static double PredictRegions(const string& seq,
79  vector<CRef<objects::CSeq_loc> >& regions,
80  vector<double>& max_scores,
81  TSeqPos win_len = 28);
82 
83  static double PredictRegions(const objects::CSeqVector& seq,
84  vector<CRef<objects::CSeq_loc> >& regions,
85  vector<double>& max_scores,
86  TSeqPos win_len = 28);
87 
88 private:
89  static void x_PredictRegions(const vector<double>& scores,
90  vector<CRef<objects::CSeq_loc> >& regions,
91  vector<double>& max_scores);
92 
93  template<class Seq>
94  friend void CCoil_ComputeScores(const Seq& seq, vector<double>& scores,
95  vector<unsigned int>& frames,
96  TSeqPos win_len);
97 
98  template<class Seq>
99  friend double
100  CCoil_PredictRegions(const Seq& seq,
101  vector<CRef<objects::CSeq_loc> >& regions,
102  vector<double>& max_scores, TSeqPos win_len);
103 
104  static const double sm_Propensities[26][7];
105 };
106 
107 
109 
110 #endif // ALGO_SEQUENCE___COILED_COIL__HPP
static void ComputeScores(const objects::CSeqVector &seq, vector< double > &scores, vector< unsigned int > &frames, TSeqPos win_len=28)
double CCoil_PredictRegions(const Seq &seq, vector< CRef< objects::CSeq_loc > > &regions, vector< double > &max_scores, TSeqPos win_len)
void CCoil_ComputeScores(const Seq &seq, vector< double > &scores, vector< unsigned int > &frames, TSeqPos win_len)
Definition: coiled_coil.cpp:76
Include a standard set of the NCBI C++ Toolkit most basic headers.
unsigned int TSeqPos
Type for sequence locations and lengths.
Definition: ncbimisc.hpp:875
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
#define NCBI_XALGOSEQ_EXPORT
Definition: ncbi_export.h:1017
Modified on Sun May 19 04:42:32 2024 by modify_doxy.py rev. 669887