~ubuntu-branches/ubuntu/oneiric/libbpp-seq/oneiric

« back to all changes in this revision

Viewing changes to src/Bpp/Seq/StateProperties/AAChouFasmanBSheetIndex.h

  • Committer: Bazaar Package Importer
  • Author(s): Julien Dutheil
  • Date: 2011-06-09 11:00:00 UTC
  • Revision ID: james.westby@ubuntu.com-20110609110000-hnfrd9it0np58l54
Tags: upstream-2.0.2
Import upstream version 2.0.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
//
 
2
// File: AAChouFasmanBSheetIndex.h
 
3
// Created by: Bastien Boussau
 
4
// Created on: Fri Jan 14 10:31 2011
 
5
//
 
6
 
 
7
/*
 
8
 Copyright or © or Copr. CNRS, (November 17, 2004)
 
9
 
 
10
 This software is a computer program whose purpose is to provide classes
 
11
 for sequences analysis.
 
12
 
 
13
 This software is governed by the CeCILL  license under French law and
 
14
 abiding by the rules of distribution of free software.  You can  use, 
 
15
 modify and/ or redistribute the software under the terms of the CeCILL
 
16
 license as circulated by CEA, CNRS and INRIA at the following URL
 
17
 "http://www.cecill.info". 
 
18
 
 
19
 As a counterpart to the access to the source code and  rights to copy,
 
20
 modify and redistribute granted by the license, users are provided only
 
21
 with a limited warranty  and the software's author,  the holder of the
 
22
 economic rights,  and the successive licensors  have only  limited
 
23
 liability. 
 
24
 
 
25
 In this respect, the user's attention is drawn to the risks associated
 
26
 with loading,  using,  modifying and/or developing or reproducing the
 
27
 software by the user in light of its specific status of free software,
 
28
 that may mean  that it is complicated to manipulate,  and  that  also
 
29
 therefore means  that it is reserved for developers  and  experienced
 
30
 professionals having in-depth computer knowledge. Users are therefore
 
31
 encouraged to load and test the software's suitability as regards their
 
32
 requirements in conditions enabling the security of their systems and/or 
 
33
 data to be ensured and,  more generally, to use and operate it in the 
 
34
 same conditions as regards security. 
 
35
 
 
36
 The fact that you are presently reading this means that you have had
 
37
 knowledge of the CeCILL license and that you accept its terms.
 
38
 */
 
39
 
 
40
#ifndef _AACHUFASMANBSHEETINDEX_H_
 
41
#define _AACHUFASMANBSHEETINDEX_H_
 
42
 
 
43
#include "AlphabetIndex1.h"
 
44
#include "../Alphabet/ProteicAlphabet.h"
 
45
 
 
46
namespace bpp
 
47
{
 
48
  
 
49
  /**
 
50
   * @brief B-sheet score for the Chou-Fasman algorithm of secondary structure prediction, according to http://prowl.rockefeller.edu/aainfo/chou.htm
 
51
   * 
 
52
   * 
 
53
   */
 
54
  class AAChouFasmanBSheetIndex:
 
55
  public AlphabetIndex1<double>
 
56
  {
 
57
  private:
 
58
  std::vector<double> bSheet_;
 
59
  
 
60
  public:
 
61
  AAChouFasmanBSheetIndex() :
 
62
  bSheet_()
 
63
  {
 
64
  bSheet_.resize(20);
 
65
  bSheet_[ 0] =  83; //A
 
66
  bSheet_[ 1] =  93; //R
 
67
  bSheet_[ 2] =  89; //N
 
68
  bSheet_[ 3] =  54; //D
 
69
  bSheet_[ 4] =  119; //C
 
70
  bSheet_[ 5] =  110; //Q
 
71
  bSheet_[ 6] =  37; //E
 
72
  bSheet_[ 7] =  75; //G
 
73
  bSheet_[ 8] =  87; //H
 
74
  bSheet_[ 9] =  160; //I
 
75
  bSheet_[10] =  130; //L
 
76
  bSheet_[11] =  74; //K
 
77
  bSheet_[12] =  105; //M
 
78
  bSheet_[13] =  138; //F
 
79
  bSheet_[14] =  55; //P
 
80
  bSheet_[15] =  75; //S
 
81
  bSheet_[16] =  119; //T
 
82
  bSheet_[17] =  137; //W
 
83
  bSheet_[18] =  147; //Y
 
84
  bSheet_[19] =  170; //V
 
85
  }
 
86
  
 
87
  virtual ~AAChouFasmanBSheetIndex() {}
 
88
  
 
89
  AAChouFasmanBSheetIndex* clone() const { return new AAChouFasmanBSheetIndex(); }
 
90
  
 
91
  public:
 
92
  double getIndex(int state) const throw (BadIntException)
 
93
  {
 
94
  if (state < 0 || state > 19) throw BadIntException(state, "AAChouFasmanBSheetIndex::getIndex(). Invalid state.", &AlphabetTools::PROTEIN_ALPHABET);
 
95
  return bSheet_[state];
 
96
  }
 
97
  
 
98
  double getIndex(const std::string& state) const throw (BadCharException)
 
99
  {
 
100
  return bSheet_[AlphabetTools::PROTEIN_ALPHABET.charToInt(state)];
 
101
  }
 
102
  
 
103
  std::vector<double>* getIndexVector() const { return new std::vector<double>(bSheet_); }
 
104
  
 
105
  const Alphabet* getAlphabet() const { return &AlphabetTools::PROTEIN_ALPHABET; }
 
106
  
 
107
  };
 
108
  
 
109
} //end of namespace bpp.
 
110
 
 
111
#endif //_AACHUFASMANBSHEETINDEX_H_
 
112
 
 
113