From 56b87da8f9adea310b267126da2cc5410b921671 Mon Sep 17 00:00:00 2001 From: aaron Date: Fri, 7 Jan 2011 19:06:04 +0000 Subject: [PATCH] a better error message for the situation where a RMD track generates a negitive length interval; the user will now see a message like "Bad input: A feature produced by the reference metadata track named "bed" at position chr1:10434-10433 has a start greater than the stop; this is an invalid position " git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@4958 348d0f76-0448-11de-a6fe-93d51630548a --- .../sting/gatk/refdata/utils/GATKFeature.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/java/src/org/broadinstitute/sting/gatk/refdata/utils/GATKFeature.java b/java/src/org/broadinstitute/sting/gatk/refdata/utils/GATKFeature.java index 9618b7485..f24df2a4a 100644 --- a/java/src/org/broadinstitute/sting/gatk/refdata/utils/GATKFeature.java +++ b/java/src/org/broadinstitute/sting/gatk/refdata/utils/GATKFeature.java @@ -27,6 +27,8 @@ import org.broad.tribble.Feature; import org.broadinstitute.sting.gatk.refdata.ReferenceOrderedDatum; import org.broadinstitute.sting.utils.GenomeLoc; import org.broadinstitute.sting.utils.GenomeLocParser; +import org.broadinstitute.sting.utils.exceptions.ReviewedStingException; +import org.broadinstitute.sting.utils.exceptions.UserException; /** @@ -44,7 +46,7 @@ public abstract class GATKFeature implements Feature { this.name = name; } - private String name; + String name; protected void setName(String name) { this.name = name; @@ -73,6 +75,9 @@ public abstract class GATKFeature implements Feature { } public GenomeLoc getLocation() { if (position == null) position = genomeLocParser.createGenomeLoc(feature.getChr(), feature.getStart(), feature.getEnd()); + if (position.getStart() > position.getStop()) { + throw new UserException.BadInput("A feature produced by the reference metadata track named \"" + this.name + "\" at position " + position + " has a start greater than the stop; this is an invalid this is an invalid position"); + } return position; }