diff --git a/public/java/src/org/broadinstitute/sting/gatk/GenomeAnalysisEngine.java b/public/java/src/org/broadinstitute/sting/gatk/GenomeAnalysisEngine.java index 8dfa89083..eab9fde79 100755 --- a/public/java/src/org/broadinstitute/sting/gatk/GenomeAnalysisEngine.java +++ b/public/java/src/org/broadinstitute/sting/gatk/GenomeAnalysisEngine.java @@ -281,7 +281,14 @@ public class GenomeAnalysisEngine { * @return An instance of the walker. */ public Walker getWalkerByName(String walkerName) { - return walkerManager.createByName(walkerName); + try { + return walkerManager.createByName(walkerName); + } catch ( UserException e ) { + if ( isGATKLite() && GATKLiteUtils.isAvailableOnlyInFullGATK(walkerName) ) { + e = new UserException.NotSupportedInGATKLite("the " + walkerName + " walker is available only in the full version of the GATK"); + } + throw e; + } } /** diff --git a/public/java/src/org/broadinstitute/sting/utils/classloader/GATKLiteUtils.java b/public/java/src/org/broadinstitute/sting/utils/classloader/GATKLiteUtils.java index db9b9d8b7..2ab7d0618 100755 --- a/public/java/src/org/broadinstitute/sting/utils/classloader/GATKLiteUtils.java +++ b/public/java/src/org/broadinstitute/sting/utils/classloader/GATKLiteUtils.java @@ -41,6 +41,21 @@ public class GATKLiteUtils { */ private GATKLiteUtils() { } + + private static Set fullVersionGATKWalkers = new HashSet(); + static { + fullVersionGATKWalkers.add("HaplotypeCaller"); + fullVersionGATKWalkers.add("ReduceReads"); + } + /** + * Utility method to check whether a given walker is only available in the full GATK release + * + * @param walkerName the walker class name (not the package) to check + */ + public static boolean isAvailableOnlyInFullGATK(final String walkerName) { + return fullVersionGATKWalkers.contains(walkerName); + } + /** * Utility method to determine whether this is the lite version of the GATK */ diff --git a/public/java/src/org/broadinstitute/sting/utils/exceptions/UserException.java b/public/java/src/org/broadinstitute/sting/utils/exceptions/UserException.java index f950cbfb3..9ce4e82a1 100755 --- a/public/java/src/org/broadinstitute/sting/utils/exceptions/UserException.java +++ b/public/java/src/org/broadinstitute/sting/utils/exceptions/UserException.java @@ -80,7 +80,7 @@ public class UserException extends ReviewedStingException { public static class NotSupportedInGATKLite extends UserException { public NotSupportedInGATKLite(String message) { - super(String.format("GATK Lite does support all of the features of the full version: %s", message)); + super(String.format("GATK Lite does not support all of the features of the full version: %s", message)); } }