vdj_pipe
pipeline for processing DNA sequence data
sequence_record.hpp
Go to the documentation of this file.
1 
7 #ifndef SEQUENCE_RECORD_HPP_
8 #define SEQUENCE_RECORD_HPP_
9 #include <iosfwd>
10 #include <iterator>
11 #include <string>
12 #include <vector>
13 
14 namespace vdj_pipe{
15 
18 struct Seq_meta {
20  std::string id_;
21 
23  std::string comm_;
24 };
25 
28 struct Seq_record : public Seq_meta {
29  typedef std::string sequence;
30 
32  sequence seq_;
33 };
34 
35 class Quality : public std::vector<unsigned char> {
36 public:
37  typedef unsigned char value_type;
38 
39 private:
40  typedef std::vector<value_type> vec_t;
41 public:
42  Quality() {}
43 
44  explicit Quality(const std::size_t n, const value_type val = 0)
45  : vec_t(n, val)
46  {}
47 
48  Quality(vec_t const& v) : vec_t(v) {}
49 };
50 
53 struct Qual_record : public Seq_meta {
54  typedef Quality quality;
55 
57  quality qual_;
58 };
59 
62 template<class ChT, class Tr> inline
63 std::basic_ostream<ChT,Tr>& operator<<(
64  std::basic_ostream<ChT,Tr>& os,
65  Qual_record::quality const& qual
66 ) {
67  std::copy(
68  qual.begin(),
69  qual.end(),
70  std::ostream_iterator<Qual_record::quality::value_type>(os, " ")
71  );
72  return os;
73 }
74 
77 struct Seq_qual_record : public Seq_meta {
78  typedef Seq_record::sequence sequence;
80 
82  sequence seq_;
83 
85  quality qual_;
86 };
87 
88 }//namespace vdj_pipe
89 #endif /* SEQUENCE_RECORD_HPP_ */
quality qual_
Definition: sequence_record.hpp:57
Definition: sequence_record.hpp:35
sequence seq_
Definition: sequence_record.hpp:32
Definition: sequence_record.hpp:18
Definition: sequence_record.hpp:77
Main namespace of vdj_pipe library.
Definition: sequence_file.hpp:14
Definition: sequence_record.hpp:28
sequence seq_
Definition: sequence_record.hpp:82
std::string id_
Definition: sequence_record.hpp:20
quality qual_
Definition: sequence_record.hpp:85
Definition: sequence_record.hpp:53
std::string comm_
Definition: sequence_record.hpp:23