Skip to content

Commit

Permalink
Fix for reading legacy run parameters
Browse files Browse the repository at this point in the history
The filename can have a lowercase r in RunParameters
  • Loading branch information
ezralanglois committed Apr 8, 2016
1 parent 50e8e2a commit 0dca905
Show file tree
Hide file tree
Showing 6 changed files with 62 additions and 26 deletions.
2 changes: 1 addition & 1 deletion docs/src/changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion interop/logic/summary/error_summary.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<size_t>(model::metric_base::base_metric::id(beg->lane(), beg->tile()));
const size_t id = static_cast<size_t>(model::metric_base::base_metric::id(beg->lane(), beg->tile()));
tmp[read.number-1][id].update(beg->cycle());
}
for(size_t read=0;read<tmp.size();++read)
Expand Down
7 changes: 0 additions & 7 deletions interop/model/metric_sets/q_metric_set.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,6 @@ class q_metrics : public metric_base::metric_set<q_metric>
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);
}
};
}
}
Expand Down
51 changes: 51 additions & 0 deletions interop/model/model_exceptions.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
/** Exceptions thrown by the model
*
* @file
* @date 3/21/16
* @version 1.0
* @copyright GNU Public License.
*/
#pragma once
#include <stdexcept>
#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) { }
};

/** @} */
}
}
}

16 changes: 0 additions & 16 deletions interop/model/run_metrics.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,22 +66,6 @@ class run_metrics
/** Define tile metric set */
typedef metric_base::metric_set<tile_metric> tile_metric_set_t;

public:
/** Define corrected intensity metric set */
typedef metric_base::metric_set<corrected_intensity_metric> corrected_intensity_metric_set_t;
/** Define error metric set */
typedef metric_base::metric_set<error_metric> error_metric_set_t;
/** Define extraction metric set */
typedef metric_base::metric_set<extraction_metric> extraction_metric_set_t;
/** Define image metric set */
typedef metric_base::metric_set<image_metric> image_metric_set_t;
/** Define index metric set */
typedef metric_base::metric_set<index_metric> index_metric_set_t;
/** Define q-metric set */
typedef metric_base::metric_set<q_metric> q_metric_set_t;
/** Define tile metric set */
typedef metric_base::metric_set<tile_metric> tile_metric_set_t;

public:
/** Constructor
*/
Expand Down
10 changes: 9 additions & 1 deletion src/interop/model/run/parameters.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"));
}

}


Expand Down

0 comments on commit 0dca905

Please sign in to comment.