diff --git a/opencga-analysis/src/main/java/org/opencb/opencga/analysis/family/qc/IBDComputation.java b/opencga-analysis/src/main/java/org/opencb/opencga/analysis/family/qc/IBDComputation.java index 7277c3d2429..7488510def0 100644 --- a/opencga-analysis/src/main/java/org/opencb/opencga/analysis/family/qc/IBDComputation.java +++ b/opencga-analysis/src/main/java/org/opencb/opencga/analysis/family/qc/IBDComputation.java @@ -32,6 +32,7 @@ import org.opencb.opencga.analysis.variant.relatedness.RelatednessAnalysis; import org.opencb.opencga.analysis.wrappers.plink.PlinkWrapperAnalysisExecutor; import org.opencb.opencga.catalog.exceptions.CatalogException; +import org.opencb.opencga.core.config.Analysis; import org.opencb.opencga.core.exceptions.ToolException; import org.opencb.opencga.core.models.family.Family; import org.opencb.opencga.core.models.individual.Individual; @@ -117,7 +118,7 @@ public static RelatednessReport compute(String study, Family family, List> inputBindings = new ArrayList<>(); inputBindings.add(new AbstractMap.SimpleEntry<>(freqPath.getParent().toString(), "/input")); @@ -311,8 +312,8 @@ private static File runIBD(String basename, Path freqPath, Path outDir) throws T String plinkParams = "plink1.9 --tfile /output/" + basename + " --genome rel-check --read-freq /input/" + FREQ_FILENAME + " --out /output/" + basename; try { - PlinkWrapperAnalysisExecutor plinkExecutor = new PlinkWrapperAnalysisExecutor(); - DockerUtils.run(plinkExecutor.getDockerImageName(), inputBindings, outputBinding, plinkParams, null); + String dockerImageName = PlinkWrapperAnalysisExecutor.getDockerImageName(analysisConf); + DockerUtils.run(dockerImageName, inputBindings, outputBinding, plinkParams, null); } catch (IOException e) { throw new ToolException(e); } diff --git a/opencga-analysis/src/main/java/org/opencb/opencga/analysis/wrappers/plink/PlinkWrapperAnalysisExecutor.java b/opencga-analysis/src/main/java/org/opencb/opencga/analysis/wrappers/plink/PlinkWrapperAnalysisExecutor.java index 890475b40fc..ffe17a02a72 100644 --- a/opencga-analysis/src/main/java/org/opencb/opencga/analysis/wrappers/plink/PlinkWrapperAnalysisExecutor.java +++ b/opencga-analysis/src/main/java/org/opencb/opencga/analysis/wrappers/plink/PlinkWrapperAnalysisExecutor.java @@ -3,6 +3,8 @@ import org.apache.commons.lang3.tuple.ImmutablePair; import org.apache.commons.lang3.tuple.Pair; import org.opencb.opencga.analysis.wrappers.executors.DockerWrapperAnalysisExecutor; +import org.opencb.opencga.core.config.Analysis; +import org.opencb.opencga.core.exceptions.ToolException; import org.opencb.opencga.core.tools.annotations.ToolExecutor; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -21,6 +23,15 @@ public class PlinkWrapperAnalysisExecutor extends DockerWrapperAnalysisExecutor private Logger logger = LoggerFactory.getLogger(this.getClass()); + public static String getDockerImageName(Analysis analysisConf) throws ToolException { + return analysisConf.getOpencgaExtTools().split(":")[0]; + } + + @Override + public String getDockerImageName() throws ToolException { + return getDockerImageName(getConfiguration().getAnalysis()); + } + @Override protected void run() throws Exception { StringBuilder sb = initCommandLine();