bpp-seq3  3.0.0
Stockholm.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: The Bio++ Development Group
2 //
3 // SPDX-License-Identifier: CECILL-2.1
4 
5 #ifndef BPP_SEQ_IO_STOCKHOLM_H
6 #define BPP_SEQ_IO_STOCKHOLM_H
7 
8 
9 #include "../Container/AlignedSequenceContainer.h"
10 #include "../Container/SequenceContainer.h"
11 #include "../Sequence.h"
12 #include "AbstractOAlignment.h"
13 
14 namespace bpp
15 {
22 class Stockholm :
23  public AbstractOAlignment
24 {
25 private:
27 
28 public:
34  Stockholm(bool checkSequenceNames = true) : checkNames_(checkSequenceNames) {}
35 
36  // Class destructor
37  virtual ~Stockholm() {}
38 
39 public:
45  void writeAlignment(std::ostream& output, const SiteContainerInterface& sc) const override;
46  void writeAlignment(const std::string& path, const SiteContainerInterface& sc, bool overwrite = true) const override
47  {
48  AbstractOAlignment::writeAlignment(path, sc, overwrite);
49  }
57  const std::string getFormatName() const override { return "Stockholm file"; }
58  const std::string getFormatDescription() const override
59  {
60  return "See http://en.wikipedia.org/wiki/Stockholm_format";
61  }
68  bool checkNames() const { return checkNames_; }
69 
76  void checkNames(bool yn) { checkNames_ = yn; }
77 };
78 } // end of namespace bpp.
79 #endif // BPP_SEQ_IO_STOCKHOLM_H
Partial implementation of the OAlignment interface.
void writeAlignment(std::ostream &output, const SiteContainerInterface &sc) const override=0
Write a container to a stream.
The Stockholm alignment file format.
Definition: Stockholm.h:24
Stockholm(bool checkSequenceNames=true)
Build a new Stockholm object.
Definition: Stockholm.h:34
const std::string getFormatDescription() const override
Definition: Stockholm.h:58
void writeAlignment(std::ostream &output, const SiteContainerInterface &sc) const override
Write a container to a stream.
Definition: Stockholm.cpp:17
const std::string getFormatName() const override
Definition: Stockholm.h:57
void writeAlignment(const std::string &path, const SiteContainerInterface &sc, bool overwrite=true) const override
Write a container to a file.
Definition: Stockholm.h:46
bool checkNames_
Definition: Stockholm.h:26
void checkNames(bool yn)
Tell whether the sequence names should be checked when reading from files.
Definition: Stockholm.h:76
virtual ~Stockholm()
Definition: Stockholm.h:37
bool checkNames() const
Definition: Stockholm.h:68
This alphabet is used to deal NumericAlphabet.