Skip to content

Commit

Permalink
Merge pull request #95 from Illumina/update-public
Browse files Browse the repository at this point in the history
Bug fix for legacy datasets and added dumptext to replace interop2csv
  • Loading branch information
ezralanglois authored Dec 21, 2016
2 parents 4364493 + 1b96bbf commit 7b52e23
Show file tree
Hide file tree
Showing 103 changed files with 2,674 additions and 527 deletions.
23 changes: 0 additions & 23 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,6 @@
language: cpp
sudo: required

env:
global:
- secure: "oALD7yjwurT4h4x/iATz8zP+q9y1bOG8l9wFucmM8HTIdThN+37YZDmLnhlRWKDZNt6NwBRom1vHmTZAmLGO0RohPxRV8RrceQGq5Jjq0gmXQafxjhbZetKxFbXKJ5/4RdUM0yxPCmYCscHEJG/1gk+F6y7hFiRPO8A5z8AhNabCZ8BMwaLaWpko7mHO1HqEs/MWExj32IF0DVQtzWyJeyO4RYkYKtBGfsGZMHfhsis3Nhfql5shN64AmlAxJewxApJg0wbnf5fbXyLYqZS92MW0GbPph+grdpEGEgGVgyGRV0Ys9EAj0CQs5ukmi+JP6TL2BbBnmreAOwiWMQDGzAKgwipOH3Phmcor4bFo5TU0vTBhP1RCxnPa/zyTrwI94KH96b+j2WT/6wDkXrixhVAeJntuWEhbJvklN/lC8/nlGnbRfyEB5Ists5yFzERxqIWd3x+qtknJO8/wcetbavBFUPcgEZdTXVv1zTquzLeUNlavseT9egFFQ7cDnGwg8b9LWb+sQeqiTjT3p6WQ/4+tw/EVn+xCfqkw746Gy8aXFdviJU3mcYeR7gvgYO84HXaoS0Mv7mxmJeWfoNopkv0U7cPNS3eXU3XZ2bg0WZl90i2LLXcQgtm8nz3NVEhGfpgjlQ+WBQcVOYG93vBcOa4powoCHojgzZn55T/J3nQ="

matrix:
include:
- compiler: clang
Expand All @@ -36,24 +32,6 @@ matrix:
- compiler: gcc
os: linux
env: INTEROP_C89=ON BUILD_TYPE=Release BUILD_NAME=linux_gcc46_release DEPLOY_BUILD=true
- compiler: gcc
os: linux
env: INTEROP_C89=ON BUILD_TYPE=Release BUILD_NAME=linux_gcc46_release COVERITY=1
addons:
apt:
sources:
- george-edison55-precise-backports
packages:
- cmake
- cmake-data
coverity_scan:
project:
name: "Illumina/interop"
description: "InterOp Libraries for Illumina Sequencers"
build_command_prepend: "cmake .. -DENABLE_SWIG=OFF -DENABLE_DOCS=OFF"
build_command: "cmake --build ."
notification_email: [email protected]
branch_pattern: master
- compiler: gcc
addons: &1
apt:
Expand Down Expand Up @@ -141,7 +119,6 @@ before_script:
- export CXX="${CXX}${COMPILER_VERSION}"

script:
- if test ! -z ${COVERITY}; then exit 0; fi
- export BUILD_PATH=${PWD}/${BUILD_NAME}
- echo 'Configuring...' && echo -en 'travis_fold:start:script.1\\r'
- cmake -DNUNIT_ROOT=$HOME/NUnit-2.6.4 ../ -DENABLE_BACKWARDS_COMPATIBILITY=$INTEROP_C89 -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_INSTALL_PREFIX=${BUILD_PATH}
Expand Down
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ environment:
# config_type: win32
- generator: "Visual Studio 12 2013 Win64"
BUILD: msvc12_win64
config_type: win64
config_type: win64_not_supported
# - generator: "Visual Studio 12 2013"
# BUILD: msvc12_win32
# config_type: win32
Expand Down
4 changes: 2 additions & 2 deletions cmake/AssemblyInfo.cs.in
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
using System.Reflection;

[assembly: AssemblyTitle("Illumina.InterOp")]
[assembly: AssemblyTitle("Illumina.InterOp with @CMAKE_CXX_COMPILER_ID@ @CMAKE_CXX_COMPILER_VERSION@")]
[assembly: AssemblyCompany("Illumina")]
[assembly: AssemblyProduct("Illumina.InterOp")]
[assembly: AssemblyProduct("Illumina.InterOp - @VERSION@ ")]
[assembly: AssemblyCopyright("Copyright © Illumina 2015")]
[assembly: AssemblyVersion("@VERSION_SHORT@")]
[assembly: AssemblyFileVersion("@VERSION_SHORT@")]
Expand Down
2 changes: 2 additions & 0 deletions cmake/package.nuspec.in
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
The Illumina InterOp libraries are a set of common routines used for reading InterOp metric files
produced by Illumina sequencers. These libraries are backwards compatible and capable of supporting prior
releases of the software, with one exception: GA systems have been excluded.

C++ Compiler: @COMPILER_INFO@
</description>
<summary>
High-level C++ binding for Illumina C++ InterOp Library, packaged for
Expand Down
2 changes: 1 addition & 1 deletion cmake/version.rc.in
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ BEGIN
BEGIN
BLOCK "040904b0"
BEGIN
VALUE "FileDescription", "Illumina InterOp Library\0"
VALUE "FileDescription", "Illumina InterOp with @CMAKE_CXX_COMPILER_ID@ @CMAKE_CXX_COMPILER_VERSION@\0"
VALUE "ProductVersion", "@VERSION@\0"
VALUE "FileVersion", "@VERSION@\0"
VALUE "InternalName", "@LIB_NAME@\0"
Expand Down
2 changes: 1 addition & 1 deletion docs/Doxyfile.in
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ MARKDOWN_SUPPORT = YES
# globally by setting AUTOLINK_SUPPORT to NO.
# The default value is: YES.

AUTOLINK_SUPPORT = YES
AUTOLINK_SUPPORT = NO

# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want
# to include (a tag file for) the STL sources as input, then you should set this
Expand Down
8 changes: 6 additions & 2 deletions docs/src/binary_formats.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
InterOp Format {#binary_formats}
==============

This pages describes the binary format for an InterOp file. The formats are broken down into two parts: (1) the
This page describes the binary format for an InterOp file. The formats are broken down into two parts: (1) the
header, which is written first, a single time for the file and (2) n-Records, which are written next, many times
composing the rest of the file.

Expand Down Expand Up @@ -29,4 +29,8 @@ The documentation for the model notes when an attribute is only populated by a s
- @subpage q_collapsed_v5 "Collapsed Q-Metrics Version 5"
- @subpage q_collapsed_v6 "Collapsed Q-Metrics Version 6"


The following are binary formats used only for testing purposes and are not officially supported:

- @subpage index_summary_v1 "Index Summary v1"
- @subpage summary_v1 "Run Summary v1"

13 changes: 13 additions & 0 deletions docs/src/calculated_metrics.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# InterOp Calculations {#calculated_metrics}

This page describes the derived metrics calculated from the InterOp files.

## Summary Tab

This section describes each metric shown in the SAV summary tab.

- @subpage q_metrics_requirement_q30 "% >= Q30"
- @subpage q_metrics_requirement_yield "Yield (G)"
- @subpage q_metrics_requirement_projected_yield "Projected Yield (G)"
- @subpage error_metrics_requirement "% Error"

12 changes: 12 additions & 0 deletions docs/src/changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,18 @@

Date | Description
---------- | -----------
2016-12-21 | Replace interop2csv with dumptext
2016-12-20 | IPA-5923: Fix bug in legacy q-metric binning
2016-12-19 | Removes the coverity run from the build matrix for every pull request
2016-12-16 | IPA-5885: Ensure error summary matches requirements
2016-12-14 | Enhance C# version information
2016-12-14 | Clean up unused enum types
2016-12-12 | IPA-5153: Ensure Summary tab calculations are consistent with Docs
2016-12-09 | IPA-5883: Fix possible memory issue in MSVC12
2016-12-08 | IPA-4674: Add support for absolute naming convention
2016-12-07 | IPA-5869: Add section filtering
2016-12-06 | IPA-5734: Synchronize master
2016-12-02 | Add Google Analytics tracking to documentation
2016-12-08 | Added admonition to avoid using MSVC 12 (2013) with C# bindings
2016-12-08 | Added support for absolute tile naming
2016-12-08 | Added ability to do section filtering
Expand Down
72 changes: 72 additions & 0 deletions interop/io/format/abstract_text_format.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
/** Metric format interface for the text format factory
*
* @file
* @date 12/19/16
* @version 1.0
* @copyright GNU Public License.
*/

#pragma once

#include <iosfwd>
#include "interop/util/cstdint.h"

namespace illumina { namespace interop { namespace io
{
/** Abstract class that provides an interface for the text format of a metric
*
* The template argument for this class corresponds to a specific type
* of metric set.
*/
template<class Metric>
struct abstract_text_format
{
/** Define the metric type */
typedef Metric metric_t;
/** Define the metric header type */
typedef typename Metric::header_type header_t;
/** ID type */
typedef typename metric_t::id_t id_t;

/** Destructor
*/
virtual ~abstract_text_format() {}
/** Write the header for a set of metric records to the given output stream
*
* @param out output stream to write the binary InterOp file data
* @param header header of a metric set
* @param channel_names list of channel names
* @param sep column seperator
* @param eol row separator
* @return number of column headers
*/
virtual size_t write_header(std::ostream &out,
const header_t &header,
const std::vector<std::string>& channel_names,
const char sep,
const char eol) = 0;
/** Write a metric record to the given output stream
*
* @param out output stream to write the binary InterOp file data
* @param metric interop metric data to write
* @param header interop metric header data to write
* @param sep column seperator
* @param eol row separator
* @param missing missing value indicator
* @return number of columns written
*/
virtual size_t write_metric(std::ostream &out,
const metric_t &metric,
const header_t &header,
const char sep,
const char eol,
const char missing) = 0;

/** Get the version of this metric format
*
* @return version number
*/
virtual ::int16_t version() const=0;
};
}}}

2 changes: 1 addition & 1 deletion interop/io/format/default_layout.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ namespace illumina { namespace interop { namespace io
*
* This function was originally added to skip control records in tile metrics.
*
* @param metric metric to check
* @param id metric to check
* @return true, if the metric id is 0
*/
template<class LayoutId>
Expand Down
7 changes: 7 additions & 0 deletions interop/io/format/generic_layout.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,13 @@ namespace illumina { namespace interop { namespace io
template<class MetricType, int Version>
struct generic_layout;

/** Define a text layout of the metric
*
* This is currently only used for writing metrics
*/
template<class MetricType, int Version>
struct text_layout;


}}}

Expand Down
12 changes: 6 additions & 6 deletions interop/io/format/metric_format.h
Original file line number Diff line number Diff line change
Expand Up @@ -247,10 +247,10 @@ namespace illumina { namespace interop { namespace io
{
const size_t offset = metric_offset_map.size();
if(offset>= metric_set.size()) metric_set.resize(offset+1);
metric_set.at(offset).set_base(id);
count += Layout::map_stream(in, metric_set.at(offset), metric_set, true);
metric_set[offset].set_base(id);
count += Layout::map_stream(in, metric_set[offset], metric_set, true);
if(!test_stream(in, metric_offset_map, count, record_size)) return;
if(Layout::skip_metric(metric_set.at(offset)))//Avoid adding control lanes in tile metrics
if(Layout::skip_metric(metric_set[offset]))//Avoid adding control lanes in tile metrics
{
metric_set.resize(offset);
}
Expand All @@ -259,9 +259,9 @@ namespace illumina { namespace interop { namespace io
else
{
const size_t offset = metric_offset_map[metric.id()];
INTEROP_ASSERTMSG(metric_set.at(offset).lane() != 0, offset);
count += Layout::map_stream(in, metric_set.at(offset), metric_set, false);
INTEROP_ASSERT(metric_set.at(offset).id()>0);
INTEROP_ASSERTMSG(metric_set[offset].lane() != 0, offset);
count += Layout::map_stream(in, metric_set[offset], metric_set, false);
INTEROP_ASSERT(metric_set[offset].id()>0);
}
}
else
Expand Down
14 changes: 1 addition & 13 deletions interop/io/format/metric_format_factory.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include <vector>
#include "interop/util/map.h"
#include "interop/util/assert.h"
#include "interop/util/self_registration.h"
#include "interop/io/format/abstract_metric_format.h"
#include "interop/util/unique_ptr.h"
#include "interop/io/stream_exceptions.h"
Expand All @@ -33,19 +34,6 @@
illumina::interop::io::metric_format_factory< Proxy > \
illumina_interop_io_##Type##Proxy##Version(new illumina::interop::io::metric_format<Proxy, illumina::interop::io::generic_layout<Metric, Version> >);

/** Ensure that static libraries are properly linked
* This must be used in a function that will definitely be linked.
*
* Tested for Microsoft Visual C++, GCC and CLang
*/
#define INTEROP_FORCE_LINK_USE(X) void force_link_metric_format(X*); force_link_metric_format(0);
/** Ensure that static libraries are properly linked
* This must be used in a file that may not be linked.
*
* Tested for Microsoft Visual C++, GCC and CLang
*/
#define INTEROP_FORCE_LINK_DEF(X) namespace illumina{namespace interop{namespace io{ void force_link_metric_format(X*){} }}} \
void force_link_metric_format(X*){} // For Microsoft Visual C++

namespace illumina { namespace interop { namespace io
{
Expand Down
92 changes: 92 additions & 0 deletions interop/io/format/text_format.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
/** Concrete text layout formats for the abstract text format interface.
*
*
* @file
* @date 12/19/16
* @version 1.0
* @copyright GNU Public License.
*/
#pragma once
#ifdef _MSC_VER
#pragma warning(disable:4702) // MSVC warns that there is unreachable code
#endif


#include "interop/util/exception.h"
#include "interop/io/format/abstract_text_format.h"
#include "interop/io/format/generic_layout.h"

namespace illumina { namespace interop { namespace io
{
/** Shared functionality for writing text InterOp metrics
*/
template<class Metric, class Layout>
struct text_format;
/** Shared functionality for writing text InterOp metrics
*
* Specialization for text_layout
*/
template<class Metric, int Version>
struct text_format<Metric, text_layout<Metric, Version> > : public abstract_text_format<Metric>
{
private:
typedef text_layout<Metric, Version> layout_t;
typedef typename Metric::id_t id_t;
public:
/** Define the metric type */
typedef Metric metric_t;
/** Define the metric header type */
typedef typename Metric::header_type header_t;

/** Write the header of text format to the given output stream
*
* @param out output stream to write the binary InterOp file data
* @param header header of a metric set
* @param channel_names list of channel names
* @param sep column seperator
* @param eol row separator
* @return number of column headers
*/
size_t write_header(std::ostream &out,
const header_t &header,
const std::vector<std::string>& channel_names,
const char sep,
const char eol)
{
out << "# " << Metric::prefix() << Metric::suffix() << sep;
out << Version << eol;
return layout_t::write_header(out, header, channel_names, sep, eol);
}

/** Write a text record to the given output stream
*
* @param out output stream
* @param metric a metric to write
* @param header metric set header
* @param sep column seperator
* @param eol row separator
* @param missing missing value indicator
* @return number of columns written
*/
size_t write_metric(std::ostream &out,
const metric_t &metric,
const header_t &header,
const char sep,
const char eol,
const char missing)
{
return layout_t::write_metric(out, metric, header, sep, eol, missing);
}

/** Get the version of this metric format
*
* @return version number
*/
::int16_t version() const
{
return static_cast< ::int16_t >(Version);
}
};
}}}


Loading

0 comments on commit 7b52e23

Please sign in to comment.