diff --git a/hpg-bigdata-analysis/pom.xml b/hpg-bigdata-analysis/pom.xml index d634175d..dbf66d0e 100644 --- a/hpg-bigdata-analysis/pom.xml +++ b/hpg-bigdata-analysis/pom.xml @@ -26,8 +26,8 @@ ../pom.xml - hpg-bigdata-analysis - ${hpg.version} + hpg-bigdata-analysis + ${hpg.version} diff --git a/hpg-bigdata-analysis/src/main/java/org/opencb/hpg/bigdata/analysis/AnalysisExecutor.java b/hpg-bigdata-analysis/src/main/java/org/opencb/hpg/bigdata/analysis/AnalysisExecutor.java index cace6b13..d03ee002 100644 --- a/hpg-bigdata-analysis/src/main/java/org/opencb/hpg/bigdata/analysis/AnalysisExecutor.java +++ b/hpg-bigdata-analysis/src/main/java/org/opencb/hpg/bigdata/analysis/AnalysisExecutor.java @@ -1,24 +1,25 @@ package org.opencb.hpg.bigdata.analysis; import org.opencb.hpg.bigdata.analysis.exceptions.AnalysisExecutorException; +import org.opencb.hpg.bigdata.core.config.OskarConfiguration; /** * Created by jtarraga on 30/01/17. */ public abstract class AnalysisExecutor { protected String studyId; + protected OskarConfiguration configuration; - protected AnalysisExecutor(String studyId) { + protected AnalysisExecutor(String studyId, OskarConfiguration configuration) { this.studyId = studyId; + this.configuration = configuration; } protected abstract void execute() throws AnalysisExecutorException; @Override public String toString() { - return "AnalysisExecutor{" - + "studyId='" + studyId + '\'' - + '}'; + return "AnalysisExecutor{" + "studyId='" + studyId + '\'' + ", configuration=" + configuration + '}'; } public String getStudyId() { @@ -29,4 +30,13 @@ public AnalysisExecutor setStudyId(String studyId) { this.studyId = studyId; return this; } + + public OskarConfiguration getConfiguration() { + return configuration; + } + + public AnalysisExecutor setConfiguration(OskarConfiguration configuration) { + this.configuration = configuration; + return this; + } } diff --git a/hpg-bigdata-analysis/src/main/java/org/opencb/hpg/bigdata/analysis/variant/LinearRegressionAnalysis.java b/hpg-bigdata-analysis/src/main/java/org/opencb/hpg/bigdata/analysis/variant/LinearRegressionAnalysis.java index ca5ca534..d06e981d 100644 --- a/hpg-bigdata-analysis/src/main/java/org/opencb/hpg/bigdata/analysis/variant/LinearRegressionAnalysis.java +++ b/hpg-bigdata-analysis/src/main/java/org/opencb/hpg/bigdata/analysis/variant/LinearRegressionAnalysis.java @@ -10,6 +10,7 @@ import org.apache.spark.sql.Dataset; import org.apache.spark.sql.Row; import org.apache.spark.sql.SQLContext; +import org.opencb.hpg.bigdata.core.config.OskarConfiguration; import java.util.ArrayList; import java.util.List; @@ -63,13 +64,14 @@ public void execute() { System.out.println("r2: " + trainingSummary.r2()); } - public LinearRegressionAnalysis(String studyId, String depVarName, String indepVarName) { - this(studyId, depVarName, indepVarName, 10, 0.3, 0.8); + public LinearRegressionAnalysis(String studyId, String depVarName, String indepVarName, OskarConfiguration configuration) { + this(studyId, depVarName, indepVarName, 10, 0.3, 0.8, configuration); } public LinearRegressionAnalysis(String studyId, String depVarName, String indepVarName, - int numIterations, double regularization, double elasticNet) { - super(studyId); + int numIterations, double regularization, double elasticNet, + OskarConfiguration configuration) { + super(studyId, configuration); this.depVarName = depVarName; this.indepVarName = indepVarName; this.numIterations = numIterations; diff --git a/hpg-bigdata-analysis/src/main/java/org/opencb/hpg/bigdata/analysis/variant/LogisticRegressionAnalysis.java b/hpg-bigdata-analysis/src/main/java/org/opencb/hpg/bigdata/analysis/variant/LogisticRegressionAnalysis.java index d02a20e7..ec046da4 100644 --- a/hpg-bigdata-analysis/src/main/java/org/opencb/hpg/bigdata/analysis/variant/LogisticRegressionAnalysis.java +++ b/hpg-bigdata-analysis/src/main/java/org/opencb/hpg/bigdata/analysis/variant/LogisticRegressionAnalysis.java @@ -8,6 +8,7 @@ import org.apache.spark.sql.Dataset; import org.apache.spark.sql.Row; import org.apache.spark.sql.functions; +import org.opencb.hpg.bigdata.core.config.OskarConfiguration; /** * Created by jtarraga on 30/05/17. @@ -70,13 +71,13 @@ public void execute() { lrModel.setThreshold(bestThreshold); } - public LogisticRegressionAnalysis(String studyId, String depVarName, String indepVarName) { - this(studyId, depVarName, indepVarName, 10, 0.3, 0.8); + public LogisticRegressionAnalysis(String studyId, String depVarName, String indepVarName, OskarConfiguration configuration) { + this(studyId, depVarName, indepVarName, 10, 0.3, 0.8, configuration); } public LogisticRegressionAnalysis(String studyId, String depVarName, String indepVarName, - int numIterations, double regularization, double elasticNet) { - super(studyId); + int numIterations, double regularization, double elasticNet, OskarConfiguration configuration) { + super(studyId, configuration); this.depVarName = depVarName; this.indepVarName = indepVarName; this.numIterations = numIterations; diff --git a/hpg-bigdata-analysis/src/main/java/org/opencb/hpg/bigdata/analysis/variant/PCAAnalysis.java b/hpg-bigdata-analysis/src/main/java/org/opencb/hpg/bigdata/analysis/variant/PCAAnalysis.java index af33e6c9..c95883b3 100644 --- a/hpg-bigdata-analysis/src/main/java/org/opencb/hpg/bigdata/analysis/variant/PCAAnalysis.java +++ b/hpg-bigdata-analysis/src/main/java/org/opencb/hpg/bigdata/analysis/variant/PCAAnalysis.java @@ -4,6 +4,7 @@ import org.apache.spark.ml.feature.PCAModel; import org.apache.spark.sql.Dataset; import org.apache.spark.sql.Row; +import org.opencb.hpg.bigdata.core.config.OskarConfiguration; /** * Created by jtarraga on 30/05/17. @@ -29,12 +30,12 @@ public void execute() { result.show(false); } - public PCAAnalysis(String studyId, String studyName, String featureName) { - this(studyId, studyName, featureName, 3); + public PCAAnalysis(String studyId, String studyName, String featureName, OskarConfiguration configuration) { + this(studyId, studyName, featureName, 3, configuration); } - public PCAAnalysis(String studyId, String studyName, String featureName, int kValue) { - super(studyId); + public PCAAnalysis(String studyId, String studyName, String featureName, int kValue, OskarConfiguration configuration) { + super(studyId, configuration); this.featureName = featureName; this.kValue = kValue; } diff --git a/hpg-bigdata-analysis/src/main/java/org/opencb/hpg/bigdata/analysis/variant/VariantAnalysisExecutor.java b/hpg-bigdata-analysis/src/main/java/org/opencb/hpg/bigdata/analysis/variant/VariantAnalysisExecutor.java index ad9f8891..6be05760 100644 --- a/hpg-bigdata-analysis/src/main/java/org/opencb/hpg/bigdata/analysis/variant/VariantAnalysisExecutor.java +++ b/hpg-bigdata-analysis/src/main/java/org/opencb/hpg/bigdata/analysis/variant/VariantAnalysisExecutor.java @@ -1,13 +1,14 @@ package org.opencb.hpg.bigdata.analysis.variant; import org.opencb.hpg.bigdata.analysis.AnalysisExecutor; +import org.opencb.hpg.bigdata.core.config.OskarConfiguration; /** * Created by jtarraga on 30/05/17. */ public abstract class VariantAnalysisExecutor extends AnalysisExecutor { - protected VariantAnalysisExecutor(String studyId) { - super(studyId); + protected VariantAnalysisExecutor(String studyId, OskarConfiguration configuration) { + super(studyId, configuration); } } diff --git a/hpg-bigdata-analysis/src/main/java/org/opencb/hpg/bigdata/analysis/variant/VariantAnalysisUtils.java b/hpg-bigdata-analysis/src/main/java/org/opencb/hpg/bigdata/analysis/variant/VariantAnalysisUtils.java index 2b8dc097..289a7fa4 100644 --- a/hpg-bigdata-analysis/src/main/java/org/opencb/hpg/bigdata/analysis/variant/VariantAnalysisUtils.java +++ b/hpg-bigdata-analysis/src/main/java/org/opencb/hpg/bigdata/analysis/variant/VariantAnalysisUtils.java @@ -33,7 +33,7 @@ public static void exportVCF(String inputAvroFilename, String metaFilename, try { manager.load(Paths.get(metaFilename)); - SparkConf sparkConf = SparkConfCreator.getConf("VCF exporter", "local", 1, true); + SparkConf sparkConf = SparkConfCreator.getConf("VCF exporter", "local", 1, false); SparkSession sparkSession = new SparkSession(new SparkContext(sparkConf)); VariantDataset vd = new VariantDataset(sparkSession); diff --git a/hpg-bigdata-analysis/src/main/java/org/opencb/hpg/bigdata/analysis/variant/wrappers/PlinkWrapper.java b/hpg-bigdata-analysis/src/main/java/org/opencb/hpg/bigdata/analysis/variant/wrappers/PlinkWrapper.java index 5b3d7c66..e5c2a8b5 100644 --- a/hpg-bigdata-analysis/src/main/java/org/opencb/hpg/bigdata/analysis/variant/wrappers/PlinkWrapper.java +++ b/hpg-bigdata-analysis/src/main/java/org/opencb/hpg/bigdata/analysis/variant/wrappers/PlinkWrapper.java @@ -14,6 +14,7 @@ import org.opencb.hpg.bigdata.analysis.exceptions.AnalysisExecutorException; import org.opencb.hpg.bigdata.analysis.exceptions.AnalysisToolException; import org.opencb.hpg.bigdata.analysis.tools.Executor; +import org.opencb.hpg.bigdata.core.config.OskarConfiguration; import org.opencb.hpg.bigdata.core.lib.SparkConfCreator; import org.opencb.hpg.bigdata.core.lib.VariantDataset; import org.slf4j.Logger; @@ -28,6 +29,8 @@ import java.util.Map; public class PlinkWrapper extends VariantAnalysisWrapper { + public static final String ANALYSIS_NAME = "plink"; + private String inFilename; private String metaFilename; private Query query; @@ -36,8 +39,8 @@ public class PlinkWrapper extends VariantAnalysisWrapper { private Logger logger; public PlinkWrapper(String studyId, String inFilename, String metaFilename, - Query query, Map plinkParams) { - super(studyId, Paths.get("plink")); + Query query, Map plinkParams, OskarConfiguration configuration) { + super(studyId, configuration); this.inFilename = inFilename; this.metaFilename = metaFilename; this.query = query; @@ -49,10 +52,17 @@ public PlinkWrapper(String studyId, String inFilename, String metaFilename, public void execute() throws AnalysisExecutorException { // Sanity check - if (binPath == null || !binPath.toFile().exists()) { - String msg = "PLINK binary path is missing or does not exist: '" + binPath + "'."; - logger.error(msg); - throw new AnalysisExecutorException(msg); + Path binPath; + try { + binPath = Paths.get(configuration.getAnalysis().get(ANALYSIS_NAME).getPath()); + if (binPath == null || !binPath.toFile().exists()) { + String msg = "PLINK binary path is missing or does not exist: '" + binPath + "'."; + logger.error(msg); + throw new AnalysisExecutorException(msg); + } + } catch (Exception e) { + logger.error(e.getMessage()); + throw new AnalysisExecutorException(e.getMessage()); } // Get output dir diff --git a/hpg-bigdata-analysis/src/main/java/org/opencb/hpg/bigdata/analysis/variant/wrappers/RvTestsWrapper.java b/hpg-bigdata-analysis/src/main/java/org/opencb/hpg/bigdata/analysis/variant/wrappers/RvTestsWrapper.java index 17f3c5af..dadea786 100644 --- a/hpg-bigdata-analysis/src/main/java/org/opencb/hpg/bigdata/analysis/variant/wrappers/RvTestsWrapper.java +++ b/hpg-bigdata-analysis/src/main/java/org/opencb/hpg/bigdata/analysis/variant/wrappers/RvTestsWrapper.java @@ -5,6 +5,7 @@ import org.opencb.hpg.bigdata.analysis.exceptions.AnalysisToolException; import org.opencb.hpg.bigdata.analysis.tools.Executor; import org.opencb.hpg.bigdata.analysis.variant.VariantAnalysisUtils; +import org.opencb.hpg.bigdata.core.config.OskarConfiguration; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -17,6 +18,8 @@ * Created by joaquin on 1/19/17. */ public class RvTestsWrapper extends VariantAnalysisWrapper { + public static final String ANALYSIS_NAME = "rvtests"; + private String inFilename; private String metaFilename; private Query query; @@ -25,8 +28,8 @@ public class RvTestsWrapper extends VariantAnalysisWrapper { private Logger logger; public RvTestsWrapper(String studyId, String inFilename, String metaFilename, - Query query, Map rvtestsParams) { - super(studyId, Paths.get("rvtest")); + Query query, Map rvtestsParams, OskarConfiguration configuration) { + super(studyId, configuration); this.inFilename = inFilename; this.metaFilename = metaFilename; this.query = query; @@ -38,10 +41,17 @@ public RvTestsWrapper(String studyId, String inFilename, String metaFilename, @Override public void execute() throws AnalysisExecutorException { // Sanity check - if (binPath == null || !binPath.toFile().exists()) { - String msg = "RvTests binary path is missing or does not exist: '" + binPath + "'."; - logger.error(msg); - throw new AnalysisExecutorException(msg); + Path binPath; + try { + binPath = Paths.get(configuration.getAnalysis().get(ANALYSIS_NAME).getPath()); + if (binPath == null || !binPath.toFile().exists()) { + String msg = "RvTests binary path is missing or does not exist: '" + binPath + "'."; + logger.error(msg); + throw new AnalysisExecutorException(msg); + } + } catch (Exception e) { + logger.error(e.getMessage()); + throw new AnalysisExecutorException(e.getMessage()); } // Get output dir @@ -78,7 +88,7 @@ public void execute() throws AnalysisExecutorException { // ...and finally, run rvtests sb.setLength(0); sb.append(binPath); - sb.append(" --inVcf ").append(vcfFilename).append(".gz"); + sb.append(" --inVcf ").append(vcfFilename); //.append(".gz"); sb.append(" --pheno ").append(pedFilename); for (String key: rvtestsParams.keySet()) { sb.append(" --").append(key).append(" ").append(rvtestsParams.get(key)); diff --git a/hpg-bigdata-analysis/src/main/java/org/opencb/hpg/bigdata/analysis/variant/wrappers/VariantAnalysisWrapper.java b/hpg-bigdata-analysis/src/main/java/org/opencb/hpg/bigdata/analysis/variant/wrappers/VariantAnalysisWrapper.java index e797d4c5..70496784 100644 --- a/hpg-bigdata-analysis/src/main/java/org/opencb/hpg/bigdata/analysis/variant/wrappers/VariantAnalysisWrapper.java +++ b/hpg-bigdata-analysis/src/main/java/org/opencb/hpg/bigdata/analysis/variant/wrappers/VariantAnalysisWrapper.java @@ -1,27 +1,11 @@ package org.opencb.hpg.bigdata.analysis.variant.wrappers; import org.opencb.hpg.bigdata.analysis.variant.VariantAnalysisExecutor; - -import java.nio.file.Path; +import org.opencb.hpg.bigdata.core.config.OskarConfiguration; public abstract class VariantAnalysisWrapper extends VariantAnalysisExecutor { - protected Path binPath; - - protected VariantAnalysisWrapper(String studyId) { - super(studyId); - } - - protected VariantAnalysisWrapper(String studyId, Path binPath) { - super(studyId); - this.binPath = binPath; - } - - public VariantAnalysisWrapper setBinPath(Path binPath) { - this.binPath = binPath; - return this; - } - public Path getBinPath() { - return binPath; + protected VariantAnalysisWrapper(String studyId, OskarConfiguration configuration) { + super(studyId, configuration); } } diff --git a/hpg-bigdata-app/src/main/java/org/opencb/hpg/bigdata/app/cli/executors/VariantCommandExecutor.java b/hpg-bigdata-app/src/main/java/org/opencb/hpg/bigdata/app/cli/executors/VariantCommandExecutor.java index a201f41f..006e1eb6 100644 --- a/hpg-bigdata-app/src/main/java/org/opencb/hpg/bigdata/app/cli/executors/VariantCommandExecutor.java +++ b/hpg-bigdata-app/src/main/java/org/opencb/hpg/bigdata/app/cli/executors/VariantCommandExecutor.java @@ -47,6 +47,7 @@ import org.opencb.hpg.bigdata.app.cli.options.VariantCommandOptions; import org.opencb.hpg.bigdata.core.avro.VariantAvroAnnotator; import org.opencb.hpg.bigdata.core.avro.VariantAvroSerializer; +import org.opencb.hpg.bigdata.core.config.AnalysisConfiguration; import org.opencb.hpg.bigdata.core.config.OskarConfiguration; import org.opencb.hpg.bigdata.core.lib.SparkConfCreator; import org.opencb.hpg.bigdata.core.lib.VariantDataset; @@ -482,16 +483,31 @@ public void rvtests() throws Exception { variantCommandOptions.rvtestsVariantCommandOptions.variantFilterOptions); } + // Binary path management + String rvtestsPath = variantCommandOptions.rvtestsVariantCommandOptions.binPath; + String rvtestsVersion = variantCommandOptions.rvtestsVariantCommandOptions.version; + + if (configuration.getAnalysis() != null) { + configuration.setAnalysis(new AnalysisConfiguration()); + } + if (StringUtils.isNotEmpty(rvtestsPath)) { + // Update config with CLI parameters + AnalysisConfiguration.Analysis rvtests = new AnalysisConfiguration.Analysis(rvtestsPath, rvtestsVersion); + configuration.getAnalysis().put(RvTestsWrapper.ANALYSIS_NAME, rvtests); + } else if (configuration.getAnalysis().get(RvTestsWrapper.ANALYSIS_NAME) == null + || StringUtils.isNotEmpty(configuration.getAnalysis().get(RvTestsWrapper.ANALYSIS_NAME).getPath())) { + // Rvtests should be installed in the system + AnalysisConfiguration.Analysis rvtests = new AnalysisConfiguration.Analysis("rvtests", ""); + configuration.getAnalysis().put(RvTestsWrapper.ANALYSIS_NAME, rvtests); + } + + // Create RvTest wrapper RvTestsWrapper rvtests = new RvTestsWrapper(variantCommandOptions.rvtestsVariantCommandOptions.datasetId, variantCommandOptions.rvtestsVariantCommandOptions.inFilename, variantCommandOptions.rvtestsVariantCommandOptions.inFilename + ".meta.json", - query, variantCommandOptions.rvtestsVariantCommandOptions.rvtestsParams); + query, variantCommandOptions.rvtestsVariantCommandOptions.rvtestsParams, configuration); - // Get the binary path from input parameter - String binPath = variantCommandOptions.rvtestsVariantCommandOptions.binPath; - if (!StringUtils.isEmpty(binPath)) { - rvtests.setBinPath(Paths.get(binPath)); - } + // Execute RvTests rvtests.execute(); } @@ -502,16 +518,31 @@ public void plink() throws Exception { variantCommandOptions.rvtestsVariantCommandOptions.variantFilterOptions); } + // Binary path management + String plinkPath = variantCommandOptions.plinkVariantCommandOptions.binPath; + String plinkVersion = variantCommandOptions.plinkVariantCommandOptions.version; + + if (configuration.getAnalysis() != null) { + configuration.setAnalysis(new AnalysisConfiguration()); + } + if (StringUtils.isNotEmpty(plinkPath)) { + // Update config with CLI parameters + AnalysisConfiguration.Analysis plink = new AnalysisConfiguration.Analysis(plinkPath, plinkVersion); + configuration.getAnalysis().put(PlinkWrapper.ANALYSIS_NAME, plink); + } else if (configuration.getAnalysis().get(PlinkWrapper.ANALYSIS_NAME) == null + || StringUtils.isNotEmpty(configuration.getAnalysis().get(PlinkWrapper.ANALYSIS_NAME).getPath())) { + // Rvtests should be installed in the system + AnalysisConfiguration.Analysis rvtests = new AnalysisConfiguration.Analysis("plink", ""); + configuration.getAnalysis().put(PlinkWrapper.ANALYSIS_NAME, rvtests); + } + + // Create PLINK wrapper PlinkWrapper plink = new PlinkWrapper(variantCommandOptions.plinkVariantCommandOptions.datasetId, variantCommandOptions.plinkVariantCommandOptions.inFilename, variantCommandOptions.plinkVariantCommandOptions.inFilename + ".meta.json", - query, variantCommandOptions.plinkVariantCommandOptions.plinkParams); + query, variantCommandOptions.plinkVariantCommandOptions.plinkParams, configuration); - // Get the binary path from input parameter - String binPath = variantCommandOptions.plinkVariantCommandOptions.binPath; - if (!StringUtils.isEmpty(binPath)) { - plink.setBinPath(Paths.get(binPath)); - } + // Execute PLINK plink.execute(); } diff --git a/hpg-bigdata-app/src/main/java/org/opencb/hpg/bigdata/app/cli/options/VariantCommandOptions.java b/hpg-bigdata-app/src/main/java/org/opencb/hpg/bigdata/app/cli/options/VariantCommandOptions.java index 04ae5fb4..2d082eb3 100644 --- a/hpg-bigdata-app/src/main/java/org/opencb/hpg/bigdata/app/cli/options/VariantCommandOptions.java +++ b/hpg-bigdata-app/src/main/java/org/opencb/hpg/bigdata/app/cli/options/VariantCommandOptions.java @@ -24,7 +24,7 @@ public class VariantCommandOptions { public PlinkVariantCommandOptions plinkVariantCommandOptions; public LocalCliOptionsParser.CommonCommandOptions commonCommandOptions; - public VariantFilterOptions commonFilterOptions; + public VariantFilterOptions variantFilterOptions; public JCommander jCommander; public VariantCommandOptions(LocalCliOptionsParser.CommonCommandOptions commonCommandOptions, @@ -43,10 +43,10 @@ public VariantCommandOptions(LocalCliOptionsParser.CommonCommandOptions commonCo } public VariantCommandOptions(LocalCliOptionsParser.CommonCommandOptions commonCommandOptions, - VariantFilterOptions commonFilterOptions, + VariantFilterOptions variantFilterOptions, JCommander jCommander) { this.commonCommandOptions = commonCommandOptions; - this.commonFilterOptions = commonFilterOptions; + this.variantFilterOptions = variantFilterOptions; this.jCommander = jCommander; this.convertVariantCommandOptions = new ConvertVariantCommandOptions(); @@ -366,7 +366,7 @@ public class RvTestsVariantCommandOptions { public LocalCliOptionsParser.CommonCommandOptions commonOptions = commonCommandOptions; @ParametersDelegate - public VariantFilterOptions variantFilterOptions = commonFilterOptions; + public VariantFilterOptions variantFilterOptions = VariantCommandOptions.this.variantFilterOptions; @Parameter(names = {"--dataset"}, description = "Target dataset.", arity = 1) public String datasetId = null; @@ -380,6 +380,9 @@ public class RvTestsVariantCommandOptions { @Parameter(names = {"--rvtests-path"}, description = "Path to the RvTests executable.", arity = 1) public String binPath = null; + + @Parameter(names = {"--rvtests-version"}, description = "RvTests version.", arity = 1) + public String version = null; } @Parameters(commandNames = {"plink"}, commandDescription = "Execute the 'plink' program.") @@ -389,7 +392,7 @@ public class PlinkVariantCommandOptions { public LocalCliOptionsParser.CommonCommandOptions commonOptions = commonCommandOptions; @ParametersDelegate - public VariantFilterOptions variantFilterOptions = commonFilterOptions; + public VariantFilterOptions variantFilterOptions = VariantCommandOptions.this.variantFilterOptions; @Parameter(names = {"--dataset"}, description = "Target dataset.", arity = 1) public String datasetId = null; @@ -403,5 +406,8 @@ public class PlinkVariantCommandOptions { @Parameter(names = {"--plink-path"}, description = "Path to the PLINK executable.", arity = 1) public String binPath = null; + + @Parameter(names = {"--plink-version"}, description = "PLINK version.", arity = 1) + public String version = null; } } diff --git a/hpg-bigdata-app/src/test/java/org/opencb/hpg/bigdata/app/cli/local/VariantPlinkCLITest.java b/hpg-bigdata-app/src/test/java/org/opencb/hpg/bigdata/app/cli/local/VariantPlinkCLITest.java index f659ea55..02d9c770 100644 --- a/hpg-bigdata-app/src/test/java/org/opencb/hpg/bigdata/app/cli/local/VariantPlinkCLITest.java +++ b/hpg-bigdata-app/src/test/java/org/opencb/hpg/bigdata/app/cli/local/VariantPlinkCLITest.java @@ -3,7 +3,7 @@ import org.junit.Test; public class VariantPlinkCLITest { - //@Test + @Test public void assoc() { try { VariantRvTestsCLITest cli = new VariantRvTestsCLITest(); diff --git a/hpg-bigdata-app/src/test/java/org/opencb/hpg/bigdata/app/cli/local/VariantRvTestsCLITest.java b/hpg-bigdata-app/src/test/java/org/opencb/hpg/bigdata/app/cli/local/VariantRvTestsCLITest.java index f9f40394..78d272be 100644 --- a/hpg-bigdata-app/src/test/java/org/opencb/hpg/bigdata/app/cli/local/VariantRvTestsCLITest.java +++ b/hpg-bigdata-app/src/test/java/org/opencb/hpg/bigdata/app/cli/local/VariantRvTestsCLITest.java @@ -11,9 +11,9 @@ public class VariantRvTestsCLITest { public String datasetName = "test"; - //public String vcfFilename = "../hpg-bigdata-app/src/test/resources/example.vcf" + public String vcfFilename = "../hpg-bigdata-app/src/test/resources/example.vcf"; //public String vcfFilename = "/home/jtarraga/data150/vcf/chr22.head1k.vcf"; - public String vcfFilename = "/home/jtarraga/data150/vcf/chr22.head100k.vcf"; + //public String vcfFilename = "/home/jtarraga/data150/vcf/chr22.head100k.vcf"; public String phenoFilename = "../hpg-bigdata-app/src/test/resources/pheno"; public String outDir = "/tmp/"; @@ -33,7 +33,7 @@ public void init() throws Exception { // convert vcf to avro StringBuilder commandLine = new StringBuilder(); - commandLine.append(" variant convert"); + commandLine.append("variant convert"); commandLine.append(" --log-level ERROR"); commandLine.append(" -i ").append(vcfPath); commandLine.append(" -o ").append(avroPath); @@ -43,7 +43,7 @@ public void init() throws Exception { if (!vcfFilename.startsWith("/")) { // load pedigree file commandLine.setLength(0); - commandLine.append(" variant metadata"); + commandLine.append("variant metadata"); commandLine.append(" --log-level ERROR"); commandLine.append(" -i ").append(avroPath); commandLine.append(" --load-pedigree ").append(phenoPath); @@ -52,13 +52,13 @@ public void init() throws Exception { } } - //@Test + @Test public void skat() { try { init(); StringBuilder commandLine = new StringBuilder(); - commandLine.append(" variant rvtests"); + commandLine.append("variant rvtests"); commandLine.append(" --log-level ERROR"); commandLine.append(" --dataset ").append(datasetName); commandLine.append(" -i ").append(avroPath);