vdj_pipe
pipeline for processing DNA sequence data
mapped_sequence_properties.hpp
Go to the documentation of this file.
1 
7 #ifndef LIB_MAPPED_SEQUENCE_PROPERTIES_HPP_
8 #define LIB_MAPPED_SEQUENCE_PROPERTIES_HPP_
9 #include "boost/algorithm/string/classification.hpp" //operator!
10 #include "boost/algorithm/string/predicate.hpp" //all
11 #include "boost/foreach.hpp"
12 
13 #include "sequence_map_short.hpp"
14 #include "sequence_map_types.hpp"
15 
16 namespace vdj_pipe{ namespace detail{
17 
20 struct Seq_props {
21  explicit Seq_props(name_seq_vector const& sv)
22  : all_short_(true),
23  same_size_(true),
24  has_ambiguous_(false),
25  min_size_(0),
26  max_size_(0)
27  {
28  if( sv.empty() ) return;
29  min_size_ = sv.front().second.size();
31  BOOST_FOREACH(match_seq const& ms, sv) {
32  if( ms.second.size() < min_size_ ) min_size_ = ms.second.size();
33  if( ms.second.size() > max_size_ ) max_size_ = ms.second.size();
34  if( has_ambiguous_ ) continue;
35  if( ! all(ms.second, ! Is_ambiguous()) ) has_ambiguous_ = true;
36  }
38  if( min_size_ != max_size_ ) same_size_ = false;
39  }
40 
41  bool all_short_;
42  bool same_size_;
44  std::size_t min_size_;
45  std::size_t max_size_;
46 };
47 
48 }//namespace detail
49 }//namespace vdj_pipe
50 #endif /* LIB_MAPPED_SEQUENCE_PROPERTIES_HPP_ */
static std::size_t length()
Definition: sequence_fls.hpp:31
Seq_props(name_seq_vector const &sv)
Definition: mapped_sequence_properties.hpp:21
bool same_size_
Definition: mapped_sequence_properties.hpp:42
std::size_t min_size_
Definition: mapped_sequence_properties.hpp:44
Definition: nucleotide_index.hpp:330
Main namespace of vdj_pipe library.
Definition: keywords_variable.hpp:11
Definition: mapped_sequence_properties.hpp:20
std::size_t max_size_
Definition: mapped_sequence_properties.hpp:45
bool has_ambiguous_
Definition: mapped_sequence_properties.hpp:43
std::pair< std::string, std::string > match_seq
Definition: sequence_map_types.hpp:14
bool all_short_
Definition: mapped_sequence_properties.hpp:41
std::vector< match_seq > name_seq_vector
Definition: sequence_map_types.hpp:15