7 #ifndef SEQUENCE_FILE_ENTRY_HPP_ 8 #define SEQUENCE_FILE_ENTRY_HPP_ 11 #include "boost/property_tree/ptree_fwd.hpp" 27 enum qual_type {none, qual, fastq};
29 typedef std::map<Val_id, value_variant> map_t;
30 typedef map_t::const_iterator iterator;
31 typedef map_t::const_iterator const_iterator;
32 typedef map_t::value_type value_type;
38 const_iterator begin()
const {
return map_.begin();}
39 const_iterator end()
const {
return map_.end();}
40 bool is_paired()
const {
return seq_rev_;}
41 bool has_emid()
const {
return mid_;}
42 bool has_quality()
const {
return qt_ != none;}
43 bool has_qual_file()
const {
return qt_ == qual;}
45 std::string
const& sequence()
const {
46 return get_str(seq_,
"sequence");
49 std::string
const& quality()
const {
50 return get_str(qual_,
"quality");
53 std::string
const& seq_rev()
const {
54 return get_str(seq_rev_,
"reverse sequence");
57 std::string
const& qual_rev()
const {
58 return get_str(qual_rev_,
"reverse quality");
61 std::string
const& mid()
const {
62 return get_str(mid_,
"MID");
65 std::string
const& mid_rev()
const {
66 return get_str(mid_rev_,
"reverse MID");
81 std::string
const& get_str(
const Val_id
id, std::string
const& msg)
const {
82 const const_iterator i = map_.find(
id);
83 if( i == map_.end() ) BOOST_THROW_EXCEPTION(
85 << Err::msg_t(msg +
" not found")
87 return boost::get<std::string>(i->second);
Main namespace of vdj_pipe library.
Definition: sequence_file.hpp:14
Definition: sequence_file_entry.hpp:26
Definition: exception.hpp:23
Definition: sequence_file_entry.hpp:34
Store values mapped against name strings and value IDs.
Definition: value_map.hpp:23