Skip to content

Commit 48eeec5

Browse files
committed
Make funcotator location more customizable
1 parent 7c9de91 commit 48eeec5

File tree

1 file changed

+26
-3
lines changed

1 file changed

+26
-3
lines changed

mGAP/src/org/labkey/mgap/pipeline/AnnotationStep.java

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -157,10 +157,11 @@ public Output processVariants(File inputVCF, File outputDirectory, ReferenceGeno
157157
}
158158

159159
boolean useFuncotator = getProvider().getParameterByName("useFuncotator").extractValue(getPipelineCtx().getJob(), getProvider(), getStepIdx(), Boolean.class, false);
160-
File funcotatorSourceDir = new File(PipelineJobService.get().getAppProperties().getToolsDirectory(), "funcotatorDataSource");
161-
if (useFuncotator && !funcotatorSourceDir.exists())
160+
File funcotatorSourceDir = null;
161+
if (useFuncotator)
162162
{
163-
throw new PipelineJobException("Unable to find file: " + funcotatorSourceDir.getPath());
163+
// this will throw if not found
164+
funcotatorSourceDir = getFuncotatorSource();
164165
}
165166

166167
getPipelineCtx().getLogger().info("processing file: " + inputVCF.getName());
@@ -596,4 +597,26 @@ public static void findChainFile(int sourceGenome, int targetGenome, SequenceAna
596597
support.cacheExpData(data);
597598
support.cacheObject(CHAIN_FILE, chainId);
598599
}
600+
601+
private File getFuncotatorSource()
602+
{
603+
File ret;
604+
605+
String path = PipelineJobService.get().getConfigProperties().getSoftwarePackagePath("FUNCOTATOR_DATA_SOURCE");
606+
if (path != null)
607+
{
608+
ret = new File(path);
609+
}
610+
else
611+
{
612+
ret = new File(PipelineJobService.get().getAppProperties().getToolsDirectory(), "VariantAnnotation");
613+
}
614+
615+
if (!ret.exists())
616+
{
617+
throw new IllegalArgumentException("Unable to find funcotator source: " + ret.getPath());
618+
}
619+
620+
return ret;
621+
}
599622
}

0 commit comments

Comments
 (0)