/*****************************************************************************/ // 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). /*****************************************************************************/ #include "statistics/Align_Data.h" /*****************************************************************************/ Align_Data::Align_Data(const std::string& data_file_name, const File_Buffer::Compression_Type compression) : my_file_buffer(data_file_name, compression), my_cached_read_was_eof(false) { ; } /*****************************************************************************/ Align_Data::~Align_Data() { ; } /*****************************************************************************/ bool Align_Data::get_next_read_align_info(Read_Align_Info& read_align_info, bool& at_end_of_tile, bool& at_eof) { if (my_cached_read_align_info.my_tile_num == 0) { // Cache was empty - need to fill it first. if (!get_next_read_align_info(my_cached_read_align_info, my_cached_read_was_eof)) { at_end_of_tile = false; // There were no clusters at all. at_eof = my_cached_read_was_eof; return false; // nothing read } } // Extract a read from the cache. read_align_info = my_cached_read_align_info; if ((at_eof = my_cached_read_was_eof)) { // Cached read was already known to be the last one available. //RP:fastq sets don't break at the end of tile at_end_of_tile = true; // no more data so end of tile } else { // Try to reload the cache. if (get_next_read_align_info(my_cached_read_align_info, my_cached_read_was_eof)) { at_end_of_tile = (my_cached_read_align_info.my_tile_num != read_align_info.my_tile_num); } else { // Could not refill the cache, so the current read will be the // last one (end of tile, end of file) after all. //RP:fastq sets don't break at the end of tile at_end_of_tile = true; at_eof = true; return true; } } return true; } /*****************************************************************************/