bpp-seq  2.2.0
RNA.h
Go to the documentation of this file.
1 //
2 // File: RNA.h
3 // Created by: Guillaume Deuchst
4 // Created on: Tue Jul 22 2003
5 //
6 
7 /*
8  Copyright or © or Copr. Bio++ Development Team, (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 _RNA_H_
41 #define _RNA_H_
42 
43 #include "NucleicAlphabet.h"
44 
45 //From the STL:
46 #include <string>
47 
48 namespace bpp
49 {
50 
58  class RNA:
59  public NucleicAlphabet
60  {
61  public:
66  RNA(bool exclamationMarkCountsAsGap = false);
67 
68  RNA(const RNA& bia) : NucleicAlphabet(bia) {}
69 
70  RNA& operator=(const RNA& bia)
71  {
73  return *this;
74  }
75 
76  RNA* clone() const
77  {
78  return new RNA(*this);
79  }
80 
81  virtual ~RNA() {}
82 
83  public:
84  std::vector<int> getAlias(int state) const throw (BadIntException);
85  std::vector<std::string> getAlias(const std::string & state) const throw (BadCharException);
86  int getGeneric(const std::vector<int> & states) const throw (BadIntException);
87  std::string getGeneric(const std::vector<std::string> & states) const throw (BadCharException);
88  std::string getAlphabetType() const { return "RNA alphabet"; }
89  };
90 
91 } //end of namespace bpp.
92 
93 #endif // _RNA_H_
An alphabet exception thrown when trying to specify a bad char to the alphabet.
NucleicAlphabet & operator=(const NucleicAlphabet &bia)
This alphabet is used to deal NumericAlphabet.
std::string getAlphabetType() const
Identification method.
Definition: RNA.h:88
virtual ~RNA()
Definition: RNA.h:81
RNA(bool exclamationMarkCountsAsGap=false)
Definition: RNA.cpp:55
RNA * clone() const
Definition: RNA.h:76
int getGeneric(const std::vector< int > &states) const
Get the generic state that match a set of states.
Definition: RNA.cpp:122
RNA & operator=(const RNA &bia)
Definition: RNA.h:70
std::vector< int > getAlias(int state) const
Get all resolved states that match a generic state.
Definition: RNA.cpp:87
An alphabet exception thrown when trying to specify a bad int to the alphabet.
This alphabet is used to deal with RNA sequences.
Definition: RNA.h:58
The abstract base class for nucleic alphabets.
RNA(const RNA &bia)
Definition: RNA.h:68