From 70519fdce32324fc4b912cfc524aa00aed137282 Mon Sep 17 00:00:00 2001 From: Tim Fennell Date: Wed, 18 Oct 2023 15:02:26 -0600 Subject: [PATCH] Ensure that query range used is limited to contig start/stop. (#31) * Ensure that query range used is limited to contig start/stop. --- docs/tools/index.md | 2 +- .../com/fulcrumgenomics/sv/tools/AggregateSvPileup.scala | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/docs/tools/index.md b/docs/tools/index.md index 5790176..98eeabd 100644 --- a/docs/tools/index.md +++ b/docs/tools/index.md @@ -4,7 +4,7 @@ title: fgsv tools # fgsv tools -The following tools are available in fgsv version 0.1.0-fd73568. +The following tools are available in fgsv version 0.1.0-dcaa891. ## All tools All tools. diff --git a/src/main/scala/com/fulcrumgenomics/sv/tools/AggregateSvPileup.scala b/src/main/scala/com/fulcrumgenomics/sv/tools/AggregateSvPileup.scala index ce0d61f..df1af6c 100644 --- a/src/main/scala/com/fulcrumgenomics/sv/tools/AggregateSvPileup.scala +++ b/src/main/scala/com/fulcrumgenomics/sv/tools/AggregateSvPileup.scala @@ -351,8 +351,8 @@ case class AggregatedBreakpointPileup(id: String, source = src, contig = contig, breakends = pileups, - queryMin = minPos - flank, - queryMax = maxPos + flank, + queryMin = Math.max(1, minPos - flank), + queryMax = Math.min(maxPos + flank, src.dict(contig).length), minTotal = minTotal, minFrequency = minFrequency, ) @@ -461,7 +461,6 @@ case class AggregatedBreakpointPileup(id: String, private def overlapsTarget(contig: String, start: Int, end: Int, targets: OverlapDetector[BEDFeature]): Boolean = { targets.overlapsAny(new Interval(contig, start, end)) } - }