Skip to content

Commit

Permalink
Merge pull request #59 from Illumina/ipa-refactor-deprecated-code
Browse files Browse the repository at this point in the history
Refactor to remove and mark deprecated code
  • Loading branch information
ezralanglois committed Apr 20, 2016
2 parents d98cbf3 + 0b4304a commit 30f3caa
Show file tree
Hide file tree
Showing 11 changed files with 50 additions and 29 deletions.
4 changes: 2 additions & 2 deletions interop/logic/summary/tile_summary.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,9 @@ namespace summary
float(0),
util::op::const_member_function(&model::metrics::tile_metric::clusterCount)));
run[0][lane].reads_pf(std::accumulate(tile_data_by_lane[lane].begin(),
tile_data_by_lane[lane].end(),
tile_data_by_lane[lane].end(),
float(0),
util::op::const_member_function(&model::metrics::tile_metric::clusterCountPf)));
util::op::const_member_function(&model::metrics::tile_metric::clusterCountPf)));

for(size_t read=1;read<run.size();++read)
{
Expand Down
1 change: 1 addition & 0 deletions interop/model/metric_sets/corrected_intensity_metric_set.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ namespace metrics {

/** Corrected Intensity Metric Set
*
* @deprecated Will be removed in 1.1.x (use metric_set<corrected_intensity_metric> instead)
* @see metric_base::metric_set
* @see corrected_intensity_metric
*/
Expand Down
1 change: 1 addition & 0 deletions interop/model/metric_sets/error_metric_set.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ namespace metrics {
* The error metric is the calculated error rate, as determined by a spiked in PhiX control sample.
* This metric is available for each lane and tile for every cycle.
*
* @deprecated Will be removed in 1.1.x (use metric_set<error_metric> instead)
* @see metric_base::metric_set
* @see error_metric
*/
Expand Down
1 change: 1 addition & 0 deletions interop/model/metric_sets/extraction_metric_set.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ namespace metrics {

/** Extraction Metric Set
*
* @deprecated Will be removed in 1.1.x (use metric_set<extraction_metric> instead)
*/
class extraction_metrics : public metric_base::metric_set<extraction_metric> {
typedef metric_base::metric_set<extraction_metric> parent_type;
Expand Down
2 changes: 2 additions & 0 deletions interop/model/metric_sets/image_metric_set.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ namespace metrics {


/** Image Metric Set
*
* @deprecated Will be removed in 1.1.x (use metric_set<image_metric> instead)
*/
class image_metrics : public metric_base::metric_set<image_metric>
{
Expand Down
2 changes: 2 additions & 0 deletions interop/model/metric_sets/index_metric_set.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ namespace metrics {


/** Index Metric Set
*
* @deprecated Will be removed in 1.1.x (use metric_set<index_metric> instead)
*/
class index_metrics : public metric_base::metric_set<index_metric>
{
Expand Down
2 changes: 2 additions & 0 deletions interop/model/metric_sets/q_metric_set.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ namespace metrics {


/** Q-score Metric Set
*
* @deprecated Will be removed in 1.1.x (use metric_set<q_metric> instead)
*/
class q_metrics : public metric_base::metric_set<q_metric>
{
Expand Down
2 changes: 2 additions & 0 deletions interop/model/metric_sets/tile_metric_set.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ namespace metrics {


/** Tile Metric Set
*
* @deprecated Will be removed in 1.1.x (use metric_set<tile_metric> instead)
*/
class tile_metrics : public metric_base::metric_set<tile_metric>
{
Expand Down
4 changes: 2 additions & 2 deletions interop/model/metrics/tile_metric.h
Original file line number Diff line number Diff line change
Expand Up @@ -207,12 +207,12 @@ namespace illumina {
* @note All metrics in this class are supported by all versions
* @{
*/
/** Density of clusters for each tile (in thousands per mm2)
/** Density of clusters for each tile (in clusters per mm2)
*
* @return cluster density
*/
float clusterDensity()const{return m_clusterDensity;}
/** Density of clusters passing filter for each tile (in thousands per mm2)
/** Density of clusters passing filter for each tile (in clusters per mm2)
*
* @return cluster density passing filter
*/
Expand Down
4 changes: 2 additions & 2 deletions interop/model/summary/lane_summary.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,15 +115,15 @@ class lane_summary
}

public:
/** Get statistics summarizing the density of tiles in the lane
/** Get statistics summarizing the density of tiles in the lane (in clusters per mm2)
*
* @return statistics summarizing the density of tiles in the lane
*/
const metric_stat_t& density()const
{
return m_density;
}
/** Get statistics summarizing the passing filter density of tiles in the lane
/** Get statistics summarizing the passing filter density of tiles in the lane (in clusters per mm2)
*
* @return statistics summarizing the passing filter density of tiles in the lane
*/
Expand Down
56 changes: 33 additions & 23 deletions src/apps/interop2csv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,13 +118,14 @@
#include <iostream>
#include <iomanip>
#include "interop/io/metric_file_stream.h"
#include "interop/model/metric_sets/tile_metric_set.h"
#include "interop/model/metric_sets/error_metric_set.h"
#include "interop/model/metric_sets/corrected_intensity_metric_set.h"
#include "interop/model/metric_sets/extraction_metric_set.h"
#include "interop/model/metric_sets/image_metric_set.h"
#include "interop/model/metric_sets/q_metric_set.h"
#include "interop/model/metric_sets/index_metric_set.h"
#include "interop/model/metrics/tile_metric.h"
#include "interop/model/metrics/error_metric.h"
#include "interop/model/metrics/corrected_intensity_metric.h"
#include "interop/model/metrics/extraction_metric.h"
#include "interop/model/metrics/image_metric.h"
#include "interop/model/metrics/q_metric.h"
#include "interop/model/metrics/index_metric.h"
#include "interop/logic/metric/q_metric.h"
#include "interop/version.h"

using namespace illumina::interop::model::metrics;
Expand Down Expand Up @@ -186,6 +187,7 @@ int main(int argc, char** argv)

for(int i=1;i<argc;i++)
{
std::cout << "# Run Folder: " << io::basename(argv[i]) << std::endl;
int res = write_interops(std::cout, argv[i]);
if(res != SUCCESS)
{
Expand Down Expand Up @@ -308,13 +310,14 @@ void write_id(std::ostream& out, const model::metric_base::base_read_metric& met
*/
int write_tile_metrics(std::ostream& out, const std::string& filename)
{
tile_metrics metrics;
typedef model::metric_base::metric_set<tile_metric> tile_metric_set;
tile_metric_set metrics;
int res = read_metrics_from_file(filename, metrics);
if(res != 0) return res;

write_header(out, metrics);
out << "Lane,Tile,Count,CountPF,Density,DensityPF\n";
for(tile_metrics::metric_array_t::const_iterator beg = metrics.metrics().begin(), end = vec_end(metrics.metrics());beg != end;++beg)
for(tile_metric_set::metric_array_t::const_iterator beg = metrics.metrics().begin(), end = vec_end(metrics.metrics());beg != end;++beg)
{
const tile_metric& metric = *beg;
write_id(out, metric);
Expand All @@ -323,7 +326,7 @@ int write_tile_metrics(std::ostream& out, const std::string& filename)

write_header(out, metrics);
out << "Lane,Tile,Read,Aligned,Prephasing,Phasing\n";
for(tile_metrics::metric_array_t::const_iterator beg = metrics.metrics().begin(), end = vec_end(metrics.metrics());beg != end;++beg)
for(tile_metric_set::metric_array_t::const_iterator beg = metrics.metrics().begin(), end = vec_end(metrics.metrics());beg != end;++beg)
{
const tile_metric& metric = *beg;
for(tile_metric::read_metric_vector::const_iterator rbeg = metric.read_metrics().begin(), rend = metric.read_metrics().end();rbeg != rend;++rbeg)
Expand Down Expand Up @@ -354,13 +357,14 @@ int write_tile_metrics(std::ostream& out, const std::string& filename)
*/
int write_error_metrics(std::ostream& out, const std::string& filename)
{
error_metrics metrics;
typedef model::metric_base::metric_set<error_metric> error_metric_set;
error_metric_set metrics;
int res = read_metrics_from_file(filename, metrics);
if(res != 0) return res;

write_header(out, metrics);
out << "Lane,Tile,Cycle,Error\n";
for(error_metrics::metric_array_t::const_iterator beg = metrics.metrics().begin(), end = vec_end(metrics.metrics());beg != end;++beg)
for(error_metric_set::metric_array_t::const_iterator beg = metrics.metrics().begin(), end = vec_end(metrics.metrics());beg != end;++beg)
{
const error_metric& metric = *beg;
write_id(out, metric);
Expand Down Expand Up @@ -388,7 +392,8 @@ int write_error_metrics(std::ostream& out, const std::string& filename)
*/
int write_corrected_intensity_metrics(std::ostream& out, const std::string& filename)
{
corrected_intensity_metrics metrics;
typedef model::metric_base::metric_set<corrected_intensity_metric> corrected_intensity_metric_set;
corrected_intensity_metric_set metrics;
int res = read_metrics_from_file(filename, metrics);
if(res != 0) return res;

Expand All @@ -398,7 +403,7 @@ int write_corrected_intensity_metrics(std::ostream& out, const std::string& file
out << "CalledIntensity_A,CalledIntensity_C,CalledIntensity_G,CalledIntensity_T,";
out << "AllIntensity_A,AllIntensity_C,AllIntensity_G,AllIntensity_T";
out << "\n";
for(corrected_intensity_metrics::metric_array_t::const_iterator beg = metrics.metrics().begin(), end = vec_end(metrics.metrics());beg != end;++beg)
for(corrected_intensity_metric_set::metric_array_t::const_iterator beg = metrics.metrics().begin(), end = vec_end(metrics.metrics());beg != end;++beg)
{
const corrected_intensity_metric& metric = *beg;
write_id(out, metric);
Expand Down Expand Up @@ -432,7 +437,8 @@ int write_corrected_intensity_metrics(std::ostream& out, const std::string& file
*/
int write_extraction_metrics(std::ostream& out, const std::string& filename)
{
extraction_metrics metrics;
typedef model::metric_base::metric_set<extraction_metric> extraction_metric_set;
extraction_metric_set metrics;
int res = read_metrics_from_file(filename, metrics);
if(res != 0) return res;

Expand All @@ -441,7 +447,7 @@ int write_extraction_metrics(std::ostream& out, const std::string& filename)
out << "P90_1,P90_2,P90_3,P90_4,";
out << "Focus_1,Focus_2,Focus_3,Focus_4";
out << "\n";
for(extraction_metrics::metric_array_t::const_iterator beg = metrics.metrics().begin(), end = vec_end(metrics.metrics());beg != end;++beg)
for(extraction_metric_set::metric_array_t::const_iterator beg = metrics.metrics().begin(), end = vec_end(metrics.metrics());beg != end;++beg)
{
const extraction_metric& metric = *beg;
write_id(out, metric);
Expand Down Expand Up @@ -473,7 +479,8 @@ int write_extraction_metrics(std::ostream& out, const std::string& filename)
*/
int write_image_metrics(std::ostream& out, const std::string& filename)
{
image_metrics metrics;
typedef model::metric_base::metric_set<image_metric> image_metric_set;
image_metric_set metrics;
int res = read_metrics_from_file(filename, metrics);
if(res != 0) return res;

Expand All @@ -484,7 +491,7 @@ int write_image_metrics(std::ostream& out, const std::string& filename)
for(size_t i=0;i<metrics.channelCount();i++)
out << ",MaxContrast_" << i+1;
out << "\n";
for(image_metrics::metric_array_t::const_iterator beg = metrics.metrics().begin(), end = vec_end(metrics.metrics());beg != end;++beg)
for(image_metric_set::metric_array_t::const_iterator beg = metrics.metrics().begin(), end = vec_end(metrics.metrics());beg != end;++beg)
{
const image_metric& metric = *beg;
write_id(out, metric);
Expand Down Expand Up @@ -522,7 +529,8 @@ int write_image_metrics(std::ostream& out, const std::string& filename)
*/
int write_q_metrics(std::ostream& out, const std::string& filename)
{
q_metrics metrics;
typedef model::metric_base::metric_set<q_metric> q_metric_set;
q_metric_set metrics;
int res = read_metrics_from_file(filename, metrics);
if(res != 0) return res;

Expand All @@ -549,10 +557,11 @@ int write_q_metrics(std::ostream& out, const std::string& filename)

write_header(out, metrics);
out << "Lane,Tile,Cycle,BinCount";
for(size_t i=0;i<metrics.histBinCount();i++)
const size_t hist_bin_count = logic::metric::count_q_metric_bins(metrics);
for(size_t i=0;i<hist_bin_count;++i)
out << ",BinCount" << i+1;
out << "\n";
for(q_metrics::metric_array_t::const_iterator beg = metrics.metrics().begin(), end = vec_end(metrics.metrics());beg != end;++beg)
for(q_metric_set::metric_array_t::const_iterator beg = metrics.metrics().begin(), end = vec_end(metrics.metrics());beg != end;++beg)
{
const q_metric& metric = *beg;
write_id(out, metric);
Expand Down Expand Up @@ -582,13 +591,14 @@ int write_q_metrics(std::ostream& out, const std::string& filename)
*/
int write_index_metrics(std::ostream& out, const std::string& filename)
{
index_metrics metrics;
typedef model::metric_base::metric_set<index_metric> index_metric_set;
index_metric_set metrics;
int res = read_metrics_from_file(filename, metrics);
if(res != 0) return res;

write_header(out, metrics);
out << "Lane,Tile,Read,Sequence,Sample,Project,Count\n";
for(index_metrics::metric_array_t::const_iterator beg = metrics.metrics().begin(), end = vec_end(metrics.metrics());beg != end;++beg)
for(index_metric_set::metric_array_t::const_iterator beg = metrics.metrics().begin(), end = vec_end(metrics.metrics());beg != end;++beg)
{
const index_metric& metric = *beg;
for(index_metric::index_array_t::const_iterator index_beg=metric.indices().begin(), index_end=metric.indices().end();index_beg != index_end;++index_beg)
Expand Down

0 comments on commit 30f3caa

Please sign in to comment.