// // 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 Ivan Mikoulitch /// #ifndef __SAMREADER_H #define __SAMREADER_H #include "stdafx.h" //typedef multimap multimap_type; // map > typedef map > map_type; class FastaReader; class SamReader { public: SamReader(string fileName); ~SamReader(void); bool ReadSamFile(); bool ProcessReferenceData(FastaReader& fr); bool CreateModifiedSamFile(); void Close(); unsigned int num_reads; private: string fileName_; string out_file_name_; string out_file_name_not_found_; string out_file_name_excluded_; // maps RNAME -> map map_type ref_map_; ifstream fs_; ifstream ifs_; ofstream ofs_; ofstream ofs_not_found_; ofstream ofs_excluded_; unsigned int total_reads_processed_; unsigned int GetInMemoryData(const char* pchar, string& rname, string& data); string ModifySamLine(string& line_string, char* line_buffer, const unsigned int line_number); }; #endif