Register GATK-full-only walkers and rethrow the missing walker error as a not supported in GATK lite error
This commit is contained in:
parent
a5721a8846
commit
357e0b35af
|
|
@ -281,7 +281,14 @@ public class GenomeAnalysisEngine {
|
||||||
* @return An instance of the walker.
|
* @return An instance of the walker.
|
||||||
*/
|
*/
|
||||||
public Walker<?, ?> getWalkerByName(String walkerName) {
|
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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -41,6 +41,21 @@ public class GATKLiteUtils {
|
||||||
*/
|
*/
|
||||||
private GATKLiteUtils() { }
|
private GATKLiteUtils() { }
|
||||||
|
|
||||||
|
|
||||||
|
private static Set<String> fullVersionGATKWalkers = new HashSet<String>();
|
||||||
|
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
|
* Utility method to determine whether this is the lite version of the GATK
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -80,7 +80,7 @@ public class UserException extends ReviewedStingException {
|
||||||
|
|
||||||
public static class NotSupportedInGATKLite extends UserException {
|
public static class NotSupportedInGATKLite extends UserException {
|
||||||
public NotSupportedInGATKLite(String message) {
|
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));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue