bpp-seq3  3.0.0
PhredPhd.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_PHREDPHD_H
6 #define BPP_SEQ_IO_PHREDPHD_H
7 
8 
9 #include "../Sequence.h"
10 #include "../SequenceWithQuality.h"
11 #include "ISequenceStream.h"
12 
13 namespace bpp
14 {
44 class PhredPhd : public ISequenceStream
45 {
46 public:
50  PhredPhd() {}
51 
52  virtual ~PhredPhd() {}
53 
54 public:
60  bool nextSequence(
61  std::istream& input,
62  Sequence& seq
63  ) const;
78  bool nextSequence(
79  std::istream& input,
80  Sequence& seq,
81  std::vector<size_t>& pos
82  ) const;
83 
89  const std::string getDataType() const { return "SequenceWithQuality"; }
90  const std::string getFormatName() const { return "phd file"; }
91  const std::string getFormatDescription() const
92  {
93  return "Sequences following the phd format as describe in the phred documentation.";
94  }
97 private:
107  bool parseFile_(std::istream& input, std::string& name, std::string& sequence, std::vector<int>& qual, std::vector<size_t>& pos) const;
108 
119  bool parseDNA_(std::istream& input, std::string& sequence, std::vector<int>& qual, std::vector<size_t>& pos) const;
120 };
121 } // end of namespace bpp
122 #endif // BPP_SEQ_IO_PHREDPHD_H
The phd sequence file format from phred software.
Definition: PhredPhd.h:45
bool nextSequence(std::istream &input, Sequence &seq) const
Definition: PhredPhd.cpp:18
bool parseDNA_(std::istream &input, std::string &sequence, std::vector< int > &qual, std::vector< size_t > &pos) const
Parse the DNA part of the file.
Definition: PhredPhd.cpp:94
const std::string getFormatName() const
Definition: PhredPhd.h:90
const std::string getDataType() const
Definition: PhredPhd.h:89
virtual ~PhredPhd()
Definition: PhredPhd.h:52
const std::string getFormatDescription() const
Definition: PhredPhd.h:91
bool parseFile_(std::istream &input, std::string &name, std::string &sequence, std::vector< int > &qual, std::vector< size_t > &pos) const
Global file parser.
Definition: PhredPhd.cpp:56
PhredPhd()
Build a new PhredPhd object.
Definition: PhredPhd.h:50
A basic implementation of the Sequence interface.
Definition: Sequence.h:117
The ISequenceStream interface.
This alphabet is used to deal NumericAlphabet.