/** * Project : CASAVA * Module : $RCSfile: AnomReadVec.hh,v $ * @author : Richard Shaw * Copyright : Copyright (c) Illumina 2010. All rights reserved. * ** 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). * */ /*****************************************************************************/ #ifndef ANOM_READ_VEC_HH #define ANOM_READ_VEC_HH /*****************************************************************************/ #include #include #include #include #include "variance/SingletonEvent.hh" #include "variance/AnomalousRead.hh" #include "common/PairStats.hh" /*****************************************************************************/ namespace ca { namespace variance_detection { /*****************************************************************************/ struct AnomReadVec : public std::vector { AnomReadVec(unsigned int groupNum = 0); AnomReadVec(AnomalousRead::Type anomReadType, unsigned int groupNum = 0); void updateBreakPoints(PairStats& pairStats); unsigned int numCommonReads(const AnomReadVec& anomReadVec); void absorb(AnomReadVec& anomReadVec); AnomalousRead::Type myAnomReadType; typedef std::vector AnomReadTypeVec; typedef AnomReadTypeVec::const_iterator AnomReadTypeVecCIter; AnomReadTypeVec myExtraAnomReadTypeVec; int myPos; unsigned int myGroupNum; int myLeftBreakPos; int myRightBreakPos; private: void ensureReadIdSetPopulated(bool forceUpdate=false); typedef std::set ReadIdSet; typedef ReadIdSet::const_iterator ReadIdSetCIter; ReadIdSet myReadIdSet; }; typedef AnomReadVec::iterator AnomReadVecIter; typedef AnomReadVec::const_iterator AnomReadVecCIter; /*****************************************************************************/ std::istream& operator>>(std::istream& istrm, AnomReadVec& anomReadVec); std::ostream& operator<<(std::ostream& ostrm, const AnomReadVec& anomReadVec); /*****************************************************************************/ // Sorting by left breakpoint then right breakpoint, should cause only // DeletionPair clusters for larger deletions to move within the list, // so the ordering should otherwise be the same. class SortAnomReadVecByLeftBrk { public: bool operator()(const AnomReadVec& anomReadVecA, const AnomReadVec& anomReadVecB) { return (anomReadVecA.myLeftBreakPos < anomReadVecB.myLeftBreakPos); } }; /*****************************************************************************/ class SortAnomReadVecByRightBrk { public: bool operator()(const AnomReadVec& anomReadVecA, const AnomReadVec& anomReadVecB) { return (anomReadVecA.myRightBreakPos < anomReadVecB.myRightBreakPos); } }; /*****************************************************************************/ class SortAnomReadVecByGroupNum { public: bool operator()(const AnomReadVec& anomReadVecA, const AnomReadVec& anomReadVecB) { return (anomReadVecA.myGroupNum < anomReadVecB.myGroupNum); } }; /*****************************************************************************/ } // namespace variance_detection } // namespace ca /*****************************************************************************/ #endif // ! ANOM_READ_GROUP_HH /*****************************************************************************/