Skip to content

Commit

Permalink
app: get the RvTest binary path from the command line #125
Browse files Browse the repository at this point in the history
  • Loading branch information
jtarraga committed Sep 18, 2017
1 parent 832c5a0 commit 360b56d
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ public RvTestsWrapper(String studyId, String inFilename, String metaFilename,
public void execute() throws AnalysisExecutorException {
// Sanity chek
if (binPath == null || !binPath.toFile().exists()) {
String msg = "RvTests binary path is missing.";
logger.error("RvTests binary path is missing.");
throw new AnalysisExecutorException("RvTests binary path is missing.");
String msg = "RvTests binary path is missing or does not exist: '" + binPath + "'.";
logger.error(msg);
throw new AnalysisExecutorException(msg);
}

// Get output dir
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -412,8 +412,12 @@ public void rvtests() throws Exception {
variantCommandOptions.rvtestsVariantCommandOptions.filterParameters,
variantCommandOptions.rvtestsVariantCommandOptions.rvtestsParams);

// TODO: get the binary path from config folder
rvtests.setBinPath(Paths.get("/home/jtarraga/soft/rvtests/executable/rvtest"));
// Get the binary path from input parameter
String binPath = variantCommandOptions.rvtestsVariantCommandOptions.binPath;
if (StringUtils.isEmpty(binPath)) {
binPath = "rvtest";
}
rvtests.setBinPath(Paths.get(binPath));
rvtests.execute();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -357,17 +357,11 @@ public class RvTestsVariantCommandOptions {
@Parameter(names = {"-i", "--input"}, description = "Input file name (in Avro/Parquet file format).",
required = true, arity = 1)
public String inFilename;
/*
@Parameter(names = {"-m", "--metadata"}, description = "Input metadata file name.",
required = true, arity = 1)
public String metaFilename;
@Parameter(names = {"-o", "--output"}, description = "Output directory name to save the rvtests results.",
required = true, arity = 1)
public String outDirname;

*/
@DynamicParameter(names = "-D", description = "RvTests parameters")
public Map<String, String> rvtestsParams = new HashMap<>();

@Parameter(names = {"--rvtest-path"}, description = "Path to the RvTest executable.", arity = 1)
public String binPath = null;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ public void skat() {
commandLine.append(" variant rvtests");
commandLine.append(" --log-level ERROR");
commandLine.append(" --dataset ").append(datasetName);
commandLine.append(" --rvtest-path ../../../soft/rvtests/executable/rvtest");
commandLine.append(" -i ").append(avroPath);
commandLine.append(" -Dsingle=wald");
commandLine.append(" -Dout=/tmp/out.wald");
Expand Down
1 change: 1 addition & 0 deletions hpg-bigdata-app/src/test/resources/example.vcf
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
##fileDate=20140730
##reference=ftp://ftp.1000genomes.ebi.ac.uk//vol1/ftp/technical/reference/phase2_reference_assembly_sequence/hs37d5.fa.gz
##source=1000GenomesPhase3Pipeline
##FORMAT=<ID=GT,Number=1,Type=String,Description="Genotype">
#CHROM POS ID REF ALT QUAL FILTER INFO FORMAT P1 P2 P3 P4 P5 P6 P7 P8 P9
1 1 . A G 100 . . GT 0/1 0/0 0/0 1/1 0/1 0/0 0/1 0/1 0/0
1 2 . A G 100 . . GT 0/0 0/0 0/0 0/0 0/0 0/0 0/1 0/0 0/1
Expand Down

0 comments on commit 360b56d

Please sign in to comment.