From 8a0505c9de3d819baf9e3a76a512fd7a5c131f5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joaqu=C3=ADn=20T=C3=A1rraga=20Gim=C3=A9nez?= Date: Tue, 6 Jun 2017 10:14:58 +0100 Subject: [PATCH] app: implement variant association test CLI, #126 --- .../app/cli/local/LocalCliOptionsParser.java | 1 + .../local/options/VariantCommandOptions.java | 35 ++++++++++++++++--- 2 files changed, 31 insertions(+), 5 deletions(-) diff --git a/hpg-bigdata-app/src/main/java/org/opencb/hpg/bigdata/app/cli/local/LocalCliOptionsParser.java b/hpg-bigdata-app/src/main/java/org/opencb/hpg/bigdata/app/cli/local/LocalCliOptionsParser.java index fe207e79..c679c362 100644 --- a/hpg-bigdata-app/src/main/java/org/opencb/hpg/bigdata/app/cli/local/LocalCliOptionsParser.java +++ b/hpg-bigdata-app/src/main/java/org/opencb/hpg/bigdata/app/cli/local/LocalCliOptionsParser.java @@ -86,6 +86,7 @@ public LocalCliOptionsParser() { variantSubCommands.addCommand("query", variantCommandOptions.queryVariantCommandOptions); variantSubCommands.addCommand("metadata", variantCommandOptions.metadataVariantCommandOptions); variantSubCommands.addCommand("rvtests", variantCommandOptions.rvtestsVariantCommandOptions); + variantSubCommands.addCommand("association", variantCommandOptions.associationVariantCommandOptions); toolCommandOptions = new ToolCommandOptions(commonCommandOptions, jcommander); jcommander.addCommand("tool", toolCommandOptions); diff --git a/hpg-bigdata-app/src/main/java/org/opencb/hpg/bigdata/app/cli/local/options/VariantCommandOptions.java b/hpg-bigdata-app/src/main/java/org/opencb/hpg/bigdata/app/cli/local/options/VariantCommandOptions.java index 1e779038..bb5a613d 100644 --- a/hpg-bigdata-app/src/main/java/org/opencb/hpg/bigdata/app/cli/local/options/VariantCommandOptions.java +++ b/hpg-bigdata-app/src/main/java/org/opencb/hpg/bigdata/app/cli/local/options/VariantCommandOptions.java @@ -21,6 +21,7 @@ public class VariantCommandOptions { public QueryVariantCommandOptions queryVariantCommandOptions; public MetadataVariantCommandOptions metadataVariantCommandOptions; public RvTestsVariantCommandOptions rvtestsVariantCommandOptions; + public AssociationVariantCommandOptions associationVariantCommandOptions; public LocalCliOptionsParser.CommonCommandOptions commonCommandOptions; public JCommander jCommander; @@ -36,6 +37,7 @@ public VariantCommandOptions(LocalCliOptionsParser.CommonCommandOptions commonCo this.queryVariantCommandOptions = new QueryVariantCommandOptions(); this.metadataVariantCommandOptions = new MetadataVariantCommandOptions(); this.rvtestsVariantCommandOptions = new RvTestsVariantCommandOptions(); + this.associationVariantCommandOptions = new AssociationVariantCommandOptions(); } @Parameters(commandNames = {"convert"}, commandDescription = "Convert gVCF/VCF files to different big data" @@ -128,14 +130,12 @@ public class AnnotateVariantCommandOptions { @ParametersDelegate public LocalCliOptionsParser.CommonCommandOptions commonOptions = commonCommandOptions; - @Parameter(names = {"-i", "--input"}, description = "0000 Input file name, usually a gVCF/VCF but it can be" + @Parameter(names = {"-i", "--input"}, description = "Input file name, usually a gVCF/VCF but it can be" + " an Avro file when converting to Parquet.", required = true, arity = 1) public String input; - @Parameter(names = {"-o", "--output"}, description = "Input file name, usually a gVCF/VCF but it can be an" - + " Avro file when converting to Parquet.", - required = true, arity = 1) + @Parameter(names = {"-o", "--output"}, description = "Output file name.", required = true, arity = 1) public String ouput; } @@ -327,7 +327,7 @@ public class MetadataVariantCommandOptions { public boolean summary = false; } - @Parameters(commandNames = {"rvtests"}, commandDescription = "Execute the 'rvtests' program.") + @Parameters(commandNames = {"rvtests"}, commandDescription = "Execute the 'rvtests' program") public class RvTestsVariantCommandOptions { @ParametersDelegate @@ -353,4 +353,29 @@ public class RvTestsVariantCommandOptions { required = true, arity = 1) public String confFilename; } + + @Parameters(commandNames = {"association"}, commandDescription = "Execute association tests such as chi-square," + + " linear and logistic regressions for additive, dominant or recessive genetic models") + public class AssociationVariantCommandOptions { + + @ParametersDelegate + public LocalCliOptionsParser.CommonCommandOptions commonOptions = commonCommandOptions; + + @Parameter(names = {"-i", "--input"}, description = "Input file name in Avro file format", required = true, + arity = 1) + public String input; + + @Parameter(names = {"-o", "--output"}, description = "Output file name to save results", required = true, + arity = 1) + public String output; + + @Parameter(names = {"--pheno"}, description = "Name of the phenotype trait to test", arity = 1) + public String pheno = "affection"; + + @Parameter(names = {"--logistic"}, description = "Logistic regression (for qualitative traits)") + public boolean logistic = false; + + @Parameter(names = {"--linear"}, description = "Linear regression (for quantitative traits)") + public boolean linear = false; + } }