From 0dca905ed5edfe54230efee557ae3a804f7d21d2 Mon Sep 17 00:00:00 2001 From: Robert Langlois Date: Thu, 7 Apr 2016 11:02:41 -0700 Subject: [PATCH] Fix for reading legacy run parameters The filename can have a lowercase r in RunParameters --- docs/src/changes.md | 2 +- interop/logic/summary/error_summary.h | 2 +- interop/model/metric_sets/q_metric_set.h | 7 ---- interop/model/model_exceptions.h | 51 ++++++++++++++++++++++++ interop/model/run_metrics.h | 16 -------- src/interop/model/run/parameters.cpp | 10 ++++- 6 files changed, 62 insertions(+), 26 deletions(-) create mode 100644 interop/model/model_exceptions.h diff --git a/docs/src/changes.md b/docs/src/changes.md index 712eb3665..333cbbbe0 100644 --- a/docs/src/changes.md +++ b/docs/src/changes.md @@ -10,7 +10,7 @@ Commit | Description ------- | ----------- | Update documentation - | Added summary tests +0b22102 | Added summary tests 13f1fb4 | Added summary logic 339a914 | Added summary model aca0152 | Added run metrics diff --git a/interop/logic/summary/error_summary.h b/interop/logic/summary/error_summary.h index dbd7f5f03..3c09e2a7c 100644 --- a/interop/logic/summary/error_summary.h +++ b/interop/logic/summary/error_summary.h @@ -166,7 +166,7 @@ void cache_cycle_state_by_lane_read(I beg, I end, const read_cycle& read = cycle_to_read[beg->cycle()-1]; if(read.number == 0) continue; INTEROP_ASSERT((read.number-1) < tmp.size()); - size_t id = static_cast(model::metric_base::base_metric::id(beg->lane(), beg->tile())); + const size_t id = static_cast(model::metric_base::base_metric::id(beg->lane(), beg->tile())); tmp[read.number-1][id].update(beg->cycle()); } for(size_t read=0;read size_t histBinCount() const { return logic::metric::count_q_metric_bins(*this); } - - /** Populate the cumulative distributions - */ - void populateCumulativeDistributions() throw( model::index_out_of_bounds_exception ) - { - logic::metric::populate_cumulative_distribution(*this); - } }; } } diff --git a/interop/model/model_exceptions.h b/interop/model/model_exceptions.h new file mode 100644 index 000000000..76c7d721a --- /dev/null +++ b/interop/model/model_exceptions.h @@ -0,0 +1,51 @@ +/** Exceptions thrown by the model + * + * @file + * @date 3/21/16 + * @version 1.0 + * @copyright GNU Public License. + */ +#pragma once +#include +#include "interop/util/exception_specification.h" + +#ifdef _MSC_VER +#pragma warning(disable:4290) // MSVC warns that it ignores the exception specification. +#endif + +namespace illumina { +namespace interop { +namespace model { + + /** @defgroup model_exceptions Model Exceptions + * + * Exceptions that can be thrown if a problem occurs while using the model + * + * @ingroup interop_exceptions + * @{ + */ + /** Exception raised if an index goes out of bounds + */ + struct index_out_of_bounds_exception : public std::out_of_range { + /** Constructor + * + * @param mesg error message + */ + index_out_of_bounds_exception(const std::string &mesg) : std::out_of_range(mesg) { } + }; + + /** Exception raised if the channel names are invalid + */ + struct invalid_channel_exception : public std::runtime_error { + /** Constructor + * + * @param mesg error message + */ + invalid_channel_exception(const std::string &mesg) : std::runtime_error(mesg) { } + }; + + /** @} */ +} +} +} + diff --git a/interop/model/run_metrics.h b/interop/model/run_metrics.h index 3f7447d18..8897ba448 100644 --- a/interop/model/run_metrics.h +++ b/interop/model/run_metrics.h @@ -66,22 +66,6 @@ class run_metrics /** Define tile metric set */ typedef metric_base::metric_set tile_metric_set_t; -public: - /** Define corrected intensity metric set */ - typedef metric_base::metric_set corrected_intensity_metric_set_t; - /** Define error metric set */ - typedef metric_base::metric_set error_metric_set_t; - /** Define extraction metric set */ - typedef metric_base::metric_set extraction_metric_set_t; - /** Define image metric set */ - typedef metric_base::metric_set image_metric_set_t; - /** Define index metric set */ - typedef metric_base::metric_set index_metric_set_t; - /** Define q-metric set */ - typedef metric_base::metric_set q_metric_set_t; - /** Define tile metric set */ - typedef metric_base::metric_set tile_metric_set_t; - public: /** Constructor */ diff --git a/src/interop/model/run/parameters.cpp b/src/interop/model/run/parameters.cpp index 8025c2e80..62b87ae68 100644 --- a/src/interop/model/run/parameters.cpp +++ b/src/interop/model/run/parameters.cpp @@ -127,7 +127,15 @@ void parameters::read(const std::string& run_folder) throw( xml::xml_file_not_fo xml::missing_xml_element_exception, xml::xml_parse_exception) { - read_file(io::combine(run_folder, "RunParameters.xml")); + try + { + read_file(io::combine(run_folder, "runParameters.xml")); + } + catch(const io::file_not_found_exception&) + { + read_file(io::combine(run_folder, "RunParameters.xml")); + } + }