/** * Project : CASAVA * Module : $RCSfile: AnomalousReadMgr.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 ANOMALOUS_READ_MGR_HH #define ANOMALOUS_READ_MGR_HH /*****************************************************************************/ #include #include #include "variance/AnomalousRead.hh" #include "variance/AnomReadGroup.hh" /*****************************************************************************/ namespace ca { namespace variance_detection { /*****************************************************************************/ class AnomalousReadMgr { public: AnomalousReadMgr(long clusterMaxInterBreakPtDist); ~AnomalousReadMgr(); void addRead(AnomalousRead::Type anomalousReadType, Singleton* singletonPtr); unsigned long totalNumReadsAdded() const; // including duplicates typedef std::vector SingletonPtrVec; typedef SingletonPtrVec::const_iterator SingletonPtrVecCIter; SingletonPtrVec& getVec(AnomalousRead::Type anomalousReadType); const SingletonPtrVec& getVec(AnomalousRead::Type anomalousReadType) const; // FIXME : Ultimately AnomalousReadMgr should encapsulate the clustering // and writing out of clusters but for now expose its innards // to ClusterFinderImpl to minimise disruption. typedef std::vector TypeVec; typedef TypeVec::const_iterator TypeVecCIter; void getAnomPairTypeVec(TypeVec& typeVec) const; typedef std::vector SingletonEventVec; typedef SingletonEventVec::iterator SingletonEventVecIter; typedef SingletonEventVec::const_iterator SingletonEventVecCIter; void getSortedAnomReads(AnomalousRead::Type anomalousReadType, SingletonEventVec& sortedAnomReads) const; typedef std::vector AnomReadGroupVec; typedef AnomReadGroupVec::iterator AnomReadGroupVecIter; typedef AnomReadGroupVec::const_iterator AnomReadGroupVecCIter; void clusterAnomPairReads(AnomalousRead::Type anomReadType, SingletonEventVec& sortedEvents, AnomReadGroupVec& clusters); private: typedef std::map TypeSingletonPtrVecMap; typedef TypeSingletonPtrVecMap::const_iterator TypeSingletonPtrVecMapCIter; const SingletonPtrVec myEmptySingletonPtrVec; TypeSingletonPtrVecMap myTypeSingletonPtrVecMap; long myClusterMaxInterBreakPtDist; }; /*****************************************************************************/ } // namespace variance_detection } // namespace ca /*****************************************************************************/ #endif // ANOMALOUS_READ_MGR_HH /*****************************************************************************/