bpp-seq  2.2.0
SequenceApplicationTools.h
Go to the documentation of this file.
1 //
2 // File: SequenceApplicationTools.h
3 // Created by: Julien Dutheil
4 // Created on: Fri Oct 21 13:13
5 // from file old ApplicationTools.h created on Sun Dec 14 09:36:26 2003
6 //
7 
8 /*
9  Copyright or © or Copr. Bio++ Development Team, (November 17, 2004)
10 
11  This software is a computer program whose purpose is to provide classes
12  for sequences analysis.
13 
14  This software is governed by the CeCILL license under French law and
15  abiding by the rules of distribution of free software. You can use,
16  modify and/ or redistribute the software under the terms of the CeCILL
17  license as circulated by CEA, CNRS and INRIA at the following URL
18  "http://www.cecill.info".
19 
20  As a counterpart to the access to the source code and rights to copy,
21  modify and redistribute granted by the license, users are provided only
22  with a limited warranty and the software's author, the holder of the
23  economic rights, and the successive licensors have only limited
24  liability.
25 
26  In this respect, the user's attention is drawn to the risks associated
27  with loading, using, modifying and/or developing or reproducing the
28  software by the user in light of its specific status of free software,
29  that may mean that it is complicated to manipulate, and that also
30  therefore means that it is reserved for developers and experienced
31  professionals having in-depth computer knowledge. Users are therefore
32  encouraged to load and test the software's suitability as regards their
33  requirements in conditions enabling the security of their systems and/or
34  data to be ensured and, more generally, to use and operate it in the
35  same conditions as regards security.
36 
37  The fact that you are presently reading this means that you have had
38  knowledge of the CeCILL license and that you accept its terms.
39 */
40 
41 #ifndef _SEQUENCEAPPLICATIONTOOLS_H_
42 #define _SEQUENCEAPPLICATIONTOOLS_H_
43 
44 #include "../Alphabet/Alphabet.h"
45 #include "../GeneticCode/GeneticCode.h"
46 #include "../AlphabetIndex/AlphabetIndex1.h"
47 #include "../AlphabetIndex/AlphabetIndex2.h"
48 #include "../Container/SequenceContainer.h"
49 #include "../Container/VectorSiteContainer.h"
50 
51 #include <map>
52 #include <string>
53 
54 namespace bpp
55 {
71  {
72  public:
75 
76  public:
99  static Alphabet* getAlphabet(
100  std::map<std::string, std::string>& params,
101  const std::string& suffix = "",
102  bool suffixIsOptional = true,
103  bool verbose = true,
104  bool allowGeneric = false,
105  int warn = 1) throw (Exception);
106 
120  static GeneticCode* getGeneticCode(const NucleicAlphabet* alphabet, const std::string& description) throw (Exception);
121 
133  const Alphabet* alphabet,
134  const std::string& description,
135  const std::string& message = "Alphabet distance:",
136  bool verbose = true) throw (Exception);
137 
138 
150  const Alphabet* alphabet,
151  const std::string& description,
152  const std::string& message = "Alphabet distance:",
153  bool verbose = true) throw (Exception);
154 
155 
175  const Alphabet* alpha,
176  std::map<std::string, std::string>& params,
177  const std::string& suffix = "",
178  bool suffixIsOptional = true,
179  bool verbose = true,
180  int warn = 1);
181 
199  const Alphabet* alpha,
200  std::map<std::string, std::string>& params,
201  const std::string& suffix = "",
202  bool suffixIsOptional = true,
203  bool verbose = true,
204  int warn = 1);
205 
235  const SiteContainer& allSites,
236  std::map<std::string, std::string>& params,
237  std::string suffix = "",
238  bool suffixIsOptional = true,
239  bool gapAsUnknown = true,
240  bool verbose = true,
241  int warn = 1);
242 
258  static void writeSequenceFile(
259  const SequenceContainer& sequences,
260  std::map<std::string, std::string>& params,
261  const std::string& suffix = "",
262  bool verbose = true,
263  int warn = 1);
264 
278  static void writeAlignmentFile(
279  const SiteContainer& sequences,
280  std::map<std::string, std::string>& params,
281  const std::string& suffix = "",
282  bool verbose = true,
283  int warn = 1);
284  };
285 } // end of namespace bpp.
286 
287 #endif // _SEQUENCEAPPLICATIONTOOLS_H_
288 
static GeneticCode * getGeneticCode(const NucleicAlphabet *alphabet, const std::string &description)
Build a GeneticCode object according to options.
The SiteContainer interface.
Definition: SiteContainer.h:63
This alphabet is used to deal NumericAlphabet.
The Alphabet interface.
Definition: Alphabet.h:130
STL namespace.
static VectorSiteContainer * getSiteContainer(const Alphabet *alpha, std::map< std::string, std::string > &params, const std::string &suffix="", bool suffixIsOptional=true, bool verbose=true, int warn=1)
Build a SiteContainer object according to options.
static AlphabetIndex2 * getAlphabetIndex2(const Alphabet *alphabet, const std::string &description, const std::string &message="Alphabet distance:", bool verbose=true)
Build a AlphabetIndex2 object for a given alphabet.
This class provides some common tools for applications.
One dimensionnal alphabet index interface.
static SequenceContainer * getSequenceContainer(const Alphabet *alpha, std::map< std::string, std::string > &params, const std::string &suffix="", bool suffixIsOptional=true, bool verbose=true, int warn=1)
Build a SequenceContainer object according to options.
static void writeAlignmentFile(const SiteContainer &sequences, std::map< std::string, std::string > &params, const std::string &suffix="", bool verbose=true, int warn=1)
Write a sequence alignment file according to options.
Two dimensionnal alphabet index interface.
static AlphabetIndex1 * getAlphabetIndex1(const Alphabet *alphabet, const std::string &description, const std::string &message="Alphabet distance:", bool verbose=true)
Build a AlphabetIndex1 object for a given alphabet.
static VectorSiteContainer * getSitesToAnalyse(const SiteContainer &allSites, std::map< std::string, std::string > &params, std::string suffix="", bool suffixIsOptional=true, bool gapAsUnknown=true, bool verbose=true, int warn=1)
Retrieves sites suitable for the analysis.
Partial implementation of the Transliterator interface for genetic code object.
Definition: GeneticCode.h:79
static Alphabet * getAlphabet(std::map< std::string, std::string > &params, const std::string &suffix="", bool suffixIsOptional=true, bool verbose=true, bool allowGeneric=false, int warn=1)
Build an Alphabet object according to options.
static void writeSequenceFile(const SequenceContainer &sequences, std::map< std::string, std::string > &params, const std::string &suffix="", bool verbose=true, int warn=1)
Write a sequence file according to options.
The SequenceContainer interface.
The abstract base class for nucleic alphabets.
The VectorSiteContainer class.