/** ** 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 SignalMeans.hh ** ** \brief I/O API for signal means files (_all files). ** ** \author Mauricio Varea **/ #ifndef CASAVA_COMMON_SIGNAL_MEANS_HH #define CASAVA_COMMON_SIGNAL_MEANS_HH #include #include #include #include "common/FastIo.hh" namespace casava { namespace common { class SignalMeans { public: SignalMeans(const unsigned int lane = 0, const unsigned int cycle = 0); SignalMeans(const SignalMeans &ref); SignalMeans &operator=(const SignalMeans &ref); bool operator==(const SignalMeans &ref) const; bool operator!=(const SignalMeans &ref) const; SignalMeans &operator++() {++cycle_; return *this;} SignalMeans operator++(int) {SignalMeans tmp(*this); ++cycle_; return tmp;} SignalMeans &operator--() {--cycle_; return *this;} SignalMeans operator--(int) {SignalMeans tmp(*this); --cycle_; return tmp;} SignalMeans &operator+=(const char &c); SignalMeans &operator-=(const char &c); unsigned int getLane() {return lane_;} unsigned int getCycle() {return cycle_;} void setLane(const unsigned int &n) {lane_ = n;} void setCycle(const unsigned int &n) {cycle_ = n;} // a SignalMeans is valid when the lane number is != 0 bool isValid() {return static_cast(lane_);} unsigned int getNumA() {return baseCall_[0];} unsigned int getNumC() {return baseCall_[1];} unsigned int getNumG() {return baseCall_[2];} unsigned int getNumT() {return baseCall_[3];} unsigned int getNumX() {return baseCall_[4];} void setNumA(const unsigned int &n) {baseCall_[0] = n;} void setNumC(const unsigned int &n) {baseCall_[1] = n;} void setNumG(const unsigned int &n) {baseCall_[2] = n;} void setNumT(const unsigned int &n) {baseCall_[3] = n;} void setNumX(const unsigned int &n) {baseCall_[4] = n;} private: unsigned int lane_; unsigned int cycle_; // {All A, All C, All G, All T, Call A, Call C, Call G, Call T} std::vector intensities_; // {Num A, Num C, Num G, Num T, Num X} std::vector baseCall_; friend std::ostream &operator<<(std::ostream &os, const SignalMeans &sm); friend std::istream &operator>>(std::istream &is, SignalMeans &sm); }; /** ** @brief Write a complete object of type SignalMeans, including the delimiter. **/ std::ostream &operator<<(std::ostream &os, const SignalMeans &sm); /** ** @brief Read a complete object of type SignalMeans, including the delimiter. **/ std::istream &operator>>(std::istream &is, SignalMeans &sm); } // namespace common } // namespace casava #endif // #ifndef CASAVA_COMMON_SIGNAL_MEANS_HH