/** ** Copyright (c) 2007-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). ** ** This file is part of the Consensus Assessment of Sequence And VAriation ** (CASAVA) software package. ** ** \file StatsFileRecord.hh ** ** \brief Defines RTA stats file io exchange helpers. ** ** \author Roman Petrovski **/ #ifndef CASAVA_IO_STATS_FILE_RECORD_HH #define CASAVA_IO_STATS_FILE_RECORD_HH #include #include #include "common/FastIo.hh" namespace casava { namespace io { namespace cc = casava::common; struct StatsFileRecord { StatsFileRecord(): cycle_(0), clusterIntensity_(0), allA_(0.0), allC_(0.0), allG_(0.0), allT_(0.0), callA_(0.0), callC_(0.0), callG_(0.0), callT_(0.0), numA_(0), numC_(0), numG_(0), numT_(0), numX_(0), numAllA_(0), numAllC_(0), numAllG_(0), numAllT_(0){;} int cycle_; //cycle number zero-based. double clusterIntensity_; // average cycle intensity double allA_; double allC_; double allG_; double allT_; double callA_; double callC_; double callG_; double callT_; int numA_; //Number of A bases in the tile cycle. int numC_; //Number of C bases in the tile cycle. int numG_; //Number of G bases in the tile cycle. int numT_; //Number of T bases in the tile cycle. int numX_; //Number of unknown bases in the tile cycle. int numAllA_; int numAllC_; int numAllG_; int numAllT_; }; inline std::istream &operator>>(std::istream &is, StatsFileRecord &sfr) { !is || (sfr.cycle_ = cc::readInteger<4>(is)); !is || (sfr.clusterIntensity_ = cc::readDouble(is)); !is || (sfr.allA_ = cc::readDouble(is)); !is || (sfr.allC_ = cc::readDouble(is)); !is || (sfr.allG_ = cc::readDouble(is)); !is || (sfr.allT_ = cc::readDouble(is)); !is || (sfr.callA_ = cc::readDouble(is)); !is || (sfr.callC_ = cc::readDouble(is)); !is || (sfr.callG_ = cc::readDouble(is)); !is || (sfr.callT_ = cc::readDouble(is)); !is || (sfr.numA_ = cc::readInteger<4>(is)); !is || (sfr.numC_ = cc::readInteger<4>(is)); !is || (sfr.numG_ = cc::readInteger<4>(is)); !is || (sfr.numT_ = cc::readInteger<4>(is)); !is || (sfr.numX_ = cc::readInteger<4>(is)); !is || (sfr.numAllA_ = cc::readInteger<4>(is)); !is || (sfr.numAllC_ = cc::readInteger<4>(is)); !is || (sfr.numAllG_ = cc::readInteger<4>(is)); !is || (sfr.numAllT_ = cc::readInteger<4>(is)); return is; } inline std::ostream &operator<<(std::ostream &os, const StatsFileRecord &sfr) { !os || cc::writeInteger<4>(os, sfr.cycle_); !os || cc::writeDouble(os, sfr.clusterIntensity_); !os || cc::writeDouble(os, sfr.allA_); !os || cc::writeDouble(os, sfr.allC_); !os || cc::writeDouble(os, sfr.allG_); !os || cc::writeDouble(os, sfr.allT_); !os || cc::writeDouble(os, sfr.callA_); !os || cc::writeDouble(os, sfr.callC_); !os || cc::writeDouble(os, sfr.callG_); !os || cc::writeDouble(os, sfr.callT_); !os || cc::writeInteger<4>(os, sfr.numA_); !os || cc::writeInteger<4>(os, sfr.numC_); !os || cc::writeInteger<4>(os, sfr.numG_); !os || cc::writeInteger<4>(os, sfr.numT_); !os || cc::writeInteger<4>(os, sfr.numX_); !os || cc::writeInteger<4>(os, sfr.numAllA_); !os || cc::writeInteger<4>(os, sfr.numAllC_); !os || cc::writeInteger<4>(os, sfr.numAllG_); !os || cc::writeInteger<4>(os, sfr.numAllT_); return os; } } // namespace io } // namespace casava #endif // CASAVA_IO_STATS_FILE_RECORD_HH