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; }