// -*- c++ -*- /*****************************************************************************/ // Copyright (c) Illumina 2008 // Author: Richard Shaw // // This software is covered by the "Illumina Genome Analyzer Software // License Agreement" and the "Illumina Source Code License Agreement", // and certain third party copyright/licenses, and any user of this // source file is bound by the terms therein (see accompanying files // Illumina_Genome_Analyzer_Software_License_Agreement.pdf and // Illumina_Source_Code_License_Agreement.pdf and third party // copyright/license notices). /*****************************************************************************/ #ifndef READ_PATTERNS_H #define READ_PATTERNS_H /*****************************************************************************/ #include #include #include "statistics/Pattern_Info.h" /*****************************************************************************/ class Read_Patterns { friend std::ostream& operator<<(std::ostream&, const Read_Patterns&); public: Read_Patterns(size_t max_patterns_to_store); ~Read_Patterns(); void record_pattern(const std::string& pattern_str); bool find_most_frequent(); unsigned int num_will_list() const; private: void multi_record_pattern(const std::string& pattern_str, unsigned int pattern_freq); typedef std::map Pattern_Freq_Map; typedef Pattern_Freq_Map::iterator Pattern_Freq_Map_Iter; typedef Pattern_Freq_Map::const_iterator Pattern_Freq_Map_CIter; Pattern_Freq_Map my_pattern_freq_map; typedef std::map Freq_Pattern_Info_Map; typedef Freq_Pattern_Info_Map::iterator Freq_Pattern_Info_Map_Iter; typedef Freq_Pattern_Info_Map::const_iterator Freq_Pattern_Info_Map_CIter; typedef Freq_Pattern_Info_Map::reverse_iterator Freq_Pattern_Info_Map_RIter; typedef Freq_Pattern_Info_Map::const_reverse_iterator Freq_Pattern_Info_Map_CRIter; Freq_Pattern_Info_Map my_freq_pattern_info_map; enum { MAX_NUM_RANKS_TO_LIST = 30}; const size_t my_max_patterns_to_store; bool my_storage_limit_reached; }; /*****************************************************************************/ std::ostream& operator<<(std::ostream& ostrm, const Read_Patterns& read_patterns); /*****************************************************************************/ #endif // ! READ_PATTERNS_H /*****************************************************************************/