bpp-seq3  3.0.0
ISequence.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_ISEQUENCE_H
6 #define BPP_SEQ_IO_ISEQUENCE_H
7 
8 #include <Bpp/Exceptions.h>
9 
10 #include "../Container/SequenceContainer.h"
11 #include "../Container/SiteContainer.h"
12 #include "../Sequence.h"
13 #include "IoSequence.h"
14 
15 // From the STL:
16 #include <iostream>
17 #include <string>
18 #include <memory>
19 
20 namespace bpp
21 {
27 class ISequence :
28  public virtual IOSequence
29 {
30 public:
31  ISequence() {}
32  virtual ~ISequence() {}
33 
34 public:
42  virtual void readSequences(
43  std::istream& input,
44  SequenceContainerInterface& container) const = 0;
52  virtual void readSequences(
53  const std::string& path,
54  SequenceContainerInterface& container) const = 0;
55 
64  virtual std::unique_ptr<SequenceContainerInterface> readSequences(
65  std::istream& input,
66  std::shared_ptr<const Alphabet> alpha) const = 0;
75  virtual std::unique_ptr<SequenceContainerInterface> readSequences(
76  const std::string& path,
77  std::shared_ptr<const Alphabet> alpha) const = 0;
78 };
79 
85 class IAlignment :
86  public virtual IOSequence
87 {
88 public:
90  virtual ~IAlignment() {}
91 
92 public:
101  virtual void readAlignment(
102  std::istream& input,
103  SequenceContainerInterface& container) const = 0;
104 
113  virtual void readAlignment(
114  const std::string& path,
115  SequenceContainerInterface& container) const = 0;
116 
125  virtual std::unique_ptr<SiteContainerInterface> readAlignment(
126  std::istream& input,
127  std::shared_ptr<const Alphabet> alpha) const = 0;
128 
137  virtual std::unique_ptr<SiteContainerInterface> readAlignment(
138  const std::string& path,
139  std::shared_ptr<const Alphabet> alpha) const = 0;
140 };
141 
149  public virtual IOProbabilisticSequence
150 {
151 public:
154 
155 public:
163  virtual void readSequences(
164  std::istream& input,
165  ProbabilisticSequenceContainerInterface& container) const = 0;
173  virtual void readSequences(
174  const std::string& path,
175  ProbabilisticSequenceContainerInterface& container) const = 0;
176 
184  virtual std::unique_ptr<ProbabilisticSequenceContainerInterface> readSequences(
185  std::istream& input,
186  std::shared_ptr<const Alphabet> alpha) const = 0;
187 
195  virtual std::unique_ptr<ProbabilisticSequenceContainerInterface> readSequences(
196  const std::string& path,
197  std::shared_ptr<const Alphabet> alpha) const = 0;
198 };
199 
207  public virtual IOProbabilisticSequence
208 {
209 public:
212 
213 public:
222  virtual void readAlignment(
223  std::istream& input,
224  ProbabilisticSequenceContainerInterface& container) const = 0;
225 
234  virtual void readAlignment(
235  const std::string& path,
236  ProbabilisticSequenceContainerInterface& container) const = 0;
237 
245  virtual std::unique_ptr<ProbabilisticSiteContainerInterface> readAlignment(
246  std::istream& input,
247  std::shared_ptr<const Alphabet> alpha) const = 0;
248 
256  virtual std::unique_ptr<ProbabilisticSiteContainerInterface> readAlignment(
257  const std::string& path,
258  std::shared_ptr<const Alphabet> alpha) const = 0;
259 };
260 } // end of namespace bpp.
261 #endif // BPP_SEQ_IO_ISEQUENCE_H
The IAlignment interface.
Definition: ISequence.h:87
virtual ~IAlignment()
Definition: ISequence.h:90
virtual std::unique_ptr< SiteContainerInterface > readAlignment(const std::string &path, std::shared_ptr< const Alphabet > alpha) const =0
Create a new container from a file.
virtual void readAlignment(const std::string &path, SequenceContainerInterface &container) const =0
Create a new container from a file.
virtual void readAlignment(std::istream &input, SequenceContainerInterface &container) const =0
Add the content of a stream to a new container.
virtual std::unique_ptr< SiteContainerInterface > readAlignment(std::istream &input, std::shared_ptr< const Alphabet > alpha) const =0
Create a new container from a stream.
The IOProbabislisticSequence interface.
Definition: IoSequence.h:38
The IOSequence interface.
Definition: IoSequence.h:23
The IProbabilisticSequence interface.
Definition: ISequence.h:208
virtual std::unique_ptr< ProbabilisticSiteContainerInterface > readAlignment(const std::string &path, std::shared_ptr< const Alphabet > alpha) const =0
Create a new container from a file.
virtual void readAlignment(const std::string &path, ProbabilisticSequenceContainerInterface &container) const =0
Create a new container from a file.
virtual std::unique_ptr< ProbabilisticSiteContainerInterface > readAlignment(std::istream &input, std::shared_ptr< const Alphabet > alpha) const =0
Create a new container from a stream.
virtual ~IProbabilisticAlignment()
Definition: ISequence.h:211
virtual void readAlignment(std::istream &input, ProbabilisticSequenceContainerInterface &container) const =0
Add the content of a stream to a new container.
The IProbabilisticSequence interface.
Definition: ISequence.h:150
virtual ~IProbabilisticSequence()
Definition: ISequence.h:153
virtual void readSequences(const std::string &path, ProbabilisticSequenceContainerInterface &container) const =0
Create a new container from a file.
virtual std::unique_ptr< ProbabilisticSequenceContainerInterface > readSequences(const std::string &path, std::shared_ptr< const Alphabet > alpha) const =0
Create a new container from a file.
virtual void readSequences(std::istream &input, ProbabilisticSequenceContainerInterface &container) const =0
Create a new container from a stream.
virtual std::unique_ptr< ProbabilisticSequenceContainerInterface > readSequences(std::istream &input, std::shared_ptr< const Alphabet > alpha) const =0
Create a new container from a stream.
The ISequence interface.
Definition: ISequence.h:29
virtual ~ISequence()
Definition: ISequence.h:32
virtual void readSequences(std::istream &input, SequenceContainerInterface &container) const =0
Create a new container from a stream.
virtual void readSequences(const std::string &path, SequenceContainerInterface &container) const =0
Create a new container from a file.
virtual std::unique_ptr< SequenceContainerInterface > readSequences(const std::string &path, std::shared_ptr< const Alphabet > alpha) const =0
Create a new container from a file.
virtual std::unique_ptr< SequenceContainerInterface > readSequences(std::istream &input, std::shared_ptr< const Alphabet > alpha) const =0
Create a new container from a stream.
The SequenceContainer interface.
This alphabet is used to deal NumericAlphabet.