Skip to content

Commit

Permalink
Update glnexus arguments to match newest version
Browse files Browse the repository at this point in the history
  • Loading branch information
bbimber committed Feb 1, 2024
1 parent 594ad2c commit 26471ac
Showing 1 changed file with 36 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,15 @@ public GLNexusHandler()
ToolParameterDescriptor.create("binVersion", "GLNexus Version", "The version of GLNexus to run, which is passed to their docker container", "textfield", new JSONObject(){{
put("allowBlank", false);
}}, "v1.2.7"),
ToolParameterDescriptor.create("configType", "Config Type", "This is passed to the --config argument of GLNexus.", "ldk-simplecombo", new JSONObject()
{{
put("multiSelect", false);
put("allowBlank", false);
put("storeValues", "gatk;DeepVariant;DeepVariantWGS;DeepVariantWES");
put("initialValues", "DeepVariant");
put("delimiter", ";");
put("joinReturnValue", true);
}}, null),
ToolParameterDescriptor.create("fileBaseName", "Filename", "This is the basename that will be used for the output gzipped VCF", "textfield", new JSONObject(){{
put("allowBlank", false);
}}, "CombinedGenotypes")
Expand Down Expand Up @@ -144,9 +153,15 @@ else if (genomeIds.isEmpty())
throw new PipelineJobException("Missing binVersion");
}

String configType = ctx.getParams().optString("configType", "DeepVariant");
if (configType == null)
{
throw new PipelineJobException("Missing configType");
}

File outputVcf = new File(ctx.getOutputDir(), basename + ".vcf.gz");

new GLNexusWrapper(ctx.getLogger()).execute(inputVcfs, outputVcf, ctx.getFileManager(), binVersion);
new GLNexusWrapper(ctx.getLogger()).execute(inputVcfs, outputVcf, ctx.getFileManager(), binVersion, configType);

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

public void execute(List<File> inputGvcfs, File outputVcf, PipelineOutputTracker tracker, String binVersion) throws PipelineJobException
public void execute(List<File> inputGvcfs, File outputVcf, PipelineOutputTracker tracker, String binVersion, String configType) throws PipelineJobException
{
File workDir = outputVcf.getParentFile();
tracker.addIntermediateFile(outputVcf);
Expand Down Expand Up @@ -242,22 +257,37 @@ public void execute(List<File> inputGvcfs, File outputVcf, PipelineOutputTracker
writer.println("\t--memory='" + maxRam + "g' \\");
}
writer.println("\tquay.io/mlin/glnexus:" + binVersion + " \\");
writer.println("\tglnexus_cli \\");
writer.println("\t--config " + configType + " \\");

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

gvcfsLocal.forEach(f -> {
writer.println("\t-i gvcf=/work/" + f.getName() + " \\");
});
if (maxRam != null)
{
writer.println("\t--mem-gbytes " + maxRam + "\\");
}

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

gvcfsLocal.forEach(f -> {
writer.println("\t/work/" + f.getName() + " \\");
});

File bcftools = BcftoolsRunner.getBcfToolsPath();
File bgzip = BgzipRunner.getExe();
writer.println("\t| " + bcftools.getPath() + " view | " + bgzip.getPath() + " -c > " + outputVcf.getPath());

// Command will fail if this exists:
File dbDir = new File (outputVcf.getParentFile(), "GLnexus.DB");

if (dbDir.exists())
{
FileUtils.deleteDirectory(dbDir);
}
}
catch (IOException e)
{
Expand Down

0 comments on commit 26471ac

Please sign in to comment.