Skip to content
This repository has been archived by the owner on Jul 17, 2023. It is now read-only.

Commit

Permalink
Merge pull request #101 from Bioinformatics/feature-MANTA-1146
Browse files Browse the repository at this point in the history
MANTA-1146 Fix imprecise SV filtering when CIEND is a subset of CIPOS
  • Loading branch information
nnariai authored and GitHub Enterprise committed Oct 26, 2017
2 parents 2dc9531 + e66f7b8 commit e88ff9b
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 7 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
- Update minimum supported linux OS from Centos 5 to 6 (MANTA-1249)

### Fixed
- Fix imprecise SV filtering when CIEND is a subset of CIPOS (MANTA-1146)
- Ensure consistent BND pairs for translocations or RNA fusions are selected during vcf merging (MANTA-1243)
- Fix manta to tolerate deserialization differences in boost above/below v1.58 (MANTA-1262)
- Impact of issue was an (infrequent) assertion using boost v1.58+: `Assertion 'size() == rhs.size()' failed`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

/// \file
/// \author Chris Saunders
/// \author Naoki Nariai
///

#include "SVCandidateProcessor.hh"
Expand Down Expand Up @@ -182,7 +183,7 @@ writeSV(
}
}

// check min size for candidate output:
// check min size, or if it is IMPRECISE case where CIEND is a subset of CIPOS for candidate output:
if (isSVBelowMinSize(sv,opt.scanOpt.minCandidateVariantSize))
{
#ifdef DEBUG_GSV
Expand Down
7 changes: 1 addition & 6 deletions src/c++/lib/format/VcfWriterSV.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
/// \file
/// \author Chris Saunders
/// \author Felix Schlesinger
/// \author Naoki Nariai
///

#include "format/VcfWriterSV.hh"
Expand Down Expand Up @@ -550,12 +551,6 @@ writeInvdel(
pos += bpABkptAdjust;
endPos += bpBBkptAdjust;

if (isImprecise)
{
// check against the rare IMPRECISE case arising when CIEND is a subset of CIPOS:
endPos=std::max(endPos,pos+1);
}

if (pos<1) return;

// get REF
Expand Down
25 changes: 25 additions & 0 deletions src/c++/lib/manta/SVCandidateUtil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

/// \file
/// \author Chris Saunders
/// \author Naoki Nariai
///

#include "manta/SVCandidateUtil.hh"
Expand All @@ -32,12 +33,36 @@ isSVBelowMinSize(
{
if (sv.bp1.interval.tid != sv.bp2.interval.tid) return false;

// check if the rare IMPRECISE case arising when CIEND is a subset of CIPOS,
// which is considered as small SV size
if (isInvalidBreakpointInterval(sv)) return true;

const pos_t bpSize(std::abs(sv.bp1.interval.range.center_pos() - sv.bp2.interval.range.center_pos())-1);
const pos_t insertSize(sv.insertSeq.size());

return (std::max(bpSize,insertSize) < static_cast<pos_t>(minSize));
}

bool
isInvalidBreakpointInterval(const SVCandidate& sv)
{
using namespace EXTENDED_SV_TYPE;
const index_t svType(getExtendedSVType(sv));

// if SV is not translocation, and IMPRECISE, then check if the SV's CIEND is a subset of CIPOS
if (!isSVTransloc(svType) && sv.isImprecise())
{
const bool isBp1First(sv.bp1.interval.range.begin_pos()<=sv.bp2.interval.range.begin_pos());

const SVBreakend& bpA(isBp1First ? sv.bp1 : sv.bp2);
const SVBreakend& bpB(isBp1First ? sv.bp2 : sv.bp1);

return bpB.interval.range.center_pos() <= bpA.interval.range.center_pos();
}

return false;
}

bool
isCis(const SVCandidate& sv)
{
Expand Down
7 changes: 7 additions & 0 deletions src/c++/lib/manta/SVCandidateUtil.hh
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

/// \file
/// \author Chris Saunders
/// \author Naoki Nariai
///

#pragma once
Expand All @@ -33,6 +34,12 @@ isSVBelowMinSize(
const SVCandidate& sv,
const unsigned minSize);

/// returns true if the rare IMPRECISE case arising when CIEND is a subset of CIPOS,
/// which is considered as small SV size
bool
isInvalidBreakpointInterval(
const SVCandidate& sv);

/// returns true if the sv is in cis orientation, i.e same chromosome
/// and a right open breakend to the left of a left open breakend
///
Expand Down

0 comments on commit e88ff9b

Please sign in to comment.