Reporting Extraction Metrics

Now, let us consider how to summarize the data into useful reporting metrics. This example continues with extraction metrics.

C#

using System;
using System.Collections.Generic;
using Illumina.InterOp.Run;
using Illumina.InterOp.Metrics;
using Illumina.InterOp.Comm;
class Example3
{
static int Main(string[] args)
{
int ret;
if((ret = Helper.CheckArguments(args)) != 0) return ret;
base_extraction_metrics extraction_metric_set = new base_extraction_metrics ();
if ((ret = Helper.ReadInterop (args [0], extraction_metric_set)) != 0)
return ret;
Console.WriteLine("Time: {0}", DateTime.FromBinary((Int64)extraction_metric_set.at(0).date_time_csharp().value));
return 0;
}
}

C++

#include <iostream>
#include <iomanip>
#include <map>
#include <ctime>
using namespace illumina::interop::io;
int read_interop_file(const char* filename, extraction_metric_set_t& extraction_metric_set);
int check_args(int argc);
int main(int argc, char** argv)
{
int ret;
if((ret = check_args(argc)) != 0) return ret;
extraction_metric_set_t extraction_metric_set;
if((ret = read_interop_file(argv[1], extraction_metric_set)) != 0) return ret;
try
{
std::time_t t = static_cast<std::time_t>(extraction_metric_set[0].date_time());
std::tm *tm = std::gmtime(&t);
if (tm != 0)
{
char buffer[80];
std::strftime(buffer, 80, "%m/%d/%Y %r", tm);
std::cout << "Time: " << buffer << std::endl;
} else std::cout << "Invalid time" << std::endl;
}
catch(const std::exception& ex)
{
std::cerr << ex.what() << std::endl;
return 1;
}
return 0;
}