coiled_coil.hpp
上传用户:yhdzpy8989
上传日期:2007-06-13
资源大小:13604k
文件大小:5k
源码类别:

生物技术

开发平台:

C/C++

  1. /*
  2.  * ===========================================================================
  3.  * PRODUCTION $Log: coiled_coil.hpp,v $
  4.  * PRODUCTION Revision 1000.0  2003/10/29 19:28:06  gouriano
  5.  * PRODUCTION PRODUCTION: IMPORTED [ORIGINAL] Dev-tree R1.4
  6.  * PRODUCTION
  7.  * ===========================================================================
  8.  */
  9. /*  $Id: coiled_coil.hpp,v 1000.0 2003/10/29 19:28:06 gouriano Exp $
  10.  * ===========================================================================
  11.  *
  12.  *                            PUBLIC DOMAIN NOTICE
  13.  *               National Center for Biotechnology Information
  14.  *
  15.  *  This software/database is a "United States Government Work" under the
  16.  *  terms of the United States Copyright Act.  It was written as part of
  17.  *  the author's official duties as a United States Government employee and
  18.  *  thus cannot be copyrighted.  This software/database is freely available
  19.  *  to the public for use. The National Library of Medicine and the U.S.
  20.  *  Government have not placed any restriction on its use or reproduction.
  21.  *
  22.  *  Although all reasonable efforts have been taken to ensure the accuracy
  23.  *  and reliability of the software and data, the NLM and the U.S.
  24.  *  Government do not and cannot warrant the performance or results that
  25.  *  may be obtained by using this software or data. The NLM and the U.S.
  26.  *  Government disclaim all warranties, express or implied, including
  27.  *  warranties of performance, merchantability or fitness for any particular
  28.  *  purpose.
  29.  *
  30.  *  Please cite the author in any work or product based on this material.
  31.  *
  32.  * ===========================================================================
  33.  *
  34.  * Authors:  Josh Cherry
  35.  *
  36.  * File Description:  Prediction of coiled coil regions of proteins
  37.  *                    according to Lupas et al., 1991 (PMID 2031185)
  38.  *
  39.  */
  40. #ifndef ALGO_SEQUENCE___COILED_COIL__HPP
  41. #define ALGO_SEQUENCE___COILED_COIL__HPP
  42. #include <corelib/ncbistd.hpp>
  43. #include <objects/seqloc/Seq_loc.hpp>
  44. #include <objmgr/seq_vector.hpp>
  45. #include <vector>
  46. #include <algorithm>
  47. BEGIN_NCBI_SCOPE
  48. class NCBI_XALGOSEQ_EXPORT CCoiledCoil
  49. {
  50. public:
  51.     /// For each sequence position, compute the best
  52.     /// coiled coil score, and the corresponding frame,
  53.     /// using a window of length win_len (article uses 28).
  54.     /// For char containers, seq must be in ncbistdaa.
  55.     static void ComputeScores(const string& seq, vector<double>& scores,
  56.                               vector<unsigned int>& frames,
  57.                               TSeqPos win_len = 28);
  58.     static void ComputeScores(const vector<char>& seq, vector<double>& scores,
  59.                               vector<unsigned int>& frames,
  60.                               TSeqPos win_len = 28);
  61.     static void ComputeScores(const objects::CSeqVector& seq,
  62.                               vector<double>& scores,
  63.                               vector<unsigned int>& frames,
  64.                               TSeqPos win_len = 28);
  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.     /// predict CC regions from sequence;
  71.     /// return top score
  72.     static double PredictRegions(const vector<char>& seq,
  73.                                  vector<CRef<objects::CSeq_loc> >& regions,
  74.                                  vector<double>& max_scores,
  75.                                  TSeqPos win_len = 28);
  76.     static double PredictRegions(const string& seq,
  77.                                  vector<CRef<objects::CSeq_loc> >& regions,
  78.                                  vector<double>& max_scores,
  79.                                  TSeqPos win_len = 28);
  80.     static double PredictRegions(const objects::CSeqVector& seq,
  81.                                  vector<CRef<objects::CSeq_loc> >& regions,
  82.                                  vector<double>& max_scores,
  83.                                  TSeqPos win_len = 28);
  84. private:
  85.     static void x_PredictRegions(const vector<double>& scores,
  86.                                  vector<CRef<objects::CSeq_loc> >& regions,
  87.                                  vector<double>& max_scores);
  88.     template<class Seq>
  89.     friend void CCoil_ComputeScores(const Seq& seq, vector<double>& scores,
  90.                                     vector<unsigned int>& frames,
  91.                                     TSeqPos win_len);
  92.     template<class Seq>
  93.     friend double
  94.     CCoil_PredictRegions(const Seq& seq,
  95.                          vector<CRef<objects::CSeq_loc> >& regions,
  96.                          vector<double>& max_scores, TSeqPos win_len);
  97.     static const double sm_Propensities[26][7];
  98. };
  99. END_NCBI_SCOPE
  100. #endif  // ALGO_SEQUENCE___COILED_COIL__HPP
  101. /*
  102.  * ===========================================================================
  103.  * $Log: coiled_coil.hpp,v $
  104.  * Revision 1000.0  2003/10/29 19:28:06  gouriano
  105.  * PRODUCTION: IMPORTED [ORIGINAL] Dev-tree R1.4
  106.  *
  107.  * Revision 1.4  2003/09/10 14:22:11  ucko
  108.  * Remove a redundant occurrence of CCoiledCoil::.
  109.  *
  110.  * Revision 1.3  2003/09/09 18:30:48  ucko
  111.  * Fixes for WorkShop, which (still) doesn't let templates access
  112.  * anything file-static.
  113.  *
  114.  * Revision 1.2  2003/09/09 16:09:08  dicuccio
  115.  * Fixes for MSVC.  Moved member template into implementation file to avoid
  116.  * naming / export conflicts.  Moved lookup table to implementation file.
  117.  *
  118.  * Revision 1.1  2003/09/08 16:15:13  jcherry
  119.  * Initial version
  120.  *
  121.  * ===========================================================================
  122.  */