7 #ifndef READ_INFO_STORE_HPP_ 8 #define READ_INFO_STORE_HPP_ 10 #include "boost/assert.hpp" 11 #include "boost/multi_index_container.hpp" 12 #include "boost/multi_index/hashed_index.hpp" 13 #include "boost/multi_index/ordered_index.hpp" 14 #include "boost/range.hpp" 15 #include "boost/noncopyable.hpp" 43 typedef boost::multi_index_container<
45 boost::multi_index::indexed_by<
46 boost::multi_index::hashed_non_unique<
47 boost::multi_index::tag<struct name_tag>,
50 boost::multi_index::ordered_non_unique<
51 boost::multi_index::tag<struct size_tag>,
63 return boost::make_tuple(
67 boost::hash<std::string>(),
68 std::equal_to<std::string>()
95 return boost::make_iterator_range(
103 const unsigned to = std::numeric_limits<unsigned>::max()
105 return boost::make_iterator_range(
113 Read_id
const*
find(
const boost::string_ref
id,
const bool reverse)
const {
114 name_index_t
const& ind =
info_index_.get<name_tag>();
115 const name_citer_t i =
find_iter(
id, reverse);
116 return i == ind.end() ? 0 : &(*i);
122 if( i == ind.end() ) {
127 const Read_id rid = *i;
137 name_iter
find_iter(
const boost::string_ref
id,
const bool reverse)
const {
138 name_index_t
const& ind = info_index_.get<name_tag>();
139 name_range r = ind.equal_range(
141 boost::hash<boost::string_ref>(),
144 name_iter i = r.begin();
145 if( i == ind.end() || i == r.end() )
return ind.end();
146 if( info_map_[*i].is_reverse() == reverse )
return i;
148 if( i == r.end() )
return ind.end();
149 if( info_map_[*i].is_reverse() == reverse )
return i;
150 BOOST_ASSERT(
false &&
"one of two reads should match");
name_citer_t const_iterator
Definition: read_info_store.hpp:74
size_range by_size(const unsigned size) const
Definition: read_info_store.hpp:94
info_mi_t::index< name_tag >::type name_index_t
Definition: read_info_store.hpp:56
const_iterator begin() const
Definition: read_info_store.hpp:87
detail::Id_map< Read_id, Read_info > info_map_t
Definition: read_info_store.hpp:31
info_map_t info_map_
Definition: read_info_store.hpp:134
size_range by_size_range(const unsigned from, const unsigned to=std::numeric_limits< unsigned >::max()) const
Definition: read_info_store.hpp:101
size_range by_size() const
Definition: read_info_store.hpp:91
bool empty() const
Definition: read_info_store.hpp:86
boost::iterator_range< name_iter > name_range
Definition: read_info_store.hpp:59
const std::string & name() const
Definition: read_info.hpp:39
Read_info_store()
Definition: read_info_store.hpp:80
Main namespace of vdj_pipe library.
Definition: keywords_variable.hpp:11
info_mi_t::index< size_tag >::type info_size_index_t
Definition: read_info_store.hpp:60
unsigned size() const
Definition: read_info.hpp:40
name_index_t::const_iterator name_citer_t
Definition: read_info_store.hpp:57
Read_id const * find(const boost::string_ref id, const bool reverse) const
Definition: read_info_store.hpp:113
name_index_t::iterator name_iter
Definition: read_info_store.hpp:58
const_iterator end() const
Definition: read_info_store.hpp:88
detail::Getter< info_map_t, Read_id, Read_info, unsigned,&Read_info::size > get_info_size
Definition: read_info_store.hpp:41
std::size_t size() const
Definition: read_info_store.hpp:85
Definition: string_ref.hpp:23
boost::iterator_range< size_iterator > size_range
Definition: read_info_store.hpp:76
info_mi_t info_index_
Definition: read_info_store.hpp:135
Definition: read_info.hpp:18
Read_info const & operator[](const Read_id iid) const
Definition: read_info_store.hpp:111
detail::Getter< info_map_t, Read_id, Read_info, std::string const &,&Read_info::name > get_name
Definition: read_info_store.hpp:36
Definition: exception.hpp:23
Definition: read_info_store.hpp:78
bool is_reverse() const
Definition: read_info.hpp:43
Store sequence-related information.
Definition: read_info_store.hpp:30
info_size_index_t::const_iterator size_iterator
Definition: read_info_store.hpp:75
Extract object by its ID and apply member function.
Definition: get_by_id.hpp:25
static info_mi_t::ctor_args_list info_index_init(info_map_t const &im)
Definition: read_info_store.hpp:62
id_type insert(value_type const &obj)
Definition: id_map.hpp:83
Read_id insert(Read_info const &ri)
Definition: read_info_store.hpp:119
boost::multi_index_container< Read_id, boost::multi_index::indexed_by< boost::multi_index::hashed_non_unique< boost::multi_index::tag< struct name_tag >, get_name >, boost::multi_index::ordered_non_unique< boost::multi_index::tag< struct size_tag >, get_info_size > > > info_mi_t
Definition: read_info_store.hpp:55
name_iter find_iter(const boost::string_ref id, const bool reverse) const
Definition: read_info_store.hpp:137