/** * Project : CASAVA * Module : $RCSfile: ClusterMerger.cpp,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). * */ /*****************************************************************************/ #include "applications/ClusterMerger.hh" #include "applications/CasavaOptions.hh" #include "common/Exceptions.hh" #include "common/PairStats.hh" #include "variance/ClusterMergerImpl.hh" /*****************************************************************************/ namespace ca { namespace applications { /*****************************************************************************/ using namespace casava::common; using namespace ca::variance_detection; /*****************************************************************************/ ClusterMerger::~ClusterMerger() {} /*****************************************************************************/ int ClusterMerger::run() { try { // Load PairStats. const boost::filesystem::path rawClustersFilePath(_options.rawClustersFilePath()); const boost::filesystem::path projDirPath(rawClustersFilePath.parent_path().parent_path(). parent_path().parent_path()); PairStats pairStats(projDirPath); pairStats.setNumSds(_options.numLowInsertSizeSds(), _options.numHighInsertSizeSds()); const unsigned int maxLinksPerCluster(10); ClusterMergerImpl clusterMerger(_options.rawClustersFilePath(), _options.outputFilePath(), _options.doAdjMerge(), _options.clusterMaxAdjMergeInterBreakPtDist(), maxLinksPerCluster); clusterMerger.importClusters(pairStats); clusterMerger.mergeClusters(); clusterMerger.generateOutputFile(); } catch(const casava::common::CasavaException& e) { cerr << "ERROR: EXCEPTION: " << e.getContext() << ": " << e.getMessage() << std::endl; throw; } return 0; } /*****************************************************************************/ } // end namespace applications } // end namespace ca /*****************************************************************************/