/** ** 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 AlignStatsXmlWriter.hh ** ** \brief Writes BCL files and other associated files (filter, position). ** ** \author Roman Petrovski **/ #include #include #include #include "common/Exceptions.hh" #include "io/PtreeXml.hh" #include "DemuxSummaryXmlWriter.hh" namespace casava { namespace demultiplex { namespace cc=casava::common; /** * \brief Records single tile summary in the tree. * * \param record Pair of Raw and Pf summary records */ void DemuxSummaryXmlWriter::addTileSummary(const std::pair &p) { const std::string tileValuePrefix("Summary" ".Lane." + boost::lexical_cast(p.first.lane_) +".Sample." + p.first.sample_ +".Barcode." + p.first.barcode_ +".Tile." + boost::lexical_cast(p.first.tile_) +".Read." + boost::lexical_cast(p.first.readNumber_)); const std::string tileValuePrefixRaw(tileValuePrefix + ".Raw.."); const std::string tileValuePrefixPf(tileValuePrefix + ".Pf.."); tree_.add(tileValuePrefixRaw + "Yield", p.first.yield_); tree_.add(tileValuePrefixRaw + "YieldQ30", p.first.yiedQ30_); tree_.add(tileValuePrefixRaw + "ClusterCount", p.first.clustersTotal_); tree_.add(tileValuePrefixRaw + "ClusterCount0MismatchBarcode", p.first.clusters0MismatchBarcode_); tree_.add(tileValuePrefixRaw + "ClusterCount1MismatchBarcode", p.first.clusters1MismatchBarcode_); tree_.add(tileValuePrefixRaw + "QualityScoreSum", p.first.qualityScoreSum_); tree_.add(tileValuePrefixPf + "Yield", p.second.yield_); tree_.add(tileValuePrefixPf + "YieldQ30", p.second.yiedQ30_); tree_.add(tileValuePrefixPf + "ClusterCount", p.second.clustersTotal_); tree_.add(tileValuePrefixPf + "ClusterCount0MismatchBarcode", p.second.clusters0MismatchBarcode_); tree_.add(tileValuePrefixPf + "ClusterCount1MismatchBarcode", p.second.clusters1MismatchBarcode_); tree_.add(tileValuePrefixPf + "QualityScoreSum", p.second.qualityScoreSum_); } void DemuxSummaryXmlWriter::close() { std::ofstream os(summaryFilePath_.string().c_str()); if (!os) { BOOST_THROW_EXCEPTION(cc::IoException(errno, "ERROR: Unable to open file for writing: " + summaryFilePath_.string())); } using namespace casava::io; os << tree_; if (!os) { BOOST_THROW_EXCEPTION(cc::IoException(errno, "ERROR: failed to store demultiplex summary: " + summaryFilePath_.string())); } } } //namespace statistics } //namespace casava