Skip to content

Commit

Permalink
app: implement variant association test CLI, #126
Browse files Browse the repository at this point in the history
  • Loading branch information
jtarraga committed Jun 6, 2017
1 parent fb2ed5e commit 8a0505c
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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"
Expand Down Expand Up @@ -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;
}

Expand Down Expand Up @@ -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
Expand All @@ -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;
}
}

0 comments on commit 8a0505c

Please sign in to comment.