7 #ifndef PARSER_QUAL_HPP_ 8 #define PARSER_QUAL_HPP_ 10 #include "boost/lexical_cast.hpp" 11 #include "boost/tokenizer.hpp" 29 <<
Err::msg_t(
"wrong file format for quality score parser")
45 const boost::string_ref
get_id() {
return Parser_line::get_id(
'>');}
47 const boost::string_ref
get_defstr() {
return Parser_line::get_defstr(
'>');}
55 template<
class InsertIter>
void get_qual(InsertIter ii) {
58 typedef boost::tokenizer<boost::char_separator<char> >
tokenizer;
59 boost::char_separator<char> sep(
" \t");
60 tokenizer tok(
str_, sep);
61 for(tokenizer::const_iterator ti = tok.begin(); ! ti.at_end(); ++ti) {
63 const int i = boost::lexical_cast<
int>(*ti);
65 }
catch(std::bad_cast
const&) {
66 BOOST_THROW_EXCEPTION(
82 }
catch(std::exception
const&) {
83 BOOST_THROW_EXCEPTION(
quality qual_
Definition: sequence_record.hpp:57
Definition: sequence_record.hpp:35
format::Format format() const
Definition: file.hpp:75
const boost::string_ref get_id()
Definition: parser_qual.hpp:45
File_istream fis_
Definition: parser_line.hpp:103
std::string str_
Definition: parser_line.hpp:104
record get_record()
Definition: parser_qual.hpp:77
void next_record()
Definition: parser_qual.hpp:46
Compression
File compression types.
Definition: file_properties.hpp:19
boost::error_info< struct errinfo_int1_, int > int1_t
Definition: exception.hpp:28
record::quality quality
Definition: parser_qual.hpp:22
Definition: parser_line.hpp:26
Main namespace of vdj_pipe library.
Definition: keywords_variable.hpp:11
Parser_line(File_input const &fi)
Definition: parser_line.hpp:34
boost::errinfo_nested_exception nested_t
Definition: exception.hpp:32
std::string const & path() const
Definition: file.hpp:74
Parser_qual(std::istream &is, const compression::Compression compr=compression::none)
Definition: parser_qual.hpp:36
Definition: parser_qual.hpp:19
boost::tokenizer< boost::char_separator< char > > tokenizer
Definition: me_factory.cpp:34
unsigned char value_type
Definition: sequence_record.hpp:37
boost::error_info< struct errinfo_str2_, std::string > str2_t
Definition: exception.hpp:26
void get_qual(InsertIter ii)
Definition: parser_qual.hpp:55
boost::error_info< struct errinfo_str1_, std::string > str1_t
Definition: exception.hpp:25
void set_meta(Seq_meta &sm, const char tag)
Definition: parser_line.hpp:70
const boost::string_ref get_defstr()
Definition: parser_qual.hpp:47
int line_num() const
Definition: parser_line.hpp:30
Definition: sequence_record.hpp:53
boost::error_info< struct errinfo_message_, std::string > msg_t
Definition: exception.hpp:24
std::string sanitize(const char c)
Definition: sanitize_string.cpp:53
Basic line-based parser; use to derive other parsers.
Definition: parser_line.hpp:23
std::istream & istream()
Definition: file_stream.hpp:102
boost::error_info< struct errinfo_line_n_, int > line_t
Definition: parser_line.hpp:27
Definition: file_properties.hpp:20
Qual_record record
Definition: parser_qual.hpp:21
int line_
Definition: parser_line.hpp:105
Parser_qual(File_input const &fi)
Definition: parser_qual.hpp:24
quality get_qual()
Definition: parser_qual.hpp:49