Commit 1027984b authored by jkvis's avatar jkvis
Browse files

Fixed bug in transposition extraction: for small (deletions/)insertions

parent 4931b6bd
......@@ -8,8 +8,8 @@
## FILE INFORMATION:
## File: Makefile
## Author: Jonathan K. Vis
## Revision: 2.01a
## Date: 2014/07/22
## Revision: 2.0.3
## Date: 2014/07/31
## *******************************************************************
## DESCRIPTION:
## Build the Extractor library for python.
......
......@@ -8,8 +8,8 @@
// FILE INFORMATION:
// File: debug.cc
// Author: Jonathan K. Vis
// Revision: 2.01a
// Date: 2014/07/29
// Revision: 2.0.3
// Date: 2014/07/31
// *******************************************************************
// DESCRIPTION:
// This source can be used to debug the Extractor library within
......
......@@ -8,8 +8,8 @@
// FILE INFORMATION:
// File: extractor.cc (depends on extractor.h)
// Author: Jonathan K. Vis
// Revision: 2.01a
// Date: 2014/07/29
// Revision: 2.0.3
// Date: 2014/07/31
// *******************************************************************
// DESCRIPTION:
// This library can be used to generete HGVS variant descriptions as
......@@ -375,11 +375,22 @@ size_t extractor_transposition(std::vector<Variant> &variant,
#endif
// End transposition extraction if no more of the sample string
// remains.
if (sample_length <= 0)
{
return weight;
} // if
// Only consider large enough inserted regions (>> 1), based on
// (average) description length of a position.
// (average) description length of a position, otherwise it is just
// a deletion/insertion.
if (sample_length <= 2 * weight_position)
{
return sample_length * WEIGHT_BASE;
weight = sample_length * WEIGHT_BASE;
variant.push_back(Variant(reference_start, reference_end, sample_start, sample_end, SUBSTITUTION, weight));
return weight;
} // if
......@@ -388,7 +399,7 @@ size_t extractor_transposition(std::vector<Variant> &variant,
size_t const length = LCS(substring, reference, complement, 0, global_reference_length, sample, sample_start, sample_end);
// No LCS found: this is an deletion/insertion.
// No LCS found: this is a deletion/insertion.
if (length <= 0 || substring.size() <= 0)
{
weight = sample_length * WEIGHT_BASE;
......
......@@ -8,8 +8,8 @@
// FILE INFORMATION:
// File: extractor.h (implemented in extractor.cc)
// Author: Jonathan K. Vis
// Revision: 2.01a
// Date: 2014/07/29
// Revision: 2.0.3
// Date: 2014/07/31
// *******************************************************************
// DESCRIPTION:
// This library can be used to generate HGVS variant descriptions as
......@@ -34,7 +34,7 @@ namespace mutalyzer
{
// Version string for run-time identification.
static char const* const VERSION = "2.0.2";
static char const* const VERSION = "2.0.3";
// The character type used for all strings. For now it should just be
......
......@@ -8,8 +8,8 @@
// FILE INFORMATION:
// File: extractor.i (SWIG interface file)
// Author: Jonathan K. Vis
// Revision: 2.01a
// Date: 2014/07/29
// Revision: 2.0.3
// Date: 2014/07/31
// *******************************************************************
// DESCRIPTION:
// Defines the SWIG interface for the Extractor library for use in
......@@ -32,7 +32,7 @@ namespace mutalyzer
{
// Version string for run-time identification.
static char const* const VERSION = "2.0.2";
static char const* const VERSION = "2.0.3";
// The character type used for all strings. For now it should just be
// a char.
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment