bpp-seq  2.2.0
Stockholm.h
Go to the documentation of this file.
1 //
2 // File: Stockholm.h
3 // Authors: Julien Dutheil
4 // Created: Thu Apr 15 2010
5 //
6 
7 /*
8 Copyright or © or Copr. Bio++ Development Team (2010)
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 _STOCKHOLM_H_
41 #define _STOCKHOLM_H_
42 
43 #include "AbstractOAlignment.h"
44 #include "../Sequence.h"
45 #include "../Container/SequenceContainer.h"
46 #include "../Container/AlignedSequenceContainer.h"
47 
48 namespace bpp
49 {
50 
57 class Stockholm:
58  public AbstractOAlignment
59 {
60  private:
61 
63 
64  public:
65 
71  Stockholm(bool checkSequenceNames = true) : checkNames_(checkSequenceNames) {}
72 
73  // Class destructor
74  virtual ~Stockholm() {}
75 
76  public:
77 
83  void writeAlignment(std::ostream& output, const SiteContainer& sc) const throw (Exception);
84  void writeAlignment(const std::string& path, const SiteContainer& sc, bool overwrite = true) const throw (Exception)
85  {
86  AbstractOAlignment::writeAlignment(path, sc, overwrite);
87  }
95  const std::string getFormatName() const { return "Stockholm file"; };
96  const std::string getFormatDescription() const
97  {
98  return "See http://en.wikipedia.org/wiki/Stockholm_format";
99  }
106  bool checkNames() const { return checkNames_; }
107 
114  void checkNames(bool yn) { checkNames_ = yn; }
115 };
116 
117 } //end of namespace bpp.
118 
119 #endif // _FASTA_H_
120 
void checkNames(bool yn)
Tell whether the sequence names should be checked when reading from files.
Definition: Stockholm.h:114
The SiteContainer interface.
Definition: SiteContainer.h:63
virtual ~Stockholm()
Definition: Stockholm.h:74
This alphabet is used to deal NumericAlphabet.
The Stockholm alignment file format.
Definition: Stockholm.h:57
void writeAlignment(const std::string &path, const SiteContainer &sc, bool overwrite=true) const
Write a container to a file.
Definition: Stockholm.h:84
bool checkNames_
Definition: Stockholm.h:62
const std::string getFormatName() const
Definition: Stockholm.h:95
bool checkNames() const
Definition: Stockholm.h:106
void writeAlignment(std::ostream &output, const SiteContainer &sc) const
Write a container to a stream.
Definition: Stockholm.cpp:54
Stockholm(bool checkSequenceNames=true)
Build a new Stockholm object.
Definition: Stockholm.h:71
const std::string getFormatDescription() const
Definition: Stockholm.h:96
Partial implementation of the OAlignment interface.
void writeAlignment(std::ostream &output, const SiteContainer &sc) const =0
Write a container to a stream.