Skip to content

Commit 26471ac

Browse files
committed
Update glnexus arguments to match newest version
1 parent 594ad2c commit 26471ac

File tree

1 file changed

+36
-6
lines changed

1 file changed

+36
-6
lines changed

SequenceAnalysis/src/org/labkey/sequenceanalysis/analysis/GLNexusHandler.java

Lines changed: 36 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,15 @@ public GLNexusHandler()
4848
ToolParameterDescriptor.create("binVersion", "GLNexus Version", "The version of GLNexus to run, which is passed to their docker container", "textfield", new JSONObject(){{
4949
put("allowBlank", false);
5050
}}, "v1.2.7"),
51+
ToolParameterDescriptor.create("configType", "Config Type", "This is passed to the --config argument of GLNexus.", "ldk-simplecombo", new JSONObject()
52+
{{
53+
put("multiSelect", false);
54+
put("allowBlank", false);
55+
put("storeValues", "gatk;DeepVariant;DeepVariantWGS;DeepVariantWES");
56+
put("initialValues", "DeepVariant");
57+
put("delimiter", ";");
58+
put("joinReturnValue", true);
59+
}}, null),
5160
ToolParameterDescriptor.create("fileBaseName", "Filename", "This is the basename that will be used for the output gzipped VCF", "textfield", new JSONObject(){{
5261
put("allowBlank", false);
5362
}}, "CombinedGenotypes")
@@ -144,9 +153,15 @@ else if (genomeIds.isEmpty())
144153
throw new PipelineJobException("Missing binVersion");
145154
}
146155

156+
String configType = ctx.getParams().optString("configType", "DeepVariant");
157+
if (configType == null)
158+
{
159+
throw new PipelineJobException("Missing configType");
160+
}
161+
147162
File outputVcf = new File(ctx.getOutputDir(), basename + ".vcf.gz");
148163

149-
new GLNexusWrapper(ctx.getLogger()).execute(inputVcfs, outputVcf, ctx.getFileManager(), binVersion);
164+
new GLNexusWrapper(ctx.getLogger()).execute(inputVcfs, outputVcf, ctx.getFileManager(), binVersion, configType);
150165

151166
ctx.getLogger().debug("adding sequence output: " + outputVcf.getPath());
152167
SequenceOutputFile so1 = new SequenceOutputFile();
@@ -202,7 +217,7 @@ private File ensureLocalCopy(File input, File workingDirectory, PipelineOutputTr
202217
}
203218
}
204219

205-
public void execute(List<File> inputGvcfs, File outputVcf, PipelineOutputTracker tracker, String binVersion) throws PipelineJobException
220+
public void execute(List<File> inputGvcfs, File outputVcf, PipelineOutputTracker tracker, String binVersion, String configType) throws PipelineJobException
206221
{
207222
File workDir = outputVcf.getParentFile();
208223
tracker.addIntermediateFile(outputVcf);
@@ -242,22 +257,37 @@ public void execute(List<File> inputGvcfs, File outputVcf, PipelineOutputTracker
242257
writer.println("\t--memory='" + maxRam + "g' \\");
243258
}
244259
writer.println("\tquay.io/mlin/glnexus:" + binVersion + " \\");
260+
writer.println("\tglnexus_cli \\");
261+
writer.println("\t--config " + configType + " \\");
245262

246-
writer.println("\t--config DeepVariant" + " \\");
263+
writer.println("\t--trim-uncalled-alleles \\");
247264

248-
gvcfsLocal.forEach(f -> {
249-
writer.println("\t-i gvcf=/work/" + f.getName() + " \\");
250-
});
265+
if (maxRam != null)
266+
{
267+
writer.println("\t--mem-gbytes " + maxRam + "\\");
268+
}
251269

252270
Integer maxThreads = SequencePipelineService.get().getMaxThreads(getLogger());
253271
if (maxThreads != null)
254272
{
255273
writer.println("\t--threads " + maxThreads + " \\");
256274
}
257275

276+
gvcfsLocal.forEach(f -> {
277+
writer.println("\t/work/" + f.getName() + " \\");
278+
});
279+
258280
File bcftools = BcftoolsRunner.getBcfToolsPath();
259281
File bgzip = BgzipRunner.getExe();
260282
writer.println("\t| " + bcftools.getPath() + " view | " + bgzip.getPath() + " -c > " + outputVcf.getPath());
283+
284+
// Command will fail if this exists:
285+
File dbDir = new File (outputVcf.getParentFile(), "GLnexus.DB");
286+
287+
if (dbDir.exists())
288+
{
289+
FileUtils.deleteDirectory(dbDir);
290+
}
261291
}
262292
catch (IOException e)
263293
{

0 commit comments

Comments
 (0)