/** * Project : CASAVA * Module : $RCSfile: ClusterFinder.cpp,v $ * @author : Tony Cox * Copyright : Copyright (c) Illumina 2008, 2009. 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). * */ #include "applications/ClusterFinder.hh" #include "applications/CasavaOptions.hh" #include "variance/SampleStats.hh" #include "variance/SingletonEvent.hh" #include "variance/AnomalousReadMgr.hh" #include "variance/ClusterFinderImpl.hh" #include "common/Alignment.hh" #include "common/Exceptions.hh" #include "common/PairStats.hh" namespace ca { namespace applications { using namespace casava::common; using namespace ca::variance_detection; ClusterFinder::~ClusterFinder() {} int ClusterFinder::run() { Alignment alignment; string line, s, sampleName; // static const char preamble[]="# sample="; map sampleInfo; AnomalousReadMgr anomalousReadMgr(_options.clusterMaxInterBreakPtDist()); ClusterFinderImpl clusterFinder ( _options.maxDistance(), _options.minGroupSize(), _options.spReadThreshold(), _options.inputReadsFilePath(), _options.summaryFilePath(), _options.outputFilePath(), _options.isQphred); try { // Load PairStats. const boost::filesystem::path inputReadsFilePath(_options.inputReadsFilePath()); const boost::filesystem::path projDirPath(inputReadsFilePath.parent_path().parent_path(). parent_path().parent_path()); PairStats pairStats(projDirPath); pairStats.setNumSds(_options.numLowInsertSizeSds(), _options.numHighInsertSizeSds()); clusterFinder.importSampleStats( sampleInfo ); clusterFinder.importReads( anomalousReadMgr, sampleInfo, pairStats ); if (anomalousReadMgr.totalNumReadsAdded() == 0) { cerr << "Warning: no reads obtained from file " << _options.inputReadsFilePath() << endl; } // ~if } catch(const casava::common::CasavaException& e) { cerr << "ERROR: EXCEPTION: " << e.getContext() << ": " << e.getMessage() << std::endl; throw; } clusterFinder( anomalousReadMgr ); return 0; } // ~int IndelFinder::run() } } // end namespace casava{ namespace { applications