// -*- mode: c++; indent-tabs-mode: nil; -*- // // Copyright 2009 Illumina, Inc. // // 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). // // /// \file /// /// \author Chris Saunders /// #ifndef __POS_BASECALL_BUFFER_HH #define __POS_BASECALL_BUFFER_HH #include "blt_common/snp_pos_info.hh" #include "blt_util/blt_types.hh" #include #include #include struct pos_basecall_buffer { pos_basecall_buffer(const std::string& ref_seq) : _ref_seq(ref_seq) {} void insert_pos_basecall(const pos_t pos, const base_call& bc){ _pdata[pos].calls.push_back(bc); } // returns NULL for empty pos // snp_pos_info* get_pos(const pos_t pos) { const piter i(_pdata.find(pos)); if(i==_pdata.end()) return NULL; return &(i->second); } void clear_pos(const pos_t pos) { const piter i(_pdata.find(pos)); if(i!=_pdata.end()) _pdata.erase(i); } #if 0 iterator pos_iter(const pos_t pos) { return _pdata.lower_bound(pos); } const_iterator pos_iter(const pos_t pos) const { return _pdata.lower_bound(pos); } // debug dumpers: void dump_pos(const pos_t pos, std::ostream& os) const; void dump(std::ostream& os) const; #endif private: typedef std::map pdata_t; typedef pdata_t::iterator piter; typedef pdata_t::const_iterator pciter; const std::string& _ref_seq; pdata_t _pdata; }; #endif