Egglib 2.1.11
C++ library reference manual
Convert.hpp
1 /*
2  Copyright 2009,2013 Stéphane De Mita, Mathieu Siol
3 
4  This file is part of the EggLib library.
5 
6  EggLib is free software: you can redistribute it and/or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation, either version 3 of the License, or
9  (at your option) any later version.
10 
11  EggLib is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU General Public License for more details.
15 
16  You should have received a copy of the GNU General Public License
17  along with EggLib. If not, see <http://www.gnu.org/licenses/>.
18 */
19 
20 
21 #ifndef EGGLIB_CONVERT_HPP
22 #define EGGLIB_CONVERT_HPP
23 
24 #include "DataMatrix.hpp"
25 #include "Align.hpp"
26 #include "EggException.hpp"
27 #include "Random.hpp"
28 #include <string>
29 
30 #include "config.h"
31 
32 #ifdef HAVE_LIBBPP_SEQ
33 #include <Bpp/Seq/Alphabet/DNA.h>
34 #include <Bpp/Seq/Alphabet/RNA.h>
35 #include <Bpp/Seq/Alphabet/ProteicAlphabet.h>
36 #include <Bpp/Seq/Alphabet/CodonAlphabet.h>
37 #include <Bpp/Seq/Sequence.h>
38 #include <Bpp/Seq/Container/AlignedSequenceContainer.h>
39 #endif
40 
41 namespace egglib {
42 
43 
52  class Convert {
53 
54  public:
55 
137  static Align align(
138  DataMatrix& dataMatrix,
139  unsigned int length=0,
140  Random* random=NULL,
141  bool randomizePositions=false,
142  bool randomizeNonVaryingStates=false,
143  bool randomizeAlleles=false,
144  bool enforceLength=false,
145  std::string mapping="ACGT",
146  char unknown='?',
147  char nonVaryingState='A'
148  );
149 
150 
151 #ifdef HAVE_LIBBPP_SEQ
152 
187  static bpp::AlignedSequenceContainer egglib2bpp(Align& align, unsigned int alphabetID, unsigned int outgroupFlag, unsigned int offset=0);
188 
189 #endif
190 
191  protected:
192 
196  Convert() { }
197 
198 
202  Convert(const Convert& source) { }
203 
204 
208  Convert& operator=(const Convert& source) { return *this; }
209 
210 
214  virtual ~Convert() { }
215 
216 #ifdef HAVE_LIBBPP_SEQ
217  static bpp::DNA dnaAlphabet;
218  static bpp::RNA rnaAlphabet;
219  static bpp::ProteicAlphabet proteicAlphabet;
220  static bpp::CodonAlphabet CodonAlphabet;
221 #endif
222 
223  };
224 }
225 
226 #endif
Pseudo-random number generator.
Definition: Random.hpp:41
Data table.
Definition: DataMatrix.hpp:41
Performs conversion between sequence holder types.
Definition: Convert.hpp:52
Convert(const Convert &source)
This class cannot be instantiated.
Definition: Convert.hpp:202
Convert()
This class cannot be instantiated.
Definition: Convert.hpp:196
static bpp::AlignedSequenceContainer egglib2bpp(Align &align, unsigned int alphabetID, unsigned int outgroupFlag, unsigned int offset=0)
Converts an alignment to the equivalent Bio++ type.
Definition: Convert.cpp:217
virtual ~Convert()
This class cannot be instantiated.
Definition: Convert.hpp:214
Definition: ABC.cpp:37
Convert & operator=(const Convert &source)
This class cannot be instantiated.
Definition: Convert.hpp:208
Handles a sequence alignment.
Definition: Align.hpp:76
static Align align(DataMatrix &dataMatrix, unsigned int length=0, Random *random=NULL, bool randomizePositions=false, bool randomizeNonVaryingStates=false, bool randomizeAlleles=false, bool enforceLength=false, std::string mapping="ACGT", char unknown='?', char nonVaryingState='A')
DataMatrix to Align conversion.
Definition: Convert.cpp:32

Hosted by 
Get EggLib at SourceForge.net. Fast, secure and Free Open Source software downloads