From 08fab49d303bb6e9553d8c14daab5d024aa15564 Mon Sep 17 00:00:00 2001 From: Mark DePristo Date: Fri, 6 Apr 2012 15:56:01 -0400 Subject: [PATCH] Added function to get bases from the current base forward in the window in ReferenceContext --- build.xml | 4 ++-- .../sting/gatk/contexts/ReferenceContext.java | 10 ++++++++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/build.xml b/build.xml index 8e9de2272..9a66d4699 100644 --- a/build.xml +++ b/build.xml @@ -955,8 +955,8 @@ - - + + diff --git a/public/java/src/org/broadinstitute/sting/gatk/contexts/ReferenceContext.java b/public/java/src/org/broadinstitute/sting/gatk/contexts/ReferenceContext.java index 376064cdb..1290319e2 100644 --- a/public/java/src/org/broadinstitute/sting/gatk/contexts/ReferenceContext.java +++ b/public/java/src/org/broadinstitute/sting/gatk/contexts/ReferenceContext.java @@ -191,6 +191,16 @@ public class ReferenceContext { return basesCache; } + /** + * All the bases in the window from the current base forward to the end of the window. + */ + public byte[] getForwardBases() { + final byte[] bases = getBases(); + final int mid = locus.getStart() - window.getStart(); + // todo -- warning of performance problem, especially if this is called over and over + return new String(bases).substring(mid).getBytes(); + } + @Deprecated public char getBaseAsChar() { return (char)getBase();