From 2797155a70a3fe7c79d456fc815ecd26493c5cf1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jacobo=20Coll=20Morag=C3=B3n?= Date: Tue, 10 Sep 2024 00:52:33 +0100 Subject: [PATCH] storage: Add VariantQueryParam "source" #TASK-6765 --- .../manager/VariantCatalogQueryUtils.java | 54 +-- .../options/ClinicalCommandOptions.java | 3 +- .../options/VariantCommandOptions.java | 45 ++- .../AnalysisClinicalCommandExecutor.java | 1 + .../AnalysisVariantCommandExecutor.java | 1 + .../AnalysisClinicalCommandOptions.java | 5 +- .../AnalysisVariantCommandOptions.java | 317 +++++++++-------- .../src/main/R/R/Clinical-methods.R | 5 +- opencga-client/src/main/R/R/Variant-methods.R | 9 +- .../rest/clients/ClinicalAnalysisClient.java | 8 +- .../client/rest/clients/VariantClient.java | 16 +- .../src/main/javascript/ClinicalAnalysis.js | 7 +- opencga-client/src/main/javascript/Variant.js | 15 +- .../rest_clients/clinical_analysis_client.py | 10 +- .../pyopencga/rest_clients/variant_client.py | 18 +- .../variant/AnnotationVariantQueryParams.java | 29 ++ .../variant/BasicVariantQueryParams.java | 4 + .../SampleVariantStatsAnalysisParams.java | 22 +- .../models/variant/VariantQueryParams.java | 275 ++++++++++++++ .../rest/analysis/ClinicalWebService.java | 121 +++---- .../rest/analysis/VariantWebService.java | 334 +++++++++--------- .../VariantOperationWebService.java | 9 +- .../options/StorageVariantCommandOptions.java | 104 +++--- .../core/variant/VariantStorageEngine.java | 2 +- .../core/variant/adaptors/VariantQuery.java | 15 + .../variant/adaptors/VariantQueryParam.java | 279 +-------------- .../variant/query/ParsedVariantQuery.java | 11 + .../variant/query/VariantQueryParser.java | 1 + .../variant/query/VariantQuerySource.java | 39 ++ .../core/variant/query/VariantQueryUtils.java | 3 +- .../query/executors/VariantQueryExecutor.java | 20 +- .../SampleIndexOnlyVariantQueryExecutor.java | 36 +- .../variant/index/sample/SampleIndexTest.java | 44 ++- 33 files changed, 1038 insertions(+), 824 deletions(-) create mode 100644 opencga-storage/opencga-storage-core/src/main/java/org/opencb/opencga/storage/core/variant/query/VariantQuerySource.java diff --git a/opencga-analysis/src/main/java/org/opencb/opencga/analysis/variant/manager/VariantCatalogQueryUtils.java b/opencga-analysis/src/main/java/org/opencb/opencga/analysis/variant/manager/VariantCatalogQueryUtils.java index b26a7f6beff..e73cb6e71c4 100644 --- a/opencga-analysis/src/main/java/org/opencb/opencga/analysis/variant/manager/VariantCatalogQueryUtils.java +++ b/opencga-analysis/src/main/java/org/opencb/opencga/analysis/variant/manager/VariantCatalogQueryUtils.java @@ -56,6 +56,7 @@ import org.opencb.opencga.core.models.sample.SamplePermissions; import org.opencb.opencga.core.models.study.Study; import org.opencb.opencga.core.models.user.UserFilter; +import org.opencb.opencga.core.models.variant.VariantQueryParams; import org.opencb.opencga.core.response.OpenCGAResult; import org.opencb.opencga.storage.core.exceptions.StorageEngineException; import org.opencb.opencga.storage.core.metadata.VariantStorageMetadataManager; @@ -89,70 +90,45 @@ */ public class VariantCatalogQueryUtils extends CatalogUtils { - public static final String SAMPLE_ANNOTATION_DESC = - "Selects some samples using metadata information from Catalog. e.g. age>20;phenotype=hpo:123,hpo:456;name=smith"; public static final QueryParam SAMPLE_ANNOTATION - = QueryParam.create("sampleAnnotation", SAMPLE_ANNOTATION_DESC, QueryParam.Type.TEXT_ARRAY); - public static final String PROJECT_DESC = ParamConstants.PROJECT_DESCRIPTION; - public static final QueryParam PROJECT = QueryParam.create(ParamConstants.PROJECT_PARAM, PROJECT_DESC, QueryParam.Type.TEXT_ARRAY); + = QueryParam.create("sampleAnnotation", VariantQueryParams.SAMPLE_ANNOTATION_DESC, QueryParam.Type.TEXT_ARRAY); + public static final QueryParam PROJECT = QueryParam.create(ParamConstants.PROJECT_PARAM, VariantQueryParams.PROJECT_DESC, QueryParam.Type.TEXT_ARRAY); - public static final String FAMILY_DESC = "Filter variants where any of the samples from the given family contains the variant " - + "(HET or HOM_ALT)"; public static final QueryParam FAMILY = - QueryParam.create("family", FAMILY_DESC, QueryParam.Type.TEXT); - public static final String FAMILY_MEMBERS_DESC = "Sub set of the members of a given family"; + QueryParam.create("family", VariantQueryParams.FAMILY_DESC, QueryParam.Type.TEXT); public static final QueryParam FAMILY_MEMBERS = - QueryParam.create("familyMembers", FAMILY_MEMBERS_DESC, QueryParam.Type.TEXT); - public static final String FAMILY_DISORDER_DESC = "Specify the disorder to use for the family segregation"; + QueryParam.create("familyMembers", VariantQueryParams.FAMILY_MEMBERS_DESC, QueryParam.Type.TEXT); public static final QueryParam FAMILY_DISORDER = - QueryParam.create("familyDisorder", FAMILY_DISORDER_DESC, QueryParam.Type.TEXT); - public static final String FAMILY_PROBAND_DESC = "Specify the proband child to use for the family segregation"; + QueryParam.create("familyDisorder", VariantQueryParams.FAMILY_DISORDER_DESC, QueryParam.Type.TEXT); public static final QueryParam FAMILY_PROBAND = - QueryParam.create("familyProband", FAMILY_PROBAND_DESC, QueryParam.Type.TEXT); - public static final String FAMILY_SEGREGATION_DESCR = "Filter by segregation mode from a given family. Accepted values: " - + "[ autosomalDominant, autosomalRecessive, XLinkedDominant, XLinkedRecessive, YLinked, mitochondrial, " - + "deNovo, deNovoStrict, mendelianError, compoundHeterozygous ]"; + QueryParam.create("familyProband", VariantQueryParams.FAMILY_PROBAND_DESC, QueryParam.Type.TEXT); public static final QueryParam FAMILY_SEGREGATION = - QueryParam.create("familySegregation", FAMILY_SEGREGATION_DESCR, QueryParam.Type.TEXT); + QueryParam.create("familySegregation", VariantQueryParams.FAMILY_SEGREGATION_DESCR, QueryParam.Type.TEXT); - public static final String SAVED_FILTER_DESCR = "Use a saved filter at User level"; public static final QueryParam SAVED_FILTER = - QueryParam.create("savedFilter", SAVED_FILTER_DESCR, QueryParam.Type.TEXT); + QueryParam.create("savedFilter", VariantQueryParams.SAVED_FILTER_DESCR, QueryParam.Type.TEXT); @Deprecated public static final QueryParam FAMILY_PHENOTYPE = FAMILY_DISORDER; @Deprecated public static final QueryParam MODE_OF_INHERITANCE = FAMILY_SEGREGATION; - public static final String PANEL_DESC = "Filter by genes from the given disease panel"; public static final QueryParam PANEL = - QueryParam.create("panel", PANEL_DESC, QueryParam.Type.TEXT); - public static final String PANEL_MOI_DESC = "Filter genes from specific panels that match certain mode of inheritance. " + - "Accepted values : " - + "[ autosomalDominant, autosomalRecessive, XLinkedDominant, XLinkedRecessive, YLinked, mitochondrial, " - + "deNovo, mendelianError, compoundHeterozygous ]"; + QueryParam.create("panel", VariantQueryParams.PANEL_DESC, QueryParam.Type.TEXT); public static final QueryParam PANEL_MODE_OF_INHERITANCE = - QueryParam.create("panelModeOfInheritance", PANEL_MOI_DESC + QueryParam.create("panelModeOfInheritance", VariantQueryParams.PANEL_MOI_DESC , QueryParam.Type.TEXT); - public static final String PANEL_CONFIDENCE_DESC = "Filter genes from specific panels that match certain confidence. " + - "Accepted values : [ high, medium, low, rejected ]"; public static final QueryParam PANEL_CONFIDENCE = - QueryParam.create("panelConfidence", PANEL_CONFIDENCE_DESC, QueryParam.Type.TEXT); + QueryParam.create("panelConfidence", VariantQueryParams.PANEL_CONFIDENCE_DESC, QueryParam.Type.TEXT); - public static final String PANEL_INTERSECTION_DESC = "Intersect panel genes and regions with given " - + "genes and regions from que input query. This will prevent returning variants from regions out of the panel."; public static final QueryParam PANEL_INTERSECTION = - QueryParam.create("panelIntersection", PANEL_INTERSECTION_DESC, Type.BOOLEAN); + QueryParam.create("panelIntersection", VariantQueryParams.PANEL_INTERSECTION_DESC, Type.BOOLEAN); - public static final String PANEL_ROLE_IN_CANCER_DESC = "Filter genes from specific panels that match certain role in cancer. " + - "Accepted values : [ both, oncogene, tumorSuppressorGene, fusion ]"; public static final QueryParam PANEL_ROLE_IN_CANCER = - QueryParam.create("panelRoleInCancer", PANEL_ROLE_IN_CANCER_DESC, QueryParam.Type.TEXT); + QueryParam.create("panelRoleInCancer", VariantQueryParams.PANEL_ROLE_IN_CANCER_DESC, QueryParam.Type.TEXT); - public static final String PANEL_FEATURE_TYPE_DESC = "Filter elements from specific panels by type. " + - "Accepted values : [ gene, region, str, variant ]"; public static final QueryParam PANEL_FEATURE_TYPE = - QueryParam.create("panelFeatureType", PANEL_FEATURE_TYPE_DESC, QueryParam.Type.TEXT); + QueryParam.create("panelFeatureType", VariantQueryParams.PANEL_FEATURE_TYPE_DESC, QueryParam.Type.TEXT); public static final List VARIANT_CATALOG_QUERY_PARAMS = Arrays.asList( SAMPLE_ANNOTATION, diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/cli/internal/options/ClinicalCommandOptions.java b/opencga-app/src/main/java/org/opencb/opencga/app/cli/internal/options/ClinicalCommandOptions.java index c2bac1cd1aa..d82974f2766 100644 --- a/opencga-app/src/main/java/org/opencb/opencga/app/cli/internal/options/ClinicalCommandOptions.java +++ b/opencga-app/src/main/java/org/opencb/opencga/app/cli/internal/options/ClinicalCommandOptions.java @@ -22,10 +22,9 @@ import java.util.List; import static org.opencb.opencga.analysis.clinical.InterpretationAnalysis.*; -import static org.opencb.opencga.analysis.variant.manager.VariantCatalogQueryUtils.*; import static org.opencb.opencga.core.api.FieldConstants.EXOMISER_CLINICAL_ANALYSIS_DESCRIPTION; import static org.opencb.opencga.core.api.FieldConstants.EXOMISER_VERSION_DESCRIPTION; -import static org.opencb.opencga.storage.core.variant.adaptors.VariantQueryParam.*; +import static org.opencb.opencga.core.models.variant.VariantQueryParams.*; @Parameters(commandNames = {"clinical"}, commandDescription = "Clinical analysis commands") public class ClinicalCommandOptions { diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/cli/internal/options/VariantCommandOptions.java b/opencga-app/src/main/java/org/opencb/opencga/app/cli/internal/options/VariantCommandOptions.java index 46ef28a52f6..173a56940ef 100644 --- a/opencga-app/src/main/java/org/opencb/opencga/app/cli/internal/options/VariantCommandOptions.java +++ b/opencga-app/src/main/java/org/opencb/opencga/app/cli/internal/options/VariantCommandOptions.java @@ -52,7 +52,6 @@ import org.opencb.opencga.core.models.variant.AnnotationVariantQueryParams; import org.opencb.opencga.core.models.variant.SampleVariantFilterParams; import org.opencb.opencga.core.tools.variant.IndividualQcAnalysisExecutor; -import org.opencb.opencga.storage.core.variant.adaptors.VariantQueryParam; import org.opencb.opencga.storage.core.variant.query.VariantQueryUtils; import org.opencb.oskar.analysis.variant.gwas.GwasConfiguration; @@ -60,7 +59,6 @@ import java.util.List; import java.util.Map; -import static org.opencb.opencga.analysis.variant.manager.VariantCatalogQueryUtils.*; import static org.opencb.opencga.app.cli.internal.options.VariantCommandOptions.CohortVariantStatsCommandOptions.COHORT_VARIANT_STATS_RUN_COMMAND; import static org.opencb.opencga.app.cli.internal.options.VariantCommandOptions.FamilyIndexCommandOptions.FAMILY_INDEX_COMMAND; import static org.opencb.opencga.app.cli.internal.options.VariantCommandOptions.FamilyIndexCommandOptions.FAMILY_INDEX_COMMAND_DESCRIPTION; @@ -73,6 +71,7 @@ import static org.opencb.opencga.core.api.FieldConstants.EXOMISER_SAMPLE_DESCRIPTION; import static org.opencb.opencga.core.api.FieldConstants.EXOMISER_VERSION_DESCRIPTION; import static org.opencb.opencga.core.api.ParamConstants.*; +import static org.opencb.opencga.core.models.variant.VariantQueryParams.*; import static org.opencb.opencga.storage.app.cli.client.options.StorageVariantCommandOptions.AggregateCommandOptions.AGGREGATE_COMMAND; import static org.opencb.opencga.storage.app.cli.client.options.StorageVariantCommandOptions.AggregateCommandOptions.AGGREGATE_COMMAND_DESCRIPTION; import static org.opencb.opencga.storage.app.cli.client.options.StorageVariantCommandOptions.AggregateFamilyCommandOptions.AGGREGATE_FAMILY_COMMAND; @@ -88,8 +87,6 @@ import static org.opencb.opencga.storage.app.cli.client.options.StorageVariantCommandOptions.GenericAnnotationSaveCommandOptions.ANNOTATION_SAVE_COMMAND_DESCRIPTION; import static org.opencb.opencga.storage.app.cli.client.options.StorageVariantCommandOptions.VariantDeleteCommandOptions.VARIANT_DELETE_COMMAND; import static org.opencb.opencga.storage.app.cli.client.options.StorageVariantCommandOptions.VariantDeleteCommandOptions.VARIANT_DELETE_COMMAND_DESCRIPTION; -import static org.opencb.opencga.storage.core.variant.adaptors.VariantQueryParam.ANNOT_CLINICAL_DESCR; -import static org.opencb.opencga.storage.core.variant.adaptors.VariantQueryParam.ANNOT_CLINICAL_SIGNIFICANCE_DESCR; /** * Created by pfurio on 23/11/16. @@ -268,7 +265,7 @@ public class VariantSecondaryIndexCommandOptions extends GeneralCliOptions.Study @Parameter(names = {"-p", "--project"}, description = "Project to index.", arity = 1) public String project; - @Parameter(names = {"-r", "--region"}, description = VariantQueryParam.REGION_DESCR) + @Parameter(names = {"-r", "--region"}, description = REGION_DESCR) public String region; @Parameter(names = {"--sample"}, description = "Samples to index." @@ -878,25 +875,25 @@ public SampleVariantFilterParams setMaxVariants(int maxVariants) { return super.setMaxVariants(maxVariants); } - @Parameter(names = {"--id"}, description = VariantQueryParam.ID_DESCR) + @Parameter(names = {"--id"}, description = ID_DESCR) @Override public AnnotationVariantQueryParams setId(String id) { return super.setId(id); } - @Parameter(names = {"--region"}, description = VariantQueryParam.REGION_DESCR) + @Parameter(names = {"--region"}, description = REGION_DESCR) @Override public AnnotationVariantQueryParams setRegion(String region) { return super.setRegion(region); } - @Parameter(names = {"--gene"}, description = VariantQueryParam.GENE_DESCR) + @Parameter(names = {"--gene"}, description = GENE_DESCR) @Override public AnnotationVariantQueryParams setGene(String gene) { return super.setGene(gene); } - @Parameter(names = {"--type"}, description = VariantQueryParam.TYPE_DESCR) + @Parameter(names = {"--type"}, description = TYPE_DESCR) @Override public AnnotationVariantQueryParams setType(String type) { return super.setType(type); @@ -926,79 +923,79 @@ public AnnotationVariantQueryParams setPanelRoleInCancer(String panelRoleInCance return super.setPanelRoleInCancer(panelRoleInCancer); } - @Parameter(names = {"--cohort-stats-ref"}, description = VariantQueryParam.STATS_REF_DESCR) + @Parameter(names = {"--cohort-stats-ref"}, description = STATS_REF_DESCR) @Override public AnnotationVariantQueryParams setCohortStatsRef(String cohortStatsRef) { return super.setCohortStatsRef(cohortStatsRef); } - @Parameter(names = {"--cohort-stats-alt"}, description = VariantQueryParam.STATS_ALT_DESCR) + @Parameter(names = {"--cohort-stats-alt"}, description = STATS_ALT_DESCR) @Override public AnnotationVariantQueryParams setCohortStatsAlt(String cohortStatsAlt) { return super.setCohortStatsAlt(cohortStatsAlt); } - @Parameter(names = {"--cohort-stats-maf"}, description = VariantQueryParam.STATS_MAF_DESCR) + @Parameter(names = {"--cohort-stats-maf"}, description = STATS_MAF_DESCR) @Override public AnnotationVariantQueryParams setCohortStatsMaf(String cohortStatsMaf) { return super.setCohortStatsMaf(cohortStatsMaf); } - @Parameter(names = {"--ct", "--consequence-type"}, description = VariantQueryParam.ANNOT_CONSEQUENCE_TYPE_DESCR) + @Parameter(names = {"--ct", "--consequence-type"}, description = ANNOT_CONSEQUENCE_TYPE_DESCR) @Override public AnnotationVariantQueryParams setCt(String ct) { return super.setCt(ct); } - @Parameter(names = {"--xref"}, description = VariantQueryParam.ANNOT_XREF_DESCR) + @Parameter(names = {"--xref"}, description = ANNOT_XREF_DESCR) @Override public AnnotationVariantQueryParams setXref(String xref) { return super.setXref(xref); } - @Parameter(names = {"--biotype"}, description = VariantQueryParam.ANNOT_BIOTYPE_DESCR) + @Parameter(names = {"--biotype"}, description = ANNOT_BIOTYPE_DESCR) @Override public AnnotationVariantQueryParams setBiotype(String biotype) { return super.setBiotype(biotype); } - @Parameter(names = {"--protein-substitution"}, description = VariantQueryParam.ANNOT_PROTEIN_SUBSTITUTION_DESCR) + @Parameter(names = {"--protein-substitution"}, description = ANNOT_PROTEIN_SUBSTITUTION_DESCR) @Override public AnnotationVariantQueryParams setProteinSubstitution(String proteinSubstitution) { return super.setProteinSubstitution(proteinSubstitution); } - @Parameter(names = {"--conservation"}, description = VariantQueryParam.ANNOT_CONSERVATION_DESCR) + @Parameter(names = {"--conservation"}, description = ANNOT_CONSERVATION_DESCR) @Override public AnnotationVariantQueryParams setConservation(String conservation) { return super.setConservation(conservation); } - @Parameter(names = {"--population-frequency-maf"}, description = VariantQueryParam.ANNOT_POPULATION_MINOR_ALLELE_FREQUENCY_DESCR) + @Parameter(names = {"--population-frequency-maf"}, description = ANNOT_POPULATION_MINOR_ALLELE_FREQUENCY_DESCR) @Override public AnnotationVariantQueryParams setPopulationFrequencyMaf(String populationFrequencyMaf) { return super.setPopulationFrequencyMaf(populationFrequencyMaf); } - @Parameter(names = {"--population-frequency-alt"}, description = VariantQueryParam.ANNOT_POPULATION_ALTERNATE_FREQUENCY_DESCR) + @Parameter(names = {"--population-frequency-alt"}, description = ANNOT_POPULATION_ALTERNATE_FREQUENCY_DESCR) @Override public AnnotationVariantQueryParams setPopulationFrequencyAlt(String populationFrequencyAlt) { return super.setPopulationFrequencyAlt(populationFrequencyAlt); } - @Parameter(names = {"--population-frequency-ref"}, description = VariantQueryParam.ANNOT_POPULATION_REFERENCE_FREQUENCY_DESCR) + @Parameter(names = {"--population-frequency-ref"}, description = ANNOT_POPULATION_REFERENCE_FREQUENCY_DESCR) @Override public AnnotationVariantQueryParams setPopulationFrequencyRef(String populationFrequencyRef) { return super.setPopulationFrequencyRef(populationFrequencyRef); } - @Parameter(names = {"--transcript-flag"}, description = VariantQueryParam.ANNOT_TRANSCRIPT_FLAG_DESCR) + @Parameter(names = {"--transcript-flag"}, description = ANNOT_TRANSCRIPT_FLAG_DESCR) @Override public AnnotationVariantQueryParams setTranscriptFlag(String transcriptFlag) { return super.setTranscriptFlag(transcriptFlag); } - @Parameter(names = {"--functional-score"}, description = VariantQueryParam.ANNOT_FUNCTIONAL_SCORE_DESCR) + @Parameter(names = {"--functional-score"}, description = ANNOT_FUNCTIONAL_SCORE_DESCR) @Override public AnnotationVariantQueryParams setFunctionalScore(String functionalScore) { return super.setFunctionalScore(functionalScore); @@ -1268,10 +1265,10 @@ public class KnockoutCommandOptions { + "By default filters by loss of function + missense_variant consequence types.") public String consequenceType; - @Parameter(names = {"--filter"}, description = VariantQueryParam.FILTER_DESCR) + @Parameter(names = {"--filter"}, description = FILTER_DESCR) public String filter; - @Parameter(names = {"--qual"}, description = VariantQueryParam.QUAL_DESCR) + @Parameter(names = {"--qual"}, description = QUAL_DESCR) public String qual; @Parameter(names = {"--skip-genes-file"}, description = "Do not generate the results file by gene") diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/cli/main/executors/AnalysisClinicalCommandExecutor.java b/opencga-app/src/main/java/org/opencb/opencga/app/cli/main/executors/AnalysisClinicalCommandExecutor.java index 07dbf9230f9..45bb96358d3 100644 --- a/opencga-app/src/main/java/org/opencb/opencga/app/cli/main/executors/AnalysisClinicalCommandExecutor.java +++ b/opencga-app/src/main/java/org/opencb/opencga/app/cli/main/executors/AnalysisClinicalCommandExecutor.java @@ -1227,6 +1227,7 @@ private RestResponse queryVariant() throws Exception { queryParams.putIfNotEmpty("panelRoleInCancer", commandOptions.panelRoleInCancer); queryParams.putIfNotEmpty("panelFeatureType", commandOptions.panelFeatureType); queryParams.putIfNotNull("panelIntersection", commandOptions.panelIntersection); + queryParams.putIfNotEmpty("source", commandOptions.source); queryParams.putIfNotEmpty("trait", commandOptions.trait); if (queryParams.get("study") == null && OpencgaMain.isShellMode()) { queryParams.putIfNotEmpty("study", sessionManager.getSession().getCurrentStudy()); diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/cli/main/executors/AnalysisVariantCommandExecutor.java b/opencga-app/src/main/java/org/opencb/opencga/app/cli/main/executors/AnalysisVariantCommandExecutor.java index 57edea737fa..304e8832f13 100644 --- a/opencga-app/src/main/java/org/opencb/opencga/app/cli/main/executors/AnalysisVariantCommandExecutor.java +++ b/opencga-app/src/main/java/org/opencb/opencga/app/cli/main/executors/AnalysisVariantCommandExecutor.java @@ -1344,6 +1344,7 @@ private RestResponse query() throws Exception { queryParams.putIfNotEmpty("panelRoleInCancer", commandOptions.panelRoleInCancer); queryParams.putIfNotEmpty("panelFeatureType", commandOptions.panelFeatureType); queryParams.putIfNotNull("panelIntersection", commandOptions.panelIntersection); + queryParams.putIfNotEmpty("source", commandOptions.source); queryParams.putIfNotEmpty("trait", commandOptions.trait); if (queryParams.get("study") == null && OpencgaMain.isShellMode()) { queryParams.putIfNotEmpty("study", sessionManager.getSession().getCurrentStudy()); diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/cli/main/options/AnalysisClinicalCommandOptions.java b/opencga-app/src/main/java/org/opencb/opencga/app/cli/main/options/AnalysisClinicalCommandOptions.java index b9dc5e1956a..f95a083d3bd 100644 --- a/opencga-app/src/main/java/org/opencb/opencga/app/cli/main/options/AnalysisClinicalCommandOptions.java +++ b/opencga-app/src/main/java/org/opencb/opencga/app/cli/main/options/AnalysisClinicalCommandOptions.java @@ -1826,7 +1826,7 @@ public class QueryVariantCommandOptions { @Parameter(names = {"--file-data"}, description = "Filter by file data (i.e. FILTER, QUAL and INFO columns from VCF file). [{file}:]{key}{op}{value}[,;]* . If no file is specified, will use all files from 'file' filter. e.g. AN>200 or file_1.vcf:AN>200;file_2.vcf:AN<10 . Many fields can be combined. e.g. file_1.vcf:AN>200;DB=true;file_2.vcf:AN<10,FILTER=PASS,LowDP", required = false, arity = 1) public String fileData; - @Parameter(names = {"--sample"}, description = "Filter variants by sample genotype. This will automatically set 'includeSample' parameter when not provided. This filter accepts multiple 3 forms: 1) List of samples: Samples that contain the main variant. Accepts AND (;) and OR (,) operators. e.g. HG0097,HG0098 . 2) List of samples with genotypes: {sample}:{gt1},{gt2}. Accepts AND (;) and OR (,) operators. e.g. HG0097:0/0;HG0098:0/1,1/1 . Unphased genotypes (e.g. 0/1, 1/1) will also include phased genotypes (e.g. 0|1, 1|0, 1|1), but not vice versa. When filtering by multi-allelic genotypes, any secondary allele will match, regardless of its position e.g. 1/2 will match with genotypes 1/2, 1/3, 1/4, .... Genotype aliases accepted: HOM_REF, HOM_ALT, HET, HET_REF, HET_ALT, HET_MISS and MISS e.g. HG0097:HOM_REF;HG0098:HET_REF,HOM_ALT . 3) Sample with segregation mode: {sample}:{segregation}. Only one sample accepted.Accepted segregation modes: [ autosomalDominant, autosomalRecessive, XLinkedDominant, XLinkedRecessive, YLinked, mitochondrial, deNovo, deNovoStrict, mendelianError, compoundHeterozygous ]. Value is case insensitive. e.g. HG0097:DeNovo Sample must have parents defined and indexed. ", required = false, arity = 1) + @Parameter(names = {"--sample"}, description = "Filter variants by sample genotype. This will automatically set 'includeSample' parameter when not provided. This filter accepts multiple 3 forms: 1) List of samples: Samples that contain the main variant. Accepts AND ';' and OR ',' operators. e.g. HG0097,HG0098 . 2) List of samples with genotypes: {sample}:{gt1},{gt2}. Accepts AND ';' and OR ',' operators. e.g. HG0097:0/0;HG0098:0/1,1/1 . Unphased genotypes (e.g. 0/1, 1/1) will also include phased genotypes (e.g. 0|1, 1|0, 1|1), but not vice versa. When filtering by multi-allelic genotypes, any secondary allele will match, regardless of its position e.g. 1/2 will match with genotypes 1/2, 1/3, 1/4, .... Genotype aliases accepted: HOM_REF, HOM_ALT, HET, HET_REF, HET_ALT, HET_MISS and MISS e.g. HG0097:HOM_REF;HG0098:HET_REF,HOM_ALT . 3) Sample with segregation mode: {sample}:{segregation}. Only one sample accepted.Accepted segregation modes: [ autosomalDominant, autosomalRecessive, XLinkedDominant, XLinkedRecessive, YLinked, mitochondrial, deNovo, deNovoStrict, mendelianError, compoundHeterozygous ]. Value is case insensitive. e.g. HG0097:DeNovo Sample must have parents defined and indexed. ", required = false, arity = 1) public String sample; @Parameter(names = {"--sample-data"}, description = "Filter by any SampleData field from samples. [{sample}:]{key}{op}{value}[,;]* . If no sample is specified, will use all samples from 'sample' or 'genotype' filter. e.g. DP>200 or HG0097:DP>200,HG0098:DP<10 . Many FORMAT fields can be combined. e.g. HG0097:DP>200;GT=1/1,0/1,HG0098:DP<10", required = false, arity = 1) @@ -1955,6 +1955,9 @@ public class QueryVariantCommandOptions { @Parameter(names = {"--panel-intersection"}, description = "Intersect panel genes and regions with given genes and regions from que input query. This will prevent returning variants from regions out of the panel.", required = false, help = true, arity = 0) public boolean panelIntersection = false; + @Parameter(names = {"--source"}, description = "Select the variant data source from where to fetch the data. Accepted values are 'variant_index' (default), 'secondary_annotation_index' and 'secondary_sample_index'. When selecting a secondary_index, the data will be retrieved exclusively from that secondary index, and the 'include/exclude' parameters will be ignored. Some data might be missing or be partial.", required = false, arity = 1) + public String source; + @Parameter(names = {"--trait"}, description = "List of traits, based on ClinVar, HPO, COSMIC, i.e.: IDs, histologies, descriptions,...", required = false, arity = 1) public String trait; diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/cli/main/options/AnalysisVariantCommandOptions.java b/opencga-app/src/main/java/org/opencb/opencga/app/cli/main/options/AnalysisVariantCommandOptions.java index 44a0ad64dd7..2e9b02d2453 100644 --- a/opencga-app/src/main/java/org/opencb/opencga/app/cli/main/options/AnalysisVariantCommandOptions.java +++ b/opencga-app/src/main/java/org/opencb/opencga/app/cli/main/options/AnalysisVariantCommandOptions.java @@ -487,238 +487,238 @@ public class RunExportCommandOptions { @Parameter(names = {"--job-dry-run"}, description = "Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run.", required = false, arity = 1) public Boolean jobDryRun; - @Parameter(names = {"--id"}, description = "The body web service id parameter", required = false, arity = 1) + @Parameter(names = {"--id"}, description = "List of variant IDs in the format chrom:start:ref:alt, e.g. 19:7177679:C:T", required = false, arity = 1) public String id; - @Parameter(names = {"--region"}, description = "The body web service region parameter", required = false, arity = 1) + @Parameter(names = {"--region"}, description = "Reference allele", required = false, arity = 1) public String region; - @Parameter(names = {"--gene"}, description = "The body web service gene parameter", required = false, arity = 1) + @Parameter(names = {"--gene"}, description = "List of genes, most gene IDs are accepted (HGNC, Ensembl gene, ...). This is an alias to 'xref' parameter", required = false, arity = 1) public String gene; - @Parameter(names = {"--type"}, description = "The body web service type parameter", required = false, arity = 1) + @Parameter(names = {"--type"}, description = "List of types, accepted values are SNV, MNV, INDEL, SV, COPY_NUMBER, COPY_NUMBER_LOSS, COPY_NUMBER_GAIN, INSERTION, DELETION, DUPLICATION, TANDEM_DUPLICATION, BREAKEND, e.g. SNV,INDEL", required = false, arity = 1) public String type; - @Parameter(names = {"--panel"}, description = "The body web service panel parameter", required = false, arity = 1) + @Parameter(names = {"--panel"}, description = "Filter by genes from the given disease panel", required = false, arity = 1) public String panel; - @Parameter(names = {"--panel-mode-of-inheritance"}, description = "The body web service panelModeOfInheritance parameter", required = false, arity = 1) + @Parameter(names = {"--panel-mode-of-inheritance"}, description = "Filter genes from specific panels that match certain mode of inheritance. Accepted values : [ autosomalDominant, autosomalRecessive, XLinkedDominant, XLinkedRecessive, YLinked, mitochondrial, deNovo, mendelianError, compoundHeterozygous ]", required = false, arity = 1) public String panelModeOfInheritance; - @Parameter(names = {"--panel-confidence"}, description = "The body web service panelConfidence parameter", required = false, arity = 1) + @Parameter(names = {"--panel-confidence"}, description = "Filter genes from specific panels that match certain confidence. Accepted values : [ high, medium, low, rejected ]", required = false, arity = 1) public String panelConfidence; - @Parameter(names = {"--panel-role-in-cancer"}, description = "The body web service panelRoleInCancer parameter", required = false, arity = 1) + @Parameter(names = {"--panel-role-in-cancer"}, description = "Filter genes from specific panels that match certain role in cancer. Accepted values : [ both, oncogene, tumorSuppressorGene, fusion ]", required = false, arity = 1) public String panelRoleInCancer; - @Parameter(names = {"--panel-intersection"}, description = "The body web service panelIntersection parameter", required = false, help = true, arity = 0) + @Parameter(names = {"--panel-intersection"}, description = "Intersect panel genes and regions with given genes and regions from que input query. This will prevent returning variants from regions out of the panel.", required = false, help = true, arity = 0) public boolean panelIntersection = false; - @Parameter(names = {"--panel-feature-type"}, description = "The body web service panelFeatureType parameter", required = false, arity = 1) + @Parameter(names = {"--panel-feature-type"}, description = "Filter elements from specific panels by type. Accepted values : [ gene, region, str, variant ]", required = false, arity = 1) public String panelFeatureType; - @Parameter(names = {"--cohort-stats-ref"}, description = "The body web service cohortStatsRef parameter", required = false, arity = 1) + @Parameter(names = {"--cohort-stats-ref"}, description = "Reference Allele Frequency: [{study:}]{cohort}[<|>|<=|>=]{number}. e.g. ALL<=0.4", required = false, arity = 1) public String cohortStatsRef; - @Parameter(names = {"--cohort-stats-alt"}, description = "The body web service cohortStatsAlt parameter", required = false, arity = 1) + @Parameter(names = {"--cohort-stats-alt"}, description = "Alternate Allele Frequency: [{study:}]{cohort}[<|>|<=|>=]{number}. e.g. ALL<=0.4", required = false, arity = 1) public String cohortStatsAlt; - @Parameter(names = {"--cohort-stats-maf"}, description = "The body web service cohortStatsMaf parameter", required = false, arity = 1) + @Parameter(names = {"--cohort-stats-maf"}, description = "Minor Allele Frequency: [{study:}]{cohort}[<|>|<=|>=]{number}. e.g. ALL<=0.4", required = false, arity = 1) public String cohortStatsMaf; - @Parameter(names = {"--ct"}, description = "The body web service ct parameter", required = false, arity = 1) + @Parameter(names = {"--ct"}, description = "List of SO consequence types, e.g. missense_variant,stop_lost or SO:0001583,SO:0001578. Accepts aliases 'loss_of_function' and 'protein_altering'", required = false, arity = 1) public String ct; - @Parameter(names = {"--xref"}, description = "The body web service xref parameter", required = false, arity = 1) + @Parameter(names = {"--xref"}, description = "List of any external reference, these can be genes, proteins or variants. Accepted IDs include HGNC, Ensembl genes, dbSNP, ClinVar, HPO, Cosmic, HGVS ...", required = false, arity = 1) public String xref; - @Parameter(names = {"--biotype"}, description = "The body web service biotype parameter", required = false, arity = 1) + @Parameter(names = {"--biotype"}, description = "List of biotypes, e.g. protein_coding", required = false, arity = 1) public String biotype; - @Parameter(names = {"--protein-substitution"}, description = "The body web service proteinSubstitution parameter", required = false, arity = 1) + @Parameter(names = {"--protein-substitution"}, description = "Protein substitution scores include SIFT and PolyPhen. You can query using the score {protein_score}[<|>|<=|>=]{number} or the description {protein_score}[~=|=]{description} e.g. polyphen>0.1,sift=tolerant", required = false, arity = 1) public String proteinSubstitution; - @Parameter(names = {"--conservation"}, description = "The body web service conservation parameter", required = false, arity = 1) + @Parameter(names = {"--conservation"}, description = "Filter by conservation score: {conservation_score}[<|>|<=|>=]{number} e.g. phastCons>0.5,phylop<0.1,gerp>0.1", required = false, arity = 1) public String conservation; - @Parameter(names = {"--population-frequency-maf"}, description = "The body web service populationFrequencyMaf parameter", required = false, arity = 1) + @Parameter(names = {"--population-frequency-maf"}, description = "Population minor allele frequency: {study}:{population}[<|>|<=|>=]{number}. e.g. 1000G:ALL<0.01", required = false, arity = 1) public String populationFrequencyMaf; - @Parameter(names = {"--population-frequency-alt"}, description = "The body web service populationFrequencyAlt parameter", required = false, arity = 1) + @Parameter(names = {"--population-frequency-alt"}, description = "Alternate Population Frequency: {study}:{population}[<|>|<=|>=]{number}. e.g. 1000G:ALL<0.01", required = false, arity = 1) public String populationFrequencyAlt; - @Parameter(names = {"--population-frequency-ref"}, description = "The body web service populationFrequencyRef parameter", required = false, arity = 1) + @Parameter(names = {"--population-frequency-ref"}, description = "Reference Population Frequency: {study}:{population}[<|>|<=|>=]{number}. e.g. 1000G:ALL<0.01", required = false, arity = 1) public String populationFrequencyRef; - @Parameter(names = {"--transcript-flag"}, description = "The body web service transcriptFlag parameter", required = false, arity = 1) + @Parameter(names = {"--transcript-flag"}, description = "List of transcript flags. e.g. canonical, CCDS, basic, LRG, MANE Select, MANE Plus Clinical, EGLH_HaemOnc, TSO500", required = false, arity = 1) public String transcriptFlag; - @Parameter(names = {"--functional-score"}, description = "The body web service functionalScore parameter", required = false, arity = 1) + @Parameter(names = {"--functional-score"}, description = "Functional score: {functional_score}[<|>|<=|>=]{number} e.g. cadd_scaled>5.2 , cadd_raw<=0.3", required = false, arity = 1) public String functionalScore; - @Parameter(names = {"--clinical"}, description = "The body web service clinical parameter", required = false, arity = 1) + @Parameter(names = {"--clinical"}, description = "Clinical source: clinvar, cosmic", required = false, arity = 1) public String clinical; - @Parameter(names = {"--clinical-significance"}, description = "The body web service clinicalSignificance parameter", required = false, arity = 1) + @Parameter(names = {"--clinical-significance"}, description = "Clinical significance: benign, likely_benign, likely_pathogenic, pathogenic", required = false, arity = 1) public String clinicalSignificance; - @Parameter(names = {"--clinical-confirmed-status"}, description = "The body web service clinicalConfirmedStatus parameter", required = false, help = true, arity = 0) + @Parameter(names = {"--clinical-confirmed-status"}, description = "Clinical confirmed status", required = false, help = true, arity = 0) public boolean clinicalConfirmedStatus = false; - @Parameter(names = {"--body_project"}, description = "The body web service project parameter", required = false, arity = 1) + @Parameter(names = {"--body_project"}, description = "Project [organization@]project where project can be either the ID or the alias", required = false, arity = 1) public String bodyProject; - @Parameter(names = {"--body_study"}, description = "The body web service study parameter", required = false, arity = 1) + @Parameter(names = {"--body_study"}, description = "Filter variants from the given studies, these can be either the numeric ID or the alias with the format organization@project:study", required = false, arity = 1) public String bodyStudy; - @Parameter(names = {"--saved-filter"}, description = "The body web service savedFilter parameter", required = false, arity = 1) + @Parameter(names = {"--saved-filter"}, description = "Use a saved filter at User level", required = false, arity = 1) public String savedFilter; - @Parameter(names = {"--chromosome"}, description = "The body web service chromosome parameter", required = false, arity = 1) + @Parameter(names = {"--chromosome"}, description = "List of chromosomes, this is an alias of 'region' parameter with just the chromosome names", required = false, arity = 1) public String chromosome; - @Parameter(names = {"--reference"}, description = "The body web service reference parameter", required = false, arity = 1) + @Parameter(names = {"--reference"}, description = "Reference allele", required = false, arity = 1) public String reference; - @Parameter(names = {"--alternate"}, description = "The body web service alternate parameter", required = false, arity = 1) + @Parameter(names = {"--alternate"}, description = "Main alternate allele", required = false, arity = 1) public String alternate; @Parameter(names = {"--release"}, description = "The body web service release parameter", required = false, arity = 1) public String release; - @Parameter(names = {"--include-study"}, description = "The body web service includeStudy parameter", required = false, arity = 1) + @Parameter(names = {"--include-study"}, description = "List of studies to include in the result. Accepts 'all' and 'none'.", required = false, arity = 1) public String includeStudy; - @Parameter(names = {"--include-sample"}, description = "The body web service includeSample parameter", required = false, arity = 1) + @Parameter(names = {"--include-sample"}, description = "List of samples to be included in the result. Accepts 'all' and 'none'. If undefined, automatically includes samples used for filtering. If none, no sample is included.", required = false, arity = 1) public String includeSample; - @Parameter(names = {"--include-file"}, description = "The body web service includeFile parameter", required = false, arity = 1) + @Parameter(names = {"--include-file"}, description = "List of files to be returned. Accepts 'all' and 'none'. If undefined, automatically includes files used for filtering. If none, no file is included.", required = false, arity = 1) public String includeFile; - @Parameter(names = {"--include-sample-data"}, description = "The body web service includeSampleData parameter", required = false, arity = 1) + @Parameter(names = {"--include-sample-data"}, description = "List of Sample Data keys (i.e. FORMAT column from VCF file) from Sample Data to include in the output. e.g: DP,AD. Accepts 'all' and 'none'.", required = false, arity = 1) public String includeSampleData; - @Parameter(names = {"--include-sample-id"}, description = "The body web service includeSampleId parameter", required = false, help = true, arity = 0) + @Parameter(names = {"--include-sample-id"}, description = "Include sampleId on each result", required = false, help = true, arity = 0) public boolean includeSampleId = false; - @Parameter(names = {"--include-genotype"}, description = "The body web service includeGenotype parameter", required = false, help = true, arity = 0) + @Parameter(names = {"--include-genotype"}, description = "Include genotypes, apart of other formats defined with includeFormat", required = false, help = true, arity = 0) public boolean includeGenotype = false; - @Parameter(names = {"--file"}, description = "The body web service file parameter", required = false, arity = 1) + @Parameter(names = {"--file"}, description = "Filter variants from the files specified. This will set includeFile parameter when not provided", required = false, arity = 1) public String file; - @Parameter(names = {"--qual"}, description = "The body web service qual parameter", required = false, arity = 1) + @Parameter(names = {"--qual"}, description = "Specify the QUAL for any of the files. If 'file' filter is provided, will match the file and the qual. e.g.: >123.4", required = false, arity = 1) public String qual; - @Parameter(names = {"--filter"}, description = "The body web service filter parameter", required = false, arity = 1) + @Parameter(names = {"--filter"}, description = "Specify the FILTER for any of the files. If 'file' filter is provided, will match the file and the filter. e.g.: PASS,LowGQX", required = false, arity = 1) public String filter; - @Parameter(names = {"--file-data"}, description = "The body web service fileData parameter", required = false, arity = 1) + @Parameter(names = {"--file-data"}, description = "Filter by file data (i.e. FILTER, QUAL and INFO columns from VCF file). [{file}:]{key}{op}{value}[,;]* . If no file is specified, will use all files from 'file' filter. e.g. AN>200 or file_1.vcf:AN>200;file_2.vcf:AN<10 . Many fields can be combined. e.g. file_1.vcf:AN>200;DB=true;file_2.vcf:AN<10,FILTER=PASS,LowDP", required = false, arity = 1) public String fileData; - @Parameter(names = {"--genotype"}, description = "The body web service genotype parameter", required = false, arity = 1) + @Parameter(names = {"--genotype"}, description = "Samples with a specific genotype: {samp_1}:{gt_1}(,{gt_n})*(;{samp_n}:{gt_1}(,{gt_n})*)* e.g. HG0097:0/0;HG0098:0/1,1/1. Unphased genotypes (e.g. 0/1, 1/1) will also include phased genotypes (e.g. 0|1, 1|0, 1|1), but not vice versa. When filtering by multi-allelic genotypes, any secondary allele will match, regardless of its position e.g. 1/2 will match with genotypes 1/2, 1/3, 1/4, .... Genotype aliases accepted: HOM_REF, HOM_ALT, HET, HET_REF, HET_ALT, HET_MISS and MISS e.g. HG0097:HOM_REF;HG0098:HET_REF,HOM_ALT. This will automatically set 'includeSample' parameter when not provided", required = false, arity = 1) public String genotype; - @Parameter(names = {"--sample"}, description = "The body web service sample parameter", required = false, arity = 1) + @Parameter(names = {"--sample"}, description = "Filter variants by sample genotype. This will automatically set 'includeSample' parameter when not provided. This filter accepts multiple 3 forms: 1) List of samples: Samples that contain the main variant. Accepts AND ';' and OR ',' operators. e.g. HG0097,HG0098 . 2) List of samples with genotypes: {sample}:{gt1},{gt2}. Accepts AND ';' and OR ',' operators. e.g. HG0097:0/0;HG0098:0/1,1/1 . Unphased genotypes (e.g. 0/1, 1/1) will also include phased genotypes (e.g. 0|1, 1|0, 1|1), but not vice versa. When filtering by multi-allelic genotypes, any secondary allele will match, regardless of its position e.g. 1/2 will match with genotypes 1/2, 1/3, 1/4, .... Genotype aliases accepted: HOM_REF, HOM_ALT, HET, HET_REF, HET_ALT, HET_MISS and MISS e.g. HG0097:HOM_REF;HG0098:HET_REF,HOM_ALT . 3) Sample with segregation mode: {sample}:{segregation}. Only one sample accepted.Accepted segregation modes: [ autosomalDominant, autosomalRecessive, XLinkedDominant, XLinkedRecessive, YLinked, mitochondrial, deNovo, deNovoStrict, mendelianError, compoundHeterozygous ]. Value is case insensitive. e.g. HG0097:DeNovo Sample must have parents defined and indexed. ", required = false, arity = 1) public String sample; - @Parameter(names = {"--sample-limit"}, description = "The body web service sampleLimit parameter", required = false, arity = 1) + @Parameter(names = {"--sample-limit"}, description = "Limit the number of samples to be included in the result", required = false, arity = 1) public Integer sampleLimit; - @Parameter(names = {"--sample-skip"}, description = "The body web service sampleSkip parameter", required = false, arity = 1) + @Parameter(names = {"--sample-skip"}, description = "Skip some samples from the result. Useful for sample pagination.", required = false, arity = 1) public Integer sampleSkip; - @Parameter(names = {"--sample-data"}, description = "The body web service sampleData parameter", required = false, arity = 1) + @Parameter(names = {"--sample-data"}, description = "Filter by any SampleData field from samples. [{sample}:]{key}{op}{value}[,;]* . If no sample is specified, will use all samples from 'sample' or 'genotype' filter. e.g. DP>200 or HG0097:DP>200,HG0098:DP<10 . Many FORMAT fields can be combined. e.g. HG0097:DP>200;GT=1/1,0/1,HG0098:DP<10", required = false, arity = 1) public String sampleData; - @Parameter(names = {"--sample-annotation"}, description = "The body web service sampleAnnotation parameter", required = false, arity = 1) + @Parameter(names = {"--sample-annotation"}, description = "Selects some samples using metadata information from Catalog. e.g. age>20;phenotype=hpo:123,hpo:456;name=smith", required = false, arity = 1) public String sampleAnnotation; - @Parameter(names = {"--family"}, description = "The body web service family parameter", required = false, arity = 1) + @Parameter(names = {"--family"}, description = "Filter variants where any of the samples from the given family contains the variant (HET or HOM_ALT)", required = false, arity = 1) public String family; - @Parameter(names = {"--family-members"}, description = "The body web service familyMembers parameter", required = false, arity = 1) + @Parameter(names = {"--family-members"}, description = "Sub set of the members of a given family", required = false, arity = 1) public String familyMembers; - @Parameter(names = {"--family-disorder"}, description = "The body web service familyDisorder parameter", required = false, arity = 1) + @Parameter(names = {"--family-disorder"}, description = "Specify the disorder to use for the family segregation", required = false, arity = 1) public String familyDisorder; - @Parameter(names = {"--family-proband"}, description = "The body web service familyProband parameter", required = false, arity = 1) + @Parameter(names = {"--family-proband"}, description = "Specify the proband child to use for the family segregation", required = false, arity = 1) public String familyProband; - @Parameter(names = {"--family-segregation"}, description = "The body web service familySegregation parameter", required = false, arity = 1) + @Parameter(names = {"--family-segregation"}, description = "Filter by segregation mode from a given family. Accepted values: [ autosomalDominant, autosomalRecessive, XLinkedDominant, XLinkedRecessive, YLinked, mitochondrial, deNovo, deNovoStrict, mendelianError, compoundHeterozygous ]", required = false, arity = 1) public String familySegregation; - @Parameter(names = {"--cohort"}, description = "The body web service cohort parameter", required = false, arity = 1) + @Parameter(names = {"--cohort"}, description = "Select variants with calculated stats for the selected cohorts", required = false, arity = 1) public String cohort; - @Parameter(names = {"--cohort-stats-pass"}, description = "The body web service cohortStatsPass parameter", required = false, arity = 1) + @Parameter(names = {"--cohort-stats-pass"}, description = "Filter PASS frequency: [{study:}]{cohort}[<|>|<=|>=]{number}. e.g. ALL>0.8", required = false, arity = 1) public String cohortStatsPass; - @Parameter(names = {"--cohort-stats-mgf"}, description = "The body web service cohortStatsMgf parameter", required = false, arity = 1) + @Parameter(names = {"--cohort-stats-mgf"}, description = "Minor Genotype Frequency: [{study:}]{cohort}[<|>|<=|>=]{number}. e.g. ALL<=0.4", required = false, arity = 1) public String cohortStatsMgf; - @Parameter(names = {"--missing-alleles"}, description = "The body web service missingAlleles parameter", required = false, arity = 1) + @Parameter(names = {"--missing-alleles"}, description = "Number of missing alleles: [{study:}]{cohort}[<|>|<=|>=]{number}", required = false, arity = 1) public String missingAlleles; - @Parameter(names = {"--missing-genotypes"}, description = "The body web service missingGenotypes parameter", required = false, arity = 1) + @Parameter(names = {"--missing-genotypes"}, description = "Number of missing genotypes: [{study:}]{cohort}[<|>|<=|>=]{number}", required = false, arity = 1) public String missingGenotypes; - @Parameter(names = {"--annotation-exists"}, description = "The body web service annotationExists parameter", required = false, arity = 1) + @Parameter(names = {"--annotation-exists"}, description = "Return only annotated variants", required = false, arity = 1) public Boolean annotationExists; - @Parameter(names = {"--score"}, description = "The body web service score parameter", required = false, arity = 1) + @Parameter(names = {"--score"}, description = "Filter by variant score: [{study:}]{score}[<|>|<=|>=]{number}", required = false, arity = 1) public String score; - @Parameter(names = {"--polyphen"}, description = "The body web service polyphen parameter", required = false, arity = 1) + @Parameter(names = {"--polyphen"}, description = "Polyphen, protein substitution score. [<|>|<=|>=]{number} or [~=|=|]{description} e.g. <=0.9 , =benign", required = false, arity = 1) public String polyphen; - @Parameter(names = {"--sift"}, description = "The body web service sift parameter", required = false, arity = 1) + @Parameter(names = {"--sift"}, description = "Sift, protein substitution score. [<|>|<=|>=]{number} or [~=|=|]{description} e.g. >0.1 , ~=tolerant", required = false, arity = 1) public String sift; @Parameter(names = {"--gene-role-in-cancer"}, description = "The body web service geneRoleInCancer parameter", required = false, arity = 1) public String geneRoleInCancer; - @Parameter(names = {"--gene-trait-id"}, description = "The body web service geneTraitId parameter", required = false, arity = 1) + @Parameter(names = {"--gene-trait-id"}, description = "List of gene trait association id. e.g. 'umls:C0007222' , 'OMIM:269600'", required = false, arity = 1) public String geneTraitId; - @Parameter(names = {"--gene-trait-name"}, description = "The body web service geneTraitName parameter", required = false, arity = 1) + @Parameter(names = {"--gene-trait-name"}, description = "List of gene trait association names. e.g. Cardiovascular Diseases", required = false, arity = 1) public String geneTraitName; - @Parameter(names = {"--trait"}, description = "The body web service trait parameter", required = false, arity = 1) + @Parameter(names = {"--trait"}, description = "List of traits, based on ClinVar, HPO, COSMIC, i.e.: IDs, histologies, descriptions,...", required = false, arity = 1) public String trait; - @Parameter(names = {"--cosmic"}, description = "The body web service cosmic parameter", required = false, arity = 1) + @Parameter(names = {"--cosmic"}, description = "List of COSMIC mutation IDs.", required = false, arity = 1) public String cosmic; - @Parameter(names = {"--clinvar"}, description = "The body web service clinvar parameter", required = false, arity = 1) + @Parameter(names = {"--clinvar"}, description = "Clinical source: clinvar, cosmic", required = false, arity = 1) public String clinvar; - @Parameter(names = {"--hpo"}, description = "The body web service hpo parameter", required = false, arity = 1) + @Parameter(names = {"--hpo"}, description = "List of HPO terms. e.g. 'HP:0000545,HP:0002812'", required = false, arity = 1) public String hpo; - @Parameter(names = {"--go"}, description = "The body web service go parameter", required = false, arity = 1) + @Parameter(names = {"--go"}, description = "List of GO (Gene Ontology) terms. e.g. 'GO:0002020'", required = false, arity = 1) public String go; - @Parameter(names = {"--expression"}, description = "The body web service expression parameter", required = false, arity = 1) + @Parameter(names = {"--expression"}, description = "List of tissues of interest. e.g. 'lung'", required = false, arity = 1) public String expression; - @Parameter(names = {"--protein-keyword"}, description = "The body web service proteinKeyword parameter", required = false, arity = 1) + @Parameter(names = {"--protein-keyword"}, description = "List of Uniprot protein variant annotation keywords", required = false, arity = 1) public String proteinKeyword; - @Parameter(names = {"--drug"}, description = "The body web service drug parameter", required = false, arity = 1) + @Parameter(names = {"--drug"}, description = "List of drug names", required = false, arity = 1) public String drug; - @Parameter(names = {"--custom-annotation"}, description = "The body web service customAnnotation parameter", required = false, arity = 1) + @Parameter(names = {"--custom-annotation"}, description = "Custom annotation: {key}[<|>|<=|>=]{number} or {key}[~=|=]{text}", required = false, arity = 1) public String customAnnotation; - @Parameter(names = {"--unknown-genotype"}, description = "The body web service unknownGenotype parameter", required = false, arity = 1) + @Parameter(names = {"--unknown-genotype"}, description = "Returned genotype for unknown genotypes. Common values: [0/0, 0|0, ./.]", required = false, arity = 1) public String unknownGenotype; - @Parameter(names = {"--sample-metadata"}, description = "The body web service sampleMetadata parameter", required = false, help = true, arity = 0) + @Parameter(names = {"--sample-metadata"}, description = "Return the samples metadata group by study. Sample names will appear in the same order as their corresponding genotypes.", required = false, help = true, arity = 0) public boolean sampleMetadata = false; - @Parameter(names = {"--sort"}, description = "The body web service sort parameter", required = false, help = true, arity = 0) + @Parameter(names = {"--sort"}, description = "Sort the results by chromosome, start, end and alternate allele", required = false, help = true, arity = 0) public boolean sort = false; @Parameter(names = {"--outdir"}, description = "The body web service outdir parameter", required = false, arity = 1) @@ -1513,7 +1513,7 @@ public class MetadataCommandOptions { @Parameter(names = {"--file"}, description = "Filter variants from the files specified. This will set includeFile parameter when not provided", required = false, arity = 1) public String file; - @Parameter(names = {"--sample"}, description = "Filter variants by sample genotype. This will automatically set 'includeSample' parameter when not provided. This filter accepts multiple 3 forms: 1) List of samples: Samples that contain the main variant. Accepts AND (;) and OR (,) operators. e.g. HG0097,HG0098 . 2) List of samples with genotypes: {sample}:{gt1},{gt2}. Accepts AND (;) and OR (,) operators. e.g. HG0097:0/0;HG0098:0/1,1/1 . Unphased genotypes (e.g. 0/1, 1/1) will also include phased genotypes (e.g. 0|1, 1|0, 1|1), but not vice versa. When filtering by multi-allelic genotypes, any secondary allele will match, regardless of its position e.g. 1/2 will match with genotypes 1/2, 1/3, 1/4, .... Genotype aliases accepted: HOM_REF, HOM_ALT, HET, HET_REF, HET_ALT, HET_MISS and MISS e.g. HG0097:HOM_REF;HG0098:HET_REF,HOM_ALT . 3) Sample with segregation mode: {sample}:{segregation}. Only one sample accepted.Accepted segregation modes: [ autosomalDominant, autosomalRecessive, XLinkedDominant, XLinkedRecessive, YLinked, mitochondrial, deNovo, deNovoStrict, mendelianError, compoundHeterozygous ]. Value is case insensitive. e.g. HG0097:DeNovo Sample must have parents defined and indexed. ", required = false, arity = 1) + @Parameter(names = {"--sample"}, description = "Filter variants by sample genotype. This will automatically set 'includeSample' parameter when not provided. This filter accepts multiple 3 forms: 1) List of samples: Samples that contain the main variant. Accepts AND ';' and OR ',' operators. e.g. HG0097,HG0098 . 2) List of samples with genotypes: {sample}:{gt1},{gt2}. Accepts AND ';' and OR ',' operators. e.g. HG0097:0/0;HG0098:0/1,1/1 . Unphased genotypes (e.g. 0/1, 1/1) will also include phased genotypes (e.g. 0|1, 1|0, 1|1), but not vice versa. When filtering by multi-allelic genotypes, any secondary allele will match, regardless of its position e.g. 1/2 will match with genotypes 1/2, 1/3, 1/4, .... Genotype aliases accepted: HOM_REF, HOM_ALT, HET, HET_REF, HET_ALT, HET_MISS and MISS e.g. HG0097:HOM_REF;HG0098:HET_REF,HOM_ALT . 3) Sample with segregation mode: {sample}:{segregation}. Only one sample accepted.Accepted segregation modes: [ autosomalDominant, autosomalRecessive, XLinkedDominant, XLinkedRecessive, YLinked, mitochondrial, deNovo, deNovoStrict, mendelianError, compoundHeterozygous ]. Value is case insensitive. e.g. HG0097:DeNovo Sample must have parents defined and indexed. ", required = false, arity = 1) public String sample; @Parameter(names = {"--include-study"}, description = "List of studies to include in the result. Accepts 'all' and 'none'.", required = false, arity = 1) @@ -1794,7 +1794,7 @@ public class QueryCommandOptions { @Parameter(names = {"--file-data"}, description = "Filter by file data (i.e. FILTER, QUAL and INFO columns from VCF file). [{file}:]{key}{op}{value}[,;]* . If no file is specified, will use all files from 'file' filter. e.g. AN>200 or file_1.vcf:AN>200;file_2.vcf:AN<10 . Many fields can be combined. e.g. file_1.vcf:AN>200;DB=true;file_2.vcf:AN<10,FILTER=PASS,LowDP", required = false, arity = 1) public String fileData; - @Parameter(names = {"--sample"}, description = "Filter variants by sample genotype. This will automatically set 'includeSample' parameter when not provided. This filter accepts multiple 3 forms: 1) List of samples: Samples that contain the main variant. Accepts AND (;) and OR (,) operators. e.g. HG0097,HG0098 . 2) List of samples with genotypes: {sample}:{gt1},{gt2}. Accepts AND (;) and OR (,) operators. e.g. HG0097:0/0;HG0098:0/1,1/1 . Unphased genotypes (e.g. 0/1, 1/1) will also include phased genotypes (e.g. 0|1, 1|0, 1|1), but not vice versa. When filtering by multi-allelic genotypes, any secondary allele will match, regardless of its position e.g. 1/2 will match with genotypes 1/2, 1/3, 1/4, .... Genotype aliases accepted: HOM_REF, HOM_ALT, HET, HET_REF, HET_ALT, HET_MISS and MISS e.g. HG0097:HOM_REF;HG0098:HET_REF,HOM_ALT . 3) Sample with segregation mode: {sample}:{segregation}. Only one sample accepted.Accepted segregation modes: [ autosomalDominant, autosomalRecessive, XLinkedDominant, XLinkedRecessive, YLinked, mitochondrial, deNovo, deNovoStrict, mendelianError, compoundHeterozygous ]. Value is case insensitive. e.g. HG0097:DeNovo Sample must have parents defined and indexed. ", required = false, arity = 1) + @Parameter(names = {"--sample"}, description = "Filter variants by sample genotype. This will automatically set 'includeSample' parameter when not provided. This filter accepts multiple 3 forms: 1) List of samples: Samples that contain the main variant. Accepts AND ';' and OR ',' operators. e.g. HG0097,HG0098 . 2) List of samples with genotypes: {sample}:{gt1},{gt2}. Accepts AND ';' and OR ',' operators. e.g. HG0097:0/0;HG0098:0/1,1/1 . Unphased genotypes (e.g. 0/1, 1/1) will also include phased genotypes (e.g. 0|1, 1|0, 1|1), but not vice versa. When filtering by multi-allelic genotypes, any secondary allele will match, regardless of its position e.g. 1/2 will match with genotypes 1/2, 1/3, 1/4, .... Genotype aliases accepted: HOM_REF, HOM_ALT, HET, HET_REF, HET_ALT, HET_MISS and MISS e.g. HG0097:HOM_REF;HG0098:HET_REF,HOM_ALT . 3) Sample with segregation mode: {sample}:{segregation}. Only one sample accepted.Accepted segregation modes: [ autosomalDominant, autosomalRecessive, XLinkedDominant, XLinkedRecessive, YLinked, mitochondrial, deNovo, deNovoStrict, mendelianError, compoundHeterozygous ]. Value is case insensitive. e.g. HG0097:DeNovo Sample must have parents defined and indexed. ", required = false, arity = 1) public String sample; @Parameter(names = {"--genotype"}, description = "Samples with a specific genotype: {samp_1}:{gt_1}(,{gt_n})*(;{samp_n}:{gt_1}(,{gt_n})*)* e.g. HG0097:0/0;HG0098:0/1,1/1. Unphased genotypes (e.g. 0/1, 1/1) will also include phased genotypes (e.g. 0|1, 1|0, 1|1), but not vice versa. When filtering by multi-allelic genotypes, any secondary allele will match, regardless of its position e.g. 1/2 will match with genotypes 1/2, 1/3, 1/4, .... Genotype aliases accepted: HOM_REF, HOM_ALT, HET, HET_REF, HET_ALT, HET_MISS and MISS e.g. HG0097:HOM_REF;HG0098:HET_REF,HOM_ALT. This will automatically set 'includeSample' parameter when not provided", required = false, arity = 1) @@ -1959,6 +1959,9 @@ public class QueryCommandOptions { @Parameter(names = {"--panel-intersection"}, description = "Intersect panel genes and regions with given genes and regions from que input query. This will prevent returning variants from regions out of the panel.", required = false, help = true, arity = 0) public boolean panelIntersection = false; + @Parameter(names = {"--source"}, description = "Select the variant data source from where to fetch the data. Accepted values are 'variant_index' (default), 'secondary_annotation_index' and 'secondary_sample_index'. When selecting a secondary_index, the data will be retrieved exclusively from that secondary index, and the 'include/exclude' parameters will be ignored. Some data might be missing or be partial.", required = false, arity = 1) + public String source; + @Parameter(names = {"--trait"}, description = "List of traits, based on ClinVar, HPO, COSMIC, i.e.: IDs, histologies, descriptions,...", required = false, arity = 1) public String trait; @@ -2091,7 +2094,7 @@ public class AggregationStatsSampleCommandOptions { @Parameter(names = {"--filter"}, description = "Specify the FILTER for any of the files. If 'file' filter is provided, will match the file and the filter. e.g.: PASS,LowGQX", required = false, arity = 1) public String filter; - @Parameter(names = {"--sample"}, description = "Filter variants by sample genotype. This will automatically set 'includeSample' parameter when not provided. This filter accepts multiple 3 forms: 1) List of samples: Samples that contain the main variant. Accepts AND (;) and OR (,) operators. e.g. HG0097,HG0098 . 2) List of samples with genotypes: {sample}:{gt1},{gt2}. Accepts AND (;) and OR (,) operators. e.g. HG0097:0/0;HG0098:0/1,1/1 . Unphased genotypes (e.g. 0/1, 1/1) will also include phased genotypes (e.g. 0|1, 1|0, 1|1), but not vice versa. When filtering by multi-allelic genotypes, any secondary allele will match, regardless of its position e.g. 1/2 will match with genotypes 1/2, 1/3, 1/4, .... Genotype aliases accepted: HOM_REF, HOM_ALT, HET, HET_REF, HET_ALT, HET_MISS and MISS e.g. HG0097:HOM_REF;HG0098:HET_REF,HOM_ALT . 3) Sample with segregation mode: {sample}:{segregation}. Only one sample accepted.Accepted segregation modes: [ autosomalDominant, autosomalRecessive, XLinkedDominant, XLinkedRecessive, YLinked, mitochondrial, deNovo, deNovoStrict, mendelianError, compoundHeterozygous ]. Value is case insensitive. e.g. HG0097:DeNovo Sample must have parents defined and indexed. ", required = false, arity = 1) + @Parameter(names = {"--sample"}, description = "Filter variants by sample genotype. This will automatically set 'includeSample' parameter when not provided. This filter accepts multiple 3 forms: 1) List of samples: Samples that contain the main variant. Accepts AND ';' and OR ',' operators. e.g. HG0097,HG0098 . 2) List of samples with genotypes: {sample}:{gt1},{gt2}. Accepts AND ';' and OR ',' operators. e.g. HG0097:0/0;HG0098:0/1,1/1 . Unphased genotypes (e.g. 0/1, 1/1) will also include phased genotypes (e.g. 0|1, 1|0, 1|1), but not vice versa. When filtering by multi-allelic genotypes, any secondary allele will match, regardless of its position e.g. 1/2 will match with genotypes 1/2, 1/3, 1/4, .... Genotype aliases accepted: HOM_REF, HOM_ALT, HET, HET_REF, HET_ALT, HET_MISS and MISS e.g. HG0097:HOM_REF;HG0098:HET_REF,HOM_ALT . 3) Sample with segregation mode: {sample}:{segregation}. Only one sample accepted.Accepted segregation modes: [ autosomalDominant, autosomalRecessive, XLinkedDominant, XLinkedRecessive, YLinked, mitochondrial, deNovo, deNovoStrict, mendelianError, compoundHeterozygous ]. Value is case insensitive. e.g. HG0097:DeNovo Sample must have parents defined and indexed. ", required = false, arity = 1) public String sample; @Parameter(names = {"--genotype"}, description = "Samples with a specific genotype: {samp_1}:{gt_1}(,{gt_n})*(;{samp_n}:{gt_1}(,{gt_n})*)* e.g. HG0097:0/0;HG0098:0/1,1/1. Unphased genotypes (e.g. 0/1, 1/1) will also include phased genotypes (e.g. 0|1, 1|0, 1|1), but not vice versa. When filtering by multi-allelic genotypes, any secondary allele will match, regardless of its position e.g. 1/2 will match with genotypes 1/2, 1/3, 1/4, .... Genotype aliases accepted: HOM_REF, HOM_ALT, HET, HET_REF, HET_ALT, HET_MISS and MISS e.g. HG0097:HOM_REF;HG0098:HET_REF,HOM_ALT. This will automatically set 'includeSample' parameter when not provided", required = false, arity = 1) @@ -2230,82 +2233,82 @@ public class RunSampleQcCommandOptions { @Parameter(names = {"--vs-description"}, description = "Variant stats description.", required = false, arity = 1) public String vsDescription; - @Parameter(names = {"--vs-query-id"}, description = "The body web service id parameter", required = false, arity = 1) + @Parameter(names = {"--vs-query-id"}, description = "List of variant IDs in the format chrom:start:ref:alt, e.g. 19:7177679:C:T", required = false, arity = 1) public String vsQueryId; - @Parameter(names = {"--vs-query-region"}, description = "The body web service region parameter", required = false, arity = 1) + @Parameter(names = {"--vs-query-region"}, description = "Reference allele", required = false, arity = 1) public String vsQueryRegion; - @Parameter(names = {"--vs-query-gene"}, description = "The body web service gene parameter", required = false, arity = 1) + @Parameter(names = {"--vs-query-gene"}, description = "List of genes, most gene IDs are accepted (HGNC, Ensembl gene, ...). This is an alias to 'xref' parameter", required = false, arity = 1) public String vsQueryGene; - @Parameter(names = {"--vs-query-type"}, description = "The body web service type parameter", required = false, arity = 1) + @Parameter(names = {"--vs-query-type"}, description = "List of types, accepted values are SNV, MNV, INDEL, SV, COPY_NUMBER, COPY_NUMBER_LOSS, COPY_NUMBER_GAIN, INSERTION, DELETION, DUPLICATION, TANDEM_DUPLICATION, BREAKEND, e.g. SNV,INDEL", required = false, arity = 1) public String vsQueryType; - @Parameter(names = {"--vs-query-panel"}, description = "The body web service panel parameter", required = false, arity = 1) + @Parameter(names = {"--vs-query-panel"}, description = "Filter by genes from the given disease panel", required = false, arity = 1) public String vsQueryPanel; - @Parameter(names = {"--vs-query-panel-mode-of-inheritance"}, description = "The body web service panelModeOfInheritance parameter", required = false, arity = 1) + @Parameter(names = {"--vs-query-panel-mode-of-inheritance"}, description = "Filter genes from specific panels that match certain mode of inheritance. Accepted values : [ autosomalDominant, autosomalRecessive, XLinkedDominant, XLinkedRecessive, YLinked, mitochondrial, deNovo, mendelianError, compoundHeterozygous ]", required = false, arity = 1) public String vsQueryPanelModeOfInheritance; - @Parameter(names = {"--vs-query-panel-confidence"}, description = "The body web service panelConfidence parameter", required = false, arity = 1) + @Parameter(names = {"--vs-query-panel-confidence"}, description = "Filter genes from specific panels that match certain confidence. Accepted values : [ high, medium, low, rejected ]", required = false, arity = 1) public String vsQueryPanelConfidence; - @Parameter(names = {"--vs-query-panel-role-in-cancer"}, description = "The body web service panelRoleInCancer parameter", required = false, arity = 1) + @Parameter(names = {"--vs-query-panel-role-in-cancer"}, description = "Filter genes from specific panels that match certain role in cancer. Accepted values : [ both, oncogene, tumorSuppressorGene, fusion ]", required = false, arity = 1) public String vsQueryPanelRoleInCancer; - @Parameter(names = {"--vs-query-panel-intersection"}, description = "The body web service panelIntersection parameter", required = false, help = true, arity = 0) + @Parameter(names = {"--vs-query-panel-intersection"}, description = "Intersect panel genes and regions with given genes and regions from que input query. This will prevent returning variants from regions out of the panel.", required = false, help = true, arity = 0) public boolean vsQueryPanelIntersection = false; - @Parameter(names = {"--vs-query-panel-feature-type"}, description = "The body web service panelFeatureType parameter", required = false, arity = 1) + @Parameter(names = {"--vs-query-panel-feature-type"}, description = "Filter elements from specific panels by type. Accepted values : [ gene, region, str, variant ]", required = false, arity = 1) public String vsQueryPanelFeatureType; - @Parameter(names = {"--vs-query-cohort-stats-ref"}, description = "The body web service cohortStatsRef parameter", required = false, arity = 1) + @Parameter(names = {"--vs-query-cohort-stats-ref"}, description = "Reference Allele Frequency: [{study:}]{cohort}[<|>|<=|>=]{number}. e.g. ALL<=0.4", required = false, arity = 1) public String vsQueryCohortStatsRef; - @Parameter(names = {"--vs-query-cohort-stats-alt"}, description = "The body web service cohortStatsAlt parameter", required = false, arity = 1) + @Parameter(names = {"--vs-query-cohort-stats-alt"}, description = "Alternate Allele Frequency: [{study:}]{cohort}[<|>|<=|>=]{number}. e.g. ALL<=0.4", required = false, arity = 1) public String vsQueryCohortStatsAlt; - @Parameter(names = {"--vs-query-cohort-stats-maf"}, description = "The body web service cohortStatsMaf parameter", required = false, arity = 1) + @Parameter(names = {"--vs-query-cohort-stats-maf"}, description = "Minor Allele Frequency: [{study:}]{cohort}[<|>|<=|>=]{number}. e.g. ALL<=0.4", required = false, arity = 1) public String vsQueryCohortStatsMaf; - @Parameter(names = {"--vs-query-ct"}, description = "The body web service ct parameter", required = false, arity = 1) + @Parameter(names = {"--vs-query-ct"}, description = "List of SO consequence types, e.g. missense_variant,stop_lost or SO:0001583,SO:0001578. Accepts aliases 'loss_of_function' and 'protein_altering'", required = false, arity = 1) public String vsQueryCt; - @Parameter(names = {"--vs-query-xref"}, description = "The body web service xref parameter", required = false, arity = 1) + @Parameter(names = {"--vs-query-xref"}, description = "List of any external reference, these can be genes, proteins or variants. Accepted IDs include HGNC, Ensembl genes, dbSNP, ClinVar, HPO, Cosmic, HGVS ...", required = false, arity = 1) public String vsQueryXref; - @Parameter(names = {"--vs-query-biotype"}, description = "The body web service biotype parameter", required = false, arity = 1) + @Parameter(names = {"--vs-query-biotype"}, description = "List of biotypes, e.g. protein_coding", required = false, arity = 1) public String vsQueryBiotype; - @Parameter(names = {"--vs-query-protein-substitution"}, description = "The body web service proteinSubstitution parameter", required = false, arity = 1) + @Parameter(names = {"--vs-query-protein-substitution"}, description = "Protein substitution scores include SIFT and PolyPhen. You can query using the score {protein_score}[<|>|<=|>=]{number} or the description {protein_score}[~=|=]{description} e.g. polyphen>0.1,sift=tolerant", required = false, arity = 1) public String vsQueryProteinSubstitution; - @Parameter(names = {"--vs-query-conservation"}, description = "The body web service conservation parameter", required = false, arity = 1) + @Parameter(names = {"--vs-query-conservation"}, description = "Filter by conservation score: {conservation_score}[<|>|<=|>=]{number} e.g. phastCons>0.5,phylop<0.1,gerp>0.1", required = false, arity = 1) public String vsQueryConservation; - @Parameter(names = {"--vs-query-population-frequency-maf"}, description = "The body web service populationFrequencyMaf parameter", required = false, arity = 1) + @Parameter(names = {"--vs-query-population-frequency-maf"}, description = "Population minor allele frequency: {study}:{population}[<|>|<=|>=]{number}. e.g. 1000G:ALL<0.01", required = false, arity = 1) public String vsQueryPopulationFrequencyMaf; - @Parameter(names = {"--vs-query-population-frequency-alt"}, description = "The body web service populationFrequencyAlt parameter", required = false, arity = 1) + @Parameter(names = {"--vs-query-population-frequency-alt"}, description = "Alternate Population Frequency: {study}:{population}[<|>|<=|>=]{number}. e.g. 1000G:ALL<0.01", required = false, arity = 1) public String vsQueryPopulationFrequencyAlt; - @Parameter(names = {"--vs-query-population-frequency-ref"}, description = "The body web service populationFrequencyRef parameter", required = false, arity = 1) + @Parameter(names = {"--vs-query-population-frequency-ref"}, description = "Reference Population Frequency: {study}:{population}[<|>|<=|>=]{number}. e.g. 1000G:ALL<0.01", required = false, arity = 1) public String vsQueryPopulationFrequencyRef; - @Parameter(names = {"--vs-query-transcript-flag"}, description = "The body web service transcriptFlag parameter", required = false, arity = 1) + @Parameter(names = {"--vs-query-transcript-flag"}, description = "List of transcript flags. e.g. canonical, CCDS, basic, LRG, MANE Select, MANE Plus Clinical, EGLH_HaemOnc, TSO500", required = false, arity = 1) public String vsQueryTranscriptFlag; - @Parameter(names = {"--vs-query-functional-score"}, description = "The body web service functionalScore parameter", required = false, arity = 1) + @Parameter(names = {"--vs-query-functional-score"}, description = "Functional score: {functional_score}[<|>|<=|>=]{number} e.g. cadd_scaled>5.2 , cadd_raw<=0.3", required = false, arity = 1) public String vsQueryFunctionalScore; - @Parameter(names = {"--vs-query-clinical"}, description = "The body web service clinical parameter", required = false, arity = 1) + @Parameter(names = {"--vs-query-clinical"}, description = "Clinical source: clinvar, cosmic", required = false, arity = 1) public String vsQueryClinical; - @Parameter(names = {"--vs-query-clinical-significance"}, description = "The body web service clinicalSignificance parameter", required = false, arity = 1) + @Parameter(names = {"--vs-query-clinical-significance"}, description = "Clinical significance: benign, likely_benign, likely_pathogenic, pathogenic", required = false, arity = 1) public String vsQueryClinicalSignificance; - @Parameter(names = {"--vs-query-clinical-confirmed-status"}, description = "The body web service clinicalConfirmedStatus parameter", required = false, help = true, arity = 0) + @Parameter(names = {"--vs-query-clinical-confirmed-status"}, description = "Clinical confirmed status", required = false, help = true, arity = 0) public boolean vsQueryClinicalConfirmedStatus = false; @Parameter(names = {"--ms-id"}, description = "Signature ID.", required = false, arity = 1) @@ -2423,82 +2426,82 @@ public class RunSampleCommandOptions { @Parameter(names = {"--job-dry-run"}, description = "Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run.", required = false, arity = 1) public Boolean jobDryRun; - @Parameter(names = {"--id"}, description = "The body web service id parameter", required = false, arity = 1) + @Parameter(names = {"--id"}, description = "List of variant IDs in the format chrom:start:ref:alt, e.g. 19:7177679:C:T", required = false, arity = 1) public String id; - @Parameter(names = {"--region"}, description = "The body web service region parameter", required = false, arity = 1) + @Parameter(names = {"--region"}, description = "Reference allele", required = false, arity = 1) public String region; - @Parameter(names = {"--gene"}, description = "The body web service gene parameter", required = false, arity = 1) + @Parameter(names = {"--gene"}, description = "List of genes, most gene IDs are accepted (HGNC, Ensembl gene, ...). This is an alias to 'xref' parameter", required = false, arity = 1) public String gene; - @Parameter(names = {"--type"}, description = "The body web service type parameter", required = false, arity = 1) + @Parameter(names = {"--type"}, description = "List of types, accepted values are SNV, MNV, INDEL, SV, COPY_NUMBER, COPY_NUMBER_LOSS, COPY_NUMBER_GAIN, INSERTION, DELETION, DUPLICATION, TANDEM_DUPLICATION, BREAKEND, e.g. SNV,INDEL", required = false, arity = 1) public String type; - @Parameter(names = {"--panel"}, description = "The body web service panel parameter", required = false, arity = 1) + @Parameter(names = {"--panel"}, description = "Filter by genes from the given disease panel", required = false, arity = 1) public String panel; - @Parameter(names = {"--panel-mode-of-inheritance"}, description = "The body web service panelModeOfInheritance parameter", required = false, arity = 1) + @Parameter(names = {"--panel-mode-of-inheritance"}, description = "Filter genes from specific panels that match certain mode of inheritance. Accepted values : [ autosomalDominant, autosomalRecessive, XLinkedDominant, XLinkedRecessive, YLinked, mitochondrial, deNovo, mendelianError, compoundHeterozygous ]", required = false, arity = 1) public String panelModeOfInheritance; - @Parameter(names = {"--panel-confidence"}, description = "The body web service panelConfidence parameter", required = false, arity = 1) + @Parameter(names = {"--panel-confidence"}, description = "Filter genes from specific panels that match certain confidence. Accepted values : [ high, medium, low, rejected ]", required = false, arity = 1) public String panelConfidence; - @Parameter(names = {"--panel-role-in-cancer"}, description = "The body web service panelRoleInCancer parameter", required = false, arity = 1) + @Parameter(names = {"--panel-role-in-cancer"}, description = "Filter genes from specific panels that match certain role in cancer. Accepted values : [ both, oncogene, tumorSuppressorGene, fusion ]", required = false, arity = 1) public String panelRoleInCancer; - @Parameter(names = {"--panel-intersection"}, description = "The body web service panelIntersection parameter", required = false, help = true, arity = 0) + @Parameter(names = {"--panel-intersection"}, description = "Intersect panel genes and regions with given genes and regions from que input query. This will prevent returning variants from regions out of the panel.", required = false, help = true, arity = 0) public boolean panelIntersection = false; - @Parameter(names = {"--panel-feature-type"}, description = "The body web service panelFeatureType parameter", required = false, arity = 1) + @Parameter(names = {"--panel-feature-type"}, description = "Filter elements from specific panels by type. Accepted values : [ gene, region, str, variant ]", required = false, arity = 1) public String panelFeatureType; - @Parameter(names = {"--cohort-stats-ref"}, description = "The body web service cohortStatsRef parameter", required = false, arity = 1) + @Parameter(names = {"--cohort-stats-ref"}, description = "Reference Allele Frequency: [{study:}]{cohort}[<|>|<=|>=]{number}. e.g. ALL<=0.4", required = false, arity = 1) public String cohortStatsRef; - @Parameter(names = {"--cohort-stats-alt"}, description = "The body web service cohortStatsAlt parameter", required = false, arity = 1) + @Parameter(names = {"--cohort-stats-alt"}, description = "Alternate Allele Frequency: [{study:}]{cohort}[<|>|<=|>=]{number}. e.g. ALL<=0.4", required = false, arity = 1) public String cohortStatsAlt; - @Parameter(names = {"--cohort-stats-maf"}, description = "The body web service cohortStatsMaf parameter", required = false, arity = 1) + @Parameter(names = {"--cohort-stats-maf"}, description = "Minor Allele Frequency: [{study:}]{cohort}[<|>|<=|>=]{number}. e.g. ALL<=0.4", required = false, arity = 1) public String cohortStatsMaf; - @Parameter(names = {"--ct"}, description = "The body web service ct parameter", required = false, arity = 1) + @Parameter(names = {"--ct"}, description = "List of SO consequence types, e.g. missense_variant,stop_lost or SO:0001583,SO:0001578. Accepts aliases 'loss_of_function' and 'protein_altering'", required = false, arity = 1) public String ct; - @Parameter(names = {"--xref"}, description = "The body web service xref parameter", required = false, arity = 1) + @Parameter(names = {"--xref"}, description = "List of any external reference, these can be genes, proteins or variants. Accepted IDs include HGNC, Ensembl genes, dbSNP, ClinVar, HPO, Cosmic, HGVS ...", required = false, arity = 1) public String xref; - @Parameter(names = {"--biotype"}, description = "The body web service biotype parameter", required = false, arity = 1) + @Parameter(names = {"--biotype"}, description = "List of biotypes, e.g. protein_coding", required = false, arity = 1) public String biotype; - @Parameter(names = {"--protein-substitution"}, description = "The body web service proteinSubstitution parameter", required = false, arity = 1) + @Parameter(names = {"--protein-substitution"}, description = "Protein substitution scores include SIFT and PolyPhen. You can query using the score {protein_score}[<|>|<=|>=]{number} or the description {protein_score}[~=|=]{description} e.g. polyphen>0.1,sift=tolerant", required = false, arity = 1) public String proteinSubstitution; - @Parameter(names = {"--conservation"}, description = "The body web service conservation parameter", required = false, arity = 1) + @Parameter(names = {"--conservation"}, description = "Filter by conservation score: {conservation_score}[<|>|<=|>=]{number} e.g. phastCons>0.5,phylop<0.1,gerp>0.1", required = false, arity = 1) public String conservation; - @Parameter(names = {"--population-frequency-maf"}, description = "The body web service populationFrequencyMaf parameter", required = false, arity = 1) + @Parameter(names = {"--population-frequency-maf"}, description = "Population minor allele frequency: {study}:{population}[<|>|<=|>=]{number}. e.g. 1000G:ALL<0.01", required = false, arity = 1) public String populationFrequencyMaf; - @Parameter(names = {"--population-frequency-alt"}, description = "The body web service populationFrequencyAlt parameter", required = false, arity = 1) + @Parameter(names = {"--population-frequency-alt"}, description = "Alternate Population Frequency: {study}:{population}[<|>|<=|>=]{number}. e.g. 1000G:ALL<0.01", required = false, arity = 1) public String populationFrequencyAlt; - @Parameter(names = {"--population-frequency-ref"}, description = "The body web service populationFrequencyRef parameter", required = false, arity = 1) + @Parameter(names = {"--population-frequency-ref"}, description = "Reference Population Frequency: {study}:{population}[<|>|<=|>=]{number}. e.g. 1000G:ALL<0.01", required = false, arity = 1) public String populationFrequencyRef; - @Parameter(names = {"--transcript-flag"}, description = "The body web service transcriptFlag parameter", required = false, arity = 1) + @Parameter(names = {"--transcript-flag"}, description = "List of transcript flags. e.g. canonical, CCDS, basic, LRG, MANE Select, MANE Plus Clinical, EGLH_HaemOnc, TSO500", required = false, arity = 1) public String transcriptFlag; - @Parameter(names = {"--functional-score"}, description = "The body web service functionalScore parameter", required = false, arity = 1) + @Parameter(names = {"--functional-score"}, description = "Functional score: {functional_score}[<|>|<=|>=]{number} e.g. cadd_scaled>5.2 , cadd_raw<=0.3", required = false, arity = 1) public String functionalScore; - @Parameter(names = {"--clinical"}, description = "The body web service clinical parameter", required = false, arity = 1) + @Parameter(names = {"--clinical"}, description = "Clinical source: clinvar, cosmic", required = false, arity = 1) public String clinical; - @Parameter(names = {"--clinical-significance"}, description = "The body web service clinicalSignificance parameter", required = false, arity = 1) + @Parameter(names = {"--clinical-significance"}, description = "Clinical significance: benign, likely_benign, likely_pathogenic, pathogenic", required = false, arity = 1) public String clinicalSignificance; - @Parameter(names = {"--clinical-confirmed-status"}, description = "The body web service clinicalConfirmedStatus parameter", required = false, help = true, arity = 0) + @Parameter(names = {"--clinical-confirmed-status"}, description = "Clinical confirmed status", required = false, help = true, arity = 0) public boolean clinicalConfirmedStatus = false; @Parameter(names = {"--genotypes"}, description = "The body web service genotypes parameter", required = false, arity = 1) @@ -2610,82 +2613,82 @@ public class RunSampleStatsCommandOptions { @Parameter(names = {"--individual"}, description = "The body web service individual parameter", required = false, arity = 1) public String individual; - @Parameter(names = {"--variant-query-id"}, description = "The body web service id parameter", required = false, arity = 1) + @Parameter(names = {"--variant-query-id"}, description = "List of variant IDs in the format chrom:start:ref:alt, e.g. 19:7177679:C:T", required = false, arity = 1) public String variantQueryId; - @Parameter(names = {"--variant-query-region"}, description = "The body web service region parameter", required = false, arity = 1) + @Parameter(names = {"--variant-query-region"}, description = "Reference allele", required = false, arity = 1) public String variantQueryRegion; - @Parameter(names = {"--variant-query-gene"}, description = "The body web service gene parameter", required = false, arity = 1) + @Parameter(names = {"--variant-query-gene"}, description = "List of genes, most gene IDs are accepted (HGNC, Ensembl gene, ...). This is an alias to 'xref' parameter", required = false, arity = 1) public String variantQueryGene; - @Parameter(names = {"--variant-query-type"}, description = "The body web service type parameter", required = false, arity = 1) + @Parameter(names = {"--variant-query-type"}, description = "List of types, accepted values are SNV, MNV, INDEL, SV, COPY_NUMBER, COPY_NUMBER_LOSS, COPY_NUMBER_GAIN, INSERTION, DELETION, DUPLICATION, TANDEM_DUPLICATION, BREAKEND, e.g. SNV,INDEL", required = false, arity = 1) public String variantQueryType; - @Parameter(names = {"--variant-query-panel"}, description = "The body web service panel parameter", required = false, arity = 1) + @Parameter(names = {"--variant-query-panel"}, description = "Filter by genes from the given disease panel", required = false, arity = 1) public String variantQueryPanel; - @Parameter(names = {"--variant-query-panel-mode-of-inheritance"}, description = "The body web service panelModeOfInheritance parameter", required = false, arity = 1) + @Parameter(names = {"--variant-query-panel-mode-of-inheritance"}, description = "Filter genes from specific panels that match certain mode of inheritance. Accepted values : [ autosomalDominant, autosomalRecessive, XLinkedDominant, XLinkedRecessive, YLinked, mitochondrial, deNovo, mendelianError, compoundHeterozygous ]", required = false, arity = 1) public String variantQueryPanelModeOfInheritance; - @Parameter(names = {"--variant-query-panel-confidence"}, description = "The body web service panelConfidence parameter", required = false, arity = 1) + @Parameter(names = {"--variant-query-panel-confidence"}, description = "Filter genes from specific panels that match certain confidence. Accepted values : [ high, medium, low, rejected ]", required = false, arity = 1) public String variantQueryPanelConfidence; - @Parameter(names = {"--variant-query-panel-role-in-cancer"}, description = "The body web service panelRoleInCancer parameter", required = false, arity = 1) + @Parameter(names = {"--variant-query-panel-role-in-cancer"}, description = "Filter genes from specific panels that match certain role in cancer. Accepted values : [ both, oncogene, tumorSuppressorGene, fusion ]", required = false, arity = 1) public String variantQueryPanelRoleInCancer; - @Parameter(names = {"--variant-query-panel-intersection"}, description = "The body web service panelIntersection parameter", required = false, help = true, arity = 0) + @Parameter(names = {"--variant-query-panel-intersection"}, description = "Intersect panel genes and regions with given genes and regions from que input query. This will prevent returning variants from regions out of the panel.", required = false, help = true, arity = 0) public boolean variantQueryPanelIntersection = false; - @Parameter(names = {"--variant-query-panel-feature-type"}, description = "The body web service panelFeatureType parameter", required = false, arity = 1) + @Parameter(names = {"--variant-query-panel-feature-type"}, description = "Filter elements from specific panels by type. Accepted values : [ gene, region, str, variant ]", required = false, arity = 1) public String variantQueryPanelFeatureType; - @Parameter(names = {"--variant-query-cohort-stats-ref"}, description = "The body web service cohortStatsRef parameter", required = false, arity = 1) + @Parameter(names = {"--variant-query-cohort-stats-ref"}, description = "Reference Allele Frequency: [{study:}]{cohort}[<|>|<=|>=]{number}. e.g. ALL<=0.4", required = false, arity = 1) public String variantQueryCohortStatsRef; - @Parameter(names = {"--variant-query-cohort-stats-alt"}, description = "The body web service cohortStatsAlt parameter", required = false, arity = 1) + @Parameter(names = {"--variant-query-cohort-stats-alt"}, description = "Alternate Allele Frequency: [{study:}]{cohort}[<|>|<=|>=]{number}. e.g. ALL<=0.4", required = false, arity = 1) public String variantQueryCohortStatsAlt; - @Parameter(names = {"--variant-query-cohort-stats-maf"}, description = "The body web service cohortStatsMaf parameter", required = false, arity = 1) + @Parameter(names = {"--variant-query-cohort-stats-maf"}, description = "Minor Allele Frequency: [{study:}]{cohort}[<|>|<=|>=]{number}. e.g. ALL<=0.4", required = false, arity = 1) public String variantQueryCohortStatsMaf; - @Parameter(names = {"--variant-query-ct"}, description = "The body web service ct parameter", required = false, arity = 1) + @Parameter(names = {"--variant-query-ct"}, description = "List of SO consequence types, e.g. missense_variant,stop_lost or SO:0001583,SO:0001578. Accepts aliases 'loss_of_function' and 'protein_altering'", required = false, arity = 1) public String variantQueryCt; - @Parameter(names = {"--variant-query-xref"}, description = "The body web service xref parameter", required = false, arity = 1) + @Parameter(names = {"--variant-query-xref"}, description = "List of any external reference, these can be genes, proteins or variants. Accepted IDs include HGNC, Ensembl genes, dbSNP, ClinVar, HPO, Cosmic, HGVS ...", required = false, arity = 1) public String variantQueryXref; - @Parameter(names = {"--variant-query-biotype"}, description = "The body web service biotype parameter", required = false, arity = 1) + @Parameter(names = {"--variant-query-biotype"}, description = "List of biotypes, e.g. protein_coding", required = false, arity = 1) public String variantQueryBiotype; - @Parameter(names = {"--variant-query-protein-substitution"}, description = "The body web service proteinSubstitution parameter", required = false, arity = 1) + @Parameter(names = {"--variant-query-protein-substitution"}, description = "Protein substitution scores include SIFT and PolyPhen. You can query using the score {protein_score}[<|>|<=|>=]{number} or the description {protein_score}[~=|=]{description} e.g. polyphen>0.1,sift=tolerant", required = false, arity = 1) public String variantQueryProteinSubstitution; - @Parameter(names = {"--variant-query-conservation"}, description = "The body web service conservation parameter", required = false, arity = 1) + @Parameter(names = {"--variant-query-conservation"}, description = "Filter by conservation score: {conservation_score}[<|>|<=|>=]{number} e.g. phastCons>0.5,phylop<0.1,gerp>0.1", required = false, arity = 1) public String variantQueryConservation; - @Parameter(names = {"--variant-query-population-frequency-maf"}, description = "The body web service populationFrequencyMaf parameter", required = false, arity = 1) + @Parameter(names = {"--variant-query-population-frequency-maf"}, description = "Population minor allele frequency: {study}:{population}[<|>|<=|>=]{number}. e.g. 1000G:ALL<0.01", required = false, arity = 1) public String variantQueryPopulationFrequencyMaf; - @Parameter(names = {"--variant-query-population-frequency-alt"}, description = "The body web service populationFrequencyAlt parameter", required = false, arity = 1) + @Parameter(names = {"--variant-query-population-frequency-alt"}, description = "Alternate Population Frequency: {study}:{population}[<|>|<=|>=]{number}. e.g. 1000G:ALL<0.01", required = false, arity = 1) public String variantQueryPopulationFrequencyAlt; - @Parameter(names = {"--variant-query-population-frequency-ref"}, description = "The body web service populationFrequencyRef parameter", required = false, arity = 1) + @Parameter(names = {"--variant-query-population-frequency-ref"}, description = "Reference Population Frequency: {study}:{population}[<|>|<=|>=]{number}. e.g. 1000G:ALL<0.01", required = false, arity = 1) public String variantQueryPopulationFrequencyRef; - @Parameter(names = {"--variant-query-transcript-flag"}, description = "The body web service transcriptFlag parameter", required = false, arity = 1) + @Parameter(names = {"--variant-query-transcript-flag"}, description = "List of transcript flags. e.g. canonical, CCDS, basic, LRG, MANE Select, MANE Plus Clinical, EGLH_HaemOnc, TSO500", required = false, arity = 1) public String variantQueryTranscriptFlag; - @Parameter(names = {"--variant-query-functional-score"}, description = "The body web service functionalScore parameter", required = false, arity = 1) + @Parameter(names = {"--variant-query-functional-score"}, description = "Functional score: {functional_score}[<|>|<=|>=]{number} e.g. cadd_scaled>5.2 , cadd_raw<=0.3", required = false, arity = 1) public String variantQueryFunctionalScore; - @Parameter(names = {"--variant-query-clinical"}, description = "The body web service clinical parameter", required = false, arity = 1) + @Parameter(names = {"--variant-query-clinical"}, description = "Clinical source: clinvar, cosmic", required = false, arity = 1) public String variantQueryClinical; - @Parameter(names = {"--variant-query-clinical-significance"}, description = "The body web service clinicalSignificance parameter", required = false, arity = 1) + @Parameter(names = {"--variant-query-clinical-significance"}, description = "Clinical significance: benign, likely_benign, likely_pathogenic, pathogenic", required = false, arity = 1) public String variantQueryClinicalSignificance; - @Parameter(names = {"--variant-query-clinical-confirmed-status"}, description = "The body web service clinicalConfirmedStatus parameter", required = false, help = true, arity = 0) + @Parameter(names = {"--variant-query-clinical-confirmed-status"}, description = "Clinical confirmed status", required = false, help = true, arity = 0) public boolean variantQueryClinicalConfirmedStatus = false; @Parameter(names = {"--variant-query-sample-data"}, description = "The body web service sampleData parameter", required = false, arity = 1) diff --git a/opencga-client/src/main/R/R/Clinical-methods.R b/opencga-client/src/main/R/R/Clinical-methods.R index a45c200d12e..aac2e841e27 100644 --- a/opencga-client/src/main/R/R/Clinical-methods.R +++ b/opencga-client/src/main/R/R/Clinical-methods.R @@ -42,7 +42,7 @@ #' | queryRgaVariant | /{apiVersion}/analysis/clinical/rga/variant/query | include, exclude, limit, skip, count, includeIndividual, skipIndividual, limitIndividual, sampleId, individualId, sex, phenotypes, disorders, numParents, geneId, geneName, chromosome, start, end, transcriptId, variants, dbSnps, knockoutType, filter, type, clinicalSignificance, populationFrequency, consequenceType, study | #' | summaryRgaVariant | /{apiVersion}/analysis/clinical/rga/variant/summary | limit, skip, count, sampleId, individualId, sex, phenotypes, disorders, numParents, geneId, geneName, chromosome, start, end, transcriptId, variants, dbSnps, knockoutType, filter, type, clinicalSignificance, populationFrequency, consequenceType, study | #' | search | /{apiVersion}/analysis/clinical/search | include, exclude, limit, skip, count, flattenAnnotations, study, id, uuid, type, disorder, files, sample, individual, proband, probandSamples, family, familyMembers, familyMemberSamples, panels, locked, analystId, priority, flags, creationDate, modificationDate, dueDate, qualityControlSummary, release, snapshot, status, internalStatus, annotation, deleted | -#' | queryVariant | /{apiVersion}/analysis/clinical/variant/query | include, exclude, limit, skip, count, approximateCount, approximateCountSamplingSize, savedFilter, includeInterpretation, id, region, type, study, file, filter, qual, fileData, sample, sampleData, sampleAnnotation, cohort, cohortStatsRef, cohortStatsAlt, cohortStatsMaf, cohortStatsMgf, cohortStatsPass, missingAlleles, missingGenotypes, score, family, familyDisorder, familySegregation, familyMembers, familyProband, gene, ct, xref, biotype, proteinSubstitution, conservation, populationFrequencyAlt, populationFrequencyRef, populationFrequencyMaf, transcriptFlag, geneTraitId, go, expression, proteinKeyword, drug, functionalScore, clinical, clinicalSignificance, clinicalConfirmedStatus, customAnnotation, panel, panelModeOfInheritance, panelConfidence, panelRoleInCancer, panelFeatureType, panelIntersection, trait | +#' | queryVariant | /{apiVersion}/analysis/clinical/variant/query | include, exclude, limit, skip, count, approximateCount, approximateCountSamplingSize, savedFilter, includeInterpretation, id, region, type, study, file, filter, qual, fileData, sample, sampleData, sampleAnnotation, cohort, cohortStatsRef, cohortStatsAlt, cohortStatsMaf, cohortStatsMgf, cohortStatsPass, missingAlleles, missingGenotypes, score, family, familyDisorder, familySegregation, familyMembers, familyProband, gene, ct, xref, biotype, proteinSubstitution, conservation, populationFrequencyAlt, populationFrequencyRef, populationFrequencyMaf, transcriptFlag, geneTraitId, go, expression, proteinKeyword, drug, functionalScore, clinical, clinicalSignificance, clinicalConfirmedStatus, customAnnotation, panel, panelModeOfInheritance, panelConfidence, panelRoleInCancer, panelFeatureType, panelIntersection, source, trait | #' | acl | /{apiVersion}/analysis/clinical/{clinicalAnalyses}/acl | clinicalAnalyses[*], study, member, silent | #' | delete | /{apiVersion}/analysis/clinical/{clinicalAnalyses}/delete | study, force, clinicalAnalyses[*] | #' | update | /{apiVersion}/analysis/clinical/{clinicalAnalyses}/update | include, exclude, clinicalAnalyses[*], study, commentsAction, flagsAction, analystsAction, filesAction, panelsAction, annotationSetsAction, includeResult, body[*] | @@ -585,7 +585,7 @@ setMethod("clinicalClient", "OpencgaR", function(OpencgaR, annotationSet, clinic #' @param filter Specify the FILTER for any of the files. If 'file' filter is provided, will match the file and the filter. e.g.: PASS,LowGQX. #' @param qual Specify the QUAL for any of the files. If 'file' filter is provided, will match the file and the qual. e.g.: >123.4. #' @param fileData Filter by file data (i.e. FILTER, QUAL and INFO columns from VCF file). [{file}:]{key}{op}{value}[,;]* . If no file is specified, will use all files from "file" filter. e.g. AN>200 or file_1.vcf:AN>200;file_2.vcf:AN<10 . Many fields can be combined. e.g. file_1.vcf:AN>200;DB=true;file_2.vcf:AN<10,FILTER=PASS,LowDP. - #' @param sample Filter variants by sample genotype. This will automatically set 'includeSample' parameter when not provided. This filter accepts multiple 3 forms: 1) List of samples: Samples that contain the main variant. Accepts AND (;) and OR (,) operators. e.g. HG0097,HG0098 . 2) List of samples with genotypes: {sample}:{gt1},{gt2}. Accepts AND (;) and OR (,) operators. e.g. HG0097:0/0;HG0098:0/1,1/1 . Unphased genotypes (e.g. 0/1, 1/1) will also include phased genotypes (e.g. 0|1, 1|0, 1|1), but not vice versa. When filtering by multi-allelic genotypes, any secondary allele will match, regardless of its position e.g. 1/2 will match with genotypes 1/2, 1/3, 1/4, .... Genotype aliases accepted: HOM_REF, HOM_ALT, HET, HET_REF, HET_ALT, HET_MISS and MISS e.g. HG0097:HOM_REF;HG0098:HET_REF,HOM_ALT . 3) Sample with segregation mode: {sample}:{segregation}. Only one sample accepted.Accepted segregation modes: [ autosomalDominant, autosomalRecessive, XLinkedDominant, XLinkedRecessive, YLinked, mitochondrial, deNovo, deNovoStrict, mendelianError, compoundHeterozygous ]. Value is case insensitive. e.g. HG0097:DeNovo Sample must have parents defined and indexed. . + #' @param sample Filter variants by sample genotype. This will automatically set 'includeSample' parameter when not provided. This filter accepts multiple 3 forms: 1) List of samples: Samples that contain the main variant. Accepts AND ';' and OR ',' operators. e.g. HG0097,HG0098 . 2) List of samples with genotypes: {sample}:{gt1},{gt2}. Accepts AND ';' and OR ',' operators. e.g. HG0097:0/0;HG0098:0/1,1/1 . Unphased genotypes (e.g. 0/1, 1/1) will also include phased genotypes (e.g. 0|1, 1|0, 1|1), but not vice versa. When filtering by multi-allelic genotypes, any secondary allele will match, regardless of its position e.g. 1/2 will match with genotypes 1/2, 1/3, 1/4, .... Genotype aliases accepted: HOM_REF, HOM_ALT, HET, HET_REF, HET_ALT, HET_MISS and MISS e.g. HG0097:HOM_REF;HG0098:HET_REF,HOM_ALT . 3) Sample with segregation mode: {sample}:{segregation}. Only one sample accepted.Accepted segregation modes: [ autosomalDominant, autosomalRecessive, XLinkedDominant, XLinkedRecessive, YLinked, mitochondrial, deNovo, deNovoStrict, mendelianError, compoundHeterozygous ]. Value is case insensitive. e.g. HG0097:DeNovo Sample must have parents defined and indexed. . #' @param sampleData Filter by any SampleData field from samples. [{sample}:]{key}{op}{value}[,;]* . If no sample is specified, will use all samples from "sample" or "genotype" filter. e.g. DP>200 or HG0097:DP>200,HG0098:DP<10 . Many FORMAT fields can be combined. e.g. HG0097:DP>200;GT=1/1,0/1,HG0098:DP<10. #' @param sampleAnnotation Selects some samples using metadata information from Catalog. e.g. age>20;phenotype=hpo:123,hpo:456;name=smith. #' @param cohort Select variants with calculated stats for the selected cohorts. @@ -628,6 +628,7 @@ setMethod("clinicalClient", "OpencgaR", function(OpencgaR, annotationSet, clinic #' @param panelRoleInCancer Filter genes from specific panels that match certain role in cancer. Accepted values : [ both, oncogene, tumorSuppressorGene, fusion ]. #' @param panelFeatureType Filter elements from specific panels by type. Accepted values : [ gene, region, str, variant ]. #' @param panelIntersection Intersect panel genes and regions with given genes and regions from que input query. This will prevent returning variants from regions out of the panel. + #' @param source Select the variant data source from where to fetch the data. Accepted values are 'variant_index' (default), 'secondary_annotation_index' and 'secondary_sample_index'. When selecting a secondary_index, the data will be retrieved exclusively from that secondary index, and the 'include/exclude' parameters will be ignored. Some data might be missing or be partial. #' @param trait List of traits, based on ClinVar, HPO, COSMIC, i.e.: IDs, histologies, descriptions,... queryVariant=fetchOpenCGA(object=OpencgaR, category="analysis", categoryId=NULL, subcategory="clinical/variant", subcategoryId=NULL, action="query", params=params, httpMethod="GET", diff --git a/opencga-client/src/main/R/R/Variant-methods.R b/opencga-client/src/main/R/R/Variant-methods.R index 5413a7604b5..0686020512d 100644 --- a/opencga-client/src/main/R/R/Variant-methods.R +++ b/opencga-client/src/main/R/R/Variant-methods.R @@ -46,7 +46,7 @@ #' | queryMutationalSignature | /{apiVersion}/analysis/variant/mutationalSignature/query | study, sample, type, ct, biotype, fileData, filter, qual, region, gene, panel, panelModeOfInheritance, panelConfidence, panelFeatureType, panelRoleInCancer, panelIntersection, msId, msDescription | #' | runMutationalSignature | /{apiVersion}/analysis/variant/mutationalSignature/run | study, jobId, jobDescription, jobDependsOn, jobTags, jobScheduledStartTime, jobPriority, jobDryRun, body[*] | #' | runPlink | /{apiVersion}/analysis/variant/plink/run | study, jobId, jobDescription, jobDependsOn, jobTags, jobScheduledStartTime, jobPriority, jobDryRun, body[*] | -#' | query | /{apiVersion}/analysis/variant/query | include, exclude, limit, skip, count, sort, summary, approximateCount, approximateCountSamplingSize, savedFilter, id, region, type, reference, alternate, project, study, file, filter, qual, fileData, sample, genotype, sampleData, sampleAnnotation, sampleMetadata, unknownGenotype, sampleLimit, sampleSkip, cohort, cohortStatsRef, cohortStatsAlt, cohortStatsMaf, cohortStatsMgf, cohortStatsPass, missingAlleles, missingGenotypes, score, family, familyDisorder, familySegregation, familyMembers, familyProband, includeStudy, includeFile, includeSample, includeSampleData, includeGenotype, includeSampleId, annotationExists, gene, ct, xref, biotype, proteinSubstitution, conservation, populationFrequencyAlt, populationFrequencyRef, populationFrequencyMaf, transcriptFlag, geneTraitId, go, expression, proteinKeyword, drug, functionalScore, clinical, clinicalSignificance, clinicalConfirmedStatus, customAnnotation, panel, panelModeOfInheritance, panelConfidence, panelRoleInCancer, panelFeatureType, panelIntersection, trait | +#' | query | /{apiVersion}/analysis/variant/query | include, exclude, limit, skip, count, sort, summary, approximateCount, approximateCountSamplingSize, savedFilter, id, region, type, reference, alternate, project, study, file, filter, qual, fileData, sample, genotype, sampleData, sampleAnnotation, sampleMetadata, unknownGenotype, sampleLimit, sampleSkip, cohort, cohortStatsRef, cohortStatsAlt, cohortStatsMaf, cohortStatsMgf, cohortStatsPass, missingAlleles, missingGenotypes, score, family, familyDisorder, familySegregation, familyMembers, familyProband, includeStudy, includeFile, includeSample, includeSampleData, includeGenotype, includeSampleId, annotationExists, gene, ct, xref, biotype, proteinSubstitution, conservation, populationFrequencyAlt, populationFrequencyRef, populationFrequencyMaf, transcriptFlag, geneTraitId, go, expression, proteinKeyword, drug, functionalScore, clinical, clinicalSignificance, clinicalConfirmedStatus, customAnnotation, panel, panelModeOfInheritance, panelConfidence, panelRoleInCancer, panelFeatureType, panelIntersection, source, trait | #' | runRelatedness | /{apiVersion}/analysis/variant/relatedness/run | study, jobId, jobDescription, jobDependsOn, jobTags, jobScheduledStartTime, jobPriority, jobDryRun, body[*] | #' | runRvtests | /{apiVersion}/analysis/variant/rvtests/run | study, jobId, jobDescription, jobDependsOn, jobTags, jobScheduledStartTime, jobPriority, jobDryRun, body[*] | #' | aggregationStatsSample | /{apiVersion}/analysis/variant/sample/aggregationStats | savedFilter, region, type, project, study, file, filter, sample, genotype, sampleAnnotation, family, familyDisorder, familySegregation, familyMembers, familyProband, ct, biotype, populationFrequencyAlt, clinical, clinicalSignificance, clinicalConfirmedStatus, field | @@ -398,7 +398,7 @@ setMethod("variantClient", "OpencgaR", function(OpencgaR, endpointName, params=N #' @param project Project [organization@]project where project can be either the ID or the alias. #' @param study Filter variants from the given studies, these can be either the numeric ID or the alias with the format organization@project:study. #' @param file Filter variants from the files specified. This will set includeFile parameter when not provided. - #' @param sample Filter variants by sample genotype. This will automatically set 'includeSample' parameter when not provided. This filter accepts multiple 3 forms: 1) List of samples: Samples that contain the main variant. Accepts AND (;) and OR (,) operators. e.g. HG0097,HG0098 . 2) List of samples with genotypes: {sample}:{gt1},{gt2}. Accepts AND (;) and OR (,) operators. e.g. HG0097:0/0;HG0098:0/1,1/1 . Unphased genotypes (e.g. 0/1, 1/1) will also include phased genotypes (e.g. 0|1, 1|0, 1|1), but not vice versa. When filtering by multi-allelic genotypes, any secondary allele will match, regardless of its position e.g. 1/2 will match with genotypes 1/2, 1/3, 1/4, .... Genotype aliases accepted: HOM_REF, HOM_ALT, HET, HET_REF, HET_ALT, HET_MISS and MISS e.g. HG0097:HOM_REF;HG0098:HET_REF,HOM_ALT . 3) Sample with segregation mode: {sample}:{segregation}. Only one sample accepted.Accepted segregation modes: [ autosomalDominant, autosomalRecessive, XLinkedDominant, XLinkedRecessive, YLinked, mitochondrial, deNovo, deNovoStrict, mendelianError, compoundHeterozygous ]. Value is case insensitive. e.g. HG0097:DeNovo Sample must have parents defined and indexed. . + #' @param sample Filter variants by sample genotype. This will automatically set 'includeSample' parameter when not provided. This filter accepts multiple 3 forms: 1) List of samples: Samples that contain the main variant. Accepts AND ';' and OR ',' operators. e.g. HG0097,HG0098 . 2) List of samples with genotypes: {sample}:{gt1},{gt2}. Accepts AND ';' and OR ',' operators. e.g. HG0097:0/0;HG0098:0/1,1/1 . Unphased genotypes (e.g. 0/1, 1/1) will also include phased genotypes (e.g. 0|1, 1|0, 1|1), but not vice versa. When filtering by multi-allelic genotypes, any secondary allele will match, regardless of its position e.g. 1/2 will match with genotypes 1/2, 1/3, 1/4, .... Genotype aliases accepted: HOM_REF, HOM_ALT, HET, HET_REF, HET_ALT, HET_MISS and MISS e.g. HG0097:HOM_REF;HG0098:HET_REF,HOM_ALT . 3) Sample with segregation mode: {sample}:{segregation}. Only one sample accepted.Accepted segregation modes: [ autosomalDominant, autosomalRecessive, XLinkedDominant, XLinkedRecessive, YLinked, mitochondrial, deNovo, deNovoStrict, mendelianError, compoundHeterozygous ]. Value is case insensitive. e.g. HG0097:DeNovo Sample must have parents defined and indexed. . #' @param includeStudy List of studies to include in the result. Accepts 'all' and 'none'. #' @param includeFile List of files to be returned. Accepts 'all' and 'none'. If undefined, automatically includes files used for filtering. If none, no file is included. #' @param includeSample List of samples to be included in the result. Accepts 'all' and 'none'. If undefined, automatically includes samples used for filtering. If none, no sample is included. @@ -483,7 +483,7 @@ setMethod("variantClient", "OpencgaR", function(OpencgaR, endpointName, params=N #' @param filter Specify the FILTER for any of the files. If 'file' filter is provided, will match the file and the filter. e.g.: PASS,LowGQX. #' @param qual Specify the QUAL for any of the files. If 'file' filter is provided, will match the file and the qual. e.g.: >123.4. #' @param fileData Filter by file data (i.e. FILTER, QUAL and INFO columns from VCF file). [{file}:]{key}{op}{value}[,;]* . If no file is specified, will use all files from "file" filter. e.g. AN>200 or file_1.vcf:AN>200;file_2.vcf:AN<10 . Many fields can be combined. e.g. file_1.vcf:AN>200;DB=true;file_2.vcf:AN<10,FILTER=PASS,LowDP. - #' @param sample Filter variants by sample genotype. This will automatically set 'includeSample' parameter when not provided. This filter accepts multiple 3 forms: 1) List of samples: Samples that contain the main variant. Accepts AND (;) and OR (,) operators. e.g. HG0097,HG0098 . 2) List of samples with genotypes: {sample}:{gt1},{gt2}. Accepts AND (;) and OR (,) operators. e.g. HG0097:0/0;HG0098:0/1,1/1 . Unphased genotypes (e.g. 0/1, 1/1) will also include phased genotypes (e.g. 0|1, 1|0, 1|1), but not vice versa. When filtering by multi-allelic genotypes, any secondary allele will match, regardless of its position e.g. 1/2 will match with genotypes 1/2, 1/3, 1/4, .... Genotype aliases accepted: HOM_REF, HOM_ALT, HET, HET_REF, HET_ALT, HET_MISS and MISS e.g. HG0097:HOM_REF;HG0098:HET_REF,HOM_ALT . 3) Sample with segregation mode: {sample}:{segregation}. Only one sample accepted.Accepted segregation modes: [ autosomalDominant, autosomalRecessive, XLinkedDominant, XLinkedRecessive, YLinked, mitochondrial, deNovo, deNovoStrict, mendelianError, compoundHeterozygous ]. Value is case insensitive. e.g. HG0097:DeNovo Sample must have parents defined and indexed. . + #' @param sample Filter variants by sample genotype. This will automatically set 'includeSample' parameter when not provided. This filter accepts multiple 3 forms: 1) List of samples: Samples that contain the main variant. Accepts AND ';' and OR ',' operators. e.g. HG0097,HG0098 . 2) List of samples with genotypes: {sample}:{gt1},{gt2}. Accepts AND ';' and OR ',' operators. e.g. HG0097:0/0;HG0098:0/1,1/1 . Unphased genotypes (e.g. 0/1, 1/1) will also include phased genotypes (e.g. 0|1, 1|0, 1|1), but not vice versa. When filtering by multi-allelic genotypes, any secondary allele will match, regardless of its position e.g. 1/2 will match with genotypes 1/2, 1/3, 1/4, .... Genotype aliases accepted: HOM_REF, HOM_ALT, HET, HET_REF, HET_ALT, HET_MISS and MISS e.g. HG0097:HOM_REF;HG0098:HET_REF,HOM_ALT . 3) Sample with segregation mode: {sample}:{segregation}. Only one sample accepted.Accepted segregation modes: [ autosomalDominant, autosomalRecessive, XLinkedDominant, XLinkedRecessive, YLinked, mitochondrial, deNovo, deNovoStrict, mendelianError, compoundHeterozygous ]. Value is case insensitive. e.g. HG0097:DeNovo Sample must have parents defined and indexed. . #' @param genotype Samples with a specific genotype: {samp_1}:{gt_1}(,{gt_n})*(;{samp_n}:{gt_1}(,{gt_n})*)* e.g. HG0097:0/0;HG0098:0/1,1/1. Unphased genotypes (e.g. 0/1, 1/1) will also include phased genotypes (e.g. 0|1, 1|0, 1|1), but not vice versa. When filtering by multi-allelic genotypes, any secondary allele will match, regardless of its position e.g. 1/2 will match with genotypes 1/2, 1/3, 1/4, .... Genotype aliases accepted: HOM_REF, HOM_ALT, HET, HET_REF, HET_ALT, HET_MISS and MISS e.g. HG0097:HOM_REF;HG0098:HET_REF,HOM_ALT. This will automatically set 'includeSample' parameter when not provided. #' @param sampleData Filter by any SampleData field from samples. [{sample}:]{key}{op}{value}[,;]* . If no sample is specified, will use all samples from "sample" or "genotype" filter. e.g. DP>200 or HG0097:DP>200,HG0098:DP<10 . Many FORMAT fields can be combined. e.g. HG0097:DP>200;GT=1/1,0/1,HG0098:DP<10. #' @param sampleAnnotation Selects some samples using metadata information from Catalog. e.g. age>20;phenotype=hpo:123,hpo:456;name=smith. @@ -538,6 +538,7 @@ setMethod("variantClient", "OpencgaR", function(OpencgaR, endpointName, params=N #' @param panelRoleInCancer Filter genes from specific panels that match certain role in cancer. Accepted values : [ both, oncogene, tumorSuppressorGene, fusion ]. #' @param panelFeatureType Filter elements from specific panels by type. Accepted values : [ gene, region, str, variant ]. #' @param panelIntersection Intersect panel genes and regions with given genes and regions from que input query. This will prevent returning variants from regions out of the panel. + #' @param source Select the variant data source from where to fetch the data. Accepted values are 'variant_index' (default), 'secondary_annotation_index' and 'secondary_sample_index'. When selecting a secondary_index, the data will be retrieved exclusively from that secondary index, and the 'include/exclude' parameters will be ignored. Some data might be missing or be partial. #' @param trait List of traits, based on ClinVar, HPO, COSMIC, i.e.: IDs, histologies, descriptions,... query=fetchOpenCGA(object=OpencgaR, category="analysis", categoryId=NULL, subcategory="variant", subcategoryId=NULL, action="query", params=params, httpMethod="GET", as.queryParam=NULL, ...), @@ -580,7 +581,7 @@ setMethod("variantClient", "OpencgaR", function(OpencgaR, endpointName, params=N #' @param study Filter variants from the given studies, these can be either the numeric ID or the alias with the format organization@project:study. #' @param file Filter variants from the files specified. This will set includeFile parameter when not provided. #' @param filter Specify the FILTER for any of the files. If 'file' filter is provided, will match the file and the filter. e.g.: PASS,LowGQX. - #' @param sample Filter variants by sample genotype. This will automatically set 'includeSample' parameter when not provided. This filter accepts multiple 3 forms: 1) List of samples: Samples that contain the main variant. Accepts AND (;) and OR (,) operators. e.g. HG0097,HG0098 . 2) List of samples with genotypes: {sample}:{gt1},{gt2}. Accepts AND (;) and OR (,) operators. e.g. HG0097:0/0;HG0098:0/1,1/1 . Unphased genotypes (e.g. 0/1, 1/1) will also include phased genotypes (e.g. 0|1, 1|0, 1|1), but not vice versa. When filtering by multi-allelic genotypes, any secondary allele will match, regardless of its position e.g. 1/2 will match with genotypes 1/2, 1/3, 1/4, .... Genotype aliases accepted: HOM_REF, HOM_ALT, HET, HET_REF, HET_ALT, HET_MISS and MISS e.g. HG0097:HOM_REF;HG0098:HET_REF,HOM_ALT . 3) Sample with segregation mode: {sample}:{segregation}. Only one sample accepted.Accepted segregation modes: [ autosomalDominant, autosomalRecessive, XLinkedDominant, XLinkedRecessive, YLinked, mitochondrial, deNovo, deNovoStrict, mendelianError, compoundHeterozygous ]. Value is case insensitive. e.g. HG0097:DeNovo Sample must have parents defined and indexed. . + #' @param sample Filter variants by sample genotype. This will automatically set 'includeSample' parameter when not provided. This filter accepts multiple 3 forms: 1) List of samples: Samples that contain the main variant. Accepts AND ';' and OR ',' operators. e.g. HG0097,HG0098 . 2) List of samples with genotypes: {sample}:{gt1},{gt2}. Accepts AND ';' and OR ',' operators. e.g. HG0097:0/0;HG0098:0/1,1/1 . Unphased genotypes (e.g. 0/1, 1/1) will also include phased genotypes (e.g. 0|1, 1|0, 1|1), but not vice versa. When filtering by multi-allelic genotypes, any secondary allele will match, regardless of its position e.g. 1/2 will match with genotypes 1/2, 1/3, 1/4, .... Genotype aliases accepted: HOM_REF, HOM_ALT, HET, HET_REF, HET_ALT, HET_MISS and MISS e.g. HG0097:HOM_REF;HG0098:HET_REF,HOM_ALT . 3) Sample with segregation mode: {sample}:{segregation}. Only one sample accepted.Accepted segregation modes: [ autosomalDominant, autosomalRecessive, XLinkedDominant, XLinkedRecessive, YLinked, mitochondrial, deNovo, deNovoStrict, mendelianError, compoundHeterozygous ]. Value is case insensitive. e.g. HG0097:DeNovo Sample must have parents defined and indexed. . #' @param genotype Samples with a specific genotype: {samp_1}:{gt_1}(,{gt_n})*(;{samp_n}:{gt_1}(,{gt_n})*)* e.g. HG0097:0/0;HG0098:0/1,1/1. Unphased genotypes (e.g. 0/1, 1/1) will also include phased genotypes (e.g. 0|1, 1|0, 1|1), but not vice versa. When filtering by multi-allelic genotypes, any secondary allele will match, regardless of its position e.g. 1/2 will match with genotypes 1/2, 1/3, 1/4, .... Genotype aliases accepted: HOM_REF, HOM_ALT, HET, HET_REF, HET_ALT, HET_MISS and MISS e.g. HG0097:HOM_REF;HG0098:HET_REF,HOM_ALT. This will automatically set 'includeSample' parameter when not provided. #' @param sampleAnnotation Selects some samples using metadata information from Catalog. e.g. age>20;phenotype=hpo:123,hpo:456;name=smith. #' @param family Filter variants where any of the samples from the given family contains the variant (HET or HOM_ALT). diff --git a/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/ClinicalAnalysisClient.java b/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/ClinicalAnalysisClient.java index 7e94ff82723..317ee2180c1 100644 --- a/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/ClinicalAnalysisClient.java +++ b/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/ClinicalAnalysisClient.java @@ -762,8 +762,8 @@ public RestResponse search(ObjectMap params) throws ClientExce * is specified, will use all files from "file" filter. e.g. AN>200 or file_1.vcf:AN>200;file_2.vcf:AN<10 . Many fields can * be combined. e.g. file_1.vcf:AN>200;DB=true;file_2.vcf:AN<10,FILTER=PASS,LowDP. * sample: Filter variants by sample genotype. This will automatically set 'includeSample' parameter when not provided. This - * filter accepts multiple 3 forms: 1) List of samples: Samples that contain the main variant. Accepts AND (;) and OR (,) - * operators. e.g. HG0097,HG0098 . 2) List of samples with genotypes: {sample}:{gt1},{gt2}. Accepts AND (;) and OR (,) + * filter accepts multiple 3 forms: 1) List of samples: Samples that contain the main variant. Accepts AND ';' and OR ',' + * operators. e.g. HG0097,HG0098 . 2) List of samples with genotypes: {sample}:{gt1},{gt2}. Accepts AND ';' and OR ',' * operators. e.g. HG0097:0/0;HG0098:0/1,1/1 . Unphased genotypes (e.g. 0/1, 1/1) will also include phased genotypes (e.g. * 0|1, 1|0, 1|1), but not vice versa. When filtering by multi-allelic genotypes, any secondary allele will match, * regardless of its position e.g. 1/2 will match with genotypes 1/2, 1/3, 1/4, .... Genotype aliases accepted: HOM_REF, @@ -826,6 +826,10 @@ public RestResponse search(ObjectMap params) throws ClientExce * panelFeatureType: Filter elements from specific panels by type. Accepted values : [ gene, region, str, variant ]. * panelIntersection: Intersect panel genes and regions with given genes and regions from que input query. This will prevent * returning variants from regions out of the panel. + * source: Select the variant data source from where to fetch the data. Accepted values are 'variant_index' (default), + * 'secondary_annotation_index' and 'secondary_sample_index'. When selecting a secondary_index, the data will be retrieved + * exclusively from that secondary index, and the 'include/exclude' parameters will be ignored. Some data might be missing + * or be partial. * trait: List of traits, based on ClinVar, HPO, COSMIC, i.e.: IDs, histologies, descriptions,... * @return a RestResponse object. * @throws ClientException ClientException if there is any server error. diff --git a/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/VariantClient.java b/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/VariantClient.java index 6a68ae8ea82..b78d73dda9b 100644 --- a/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/VariantClient.java +++ b/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/VariantClient.java @@ -579,8 +579,8 @@ public RestResponse runMendelianError(MendelianErrorAnalysisParams data, Ob * organization@project:study. * file: Filter variants from the files specified. This will set includeFile parameter when not provided. * sample: Filter variants by sample genotype. This will automatically set 'includeSample' parameter when not provided. This - * filter accepts multiple 3 forms: 1) List of samples: Samples that contain the main variant. Accepts AND (;) and OR (,) - * operators. e.g. HG0097,HG0098 . 2) List of samples with genotypes: {sample}:{gt1},{gt2}. Accepts AND (;) and OR (,) + * filter accepts multiple 3 forms: 1) List of samples: Samples that contain the main variant. Accepts AND ';' and OR ',' + * operators. e.g. HG0097,HG0098 . 2) List of samples with genotypes: {sample}:{gt1},{gt2}. Accepts AND ';' and OR ',' * operators. e.g. HG0097:0/0;HG0098:0/1,1/1 . Unphased genotypes (e.g. 0/1, 1/1) will also include phased genotypes (e.g. * 0|1, 1|0, 1|1), but not vice versa. When filtering by multi-allelic genotypes, any secondary allele will match, * regardless of its position e.g. 1/2 will match with genotypes 1/2, 1/3, 1/4, .... Genotype aliases accepted: HOM_REF, @@ -720,8 +720,8 @@ public RestResponse runPlink(PlinkWrapperParams data, ObjectMap params) thr * is specified, will use all files from "file" filter. e.g. AN>200 or file_1.vcf:AN>200;file_2.vcf:AN<10 . Many fields can * be combined. e.g. file_1.vcf:AN>200;DB=true;file_2.vcf:AN<10,FILTER=PASS,LowDP. * sample: Filter variants by sample genotype. This will automatically set 'includeSample' parameter when not provided. This - * filter accepts multiple 3 forms: 1) List of samples: Samples that contain the main variant. Accepts AND (;) and OR (,) - * operators. e.g. HG0097,HG0098 . 2) List of samples with genotypes: {sample}:{gt1},{gt2}. Accepts AND (;) and OR (,) + * filter accepts multiple 3 forms: 1) List of samples: Samples that contain the main variant. Accepts AND ';' and OR ',' + * operators. e.g. HG0097,HG0098 . 2) List of samples with genotypes: {sample}:{gt1},{gt2}. Accepts AND ';' and OR ',' * operators. e.g. HG0097:0/0;HG0098:0/1,1/1 . Unphased genotypes (e.g. 0/1, 1/1) will also include phased genotypes (e.g. * 0|1, 1|0, 1|1), but not vice versa. When filtering by multi-allelic genotypes, any secondary allele will match, * regardless of its position e.g. 1/2 will match with genotypes 1/2, 1/3, 1/4, .... Genotype aliases accepted: HOM_REF, @@ -805,6 +805,10 @@ public RestResponse runPlink(PlinkWrapperParams data, ObjectMap params) thr * panelFeatureType: Filter elements from specific panels by type. Accepted values : [ gene, region, str, variant ]. * panelIntersection: Intersect panel genes and regions with given genes and regions from que input query. This will prevent * returning variants from regions out of the panel. + * source: Select the variant data source from where to fetch the data. Accepted values are 'variant_index' (default), + * 'secondary_annotation_index' and 'secondary_sample_index'. When selecting a secondary_index, the data will be retrieved + * exclusively from that secondary index, and the 'include/exclude' parameters will be ignored. Some data might be missing + * or be partial. * trait: List of traits, based on ClinVar, HPO, COSMIC, i.e.: IDs, histologies, descriptions,... * @return a RestResponse object. * @throws ClientException ClientException if there is any server error. @@ -873,8 +877,8 @@ public RestResponse runRvtests(RvtestsWrapperParams data, ObjectMap params) * filter: Specify the FILTER for any of the files. If 'file' filter is provided, will match the file and the filter. e.g.: * PASS,LowGQX. * sample: Filter variants by sample genotype. This will automatically set 'includeSample' parameter when not provided. This - * filter accepts multiple 3 forms: 1) List of samples: Samples that contain the main variant. Accepts AND (;) and OR (,) - * operators. e.g. HG0097,HG0098 . 2) List of samples with genotypes: {sample}:{gt1},{gt2}. Accepts AND (;) and OR (,) + * filter accepts multiple 3 forms: 1) List of samples: Samples that contain the main variant. Accepts AND ';' and OR ',' + * operators. e.g. HG0097,HG0098 . 2) List of samples with genotypes: {sample}:{gt1},{gt2}. Accepts AND ';' and OR ',' * operators. e.g. HG0097:0/0;HG0098:0/1,1/1 . Unphased genotypes (e.g. 0/1, 1/1) will also include phased genotypes (e.g. * 0|1, 1|0, 1|1), but not vice versa. When filtering by multi-allelic genotypes, any secondary allele will match, * regardless of its position e.g. 1/2 will match with genotypes 1/2, 1/3, 1/4, .... Genotype aliases accepted: HOM_REF, diff --git a/opencga-client/src/main/javascript/ClinicalAnalysis.js b/opencga-client/src/main/javascript/ClinicalAnalysis.js index 931d5fe01ce..015874e6631 100644 --- a/opencga-client/src/main/javascript/ClinicalAnalysis.js +++ b/opencga-client/src/main/javascript/ClinicalAnalysis.js @@ -650,8 +650,8 @@ export default class ClinicalAnalysis extends OpenCGAParentClass { * [{file}:]{key}{op}{value}[,;]* . If no file is specified, will use all files from "file" filter. e.g. AN>200 or * file_1.vcf:AN>200;file_2.vcf:AN<10 . Many fields can be combined. e.g. file_1.vcf:AN>200;DB=true;file_2.vcf:AN<10,FILTER=PASS,LowDP. * @param {String} [params.sample] - Filter variants by sample genotype. This will automatically set 'includeSample' parameter when not - * provided. This filter accepts multiple 3 forms: 1) List of samples: Samples that contain the main variant. Accepts AND (;) and OR (,) - * operators. e.g. HG0097,HG0098 . 2) List of samples with genotypes: {sample}:{gt1},{gt2}. Accepts AND (;) and OR (,) operators. e.g. + * provided. This filter accepts multiple 3 forms: 1) List of samples: Samples that contain the main variant. Accepts AND ';' and OR ',' + * operators. e.g. HG0097,HG0098 . 2) List of samples with genotypes: {sample}:{gt1},{gt2}. Accepts AND ';' and OR ',' operators. e.g. * HG0097:0/0;HG0098:0/1,1/1 . Unphased genotypes (e.g. 0/1, 1/1) will also include phased genotypes (e.g. 0|1, 1|0, 1|1), but not vice * versa. When filtering by multi-allelic genotypes, any secondary allele will match, regardless of its position e.g. 1/2 will match with * genotypes 1/2, 1/3, 1/4, .... Genotype aliases accepted: HOM_REF, HOM_ALT, HET, HET_REF, HET_ALT, HET_MISS and MISS e.g. @@ -723,6 +723,9 @@ export default class ClinicalAnalysis extends OpenCGAParentClass { * variant ]. * @param {Boolean} [params.panelIntersection] - Intersect panel genes and regions with given genes and regions from que input query. * This will prevent returning variants from regions out of the panel. + * @param {String} [params.source] - Select the variant data source from where to fetch the data. Accepted values are 'variant_index' + * (default), 'secondary_annotation_index' and 'secondary_sample_index'. When selecting a secondary_index, the data will be retrieved + * exclusively from that secondary index, and the 'include/exclude' parameters will be ignored. Some data might be missing or be partial. * @param {String} [params.trait] - List of traits, based on ClinVar, HPO, COSMIC, i.e.: IDs, histologies, descriptions,... * @returns {Promise} Promise object in the form of RestResponse instance. */ diff --git a/opencga-client/src/main/javascript/Variant.js b/opencga-client/src/main/javascript/Variant.js index 7d8b01966da..ae291e7a9e5 100644 --- a/opencga-client/src/main/javascript/Variant.js +++ b/opencga-client/src/main/javascript/Variant.js @@ -470,8 +470,8 @@ export default class Variant extends OpenCGAParentClass { * format organization@project:study. * @param {String} [params.file] - Filter variants from the files specified. This will set includeFile parameter when not provided. * @param {String} [params.sample] - Filter variants by sample genotype. This will automatically set 'includeSample' parameter when not - * provided. This filter accepts multiple 3 forms: 1) List of samples: Samples that contain the main variant. Accepts AND (;) and OR (,) - * operators. e.g. HG0097,HG0098 . 2) List of samples with genotypes: {sample}:{gt1},{gt2}. Accepts AND (;) and OR (,) operators. e.g. + * provided. This filter accepts multiple 3 forms: 1) List of samples: Samples that contain the main variant. Accepts AND ';' and OR ',' + * operators. e.g. HG0097,HG0098 . 2) List of samples with genotypes: {sample}:{gt1},{gt2}. Accepts AND ';' and OR ',' operators. e.g. * HG0097:0/0;HG0098:0/1,1/1 . Unphased genotypes (e.g. 0/1, 1/1) will also include phased genotypes (e.g. 0|1, 1|0, 1|1), but not vice * versa. When filtering by multi-allelic genotypes, any secondary allele will match, regardless of its position e.g. 1/2 will match with * genotypes 1/2, 1/3, 1/4, .... Genotype aliases accepted: HOM_REF, HOM_ALT, HET, HET_REF, HET_ALT, HET_MISS and MISS e.g. @@ -603,8 +603,8 @@ export default class Variant extends OpenCGAParentClass { * [{file}:]{key}{op}{value}[,;]* . If no file is specified, will use all files from "file" filter. e.g. AN>200 or * file_1.vcf:AN>200;file_2.vcf:AN<10 . Many fields can be combined. e.g. file_1.vcf:AN>200;DB=true;file_2.vcf:AN<10,FILTER=PASS,LowDP. * @param {String} [params.sample] - Filter variants by sample genotype. This will automatically set 'includeSample' parameter when not - * provided. This filter accepts multiple 3 forms: 1) List of samples: Samples that contain the main variant. Accepts AND (;) and OR (,) - * operators. e.g. HG0097,HG0098 . 2) List of samples with genotypes: {sample}:{gt1},{gt2}. Accepts AND (;) and OR (,) operators. e.g. + * provided. This filter accepts multiple 3 forms: 1) List of samples: Samples that contain the main variant. Accepts AND ';' and OR ',' + * operators. e.g. HG0097,HG0098 . 2) List of samples with genotypes: {sample}:{gt1},{gt2}. Accepts AND ';' and OR ',' operators. e.g. * HG0097:0/0;HG0098:0/1,1/1 . Unphased genotypes (e.g. 0/1, 1/1) will also include phased genotypes (e.g. 0|1, 1|0, 1|1), but not vice * versa. When filtering by multi-allelic genotypes, any secondary allele will match, regardless of its position e.g. 1/2 will match with * genotypes 1/2, 1/3, 1/4, .... Genotype aliases accepted: HOM_REF, HOM_ALT, HET, HET_REF, HET_ALT, HET_MISS and MISS e.g. @@ -696,6 +696,9 @@ export default class Variant extends OpenCGAParentClass { * variant ]. * @param {Boolean} [params.panelIntersection] - Intersect panel genes and regions with given genes and regions from que input query. * This will prevent returning variants from regions out of the panel. + * @param {String} [params.source] - Select the variant data source from where to fetch the data. Accepted values are 'variant_index' + * (default), 'secondary_annotation_index' and 'secondary_sample_index'. When selecting a secondary_index, the data will be retrieved + * exclusively from that secondary index, and the 'include/exclude' parameters will be ignored. Some data might be missing or be partial. * @param {String} [params.trait] - List of traits, based on ClinVar, HPO, COSMIC, i.e.: IDs, histologies, descriptions,... * @returns {Promise} Promise object in the form of RestResponse instance. */ @@ -755,8 +758,8 @@ export default class Variant extends OpenCGAParentClass { * @param {String} [params.filter] - Specify the FILTER for any of the files. If 'file' filter is provided, will match the file and the * filter. e.g.: PASS,LowGQX. * @param {String} [params.sample] - Filter variants by sample genotype. This will automatically set 'includeSample' parameter when not - * provided. This filter accepts multiple 3 forms: 1) List of samples: Samples that contain the main variant. Accepts AND (;) and OR (,) - * operators. e.g. HG0097,HG0098 . 2) List of samples with genotypes: {sample}:{gt1},{gt2}. Accepts AND (;) and OR (,) operators. e.g. + * provided. This filter accepts multiple 3 forms: 1) List of samples: Samples that contain the main variant. Accepts AND ';' and OR ',' + * operators. e.g. HG0097,HG0098 . 2) List of samples with genotypes: {sample}:{gt1},{gt2}. Accepts AND ';' and OR ',' operators. e.g. * HG0097:0/0;HG0098:0/1,1/1 . Unphased genotypes (e.g. 0/1, 1/1) will also include phased genotypes (e.g. 0|1, 1|0, 1|1), but not vice * versa. When filtering by multi-allelic genotypes, any secondary allele will match, regardless of its position e.g. 1/2 will match with * genotypes 1/2, 1/3, 1/4, .... Genotype aliases accepted: HOM_REF, HOM_ALT, HET, HET_REF, HET_ALT, HET_MISS and MISS e.g. diff --git a/opencga-client/src/main/python/pyopencga/rest_clients/clinical_analysis_client.py b/opencga-client/src/main/python/pyopencga/rest_clients/clinical_analysis_client.py index 0a531515217..70760afea27 100644 --- a/opencga-client/src/main/python/pyopencga/rest_clients/clinical_analysis_client.py +++ b/opencga-client/src/main/python/pyopencga/rest_clients/clinical_analysis_client.py @@ -814,9 +814,9 @@ def query_variant(self, **options): :param str sample: Filter variants by sample genotype. This will automatically set 'includeSample' parameter when not provided. This filter accepts multiple 3 forms: 1) List of samples: Samples that - contain the main variant. Accepts AND (;) and OR (,) operators. + contain the main variant. Accepts AND ';' and OR ',' operators. e.g. HG0097,HG0098 . 2) List of samples with genotypes: - {sample}:{gt1},{gt2}. Accepts AND (;) and OR (,) operators. e.g. + {sample}:{gt1},{gt2}. Accepts AND ';' and OR ',' operators. e.g. HG0097:0/0;HG0098:0/1,1/1 . Unphased genotypes (e.g. 0/1, 1/1) will also include phased genotypes (e.g. 0|1, 1|0, 1|1), but not vice versa. When filtering by multi-allelic genotypes, any secondary @@ -926,6 +926,12 @@ def query_variant(self, **options): :param bool panel_intersection: Intersect panel genes and regions with given genes and regions from que input query. This will prevent returning variants from regions out of the panel. + :param str source: Select the variant data source from where to fetch + the data. Accepted values are 'variant_index' (default), + 'secondary_annotation_index' and 'secondary_sample_index'. When + selecting a secondary_index, the data will be retrieved exclusively + from that secondary index, and the 'include/exclude' parameters + will be ignored. Some data might be missing or be partial. :param str trait: List of traits, based on ClinVar, HPO, COSMIC, i.e.: IDs, histologies, descriptions,... """ diff --git a/opencga-client/src/main/python/pyopencga/rest_clients/variant_client.py b/opencga-client/src/main/python/pyopencga/rest_clients/variant_client.py index 3993f48ba22..24aa650aa41 100644 --- a/opencga-client/src/main/python/pyopencga/rest_clients/variant_client.py +++ b/opencga-client/src/main/python/pyopencga/rest_clients/variant_client.py @@ -610,9 +610,9 @@ def metadata(self, **options): :param str sample: Filter variants by sample genotype. This will automatically set 'includeSample' parameter when not provided. This filter accepts multiple 3 forms: 1) List of samples: Samples that - contain the main variant. Accepts AND (;) and OR (,) operators. + contain the main variant. Accepts AND ';' and OR ',' operators. e.g. HG0097,HG0098 . 2) List of samples with genotypes: - {sample}:{gt1},{gt2}. Accepts AND (;) and OR (,) operators. e.g. + {sample}:{gt1},{gt2}. Accepts AND ';' and OR ',' operators. e.g. HG0097:0/0;HG0098:0/1,1/1 . Unphased genotypes (e.g. 0/1, 1/1) will also include phased genotypes (e.g. 0|1, 1|0, 1|1), but not vice versa. When filtering by multi-allelic genotypes, any secondary @@ -802,9 +802,9 @@ def query(self, **options): :param str sample: Filter variants by sample genotype. This will automatically set 'includeSample' parameter when not provided. This filter accepts multiple 3 forms: 1) List of samples: Samples that - contain the main variant. Accepts AND (;) and OR (,) operators. + contain the main variant. Accepts AND ';' and OR ',' operators. e.g. HG0097,HG0098 . 2) List of samples with genotypes: - {sample}:{gt1},{gt2}. Accepts AND (;) and OR (,) operators. e.g. + {sample}:{gt1},{gt2}. Accepts AND ';' and OR ',' operators. e.g. HG0097:0/0;HG0098:0/1,1/1 . Unphased genotypes (e.g. 0/1, 1/1) will also include phased genotypes (e.g. 0|1, 1|0, 1|1), but not vice versa. When filtering by multi-allelic genotypes, any secondary @@ -949,6 +949,12 @@ def query(self, **options): :param bool panel_intersection: Intersect panel genes and regions with given genes and regions from que input query. This will prevent returning variants from regions out of the panel. + :param str source: Select the variant data source from where to fetch + the data. Accepted values are 'variant_index' (default), + 'secondary_annotation_index' and 'secondary_sample_index'. When + selecting a secondary_index, the data will be retrieved exclusively + from that secondary index, and the 'include/exclude' parameters + will be ignored. Some data might be missing or be partial. :param str trait: List of traits, based on ClinVar, HPO, COSMIC, i.e.: IDs, histologies, descriptions,... """ @@ -1032,9 +1038,9 @@ def aggregation_stats_sample(self, **options): :param str sample: Filter variants by sample genotype. This will automatically set 'includeSample' parameter when not provided. This filter accepts multiple 3 forms: 1) List of samples: Samples that - contain the main variant. Accepts AND (;) and OR (,) operators. + contain the main variant. Accepts AND ';' and OR ',' operators. e.g. HG0097,HG0098 . 2) List of samples with genotypes: - {sample}:{gt1},{gt2}. Accepts AND (;) and OR (,) operators. e.g. + {sample}:{gt1},{gt2}. Accepts AND ';' and OR ',' operators. e.g. HG0097:0/0;HG0098:0/1,1/1 . Unphased genotypes (e.g. 0/1, 1/1) will also include phased genotypes (e.g. 0|1, 1|0, 1|1), but not vice versa. When filtering by multi-allelic genotypes, any secondary diff --git a/opencga-core/src/main/java/org/opencb/opencga/core/models/variant/AnnotationVariantQueryParams.java b/opencga-core/src/main/java/org/opencb/opencga/core/models/variant/AnnotationVariantQueryParams.java index 3713cce05b1..cdcb0bcd878 100644 --- a/opencga-core/src/main/java/org/opencb/opencga/core/models/variant/AnnotationVariantQueryParams.java +++ b/opencga-core/src/main/java/org/opencb/opencga/core/models/variant/AnnotationVariantQueryParams.java @@ -1,37 +1,66 @@ package org.opencb.opencga.core.models.variant; import com.fasterxml.jackson.annotation.JsonInclude; +import org.opencb.commons.annotations.DataField; import org.opencb.commons.datastore.core.Query; import org.opencb.opencga.core.tools.ToolParams; +import static org.opencb.opencga.core.models.variant.VariantQueryParams.*; + public class AnnotationVariantQueryParams extends ToolParams { + @DataField(description = ID_DESCR) private String id; + @DataField(description = REFERENCE_DESCR) private String region; + @DataField(description = GENE_DESCR) private String gene; + @DataField(description = TYPE_DESCR) private String type; + @DataField(description = PANEL_DESC) private String panel; + @DataField(description = PANEL_MOI_DESC) private String panelModeOfInheritance; + @DataField(description = PANEL_CONFIDENCE_DESC) private String panelConfidence; + @DataField(description = PANEL_ROLE_IN_CANCER_DESC) private String panelRoleInCancer; @JsonInclude(JsonInclude.Include.NON_DEFAULT) + @DataField(description = PANEL_INTERSECTION_DESC) private boolean panelIntersection; + @DataField(description = PANEL_FEATURE_TYPE_DESC) private String panelFeatureType; + @DataField(description = STATS_REF_DESCR) private String cohortStatsRef; + @DataField(description = STATS_ALT_DESCR) private String cohortStatsAlt; + @DataField(description = STATS_MAF_DESCR) private String cohortStatsMaf; + @DataField(description = ANNOT_CONSEQUENCE_TYPE_DESCR) private String ct; + @DataField(description = ANNOT_XREF_DESCR) private String xref; + @DataField(description = ANNOT_BIOTYPE_DESCR) private String biotype; + @DataField(description = ANNOT_PROTEIN_SUBSTITUTION_DESCR) private String proteinSubstitution; + @DataField(description = ANNOT_CONSERVATION_DESCR) private String conservation; + @DataField(description = ANNOT_POPULATION_MINOR_ALLELE_FREQUENCY_DESCR) private String populationFrequencyMaf; + @DataField(description = ANNOT_POPULATION_ALTERNATE_FREQUENCY_DESCR) private String populationFrequencyAlt; + @DataField(description = ANNOT_POPULATION_REFERENCE_FREQUENCY_DESCR) private String populationFrequencyRef; + @DataField(description = ANNOT_TRANSCRIPT_FLAG_DESCR) private String transcriptFlag; + @DataField(description = ANNOT_FUNCTIONAL_SCORE_DESCR) private String functionalScore; + @DataField(description = ANNOT_CLINICAL_DESCR) private String clinical; + @DataField(description = ANNOT_CLINICAL_SIGNIFICANCE_DESCR) private String clinicalSignificance; @JsonInclude(JsonInclude.Include.NON_DEFAULT) + @DataField(description = ANNOT_CLINICAL_CONFIRMED_STATUS_DESCR) private boolean clinicalConfirmedStatus; public AnnotationVariantQueryParams() { diff --git a/opencga-core/src/main/java/org/opencb/opencga/core/models/variant/BasicVariantQueryParams.java b/opencga-core/src/main/java/org/opencb/opencga/core/models/variant/BasicVariantQueryParams.java index 72b621af649..5314c4bc7c8 100644 --- a/opencga-core/src/main/java/org/opencb/opencga/core/models/variant/BasicVariantQueryParams.java +++ b/opencga-core/src/main/java/org/opencb/opencga/core/models/variant/BasicVariantQueryParams.java @@ -16,12 +16,16 @@ package org.opencb.opencga.core.models.variant; +import org.opencb.commons.annotations.DataField; + /** * Basic set of VariantQueryParams, containing only the most used ones. */ public class BasicVariantQueryParams extends AnnotationVariantQueryParams { + @DataField(description = VariantQueryParams.PROJECT_DESC) private String project; + @DataField(description = VariantQueryParams.STUDY_DESCR) private String study; public String getProject() { diff --git a/opencga-core/src/main/java/org/opencb/opencga/core/models/variant/SampleVariantStatsAnalysisParams.java b/opencga-core/src/main/java/org/opencb/opencga/core/models/variant/SampleVariantStatsAnalysisParams.java index aa32124e051..0807a4ae731 100644 --- a/opencga-core/src/main/java/org/opencb/opencga/core/models/variant/SampleVariantStatsAnalysisParams.java +++ b/opencga-core/src/main/java/org/opencb/opencga/core/models/variant/SampleVariantStatsAnalysisParams.java @@ -27,7 +27,7 @@ public class SampleVariantStatsAnalysisParams extends ToolParams { + "Use sample=all to compute sample stats of all samples in the variant storage."; private List sample; private List individual; - private VariantQueryParams variantQuery = new VariantQueryParams(); + private VariantQueryParamsForSampleVariantStats variantQuery = new VariantQueryParamsForSampleVariantStats(); private String outdir; private boolean index; private boolean indexOverwrite; @@ -35,14 +35,14 @@ public class SampleVariantStatsAnalysisParams extends ToolParams { private String indexDescription; private Integer batchSize; - public static class VariantQueryParams extends AnnotationVariantQueryParams { + public static class VariantQueryParamsForSampleVariantStats extends AnnotationVariantQueryParams { public String sampleData; public String fileData; - public VariantQueryParams() { + public VariantQueryParamsForSampleVariantStats() { } - public VariantQueryParams(Query query) { + public VariantQueryParamsForSampleVariantStats(Query query) { super(query); } @@ -50,7 +50,7 @@ public String getSampleData() { return sampleData; } - public VariantQueryParams setSampleData(String sampleData) { + public VariantQueryParamsForSampleVariantStats setSampleData(String sampleData) { this.sampleData = sampleData; return this; } @@ -59,7 +59,7 @@ public String getFileData() { return fileData; } - public VariantQueryParams setFileData(String fileData) { + public VariantQueryParamsForSampleVariantStats setFileData(String fileData) { this.fileData = fileData; return this; } @@ -72,19 +72,19 @@ public SampleVariantStatsAnalysisParams(List sample, List indivi boolean indexOverwrite, String indexId, String indexDescription, Integer batchSize, AnnotationVariantQueryParams variantQuery) { this(sample, individual, outdir, index, indexOverwrite, indexId, indexDescription, batchSize, - variantQuery == null ? null : new VariantQueryParams(variantQuery.toQuery())); + variantQuery == null ? null : new VariantQueryParamsForSampleVariantStats(variantQuery.toQuery())); } public SampleVariantStatsAnalysisParams(List sample, List individual, String outdir, boolean index, boolean indexOverwrite, String indexId, String indexDescription, Integer batchSize, Query variantQuery) { this(sample, individual, outdir, index, indexOverwrite, indexId, indexDescription, batchSize, - variantQuery == null ? null : new VariantQueryParams(variantQuery)); + variantQuery == null ? null : new VariantQueryParamsForSampleVariantStats(variantQuery)); } public SampleVariantStatsAnalysisParams(List sample, List individual, String outdir, boolean index, boolean indexOverwrite, String indexId, String indexDescription, Integer batchSize, - VariantQueryParams variantQuery) { + VariantQueryParamsForSampleVariantStats variantQuery) { this.sample = sample; this.individual = individual; this.variantQuery = variantQuery; @@ -114,11 +114,11 @@ public SampleVariantStatsAnalysisParams setIndividual(List individual) { return this; } - public VariantQueryParams getVariantQuery() { + public VariantQueryParamsForSampleVariantStats getVariantQuery() { return variantQuery; } - public SampleVariantStatsAnalysisParams setVariantQuery(VariantQueryParams variantQuery) { + public SampleVariantStatsAnalysisParams setVariantQuery(VariantQueryParamsForSampleVariantStats variantQuery) { this.variantQuery = variantQuery; return this; } diff --git a/opencga-core/src/main/java/org/opencb/opencga/core/models/variant/VariantQueryParams.java b/opencga-core/src/main/java/org/opencb/opencga/core/models/variant/VariantQueryParams.java index b3ffc62bbe4..3a018796c21 100644 --- a/opencga-core/src/main/java/org/opencb/opencga/core/models/variant/VariantQueryParams.java +++ b/opencga-core/src/main/java/org/opencb/opencga/core/models/variant/VariantQueryParams.java @@ -17,7 +17,9 @@ package org.opencb.opencga.core.models.variant; import com.fasterxml.jackson.annotation.JsonInclude; +import org.opencb.commons.annotations.DataField; import org.opencb.commons.datastore.core.Query; +import org.opencb.opencga.core.api.ParamConstants; /** * When using native values (like boolean or int), set add @@ -25,68 +27,332 @@ */ public class VariantQueryParams extends BasicVariantQueryParams { + public static final String SAMPLE_ANNOTATION_DESC = + "Selects some samples using metadata information from Catalog. e.g. age>20;phenotype=hpo:123,hpo:456;name=smith"; + public static final String PROJECT_DESC = ParamConstants.PROJECT_DESCRIPTION; + public static final String FAMILY_DESC = "Filter variants where any of the samples from the given family contains the variant " + + "(HET or HOM_ALT)"; + public static final String FAMILY_MEMBERS_DESC = "Sub set of the members of a given family"; + public static final String FAMILY_DISORDER_DESC = "Specify the disorder to use for the family segregation"; + public static final String FAMILY_PROBAND_DESC = "Specify the proband child to use for the family segregation"; + public static final String FAMILY_SEGREGATION_DESCR = "Filter by segregation mode from a given family. Accepted values: " + + "[ autosomalDominant, autosomalRecessive, XLinkedDominant, XLinkedRecessive, YLinked, mitochondrial, " + + "deNovo, deNovoStrict, mendelianError, compoundHeterozygous ]"; + public static final String SAVED_FILTER_DESCR = "Use a saved filter at User level"; + public static final String PANEL_DESC = "Filter by genes from the given disease panel"; + public static final String PANEL_MOI_DESC = "Filter genes from specific panels that match certain mode of inheritance. " + + "Accepted values : " + + "[ autosomalDominant, autosomalRecessive, XLinkedDominant, XLinkedRecessive, YLinked, mitochondrial, " + + "deNovo, mendelianError, compoundHeterozygous ]"; + public static final String PANEL_CONFIDENCE_DESC = "Filter genes from specific panels that match certain confidence. " + + "Accepted values : [ high, medium, low, rejected ]"; + public static final String PANEL_INTERSECTION_DESC = "Intersect panel genes and regions with given " + + "genes and regions from que input query. This will prevent returning variants from regions out of the panel."; + public static final String PANEL_ROLE_IN_CANCER_DESC = "Filter genes from specific panels that match certain role in cancer. " + + "Accepted values : [ both, oncogene, tumorSuppressorGene, fusion ]"; + public static final String PANEL_FEATURE_TYPE_DESC = "Filter elements from specific panels by type. " + + "Accepted values : [ gene, region, str, variant ]"; + private static final String ACCEPTS_AND_OR = "Accepts AND ';' and OR ',' operators."; + private static final String ACCEPTS_ALL_NONE = "Accepts '" + ParamConstants.ALL + "' and '" + ParamConstants.NONE + "'."; + + public static final String ID_DESCR + = "List of variant IDs in the format chrom:start:ref:alt, e.g. 19:7177679:C:T"; + public static final String REGION_DESCR + = "List of regions, these can be just a single chromosome name or regions in the format chr:start-end, e.g.: 2,3:100000-200000"; + @Deprecated + public static final String CHROMOSOME_DESCR + = "List of chromosomes, this is an alias of 'region' parameter with just the chromosome names"; + public static final String REFERENCE_DESCR + = "Reference allele"; + public static final String ALTERNATE_DESCR + = "Main alternate allele"; + public static final String TYPE_DESCR + = "List of types, accepted values are SNV, MNV, INDEL, SV, COPY_NUMBER, COPY_NUMBER_LOSS, COPY_NUMBER_GAIN," + + " INSERTION, DELETION, DUPLICATION, TANDEM_DUPLICATION, BREAKEND, e.g. SNV,INDEL"; + public static final String STUDY_DESCR + = "Filter variants from the given studies, these can be either the numeric ID or the alias with the format " + + "organization@project:study"; + public static final String GENOTYPE_DESCR + = "Samples with a specific genotype: {samp_1}:{gt_1}(,{gt_n})*(;{samp_n}:{gt_1}(,{gt_n})*)*" + + " e.g. HG0097:0/0;HG0098:0/1,1/1. " + + "Unphased genotypes (e.g. 0/1, 1/1) will also include phased genotypes (e.g. 0|1, 1|0, 1|1), but not vice versa. " + + "When filtering by multi-allelic genotypes, any secondary allele will match, regardless of its position" + + " e.g. 1/2 will match with genotypes 1/2, 1/3, 1/4, .... " + + "Genotype aliases accepted: HOM_REF, HOM_ALT, HET, HET_REF, HET_ALT, HET_MISS and MISS " + + " e.g. HG0097:HOM_REF;HG0098:HET_REF,HOM_ALT. " + + "This will automatically set 'includeSample' parameter when not provided"; + public static final String SAMPLE_DATA_DESCR + = "Filter by any SampleData field from samples. [{sample}:]{key}{op}{value}[,;]* . " + + "If no sample is specified, will use all samples from \"sample\" or \"genotype\" filter. " + + "e.g. DP>200 or HG0097:DP>200,HG0098:DP<10 . " + + "Many FORMAT fields can be combined. e.g. HG0097:DP>200;GT=1/1,0/1,HG0098:DP<10"; + public static final String INCLUDE_SAMPLE_ID_DESCR + = "Include sampleId on each result"; + public static final String SAMPLE_METADATA_DESCR + = "Return the samples metadata group by study. Sample names will appear in the same order as their corresponding genotypes."; + public static final String INCLUDE_GENOTYPE_DESCR + = "Include genotypes, apart of other formats defined with includeFormat"; + public static final String SAMPLE_LIMIT_DESCR + = "Limit the number of samples to be included in the result"; + public static final String SAMPLE_SKIP_DESCR + = "Skip some samples from the result. Useful for sample pagination."; + public static final String FILE_DESCR + = "Filter variants from the files specified. This will set includeFile parameter when not provided"; + public static final String FILE_DATA_DESCR + = "Filter by file data (i.e. FILTER, QUAL and INFO columns from VCF file). [{file}:]{key}{op}{value}[,;]* . " + + "If no file is specified, will use all files from \"file\" filter. " + + "e.g. AN>200 or file_1.vcf:AN>200;file_2.vcf:AN<10 . " + + "Many fields can be combined. e.g. file_1.vcf:AN>200;DB=true;file_2.vcf:AN<10,FILTER=PASS,LowDP"; + public static final String FILTER_DESCR + = "Specify the FILTER for any of the files. If 'file' filter is provided, will match the file and the filter. " + + "e.g.: PASS,LowGQX"; + public static final String QUAL_DESCR + = "Specify the QUAL for any of the files. If 'file' filter is provided, will match the file and the qual. " + + "e.g.: >123.4"; + public static final String COHORT_DESCR + = "Select variants with calculated stats for the selected cohorts"; + public static final String STATS_REF_DESCR + = "Reference Allele Frequency: [{study:}]{cohort}[<|>|<=|>=]{number}. e.g. ALL<=0.4"; + public static final String STATS_ALT_DESCR + = "Alternate Allele Frequency: [{study:}]{cohort}[<|>|<=|>=]{number}. e.g. ALL<=0.4"; + public static final String STATS_MAF_DESCR + = "Minor Allele Frequency: [{study:}]{cohort}[<|>|<=|>=]{number}. e.g. ALL<=0.4"; + public static final String STATS_MGF_DESCR + = "Minor Genotype Frequency: [{study:}]{cohort}[<|>|<=|>=]{number}. e.g. ALL<=0.4"; + public static final String STATS_PASS_FREQ_DESCR + = "Filter PASS frequency: [{study:}]{cohort}[<|>|<=|>=]{number}. e.g. ALL>0.8"; + public static final String MISSING_ALLELES_DESCR + = "Number of missing alleles: [{study:}]{cohort}[<|>|<=|>=]{number}"; + public static final String MISSING_GENOTYPES_DESCR + = "Number of missing genotypes: [{study:}]{cohort}[<|>|<=|>=]{number}"; + public static final String SCORE_DESCR + = "Filter by variant score: [{study:}]{score}[<|>|<=|>=]{number}"; + public static final String ANNOT_EXISTS_DESCR + = "Return only annotated variants"; + public static final String ANNOT_XREF_DESCR + = "List of any external reference, these can be genes, proteins or variants. " + + "Accepted IDs include HGNC, Ensembl genes, dbSNP, ClinVar, HPO, Cosmic, HGVS ..."; + public static final String GENE_DESCR + = "List of genes, most gene IDs are accepted (HGNC, Ensembl gene, ...). This is an alias to 'xref' parameter"; + public static final String ANNOT_BIOTYPE_DESCR + = "List of biotypes, e.g. protein_coding"; + public static final String ANNOT_CONSEQUENCE_TYPE_DESCR + = "List of SO consequence types, e.g. missense_variant,stop_lost or SO:0001583,SO:0001578. " + + "Accepts aliases 'loss_of_function' and 'protein_altering'"; + @Deprecated + public static final String ANNOT_POLYPHEN_DESCR + = "Polyphen, protein substitution score. [<|>|<=|>=]{number} or [~=|=|]{description} e.g. <=0.9 , =benign"; + @Deprecated + public static final String ANNOT_SIFT_DESCR + = "Sift, protein substitution score. [<|>|<=|>=]{number} or [~=|=|]{description} e.g. >0.1 , ~=tolerant"; + public static final String ANNOT_PROTEIN_SUBSTITUTION_DESCR + = "Protein substitution scores include SIFT and PolyPhen. You can query using the score {protein_score}[<|>|<=|>=]{number}" + + " or the description {protein_score}[~=|=]{description} e.g. polyphen>0.1,sift=tolerant"; + public static final String ANNOT_CONSERVATION_DESCR + = "Filter by conservation score: {conservation_score}[<|>|<=|>=]{number} e.g. phastCons>0.5,phylop<0.1,gerp>0.1"; + public static final String ANNOT_POPULATION_ALTERNATE_FREQUENCY_DESCR + = "Alternate Population Frequency: {study}:{population}[<|>|<=|>=]{number}. e.g. " + + ParamConstants.POP_FREQ_1000G + ":ALL<0.01"; + public static final String ANNOT_POPULATION_REFERENCE_FREQUENCY_DESCR + = "Reference Population Frequency: {study}:{population}[<|>|<=|>=]{number}. e.g. " + + ParamConstants.POP_FREQ_1000G + ":ALL<0.01"; + public static final String ANNOT_POPULATION_MINOR_ALLELE_FREQUENCY_DESCR + = "Population minor allele frequency: {study}:{population}[<|>|<=|>=]{number}. e.g. " + + ParamConstants.POP_FREQ_1000G + ":ALL<0.01"; + public static final String ANNOT_TRANSCRIPT_FLAG_DESCR + = "List of transcript flags. e.g. canonical, CCDS, basic, LRG, MANE Select, MANE Plus Clinical, EGLH_HaemOnc, TSO500"; + public static final String ANNOT_GENE_TRAIT_ID_DESCR + = "List of gene trait association id. e.g. \"umls:C0007222\" , \"OMIM:269600\""; + @Deprecated + public static final String ANNOT_GENE_TRAIT_NAME_DESCR + = "List of gene trait association names. e.g. Cardiovascular Diseases"; + public static final String ANNOT_TRAIT_DESCR + = "List of traits, based on ClinVar, HPO, COSMIC, i.e.: IDs, histologies, descriptions,..."; + public static final String ANNOT_CLINICAL_DESCR + = "Clinical source: clinvar, cosmic"; + public static final String ANNOT_CLINICAL_SIGNIFICANCE_DESCR + = "Clinical significance: benign, likely_benign, likely_pathogenic, pathogenic"; + public static final String ANNOT_CLINICAL_CONFIRMED_STATUS_DESCR + = "Clinical confirmed status"; + @Deprecated + public static final String ANNOT_CLINVAR_DESCR + = "List of ClinVar accessions"; + @Deprecated + public static final String ANNOT_COSMIC_DESCR + = "List of COSMIC mutation IDs."; + @Deprecated + public static final String ANNOT_HPO_DESCR + = "List of HPO terms. e.g. \"HP:0000545,HP:0002812\""; + public static final String ANNOT_GO_DESCR + = "List of GO (Gene Ontology) terms. e.g. \"GO:0002020\""; + public static final String ANNOT_EXPRESSION_DESCR + = "List of tissues of interest. e.g. \"lung\""; + public static final String ANNOT_GENE_ROLE_IN_CANCER_DESCR + = ""; + public static final String ANNOT_PROTEIN_KEYWORD_DESCR + = "List of Uniprot protein variant annotation keywords"; + public static final String ANNOT_DRUG_DESCR + = "List of drug names"; + public static final String ANNOT_FUNCTIONAL_SCORE_DESCR + = "Functional score: {functional_score}[<|>|<=|>=]{number} e.g. cadd_scaled>5.2 , cadd_raw<=0.3"; + public static final String CUSTOM_ANNOTATION_DESCR + = "Custom annotation: {key}[<|>|<=|>=]{number} or {key}[~=|=]{text}"; + public static final String UNKNOWN_GENOTYPE_DESCR + = "Returned genotype for unknown genotypes. Common values: [0/0, 0|0, ./.]"; + public static final String RELEASE_DESCR + = ""; + public static final String SOURCE_DESCR = "Select the variant data source from where to fetch the data." + + " Accepted values are 'variant_index' (default), 'secondary_annotation_index' and 'secondary_sample_index'. " + + "When selecting a secondary_index, the data will be retrieved exclusively from that secondary index, " + + "and the 'include/exclude' parameters will be ignored. " + + "If the given query can not be fully resolved using the secondary index, an exception will be raised. " + + "As the returned variants will only contain data from the secondary_index, some data might be missing or be partial."; + public static final String INCLUDE_FILE_DESCR + = "List of files to be returned. " + + ACCEPTS_ALL_NONE + " If undefined, automatically includes files used for filtering. If none, no file is included."; + public static final String INCLUDE_SAMPLE_DATA_DESCR + = "List of Sample Data keys (i.e. FORMAT column from VCF file) from Sample Data to include in the output. e.g: DP,AD. " + + ACCEPTS_ALL_NONE; + public static final String INCLUDE_SAMPLE_DESCR + = "List of samples to be included in the result. " + + ACCEPTS_ALL_NONE + " If undefined, automatically includes samples used for filtering. If none, no sample is included."; + public static final String INCLUDE_STUDY_DESCR + = "List of studies to include in the result. " + + ACCEPTS_ALL_NONE; + public static final String SAMPLE_DESCR + = "Filter variants by sample genotype. " + + "This will automatically set 'includeSample' parameter when not provided. " + + "This filter accepts multiple 3 forms: " + + "1) List of samples: Samples that contain the main variant. " + ACCEPTS_AND_OR + " " + + " e.g. HG0097,HG0098 . " + + "2) List of samples with genotypes: {sample}:{gt1},{gt2}. " + ACCEPTS_AND_OR + " " + + " e.g. HG0097:0/0;HG0098:0/1,1/1 . " + + "Unphased genotypes (e.g. 0/1, 1/1) will also include phased genotypes (e.g. 0|1, 1|0, 1|1), but not vice versa. " + + "When filtering by multi-allelic genotypes, any secondary allele will match, regardless of its position" + + " e.g. 1/2 will match with genotypes 1/2, 1/3, 1/4, .... " + + "Genotype aliases accepted: HOM_REF, HOM_ALT, HET, HET_REF, HET_ALT, HET_MISS and MISS " + + " e.g. HG0097:HOM_REF;HG0098:HET_REF,HOM_ALT . " + + "3) Sample with segregation mode: {sample}:{segregation}. Only one sample accepted." + + "Accepted segregation modes: " + + "[ autosomalDominant, autosomalRecessive, XLinkedDominant, XLinkedRecessive, YLinked, mitochondrial, " + + "deNovo, deNovoStrict, mendelianError, compoundHeterozygous ]. Value is case insensitive." + + " e.g. HG0097:DeNovo " + + "Sample must have parents defined and indexed. "; + + @DataField(description = SAVED_FILTER_DESCR) private String savedFilter; + @DataField(description = CHROMOSOME_DESCR) private String chromosome; + @DataField(description = REFERENCE_DESCR) private String reference; + @DataField(description = ALTERNATE_DESCR) private String alternate; + @DataField(description = RELEASE_DESCR) private String release; + @DataField(description = INCLUDE_STUDY_DESCR) private String includeStudy; + @DataField(description = INCLUDE_SAMPLE_DESCR) private String includeSample; + @DataField(description = INCLUDE_FILE_DESCR) private String includeFile; + @DataField(description = INCLUDE_SAMPLE_DATA_DESCR) private String includeSampleData; @JsonInclude(JsonInclude.Include.NON_DEFAULT) + @DataField(description = INCLUDE_SAMPLE_ID_DESCR) private boolean includeSampleId; @JsonInclude(JsonInclude.Include.NON_DEFAULT) + @DataField(description = INCLUDE_GENOTYPE_DESCR) private boolean includeGenotype; + @DataField(description = FILE_DESCR) private String file; + @DataField(description = QUAL_DESCR) private String qual; + @DataField(description = FILTER_DESCR) private String filter; + @DataField(description = FILE_DATA_DESCR) private String fileData; + @DataField(description = GENOTYPE_DESCR) private String genotype; + @DataField(description = SAMPLE_DESCR) private String sample; + @DataField(description = SAMPLE_LIMIT_DESCR) private Integer sampleLimit; + @DataField(description = SAMPLE_SKIP_DESCR) private Integer sampleSkip; + @DataField(description = SAMPLE_DATA_DESCR) private String sampleData; + @DataField(description = SAMPLE_ANNOTATION_DESC) private String sampleAnnotation; + @DataField(description = FAMILY_DESC) private String family; + @DataField(description = FAMILY_MEMBERS_DESC) private String familyMembers; + @DataField(description = FAMILY_DISORDER_DESC) private String familyDisorder; + @DataField(description = FAMILY_PROBAND_DESC) private String familyProband; + @DataField(description = FAMILY_SEGREGATION_DESCR) private String familySegregation; + @DataField(description = COHORT_DESCR) private String cohort; + @DataField(description = STATS_PASS_FREQ_DESCR) private String cohortStatsPass; + @DataField(description = STATS_MGF_DESCR) private String cohortStatsMgf; + @DataField(description = MISSING_ALLELES_DESCR) private String missingAlleles; + @DataField(description = MISSING_GENOTYPES_DESCR) private String missingGenotypes; + @DataField(description = ANNOT_EXISTS_DESCR) private Boolean annotationExists; + @DataField(description = SCORE_DESCR) private String score; + @DataField(description = ANNOT_POLYPHEN_DESCR) @Deprecated private String polyphen; + @DataField(description = ANNOT_SIFT_DESCR) @Deprecated private String sift; + @DataField(description = ANNOT_GENE_ROLE_IN_CANCER_DESCR) private String geneRoleInCancer; + @DataField(description = ANNOT_GENE_TRAIT_ID_DESCR) private String geneTraitId; + @DataField(description = ANNOT_GENE_TRAIT_NAME_DESCR) private String geneTraitName; + @DataField(description = ANNOT_TRAIT_DESCR) private String trait; + @DataField(description = ANNOT_COSMIC_DESCR) private String cosmic; + @DataField(description = ANNOT_CLINICAL_DESCR) private String clinvar; + @DataField(description = ANNOT_HPO_DESCR) private String hpo; + @DataField(description = ANNOT_GO_DESCR) private String go; + @DataField(description = ANNOT_EXPRESSION_DESCR) private String expression; + @DataField(description = ANNOT_PROTEIN_KEYWORD_DESCR) private String proteinKeyword; + @DataField(description = ANNOT_DRUG_DESCR) private String drug; + @DataField(description = CUSTOM_ANNOTATION_DESCR) private String customAnnotation; + @DataField(since = "3.2.1", description = SOURCE_DESCR) + private String source; + @DataField(description = UNKNOWN_GENOTYPE_DESCR) private String unknownGenotype; @JsonInclude(JsonInclude.Include.NON_DEFAULT) + @DataField(description = SAMPLE_METADATA_DESCR) private boolean sampleMetadata = false; @JsonInclude(JsonInclude.Include.NON_DEFAULT) + @DataField(description = "Sort the results by chromosome, start, end and alternate allele") private boolean sort = false; @@ -534,6 +800,15 @@ public VariantQueryParams setUnknownGenotype(String unknownGenotype) { return this; } + public String getSource() { + return source; + } + + public VariantQueryParams setSource(String source) { + this.source = source; + return this; + } + public boolean isSampleMetadata() { return sampleMetadata; } diff --git a/opencga-server/src/main/java/org/opencb/opencga/server/rest/analysis/ClinicalWebService.java b/opencga-server/src/main/java/org/opencb/opencga/server/rest/analysis/ClinicalWebService.java index 3dd6fa53aa4..ef46a69aab4 100644 --- a/opencga-server/src/main/java/org/opencb/opencga/server/rest/analysis/ClinicalWebService.java +++ b/opencga-server/src/main/java/org/opencb/opencga/server/rest/analysis/ClinicalWebService.java @@ -32,7 +32,6 @@ import org.opencb.opencga.analysis.clinical.zetta.ZettaInterpretationAnalysis; import org.opencb.opencga.analysis.rga.RgaManager; import org.opencb.opencga.analysis.rga.RgaQueryParams; -import org.opencb.opencga.analysis.variant.manager.VariantCatalogQueryUtils; import org.opencb.opencga.analysis.variant.manager.VariantStorageManager; import org.opencb.opencga.catalog.db.api.ClinicalAnalysisDBAdaptor; import org.opencb.opencga.catalog.db.api.InterpretationDBAdaptor; @@ -49,6 +48,7 @@ import org.opencb.opencga.core.models.job.Job; import org.opencb.opencga.core.models.sample.Sample; import org.opencb.opencga.core.models.study.configuration.ClinicalAnalysisStudyConfiguration; +import org.opencb.opencga.core.models.variant.VariantQueryParams; import org.opencb.opencga.core.tools.annotations.*; import javax.servlet.http.HttpServletRequest; @@ -61,11 +61,10 @@ import java.util.Map; import java.util.concurrent.atomic.AtomicReference; -import static org.opencb.opencga.analysis.variant.manager.VariantCatalogQueryUtils.SAVED_FILTER_DESCR; +import static org.opencb.opencga.core.models.variant.VariantQueryParams.SAVED_FILTER_DESCR; import static org.opencb.opencga.core.api.ParamConstants.INCLUDE_INTERPRETATION; import static org.opencb.opencga.core.api.ParamConstants.JOB_DEPENDS_ON; import static org.opencb.opencga.server.rest.analysis.VariantWebService.getVariantQuery; -import static org.opencb.opencga.storage.core.variant.adaptors.VariantQueryParam.*; @Path("/{apiVersion}/analysis/clinical") @Produces(MediaType.APPLICATION_JSON) @@ -1210,67 +1209,69 @@ public Response rgaIndexRun( // Interpretation ID to include fields related to @ApiImplicitParam(name = ParamConstants.INCLUDE_INTERPRETATION, value = ParamConstants.INCLUDE_INTERPRETATION_DESCRIPTION, dataType = "string", paramType = "query"), // Variant filters - @ApiImplicitParam(name = "id", value = ID_DESCR, dataType = "string", paramType = "query"), - @ApiImplicitParam(name = "region", value = REGION_DESCR, dataType = "string", paramType = "query"), - @ApiImplicitParam(name = "type", value = TYPE_DESCR, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "id", value = VariantQueryParams.ID_DESCR, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "region", value = VariantQueryParams.REGION_DESCR, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "type", value = VariantQueryParams.TYPE_DESCR, dataType = "string", paramType = "query"), // Study filters - @ApiImplicitParam(name = ParamConstants.STUDY_PARAM, value = STUDY_DESCR, dataType = "string", paramType = "query"), - @ApiImplicitParam(name = "file", value = FILE_DESCR, dataType = "string", paramType = "query"), - @ApiImplicitParam(name = "filter", value = FILTER_DESCR, dataType = "string", paramType = "query"), - @ApiImplicitParam(name = "qual", value = QUAL_DESCR, dataType = "string", paramType = "query"), - @ApiImplicitParam(name = "fileData", value = FILE_DATA_DESCR, dataType = "string", paramType = "query"), - - @ApiImplicitParam(name = "sample", value = SAMPLE_DESCR, dataType = "string", paramType = "query"), - @ApiImplicitParam(name = "sampleData", value = SAMPLE_DATA_DESCR, dataType = "string", paramType = "query"), - @ApiImplicitParam(name = "sampleAnnotation", value = VariantCatalogQueryUtils.SAMPLE_ANNOTATION_DESC, dataType = "string", paramType = "query"), - - @ApiImplicitParam(name = "cohort", value = COHORT_DESCR, dataType = "string", paramType = "query"), - @ApiImplicitParam(name = "cohortStatsRef", value = STATS_REF_DESCR, dataType = "string", paramType = "query"), - @ApiImplicitParam(name = "cohortStatsAlt", value = STATS_ALT_DESCR, dataType = "string", paramType = "query"), - @ApiImplicitParam(name = "cohortStatsMaf", value = STATS_MAF_DESCR, dataType = "string", paramType = "query"), - @ApiImplicitParam(name = "cohortStatsMgf", value = STATS_MGF_DESCR, dataType = "string", paramType = "query"), - @ApiImplicitParam(name = "cohortStatsPass", value = STATS_PASS_FREQ_DESCR, dataType = "string", paramType = "query"), - @ApiImplicitParam(name = "missingAlleles", value = MISSING_ALLELES_DESCR, dataType = "string", paramType = "query"), - @ApiImplicitParam(name = "missingGenotypes", value = MISSING_GENOTYPES_DESCR, dataType = "string", paramType = "query"), - @ApiImplicitParam(name = "score", value = SCORE_DESCR, dataType = "string", paramType = "query"), - - @ApiImplicitParam(name = "family", value = VariantCatalogQueryUtils.FAMILY_DESC, dataType = "string", paramType = "query"), - @ApiImplicitParam(name = "familyDisorder", value = VariantCatalogQueryUtils.FAMILY_DISORDER_DESC, dataType = "string", paramType = "query"), - @ApiImplicitParam(name = "familySegregation", value = VariantCatalogQueryUtils.FAMILY_SEGREGATION_DESCR, dataType = "string", paramType = "query"), - @ApiImplicitParam(name = "familyMembers", value = VariantCatalogQueryUtils.FAMILY_MEMBERS_DESC, dataType = "string", paramType = "query"), - @ApiImplicitParam(name = "familyProband", value = VariantCatalogQueryUtils.FAMILY_PROBAND_DESC, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = ParamConstants.STUDY_PARAM, value = VariantQueryParams.STUDY_DESCR, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "file", value = VariantQueryParams.FILE_DESCR, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "filter", value = VariantQueryParams.FILTER_DESCR, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "qual", value = VariantQueryParams.QUAL_DESCR, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "fileData", value = VariantQueryParams.FILE_DATA_DESCR, dataType = "string", paramType = "query"), + + @ApiImplicitParam(name = "sample", value = VariantQueryParams.SAMPLE_DESCR, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "sampleData", value = VariantQueryParams.SAMPLE_DATA_DESCR, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "sampleAnnotation", value = VariantQueryParams.SAMPLE_ANNOTATION_DESC, dataType = "string", paramType = "query"), + + @ApiImplicitParam(name = "cohort", value = VariantQueryParams.COHORT_DESCR, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "cohortStatsRef", value = VariantQueryParams.STATS_REF_DESCR, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "cohortStatsAlt", value = VariantQueryParams.STATS_ALT_DESCR, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "cohortStatsMaf", value = VariantQueryParams.STATS_MAF_DESCR, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "cohortStatsMgf", value = VariantQueryParams.STATS_MGF_DESCR, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "cohortStatsPass", value = VariantQueryParams.STATS_PASS_FREQ_DESCR, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "missingAlleles", value = VariantQueryParams.MISSING_ALLELES_DESCR, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "missingGenotypes", value = VariantQueryParams.MISSING_GENOTYPES_DESCR, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "score", value = VariantQueryParams.SCORE_DESCR, dataType = "string", paramType = "query"), + + @ApiImplicitParam(name = "family", value = VariantQueryParams.FAMILY_DESC, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "familyDisorder", value = VariantQueryParams.FAMILY_DISORDER_DESC, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "familySegregation", value = VariantQueryParams.FAMILY_SEGREGATION_DESCR, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "familyMembers", value = VariantQueryParams.FAMILY_MEMBERS_DESC, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "familyProband", value = VariantQueryParams.FAMILY_PROBAND_DESC, dataType = "string", paramType = "query"), // Annotation filters - @ApiImplicitParam(name = "gene", value = GENE_DESCR, dataType = "string", paramType = "query"), - @ApiImplicitParam(name = "ct", value = ANNOT_CONSEQUENCE_TYPE_DESCR, dataType = "string", paramType = "query"), - @ApiImplicitParam(name = "xref", value = ANNOT_XREF_DESCR, dataType = "string", paramType = "query"), - @ApiImplicitParam(name = "biotype", value = ANNOT_BIOTYPE_DESCR, dataType = "string", paramType = "query"), - @ApiImplicitParam(name = "proteinSubstitution", value = ANNOT_PROTEIN_SUBSTITUTION_DESCR, dataType = "string", paramType = "query"), - @ApiImplicitParam(name = "conservation", value = ANNOT_CONSERVATION_DESCR, dataType = "string", paramType = "query"), - @ApiImplicitParam(name = "populationFrequencyAlt", value = ANNOT_POPULATION_ALTERNATE_FREQUENCY_DESCR, dataType = "string", paramType = "query"), - @ApiImplicitParam(name = "populationFrequencyRef", value = ANNOT_POPULATION_REFERENCE_FREQUENCY_DESCR, dataType = "string", paramType = "query"), - @ApiImplicitParam(name = "populationFrequencyMaf", value = ANNOT_POPULATION_MINOR_ALLELE_FREQUENCY_DESCR, dataType = "string", paramType = "query"), - @ApiImplicitParam(name = "transcriptFlag", value = ANNOT_TRANSCRIPT_FLAG_DESCR, dataType = "string", paramType = "query"), - @ApiImplicitParam(name = "geneTraitId", value = ANNOT_GENE_TRAIT_ID_DESCR, dataType = "string", paramType = "query"), - @ApiImplicitParam(name = "go", value = ANNOT_GO_DESCR, dataType = "string", paramType = "query"), - @ApiImplicitParam(name = "expression", value = ANNOT_EXPRESSION_DESCR, dataType = "string", paramType = "query"), - @ApiImplicitParam(name = "proteinKeyword", value = ANNOT_PROTEIN_KEYWORD_DESCR, dataType = "string", paramType = "query"), - @ApiImplicitParam(name = "drug", value = ANNOT_DRUG_DESCR, dataType = "string", paramType = "query"), - @ApiImplicitParam(name = "functionalScore", value = ANNOT_FUNCTIONAL_SCORE_DESCR, dataType = "string", paramType = "query"), - @ApiImplicitParam(name = "clinical", value = ANNOT_CLINICAL_DESCR, dataType = "string", paramType = "query"), - @ApiImplicitParam(name = "clinicalSignificance", value = ANNOT_CLINICAL_SIGNIFICANCE_DESCR, dataType = "string", paramType = "query"), - @ApiImplicitParam(name = "clinicalConfirmedStatus", value = ANNOT_CLINICAL_CONFIRMED_STATUS_DESCR, dataType = "boolean", paramType = "query"), - @ApiImplicitParam(name = "customAnnotation", value = CUSTOM_ANNOTATION_DESCR, dataType = "string", paramType = "query"), - - @ApiImplicitParam(name = "panel", value = VariantCatalogQueryUtils.PANEL_DESC, dataType = "string", paramType = "query"), - @ApiImplicitParam(name = "panelModeOfInheritance", value = VariantCatalogQueryUtils.PANEL_MOI_DESC, dataType = "string", paramType = "query"), - @ApiImplicitParam(name = "panelConfidence", value = VariantCatalogQueryUtils.PANEL_CONFIDENCE_DESC, dataType = "string", paramType = "query"), - @ApiImplicitParam(name = "panelRoleInCancer", value = VariantCatalogQueryUtils.PANEL_ROLE_IN_CANCER_DESC, dataType = "string", paramType = "query"), - @ApiImplicitParam(name = "panelFeatureType", value = VariantCatalogQueryUtils.PANEL_FEATURE_TYPE_DESC, dataType = "string", paramType = "query"), - @ApiImplicitParam(name = "panelIntersection", value = VariantCatalogQueryUtils.PANEL_INTERSECTION_DESC, dataType = "boolean", paramType = "query"), - - @ApiImplicitParam(name = "trait", value = ANNOT_TRAIT_DESCR, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "gene", value = VariantQueryParams.GENE_DESCR, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "ct", value = VariantQueryParams.ANNOT_CONSEQUENCE_TYPE_DESCR, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "xref", value = VariantQueryParams.ANNOT_XREF_DESCR, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "biotype", value = VariantQueryParams.ANNOT_BIOTYPE_DESCR, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "proteinSubstitution", value = VariantQueryParams.ANNOT_PROTEIN_SUBSTITUTION_DESCR, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "conservation", value = VariantQueryParams.ANNOT_CONSERVATION_DESCR, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "populationFrequencyAlt", value = VariantQueryParams.ANNOT_POPULATION_ALTERNATE_FREQUENCY_DESCR, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "populationFrequencyRef", value = VariantQueryParams.ANNOT_POPULATION_REFERENCE_FREQUENCY_DESCR, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "populationFrequencyMaf", value = VariantQueryParams.ANNOT_POPULATION_MINOR_ALLELE_FREQUENCY_DESCR, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "transcriptFlag", value = VariantQueryParams.ANNOT_TRANSCRIPT_FLAG_DESCR, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "geneTraitId", value = VariantQueryParams.ANNOT_GENE_TRAIT_ID_DESCR, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "go", value = VariantQueryParams.ANNOT_GO_DESCR, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "expression", value = VariantQueryParams.ANNOT_EXPRESSION_DESCR, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "proteinKeyword", value = VariantQueryParams.ANNOT_PROTEIN_KEYWORD_DESCR, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "drug", value = VariantQueryParams.ANNOT_DRUG_DESCR, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "functionalScore", value = VariantQueryParams.ANNOT_FUNCTIONAL_SCORE_DESCR, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "clinical", value = VariantQueryParams.ANNOT_CLINICAL_DESCR, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "clinicalSignificance", value = VariantQueryParams.ANNOT_CLINICAL_SIGNIFICANCE_DESCR, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "clinicalConfirmedStatus", value = VariantQueryParams.ANNOT_CLINICAL_CONFIRMED_STATUS_DESCR, dataType = "boolean", paramType = "query"), + @ApiImplicitParam(name = "customAnnotation", value = VariantQueryParams.CUSTOM_ANNOTATION_DESCR, dataType = "string", paramType = "query"), + + @ApiImplicitParam(name = "panel", value = VariantQueryParams.PANEL_DESC, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "panelModeOfInheritance", value = VariantQueryParams.PANEL_MOI_DESC, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "panelConfidence", value = VariantQueryParams.PANEL_CONFIDENCE_DESC, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "panelRoleInCancer", value = VariantQueryParams.PANEL_ROLE_IN_CANCER_DESC, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "panelFeatureType", value = VariantQueryParams.PANEL_FEATURE_TYPE_DESC, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "panelIntersection", value = VariantQueryParams.PANEL_INTERSECTION_DESC, dataType = "boolean", paramType = "query"), + + @ApiImplicitParam(name = "source", value = VariantQueryParams.SOURCE_DESCR, dataType = "string", paramType = "query"), + + @ApiImplicitParam(name = "trait", value = VariantQueryParams.ANNOT_TRAIT_DESCR, dataType = "string", paramType = "query"), }) public Response variantQuery() { // Get all query options diff --git a/opencga-server/src/main/java/org/opencb/opencga/server/rest/analysis/VariantWebService.java b/opencga-server/src/main/java/org/opencb/opencga/server/rest/analysis/VariantWebService.java index 70748fffb0c..269424eb522 100644 --- a/opencga-server/src/main/java/org/opencb/opencga/server/rest/analysis/VariantWebService.java +++ b/opencga-server/src/main/java/org/opencb/opencga/server/rest/analysis/VariantWebService.java @@ -94,7 +94,7 @@ import java.nio.file.Paths; import java.util.*; -import static org.opencb.opencga.analysis.variant.manager.VariantCatalogQueryUtils.SAVED_FILTER_DESCR; +import static org.opencb.opencga.core.models.variant.VariantQueryParams.SAVED_FILTER_DESCR; import static org.opencb.opencga.core.api.ParamConstants.JOB_DEPENDS_ON; import static org.opencb.opencga.core.common.JacksonUtils.getUpdateObjectMapper; import static org.opencb.opencga.storage.core.variant.adaptors.VariantQueryParam.*; @@ -230,84 +230,86 @@ public Response variantFileDelete( @ApiImplicitParam(name = "savedFilter", value = SAVED_FILTER_DESCR, dataType = "string", paramType = "query"), // Variant filters - @ApiImplicitParam(name = "id", value = ID_DESCR, dataType = "string", paramType = "query"), - @ApiImplicitParam(name = "region", value = REGION_DESCR, dataType = "string", paramType = "query"), - @ApiImplicitParam(name = "type", value = TYPE_DESCR, dataType = "string", paramType = "query"), - @ApiImplicitParam(name = "reference", value = REFERENCE_DESCR, dataType = "string", paramType = "query"), - @ApiImplicitParam(name = "alternate", value = ALTERNATE_DESCR, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "id", value = VariantQueryParams.ID_DESCR, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "region", value = VariantQueryParams.REGION_DESCR, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "type", value = VariantQueryParams.TYPE_DESCR, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "reference", value = VariantQueryParams.REFERENCE_DESCR, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "alternate", value = VariantQueryParams.ALTERNATE_DESCR, dataType = "string", paramType = "query"), // Study filters - @ApiImplicitParam(name = ParamConstants.PROJECT_PARAM, value = VariantCatalogQueryUtils.PROJECT_DESC, dataType = "string", paramType = "query"), - @ApiImplicitParam(name = ParamConstants.STUDY_PARAM, value = STUDY_DESCR, dataType = "string", paramType = "query"), - @ApiImplicitParam(name = "file", value = FILE_DESCR, dataType = "string", paramType = "query"), - @ApiImplicitParam(name = "filter", value = FILTER_DESCR, dataType = "string", paramType = "query"), - @ApiImplicitParam(name = "qual", value = QUAL_DESCR, dataType = "string", paramType = "query"), - @ApiImplicitParam(name = "fileData", value = FILE_DATA_DESCR, dataType = "string", paramType = "query"), - - @ApiImplicitParam(name = "sample", value = SAMPLE_DESCR, dataType = "string", paramType = "query"), - @ApiImplicitParam(name = "genotype", value = GENOTYPE_DESCR, dataType = "string", paramType = "query"), - @ApiImplicitParam(name = "sampleData", value = SAMPLE_DATA_DESCR, dataType = "string", paramType = "query"), - @ApiImplicitParam(name = "sampleAnnotation", value = VariantCatalogQueryUtils.SAMPLE_ANNOTATION_DESC, dataType = "string", paramType = "query"), - @ApiImplicitParam(name = "sampleMetadata", value = SAMPLE_METADATA_DESCR, dataType = "boolean", paramType = "query"), - @ApiImplicitParam(name = "unknownGenotype", value = UNKNOWN_GENOTYPE_DESCR, dataType = "string", paramType = "query"), - @ApiImplicitParam(name = "sampleLimit", value = SAMPLE_LIMIT_DESCR, dataType = "integer", paramType = "query"), - @ApiImplicitParam(name = "sampleSkip", value = SAMPLE_SKIP_DESCR, dataType = "integer", paramType = "query"), - - @ApiImplicitParam(name = "cohort", value = COHORT_DESCR, dataType = "string", paramType = "query"), - @ApiImplicitParam(name = "cohortStatsRef", value = STATS_REF_DESCR, dataType = "string", paramType = "query"), - @ApiImplicitParam(name = "cohortStatsAlt", value = STATS_ALT_DESCR, dataType = "string", paramType = "query"), - @ApiImplicitParam(name = "cohortStatsMaf", value = STATS_MAF_DESCR, dataType = "string", paramType = "query"), - @ApiImplicitParam(name = "cohortStatsMgf", value = STATS_MGF_DESCR, dataType = "string", paramType = "query"), - @ApiImplicitParam(name = "cohortStatsPass", value = STATS_PASS_FREQ_DESCR, dataType = "string", paramType = "query"), - @ApiImplicitParam(name = "missingAlleles", value = MISSING_ALLELES_DESCR, dataType = "string", paramType = "query"), - @ApiImplicitParam(name = "missingGenotypes", value = MISSING_GENOTYPES_DESCR, dataType = "string", paramType = "query"), - @ApiImplicitParam(name = "score", value = SCORE_DESCR, dataType = "string", paramType = "query"), - - @ApiImplicitParam(name = "family", value = VariantCatalogQueryUtils.FAMILY_DESC, dataType = "string", paramType = "query"), - @ApiImplicitParam(name = "familyDisorder", value = VariantCatalogQueryUtils.FAMILY_DISORDER_DESC, dataType = "string", paramType = "query"), - @ApiImplicitParam(name = "familySegregation", value = VariantCatalogQueryUtils.FAMILY_SEGREGATION_DESCR, dataType = "string", paramType = "query"), - @ApiImplicitParam(name = "familyMembers", value = VariantCatalogQueryUtils.FAMILY_MEMBERS_DESC, dataType = "string", paramType = "query"), - @ApiImplicitParam(name = "familyProband", value = VariantCatalogQueryUtils.FAMILY_PROBAND_DESC, dataType = "string", paramType = "query"), - - @ApiImplicitParam(name = "includeStudy", value = INCLUDE_STUDY_DESCR, dataType = "string", paramType = "query"), - @ApiImplicitParam(name = "includeFile", value = INCLUDE_FILE_DESCR, dataType = "string", paramType = "query"), - @ApiImplicitParam(name = "includeSample", value = INCLUDE_SAMPLE_DESCR, dataType = "string", paramType = "query"), - @ApiImplicitParam(name = "includeSampleData", value = INCLUDE_SAMPLE_DATA_DESCR, dataType = "string", paramType = "query"), - @ApiImplicitParam(name = "includeGenotype", value = INCLUDE_GENOTYPE_DESCR, dataType = "string", paramType = "query"), - @ApiImplicitParam(name = "includeSampleId", value = INCLUDE_SAMPLE_ID_DESCR, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = ParamConstants.PROJECT_PARAM, value = VariantQueryParams.PROJECT_DESC, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = ParamConstants.STUDY_PARAM, value = VariantQueryParams.STUDY_DESCR, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "file", value = VariantQueryParams.FILE_DESCR, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "filter", value = VariantQueryParams.FILTER_DESCR, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "qual", value = VariantQueryParams.QUAL_DESCR, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "fileData", value = VariantQueryParams.FILE_DATA_DESCR, dataType = "string", paramType = "query"), + + @ApiImplicitParam(name = "sample", value = VariantQueryParams.SAMPLE_DESCR, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "genotype", value = VariantQueryParams.GENOTYPE_DESCR, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "sampleData", value = VariantQueryParams.SAMPLE_DATA_DESCR, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "sampleAnnotation", value = VariantQueryParams.SAMPLE_ANNOTATION_DESC, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "sampleMetadata", value = VariantQueryParams.SAMPLE_METADATA_DESCR, dataType = "boolean", paramType = "query"), + @ApiImplicitParam(name = "unknownGenotype", value = VariantQueryParams.UNKNOWN_GENOTYPE_DESCR, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "sampleLimit", value = VariantQueryParams.SAMPLE_LIMIT_DESCR, dataType = "integer", paramType = "query"), + @ApiImplicitParam(name = "sampleSkip", value = VariantQueryParams.SAMPLE_SKIP_DESCR, dataType = "integer", paramType = "query"), + + @ApiImplicitParam(name = "cohort", value = VariantQueryParams.COHORT_DESCR, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "cohortStatsRef", value = VariantQueryParams.STATS_REF_DESCR, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "cohortStatsAlt", value = VariantQueryParams.STATS_ALT_DESCR, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "cohortStatsMaf", value = VariantQueryParams.STATS_MAF_DESCR, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "cohortStatsMgf", value = VariantQueryParams.STATS_MGF_DESCR, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "cohortStatsPass", value = VariantQueryParams.STATS_PASS_FREQ_DESCR, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "missingAlleles", value = VariantQueryParams.MISSING_ALLELES_DESCR, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "missingGenotypes", value = VariantQueryParams.MISSING_GENOTYPES_DESCR, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "score", value = VariantQueryParams.SCORE_DESCR, dataType = "string", paramType = "query"), + + @ApiImplicitParam(name = "family", value = VariantQueryParams.FAMILY_DESC, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "familyDisorder", value = VariantQueryParams.FAMILY_DISORDER_DESC, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "familySegregation", value = VariantQueryParams.FAMILY_SEGREGATION_DESCR, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "familyMembers", value = VariantQueryParams.FAMILY_MEMBERS_DESC, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "familyProband", value = VariantQueryParams.FAMILY_PROBAND_DESC, dataType = "string", paramType = "query"), + + @ApiImplicitParam(name = "includeStudy", value = VariantQueryParams.INCLUDE_STUDY_DESCR, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "includeFile", value = VariantQueryParams.INCLUDE_FILE_DESCR, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "includeSample", value = VariantQueryParams.INCLUDE_SAMPLE_DESCR, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "includeSampleData", value = VariantQueryParams.INCLUDE_SAMPLE_DATA_DESCR, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "includeGenotype", value = VariantQueryParams.INCLUDE_GENOTYPE_DESCR, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "includeSampleId", value = VariantQueryParams.INCLUDE_SAMPLE_ID_DESCR, dataType = "string", paramType = "query"), // Annotation filters - @ApiImplicitParam(name = "annotationExists", value = ANNOT_EXISTS_DESCR, dataType = "java.lang.Boolean", paramType = "query"), - @ApiImplicitParam(name = "gene", value = GENE_DESCR, dataType = "string", paramType = "query"), - @ApiImplicitParam(name = "ct", value = ANNOT_CONSEQUENCE_TYPE_DESCR, dataType = "string", paramType = "query"), - @ApiImplicitParam(name = "xref", value = ANNOT_XREF_DESCR, dataType = "string", paramType = "query"), - @ApiImplicitParam(name = "biotype", value = ANNOT_BIOTYPE_DESCR, dataType = "string", paramType = "query"), - @ApiImplicitParam(name = "proteinSubstitution", value = ANNOT_PROTEIN_SUBSTITUTION_DESCR, dataType = "string", paramType = "query"), - @ApiImplicitParam(name = "conservation", value = ANNOT_CONSERVATION_DESCR, dataType = "string", paramType = "query"), - @ApiImplicitParam(name = "populationFrequencyAlt", value = ANNOT_POPULATION_ALTERNATE_FREQUENCY_DESCR, dataType = "string", paramType = "query"), - @ApiImplicitParam(name = "populationFrequencyRef", value = ANNOT_POPULATION_REFERENCE_FREQUENCY_DESCR, dataType = "string", paramType = "query"), - @ApiImplicitParam(name = "populationFrequencyMaf", value = ANNOT_POPULATION_MINOR_ALLELE_FREQUENCY_DESCR, dataType = "string", paramType = "query"), - @ApiImplicitParam(name = "transcriptFlag", value = ANNOT_TRANSCRIPT_FLAG_DESCR, dataType = "string", paramType = "query"), - @ApiImplicitParam(name = "geneTraitId", value = ANNOT_GENE_TRAIT_ID_DESCR, dataType = "string", paramType = "query"), - @ApiImplicitParam(name = "go", value = ANNOT_GO_DESCR, dataType = "string", paramType = "query"), - @ApiImplicitParam(name = "expression", value = ANNOT_EXPRESSION_DESCR, dataType = "string", paramType = "query"), - @ApiImplicitParam(name = "proteinKeyword", value = ANNOT_PROTEIN_KEYWORD_DESCR, dataType = "string", paramType = "query"), - @ApiImplicitParam(name = "drug", value = ANNOT_DRUG_DESCR, dataType = "string", paramType = "query"), - @ApiImplicitParam(name = "functionalScore", value = ANNOT_FUNCTIONAL_SCORE_DESCR, dataType = "string", paramType = "query"), - @ApiImplicitParam(name = "clinical", value = ANNOT_CLINICAL_DESCR, dataType = "string", paramType = "query"), - @ApiImplicitParam(name = "clinicalSignificance", value = ANNOT_CLINICAL_SIGNIFICANCE_DESCR, dataType = "string", paramType = "query"), - @ApiImplicitParam(name = "clinicalConfirmedStatus", value = ANNOT_CLINICAL_CONFIRMED_STATUS_DESCR, dataType = "boolean", paramType = "query"), - @ApiImplicitParam(name = "customAnnotation", value = CUSTOM_ANNOTATION_DESCR, dataType = "string", paramType = "query"), - - @ApiImplicitParam(name = "panel", value = VariantCatalogQueryUtils.PANEL_DESC, dataType = "string", paramType = "query"), - @ApiImplicitParam(name = "panelModeOfInheritance", value = VariantCatalogQueryUtils.PANEL_MOI_DESC, dataType = "string", paramType = "query"), - @ApiImplicitParam(name = "panelConfidence", value = VariantCatalogQueryUtils.PANEL_CONFIDENCE_DESC, dataType = "string", paramType = "query"), - @ApiImplicitParam(name = "panelRoleInCancer", value = VariantCatalogQueryUtils.PANEL_ROLE_IN_CANCER_DESC, dataType = "string", paramType = "query"), - @ApiImplicitParam(name = "panelFeatureType", value = VariantCatalogQueryUtils.PANEL_FEATURE_TYPE_DESC, dataType = "string", paramType = "query"), - @ApiImplicitParam(name = "panelIntersection", value = VariantCatalogQueryUtils.PANEL_INTERSECTION_DESC, dataType = "boolean", paramType = "query"), + @ApiImplicitParam(name = "annotationExists", value = VariantQueryParams.ANNOT_EXISTS_DESCR, dataType = "java.lang.Boolean", paramType = "query"), + @ApiImplicitParam(name = "gene", value = VariantQueryParams.GENE_DESCR, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "ct", value = VariantQueryParams.ANNOT_CONSEQUENCE_TYPE_DESCR, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "xref", value = VariantQueryParams.ANNOT_XREF_DESCR, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "biotype", value = VariantQueryParams.ANNOT_BIOTYPE_DESCR, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "proteinSubstitution", value = VariantQueryParams.ANNOT_PROTEIN_SUBSTITUTION_DESCR, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "conservation", value = VariantQueryParams.ANNOT_CONSERVATION_DESCR, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "populationFrequencyAlt", value = VariantQueryParams.ANNOT_POPULATION_ALTERNATE_FREQUENCY_DESCR, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "populationFrequencyRef", value = VariantQueryParams.ANNOT_POPULATION_REFERENCE_FREQUENCY_DESCR, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "populationFrequencyMaf", value = VariantQueryParams.ANNOT_POPULATION_MINOR_ALLELE_FREQUENCY_DESCR, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "transcriptFlag", value = VariantQueryParams.ANNOT_TRANSCRIPT_FLAG_DESCR, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "geneTraitId", value = VariantQueryParams.ANNOT_GENE_TRAIT_ID_DESCR, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "go", value = VariantQueryParams.ANNOT_GO_DESCR, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "expression", value = VariantQueryParams.ANNOT_EXPRESSION_DESCR, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "proteinKeyword", value = VariantQueryParams.ANNOT_PROTEIN_KEYWORD_DESCR, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "drug", value = VariantQueryParams.ANNOT_DRUG_DESCR, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "functionalScore", value = VariantQueryParams.ANNOT_FUNCTIONAL_SCORE_DESCR, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "clinical", value = VariantQueryParams.ANNOT_CLINICAL_DESCR, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "clinicalSignificance", value = VariantQueryParams.ANNOT_CLINICAL_SIGNIFICANCE_DESCR, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "clinicalConfirmedStatus", value = VariantQueryParams.ANNOT_CLINICAL_CONFIRMED_STATUS_DESCR, dataType = "boolean", paramType = "query"), + @ApiImplicitParam(name = "customAnnotation", value = VariantQueryParams.CUSTOM_ANNOTATION_DESCR, dataType = "string", paramType = "query"), + + @ApiImplicitParam(name = "panel", value = VariantQueryParams.PANEL_DESC, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "panelModeOfInheritance", value = VariantQueryParams.PANEL_MOI_DESC, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "panelConfidence", value = VariantQueryParams.PANEL_CONFIDENCE_DESC, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "panelRoleInCancer", value = VariantQueryParams.PANEL_ROLE_IN_CANCER_DESC, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "panelFeatureType", value = VariantQueryParams.PANEL_FEATURE_TYPE_DESC, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "panelIntersection", value = VariantQueryParams.PANEL_INTERSECTION_DESC, dataType = "boolean", paramType = "query"), + + @ApiImplicitParam(name = "source", value = VariantQueryParams.SOURCE_DESCR, dataType = "string", paramType = "query"), // WARN: Only available in Solr - @ApiImplicitParam(name = "trait", value = ANNOT_TRAIT_DESCR, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "trait", value = VariantQueryParams.ANNOT_TRAIT_DESCR, dataType = "string", paramType = "query"), // // DEPRECATED PARAMS // @ApiImplicitParam(name = "chromosome", value = DEPRECATED + "Use 'region' instead", dataType = "string", paramType = "query"), @@ -415,8 +417,8 @@ public Response export( @Path("/annotation/query") @ApiOperation(value = "Query variant annotations from any saved versions", response = VariantAnnotation.class) @ApiImplicitParams({ - @ApiImplicitParam(name = "id", value = ID_DESCR, dataType = "string", paramType = "query"), - @ApiImplicitParam(name = "region", value = REGION_DESCR, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "id", value = VariantQueryParams.ID_DESCR, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "region", value = VariantQueryParams.REGION_DESCR, dataType = "string", paramType = "query"), @ApiImplicitParam(name = QueryOptions.INCLUDE, value = ParamConstants.INCLUDE_DESCRIPTION, example = "name,attributes", dataType = "string", paramType = "query"), @ApiImplicitParam(name = QueryOptions.EXCLUDE, value = ParamConstants.EXCLUDE_DESCRIPTION, example = "id,status", dataType = "string", paramType = "query"), @ApiImplicitParam(name = QueryOptions.LIMIT, value = ParamConstants.LIMIT_DESCRIPTION, dataType = "integer", paramType = "query"), @@ -437,7 +439,7 @@ public Response getAnnotation(@ApiParam(value = "Annotation identifier") @Defaul @Path("/annotation/metadata") @ApiOperation(value = "Read variant annotations metadata from any saved versions") public Response getAnnotationMetadata(@ApiParam(value = "Annotation identifier") @QueryParam("annotationId") String annotationId, - @ApiParam(value = VariantCatalogQueryUtils.PROJECT_DESC) @QueryParam(ParamConstants.PROJECT_PARAM) String project) { + @ApiParam(value = VariantQueryParams.PROJECT_DESC) @QueryParam(ParamConstants.PROJECT_PARAM) String project) { return run(() -> variantManager.getAnnotationMetadata(annotationId, project, token)); } @@ -557,7 +559,7 @@ public Response familyGenotypes( public Response samples( @ApiParam(value = "Study where all the samples belong to") @QueryParam(ParamConstants.STUDY_PARAM) String studyStr, @ApiParam(value = "List of samples to check. By default, all samples") @QueryParam("sample") String samples, - @ApiParam(value = VariantCatalogQueryUtils.SAMPLE_ANNOTATION_DESC) @QueryParam("sampleAnnotation") String sampleAnnotation, + @ApiParam(value = VariantQueryParams.SAMPLE_ANNOTATION_DESC) @QueryParam("sampleAnnotation") String sampleAnnotation, @ApiParam(value = "Genotypes that the sample must have to be selected") @QueryParam("genotype") @DefaultValue("0/1,1/1") String genotypesStr, @ApiParam(value = "Samples must be present in ALL variants or in ANY variant.") @QueryParam("all") @DefaultValue("false") boolean all ) { @@ -649,32 +651,32 @@ public Response sampleQuery( @ApiImplicitParam(name = "savedFilter", value = SAVED_FILTER_DESCR, dataType = "string", paramType = "query"), // Variant filters - @ApiImplicitParam(name = "region", value = REGION_DESCR, dataType = "string", paramType = "query"), - @ApiImplicitParam(name = "type", value = TYPE_DESCR, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "region", value = VariantQueryParams.REGION_DESCR, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "type", value = VariantQueryParams.TYPE_DESCR, dataType = "string", paramType = "query"), // Study filters - @ApiImplicitParam(name = ParamConstants.PROJECT_PARAM, value = VariantCatalogQueryUtils.PROJECT_DESC, dataType = "string", paramType = "query"), - @ApiImplicitParam(name = ParamConstants.STUDY_PARAM, value = STUDY_DESCR, dataType = "string", paramType = "query"), - @ApiImplicitParam(name = "file", value = FILE_DESCR, dataType = "string", paramType = "query"), - @ApiImplicitParam(name = "filter", value = FILTER_DESCR, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = ParamConstants.PROJECT_PARAM, value = VariantQueryParams.PROJECT_DESC, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = ParamConstants.STUDY_PARAM, value = VariantQueryParams.STUDY_DESCR, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "file", value = VariantQueryParams.FILE_DESCR, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "filter", value = VariantQueryParams.FILTER_DESCR, dataType = "string", paramType = "query"), - @ApiImplicitParam(name = "sample", value = SAMPLE_DESCR, dataType = "string", paramType = "query"), - @ApiImplicitParam(name = "genotype", value = GENOTYPE_DESCR, dataType = "string", paramType = "query"), - @ApiImplicitParam(name = "sampleAnnotation", value = VariantCatalogQueryUtils.SAMPLE_ANNOTATION_DESC, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "sample", value = VariantQueryParams.SAMPLE_DESCR, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "genotype", value = VariantQueryParams.GENOTYPE_DESCR, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "sampleAnnotation", value = VariantQueryParams.SAMPLE_ANNOTATION_DESC, dataType = "string", paramType = "query"), - @ApiImplicitParam(name = "family", value = VariantCatalogQueryUtils.FAMILY_DESC, dataType = "string", paramType = "query"), - @ApiImplicitParam(name = "familyDisorder", value = VariantCatalogQueryUtils.FAMILY_DISORDER_DESC, dataType = "string", paramType = "query"), - @ApiImplicitParam(name = "familySegregation", value = VariantCatalogQueryUtils.FAMILY_SEGREGATION_DESCR, dataType = "string", paramType = "query"), - @ApiImplicitParam(name = "familyMembers", value = VariantCatalogQueryUtils.FAMILY_MEMBERS_DESC, dataType = "string", paramType = "query"), - @ApiImplicitParam(name = "familyProband", value = VariantCatalogQueryUtils.FAMILY_PROBAND_DESC, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "family", value = VariantQueryParams.FAMILY_DESC, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "familyDisorder", value = VariantQueryParams.FAMILY_DISORDER_DESC, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "familySegregation", value = VariantQueryParams.FAMILY_SEGREGATION_DESCR, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "familyMembers", value = VariantQueryParams.FAMILY_MEMBERS_DESC, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "familyProband", value = VariantQueryParams.FAMILY_PROBAND_DESC, dataType = "string", paramType = "query"), // Annotation filters - @ApiImplicitParam(name = "ct", value = ANNOT_CONSEQUENCE_TYPE_DESCR, dataType = "string", paramType = "query"), - @ApiImplicitParam(name = "biotype", value = ANNOT_BIOTYPE_DESCR, dataType = "string", paramType = "query"), - @ApiImplicitParam(name = "populationFrequencyAlt", value = ANNOT_POPULATION_ALTERNATE_FREQUENCY_DESCR, dataType = "string", paramType = "query"), - @ApiImplicitParam(name = "clinical", value = ANNOT_CLINICAL_DESCR, dataType = "string", paramType = "query"), - @ApiImplicitParam(name = "clinicalSignificance", value = ANNOT_CLINICAL_SIGNIFICANCE_DESCR, dataType = "string", paramType = "query"), - @ApiImplicitParam(name = "clinicalConfirmedStatus", value = ANNOT_CLINICAL_CONFIRMED_STATUS_DESCR, dataType = "boolean", paramType = "query") + @ApiImplicitParam(name = "ct", value = VariantQueryParams.ANNOT_CONSEQUENCE_TYPE_DESCR, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "biotype", value = VariantQueryParams.ANNOT_BIOTYPE_DESCR, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "populationFrequencyAlt", value = VariantQueryParams.ANNOT_POPULATION_ALTERNATE_FREQUENCY_DESCR, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "clinical", value = VariantQueryParams.ANNOT_CLINICAL_DESCR, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "clinicalSignificance", value = VariantQueryParams.ANNOT_CLINICAL_SIGNIFICANCE_DESCR, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "clinicalConfirmedStatus", value = VariantQueryParams.ANNOT_CLINICAL_CONFIRMED_STATUS_DESCR, dataType = "boolean", paramType = "query") }) public Response sampleAggregationStats(@ApiParam(value = "List of facet fields separated by semicolons, e.g.: studies;type." @@ -714,24 +716,24 @@ public Response sampleStatsRun( @Path("/sample/stats/query") @ApiImplicitParams({ // Variant filters - @ApiImplicitParam(name = "region", value = REGION_DESCR, dataType = "string", paramType = "query"), - @ApiImplicitParam(name = "type", value = TYPE_DESCR, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "region", value = VariantQueryParams.REGION_DESCR, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "type", value = VariantQueryParams.TYPE_DESCR, dataType = "string", paramType = "query"), // Study filters - @ApiImplicitParam(name = ParamConstants.STUDY_PARAM, value = STUDY_DESCR, dataType = "string", paramType = "query"), - @ApiImplicitParam(name = "file", value = FILE_DESCR, dataType = "string", paramType = "query"), - @ApiImplicitParam(name = "filter", value = FILTER_DESCR, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = ParamConstants.STUDY_PARAM, value = VariantQueryParams.STUDY_DESCR, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "file", value = VariantQueryParams.FILE_DESCR, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "filter", value = VariantQueryParams.FILTER_DESCR, dataType = "string", paramType = "query"), - @ApiImplicitParam(name = "sampleData", value = SAMPLE_DATA_DESCR, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "sampleData", value = VariantQueryParams.SAMPLE_DATA_DESCR, dataType = "string", paramType = "query"), // Annotation filters - @ApiImplicitParam(name = "ct", value = ANNOT_CONSEQUENCE_TYPE_DESCR, dataType = "string", paramType = "query"), - @ApiImplicitParam(name = "biotype", value = ANNOT_BIOTYPE_DESCR, dataType = "string", paramType = "query"), - @ApiImplicitParam(name = "transcriptFlag", value = ANNOT_TRANSCRIPT_FLAG_DESCR, dataType = "string", paramType = "query"), - @ApiImplicitParam(name = "populationFrequencyAlt", value = ANNOT_POPULATION_ALTERNATE_FREQUENCY_DESCR, dataType = "string", paramType = "query"), - @ApiImplicitParam(name = "clinical", value = ANNOT_CLINICAL_DESCR, dataType = "string", paramType = "query"), - @ApiImplicitParam(name = "clinicalSignificance", value = ANNOT_CLINICAL_SIGNIFICANCE_DESCR, dataType = "string", paramType = "query"), - @ApiImplicitParam(name = "clinicalConfirmedStatus", value = ANNOT_CLINICAL_CONFIRMED_STATUS_DESCR, dataType = "boolean", paramType = "query"), + @ApiImplicitParam(name = "ct", value = VariantQueryParams.ANNOT_CONSEQUENCE_TYPE_DESCR, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "biotype", value = VariantQueryParams.ANNOT_BIOTYPE_DESCR, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "transcriptFlag", value = VariantQueryParams.ANNOT_TRANSCRIPT_FLAG_DESCR, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "populationFrequencyAlt", value = VariantQueryParams.ANNOT_POPULATION_ALTERNATE_FREQUENCY_DESCR, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "clinical", value = VariantQueryParams.ANNOT_CLINICAL_DESCR, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "clinicalSignificance", value = VariantQueryParams.ANNOT_CLINICAL_SIGNIFICANCE_DESCR, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "clinicalConfirmedStatus", value = VariantQueryParams.ANNOT_CLINICAL_CONFIRMED_STATUS_DESCR, dataType = "boolean", paramType = "query"), }) @ApiOperation(value = "Obtain sample variant stats from a sample.", response = SampleVariantStats.class) public Response sampleStatsQuery(@ApiParam(value = ParamConstants.STUDY_DESCRIPTION) @QueryParam(ParamConstants.STUDY_PARAM) String studyStr, @@ -827,12 +829,12 @@ public Response cohortStatsDelete(@ApiParam(value = ParamConstants.STUDY_PARAM) @ApiImplicitParam(name = "savedFilter", value = SAVED_FILTER_DESCR, dataType = "string", paramType = "query"), // Variant filters - @ApiImplicitParam(name = "region", value = REGION_DESCR, dataType = "string", paramType = "query"), - @ApiImplicitParam(name = "type", value = TYPE_DESCR, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "region", value = VariantQueryParams.REGION_DESCR, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "type", value = VariantQueryParams.TYPE_DESCR, dataType = "string", paramType = "query"), // Study filters - @ApiImplicitParam(name = ParamConstants.PROJECT_PARAM, value = VariantCatalogQueryUtils.PROJECT_DESC, dataType = "string", paramType = "query"), - @ApiImplicitParam(name = ParamConstants.STUDY_PARAM, value = STUDY_DESCR, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = ParamConstants.PROJECT_PARAM, value = VariantQueryParams.PROJECT_DESC, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = ParamConstants.STUDY_PARAM, value = VariantQueryParams.STUDY_DESCR, dataType = "string", paramType = "query"), // @ApiImplicitParam(name = "file", value = FILE_DESCR, dataType = "string", paramType = "query"), // @ApiImplicitParam(name = "filter", value = FILTER_DESCR, dataType = "string", paramType = "query"), @@ -842,15 +844,15 @@ public Response cohortStatsDelete(@ApiParam(value = ParamConstants.STUDY_PARAM) // @ApiImplicitParam(name = "samplesMetadata", value = SAMPLE_METADATA_DESCR, dataType = "boolean", paramType = "query"), // @ApiImplicitParam(name = "unknownGenotype", value = UNKNOWN_GENOTYPE_DESCR, dataType = "string", paramType = "query"), - @ApiImplicitParam(name = "cohort", value = COHORT_DESCR, dataType = "string", paramType = "query"), - @ApiImplicitParam(name = "cohortStatsRef", value = STATS_REF_DESCR, dataType = "string", paramType = "query"), - @ApiImplicitParam(name = "cohortStatsAlt", value = STATS_ALT_DESCR, dataType = "string", paramType = "query"), - @ApiImplicitParam(name = "cohortStatsMaf", value = STATS_MAF_DESCR, dataType = "string", paramType = "query"), - @ApiImplicitParam(name = "cohortStatsMgf", value = STATS_MGF_DESCR, dataType = "string", paramType = "query"), - @ApiImplicitParam(name = "cohortStatsPass", value = STATS_PASS_FREQ_DESCR, dataType = "string", paramType = "query"), - @ApiImplicitParam(name = "missingAlleles", value = MISSING_ALLELES_DESCR, dataType = "string", paramType = "query"), - @ApiImplicitParam(name = "missingGenotypes", value = MISSING_GENOTYPES_DESCR, dataType = "string", paramType = "query"), - @ApiImplicitParam(name = "score", value = SCORE_DESCR, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "cohort", value = VariantQueryParams.COHORT_DESCR, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "cohortStatsRef", value = VariantQueryParams.STATS_REF_DESCR, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "cohortStatsAlt", value = VariantQueryParams.STATS_ALT_DESCR, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "cohortStatsMaf", value = VariantQueryParams.STATS_MAF_DESCR, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "cohortStatsMgf", value = VariantQueryParams.STATS_MGF_DESCR, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "cohortStatsPass", value = VariantQueryParams.STATS_PASS_FREQ_DESCR, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "missingAlleles", value = VariantQueryParams.MISSING_ALLELES_DESCR, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "missingGenotypes", value = VariantQueryParams.MISSING_GENOTYPES_DESCR, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "score", value = VariantQueryParams.SCORE_DESCR, dataType = "string", paramType = "query"), // @ApiImplicitParam(name = "family", value = VariantCatalogQueryUtils.FAMILY_DESC, dataType = "string", paramType = "query"), // @ApiImplicitParam(name = "familyDisorder", value = VariantCatalogQueryUtils.FAMILY_DISORDER_DESC, dataType = "string", paramType = "query"), @@ -859,30 +861,30 @@ public Response cohortStatsDelete(@ApiParam(value = ParamConstants.STUDY_PARAM) // @ApiImplicitParam(name = "familyProband", value = VariantCatalogQueryUtils.FAMILY_PROBAND_DESC, dataType = "string", paramType = "query"), // Annotation filters - @ApiImplicitParam(name = "annotationExists", value = ANNOT_EXISTS_DESCR, dataType = "java.lang.Boolean", paramType = "query"), - @ApiImplicitParam(name = "gene", value = GENE_DESCR, dataType = "string", paramType = "query"), - @ApiImplicitParam(name = "ct", value = ANNOT_CONSEQUENCE_TYPE_DESCR, dataType = "string", paramType = "query"), - @ApiImplicitParam(name = "xref", value = ANNOT_XREF_DESCR, dataType = "string", paramType = "query"), - @ApiImplicitParam(name = "biotype", value = ANNOT_BIOTYPE_DESCR, dataType = "string", paramType = "query"), - @ApiImplicitParam(name = "proteinSubstitution", value = ANNOT_PROTEIN_SUBSTITUTION_DESCR, dataType = "string", paramType = "query"), - @ApiImplicitParam(name = "conservation", value = ANNOT_CONSERVATION_DESCR, dataType = "string", paramType = "query"), - @ApiImplicitParam(name = "populationFrequencyAlt", value = ANNOT_POPULATION_ALTERNATE_FREQUENCY_DESCR, dataType = "string", paramType = "query"), - @ApiImplicitParam(name = "populationFrequencyRef", value = ANNOT_POPULATION_REFERENCE_FREQUENCY_DESCR, dataType = "string", paramType = "query"), - @ApiImplicitParam(name = "populationFrequencyMaf", value = ANNOT_POPULATION_MINOR_ALLELE_FREQUENCY_DESCR, dataType = "string", paramType = "query"), - @ApiImplicitParam(name = "transcriptFlag", value = ANNOT_TRANSCRIPT_FLAG_DESCR, dataType = "string", paramType = "query"), - @ApiImplicitParam(name = "geneTraitId", value = ANNOT_GENE_TRAIT_ID_DESCR, dataType = "string", paramType = "query"), - @ApiImplicitParam(name = "go", value = ANNOT_GO_DESCR, dataType = "string", paramType = "query"), - @ApiImplicitParam(name = "expression", value = ANNOT_EXPRESSION_DESCR, dataType = "string", paramType = "query"), - @ApiImplicitParam(name = "proteinKeyword", value = ANNOT_PROTEIN_KEYWORD_DESCR, dataType = "string", paramType = "query"), - @ApiImplicitParam(name = "drug", value = ANNOT_DRUG_DESCR, dataType = "string", paramType = "query"), - @ApiImplicitParam(name = "functionalScore", value = ANNOT_FUNCTIONAL_SCORE_DESCR, dataType = "string", paramType = "query"), - @ApiImplicitParam(name = "clinical", value = ANNOT_CLINICAL_DESCR, dataType = "string", paramType = "query"), - @ApiImplicitParam(name = "clinicalSignificance", value = ANNOT_CLINICAL_SIGNIFICANCE_DESCR, dataType = "string", paramType = "query"), - @ApiImplicitParam(name = "clinicalConfirmedStatus", value = ANNOT_CLINICAL_CONFIRMED_STATUS_DESCR, dataType = "boolean", paramType = "query"), - @ApiImplicitParam(name = "customAnnotation", value = CUSTOM_ANNOTATION_DESCR, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "annotationExists", value = VariantQueryParams.ANNOT_EXISTS_DESCR, dataType = "java.lang.Boolean", paramType = "query"), + @ApiImplicitParam(name = "gene", value = VariantQueryParams.GENE_DESCR, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "ct", value = VariantQueryParams.ANNOT_CONSEQUENCE_TYPE_DESCR, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "xref", value = VariantQueryParams.ANNOT_XREF_DESCR, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "biotype", value = VariantQueryParams.ANNOT_BIOTYPE_DESCR, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "proteinSubstitution", value = VariantQueryParams.ANNOT_PROTEIN_SUBSTITUTION_DESCR, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "conservation", value = VariantQueryParams.ANNOT_CONSERVATION_DESCR, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "populationFrequencyAlt", value = VariantQueryParams.ANNOT_POPULATION_ALTERNATE_FREQUENCY_DESCR, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "populationFrequencyRef", value = VariantQueryParams.ANNOT_POPULATION_REFERENCE_FREQUENCY_DESCR, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "populationFrequencyMaf", value = VariantQueryParams.ANNOT_POPULATION_MINOR_ALLELE_FREQUENCY_DESCR, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "transcriptFlag", value = VariantQueryParams.ANNOT_TRANSCRIPT_FLAG_DESCR, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "geneTraitId", value = VariantQueryParams.ANNOT_GENE_TRAIT_ID_DESCR, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "go", value = VariantQueryParams.ANNOT_GO_DESCR, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "expression", value = VariantQueryParams.ANNOT_EXPRESSION_DESCR, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "proteinKeyword", value = VariantQueryParams.ANNOT_PROTEIN_KEYWORD_DESCR, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "drug", value = VariantQueryParams.ANNOT_DRUG_DESCR, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "functionalScore", value = VariantQueryParams.ANNOT_FUNCTIONAL_SCORE_DESCR, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "clinical", value = VariantQueryParams.ANNOT_CLINICAL_DESCR, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "clinicalSignificance", value = VariantQueryParams.ANNOT_CLINICAL_SIGNIFICANCE_DESCR, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "clinicalConfirmedStatus", value = VariantQueryParams.ANNOT_CLINICAL_CONFIRMED_STATUS_DESCR, dataType = "boolean", paramType = "query"), + @ApiImplicitParam(name = "customAnnotation", value = VariantQueryParams.CUSTOM_ANNOTATION_DESCR, dataType = "string", paramType = "query"), // WARN: Only available in Solr - @ApiImplicitParam(name = "trait", value = ANNOT_TRAIT_DESCR, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "trait", value = VariantQueryParams.ANNOT_TRAIT_DESCR, dataType = "string", paramType = "query"), }) public Response getAggregationStats(@ApiParam(value = "List of facet fields separated by semicolons, e.g.: studies;type. For nested faceted fields use >>, e.g.: chromosome>>type;percentile(gerp)") @QueryParam(ParamConstants.FIELD_PARAM) String field) { return run(() -> { @@ -904,13 +906,13 @@ public Response cohortStatsDelete(@ApiParam(value = ParamConstants.STUDY_PARAM) @Path("/metadata") @ApiOperation(value = "", response = VariantMetadata.class) @ApiImplicitParams({ - @ApiImplicitParam(name = ParamConstants.PROJECT_PARAM, value = VariantCatalogQueryUtils.PROJECT_DESC, dataType = "string", paramType = "query"), - @ApiImplicitParam(name = ParamConstants.STUDY_PARAM, value = STUDY_DESCR, dataType = "string", paramType = "query"), - @ApiImplicitParam(name = "file", value = FILE_DESCR, dataType = "string", paramType = "query"), - @ApiImplicitParam(name = "sample", value = SAMPLE_DESCR, dataType = "string", paramType = "query"), - @ApiImplicitParam(name = "includeStudy", value = INCLUDE_STUDY_DESCR, dataType = "string", paramType = "query"), - @ApiImplicitParam(name = "includeFile", value = INCLUDE_FILE_DESCR, dataType = "string", paramType = "query"), - @ApiImplicitParam(name = "includeSample", value = INCLUDE_SAMPLE_DESCR, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = ParamConstants.PROJECT_PARAM, value = VariantQueryParams.PROJECT_DESC, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = ParamConstants.STUDY_PARAM, value = VariantQueryParams.STUDY_DESCR, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "file", value = VariantQueryParams.FILE_DESCR, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "sample", value = VariantQueryParams.SAMPLE_DESCR, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "includeStudy", value = VariantQueryParams.INCLUDE_STUDY_DESCR, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "includeFile", value = VariantQueryParams.INCLUDE_FILE_DESCR, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "includeSample", value = VariantQueryParams.INCLUDE_SAMPLE_DESCR, dataType = "string", paramType = "query"), @ApiImplicitParam(name = QueryOptions.INCLUDE, value = ParamConstants.INCLUDE_DESCRIPTION, example = "name,attributes", dataType = "string", paramType = "query"), @ApiImplicitParam(name = QueryOptions.EXCLUDE, value = ParamConstants.EXCLUDE_DESCRIPTION, example = "id,status", dataType = "string", paramType = "query"), }) @@ -972,22 +974,22 @@ public Response mutationalSignatureRun( @Path("/mutationalSignature/query") @ApiOperation(value = MutationalSignatureAnalysis.DESCRIPTION + " Use context index.", response = Signature.class) @ApiImplicitParams({ - @ApiImplicitParam(name = "study", value = STUDY_DESCR, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "study", value = VariantQueryParams.STUDY_DESCR, dataType = "string", paramType = "query"), @ApiImplicitParam(name = "sample", value = "Sample name", dataType = "string", paramType = "query"), @ApiImplicitParam(name = "type", value = "Variant type. Valid values: SNV, SV", dataType = "string", paramType = "query"), - @ApiImplicitParam(name = "ct", value = ANNOT_CONSEQUENCE_TYPE_DESCR, dataType = "string", paramType = "query"), - @ApiImplicitParam(name = "biotype", value = ANNOT_BIOTYPE_DESCR, dataType = "string", paramType = "query"), - @ApiImplicitParam(name = "fileData", value = FILE_DATA_DESCR, dataType = "string", paramType = "query"), - @ApiImplicitParam(name = "filter", value = FILTER_DESCR, dataType = "string", paramType = "query"), - @ApiImplicitParam(name = "qual", value = QUAL_DESCR, dataType = "string", paramType = "query"), - @ApiImplicitParam(name = "region", value = REGION_DESCR, dataType = "string", paramType = "query"), - @ApiImplicitParam(name = "gene", value = GENE_DESCR, dataType = "string", paramType = "query"), - @ApiImplicitParam(name = "panel", value = VariantCatalogQueryUtils.PANEL_DESC, dataType = "string", paramType = "query"), - @ApiImplicitParam(name = "panelModeOfInheritance", value = VariantCatalogQueryUtils.PANEL_MOI_DESC, dataType = "string", paramType = "query"), - @ApiImplicitParam(name = "panelConfidence", value = VariantCatalogQueryUtils.PANEL_CONFIDENCE_DESC, dataType = "string", paramType = "query"), - @ApiImplicitParam(name = "panelFeatureType", value = VariantCatalogQueryUtils.PANEL_FEATURE_TYPE_DESC, dataType = "string", paramType = "query"), - @ApiImplicitParam(name = "panelRoleInCancer", value = VariantCatalogQueryUtils.PANEL_ROLE_IN_CANCER_DESC, dataType = "string", paramType = "query"), - @ApiImplicitParam(name = "panelIntersection", value = VariantCatalogQueryUtils.PANEL_INTERSECTION_DESC, dataType = "boolean", paramType = "query"), + @ApiImplicitParam(name = "ct", value = VariantQueryParams.ANNOT_CONSEQUENCE_TYPE_DESCR, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "biotype", value = VariantQueryParams.ANNOT_BIOTYPE_DESCR, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "fileData", value = VariantQueryParams.FILE_DATA_DESCR, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "filter", value = VariantQueryParams.FILTER_DESCR, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "qual", value = VariantQueryParams.QUAL_DESCR, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "region", value = VariantQueryParams.REGION_DESCR, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "gene", value = VariantQueryParams.GENE_DESCR, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "panel", value = VariantQueryParams.PANEL_DESC, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "panelModeOfInheritance", value = VariantQueryParams.PANEL_MOI_DESC, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "panelConfidence", value = VariantQueryParams.PANEL_CONFIDENCE_DESC, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "panelFeatureType", value = VariantQueryParams.PANEL_FEATURE_TYPE_DESC, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "panelRoleInCancer", value = VariantQueryParams.PANEL_ROLE_IN_CANCER_DESC, dataType = "string", paramType = "query"), + @ApiImplicitParam(name = "panelIntersection", value = VariantQueryParams.PANEL_INTERSECTION_DESC, dataType = "boolean", paramType = "query"), }) public Response mutationalSignatureQuery( @ApiParam(value = FieldConstants.MUTATIONAL_SIGNATURE_ID_DESCRIPTION) @QueryParam("msId") String msId, diff --git a/opencga-server/src/main/java/org/opencb/opencga/server/rest/operations/VariantOperationWebService.java b/opencga-server/src/main/java/org/opencb/opencga/server/rest/operations/VariantOperationWebService.java index a2143f45090..a5dd2d39ead 100644 --- a/opencga-server/src/main/java/org/opencb/opencga/server/rest/operations/VariantOperationWebService.java +++ b/opencga-server/src/main/java/org/opencb/opencga/server/rest/operations/VariantOperationWebService.java @@ -21,7 +21,6 @@ import org.opencb.commons.datastore.core.DataResult; import org.opencb.commons.datastore.core.ObjectMap; import org.opencb.opencga.analysis.variant.julie.JulieTool; -import org.opencb.opencga.analysis.variant.manager.VariantCatalogQueryUtils; import org.opencb.opencga.analysis.variant.operations.*; import org.opencb.opencga.core.api.ParamConstants; import org.opencb.opencga.core.config.storage.CellBaseConfiguration; @@ -241,7 +240,7 @@ public Response secondaryIndex( @ApiParam(value = ParamConstants.JOB_SCHEDULED_START_TIME_DESCRIPTION) @QueryParam(ParamConstants.JOB_SCHEDULED_START_TIME) String scheduledStartTime, @ApiParam(value = ParamConstants.JOB_PRIORITY_DESCRIPTION) @QueryParam(ParamConstants.SUBMIT_JOB_PRIORITY_PARAM) String jobPriority, @ApiParam(value = ParamConstants.JOB_DRY_RUN_DESCRIPTION) @QueryParam(ParamConstants.JOB_DRY_RUN) Boolean dryRun, - @ApiParam(value = VariantCatalogQueryUtils.PROJECT_DESC) @QueryParam(ParamConstants.PROJECT_PARAM) String project, + @ApiParam(value = VariantQueryParams.PROJECT_DESC) @QueryParam(ParamConstants.PROJECT_PARAM) String project, @ApiParam(value = ParamConstants.STUDY_DESCRIPTION) @QueryParam(ParamConstants.STUDY_PARAM) String study, @ApiParam(value = VariantSecondaryAnnotationIndexParams.DESCRIPTION) VariantSecondaryAnnotationIndexParams params) { return variantSecondaryAnnotationIndex(jobName, jobDescription, dependsOn, jobTags, scheduledStartTime, jobPriority, dryRun, project, study, params); @@ -258,7 +257,7 @@ public Response variantSecondaryAnnotationIndex( @ApiParam(value = ParamConstants.JOB_SCHEDULED_START_TIME_DESCRIPTION) @QueryParam(ParamConstants.JOB_SCHEDULED_START_TIME) String scheduledStartTime, @ApiParam(value = ParamConstants.JOB_PRIORITY_DESCRIPTION) @QueryParam(ParamConstants.SUBMIT_JOB_PRIORITY_PARAM) String jobPriority, @ApiParam(value = ParamConstants.JOB_DRY_RUN_DESCRIPTION) @QueryParam(ParamConstants.JOB_DRY_RUN) Boolean dryRun, - @ApiParam(value = VariantCatalogQueryUtils.PROJECT_DESC) @QueryParam(ParamConstants.PROJECT_PARAM) String project, + @ApiParam(value = VariantQueryParams.PROJECT_DESC) @QueryParam(ParamConstants.PROJECT_PARAM) String project, @ApiParam(value = ParamConstants.STUDY_DESCRIPTION) @QueryParam(ParamConstants.STUDY_PARAM) String study, @ApiParam(value = VariantSecondaryAnnotationIndexParams.DESCRIPTION) VariantSecondaryAnnotationIndexParams params) { return submitOperation(VariantSecondaryAnnotationIndexOperationTool.ID, project, study, params, jobName, jobDescription, dependsOn, jobTags, scheduledStartTime, jobPriority, dryRun); @@ -311,7 +310,7 @@ public Response annotationDelete( @ApiParam(value = ParamConstants.JOB_SCHEDULED_START_TIME_DESCRIPTION) @QueryParam(ParamConstants.JOB_SCHEDULED_START_TIME) String scheduledStartTime, @ApiParam(value = ParamConstants.JOB_PRIORITY_DESCRIPTION) @QueryParam(ParamConstants.SUBMIT_JOB_PRIORITY_PARAM) String jobPriority, @ApiParam(value = ParamConstants.JOB_DRY_RUN_DESCRIPTION) @QueryParam(ParamConstants.JOB_DRY_RUN) Boolean dryRun, - @ApiParam(value = VariantCatalogQueryUtils.PROJECT_DESC) @QueryParam(ParamConstants.PROJECT_PARAM) String project, + @ApiParam(value = VariantQueryParams.PROJECT_DESC) @QueryParam(ParamConstants.PROJECT_PARAM) String project, @ApiParam(value = "Annotation identifier") @QueryParam("annotationId") String annotationId ) { Map params = new HashMap<>(); @@ -332,7 +331,7 @@ public Response annotationSave( @ApiParam(value = ParamConstants.JOB_SCHEDULED_START_TIME_DESCRIPTION) @QueryParam(ParamConstants.JOB_SCHEDULED_START_TIME) String scheduledStartTime, @ApiParam(value = ParamConstants.JOB_PRIORITY_DESCRIPTION) @QueryParam(ParamConstants.SUBMIT_JOB_PRIORITY_PARAM) String jobPriority, @ApiParam(value = ParamConstants.JOB_DRY_RUN_DESCRIPTION) @QueryParam(ParamConstants.JOB_DRY_RUN) Boolean dryRun, - @ApiParam(value = VariantCatalogQueryUtils.PROJECT_DESC) @QueryParam(ParamConstants.PROJECT_PARAM) String project, + @ApiParam(value = VariantQueryParams.PROJECT_DESC) @QueryParam(ParamConstants.PROJECT_PARAM) String project, @ApiParam(value = VariantAnnotationSaveParams.DESCRIPTION) VariantAnnotationSaveParams params) { return submitOperationToProject(VariantAnnotationSaveOperationTool.ID, project, params, jobName, jobDescription, dependsOn, jobTags, scheduledStartTime, jobPriority, dryRun); diff --git a/opencga-storage/opencga-storage-app/src/main/java/org/opencb/opencga/storage/app/cli/client/options/StorageVariantCommandOptions.java b/opencga-storage/opencga-storage-app/src/main/java/org/opencb/opencga/storage/app/cli/client/options/StorageVariantCommandOptions.java index 398b7f775cd..b4f12c8b5fb 100644 --- a/opencga-storage/opencga-storage-app/src/main/java/org/opencb/opencga/storage/app/cli/client/options/StorageVariantCommandOptions.java +++ b/opencga-storage/opencga-storage-app/src/main/java/org/opencb/opencga/storage/app/cli/client/options/StorageVariantCommandOptions.java @@ -20,6 +20,7 @@ import com.beust.jcommander.converters.CommaParameterSplitter; import org.opencb.biodata.models.variant.metadata.Aggregation; import org.opencb.opencga.core.models.operations.variant.VariantScoreIndexParams; +import org.opencb.opencga.core.models.variant.VariantQueryParams; import org.opencb.opencga.storage.app.cli.GeneralCliOptions; import org.opencb.opencga.storage.core.variant.annotation.VariantAnnotationManager; import org.opencb.opencga.storage.core.variant.annotation.annotators.VariantAnnotatorFactory; @@ -31,7 +32,6 @@ import static org.opencb.opencga.storage.app.cli.client.options.StorageVariantCommandOptions.GenericAnnotationCommandOptions.ANNOTATION_ID_DESCRIPTION; import static org.opencb.opencga.storage.app.cli.client.options.StorageVariantCommandOptions.GenericAnnotationCommandOptions.ANNOTATION_ID_PARAM; -import static org.opencb.opencga.storage.core.variant.adaptors.VariantQueryParam.*; /** * Created by imedina on 22/01/17. @@ -249,31 +249,31 @@ public class VariantDeleteCommandOptions extends GenericVariantDeleteOptions { */ public static class BasicVariantQueryOptions { - @Parameter(names = {"--id"}, description = ID_DESCR, variableArity = true) + @Parameter(names = {"--id"}, description = VariantQueryParams.ID_DESCR, variableArity = true) public List id; - @Parameter(names = {"-r", "--region"}, description = REGION_DESCR) + @Parameter(names = {"-r", "--region"}, description = VariantQueryParams.REGION_DESCR) public String region; @Parameter(names = {"--region-file"}, description = "GFF File with regions") public String regionFile; - @Parameter(names = {"-g", "--gene"}, description = GENE_DESCR) + @Parameter(names = {"-g", "--gene"}, description = VariantQueryParams.GENE_DESCR) public String gene; - @Parameter(names = {"-t", "--type"}, description = TYPE_DESCR) + @Parameter(names = {"-t", "--type"}, description = VariantQueryParams.TYPE_DESCR) public String type; - @Parameter(names = {"--ct", "--consequence-type"}, description = ANNOT_CONSEQUENCE_TYPE_DESCR) + @Parameter(names = {"--ct", "--consequence-type"}, description = VariantQueryParams.ANNOT_CONSEQUENCE_TYPE_DESCR) public String consequenceType; - @Parameter(names = {"-c", "--conservation"}, description = ANNOT_CONSERVATION_DESCR) + @Parameter(names = {"-c", "--conservation"}, description = VariantQueryParams.ANNOT_CONSERVATION_DESCR) public String conservation; - @Parameter(names = {"--ps", "--protein-substitution"}, description = ANNOT_PROTEIN_SUBSTITUTION_DESCR) + @Parameter(names = {"--ps", "--protein-substitution"}, description = VariantQueryParams.ANNOT_PROTEIN_SUBSTITUTION_DESCR) public String proteinSubstitution; - @Parameter(names = {"--fs", "--functional-score"}, description = ANNOT_FUNCTIONAL_SCORE_DESCR) + @Parameter(names = {"--fs", "--functional-score"}, description = VariantQueryParams.ANNOT_FUNCTIONAL_SCORE_DESCR) public String functionalScore; @Deprecated @@ -288,16 +288,16 @@ void setDeprecatedPopulationFreqAlternate(String populationFreqAlt) { this.populationFreqAlt = populationFreqAlt; } - @Parameter(names = {"--pf", "--population-frequency-alt"}, description = ANNOT_POPULATION_ALTERNATE_FREQUENCY_DESCR) + @Parameter(names = {"--pf", "--population-frequency-alt"}, description = VariantQueryParams.ANNOT_POPULATION_ALTERNATE_FREQUENCY_DESCR) public String populationFreqAlt; - @Parameter(names = {"--cohort-stats-ref"}, description = STATS_REF_DESCR) + @Parameter(names = {"--cohort-stats-ref"}, description = VariantQueryParams.STATS_REF_DESCR) public String rf; - @Parameter(names = {"--cohort-stats-alt"}, description = STATS_ALT_DESCR) + @Parameter(names = {"--cohort-stats-alt"}, description = VariantQueryParams.STATS_ALT_DESCR) public String af; - @Parameter(names = {"--maf", "--cohort-stats-maf"}, description = STATS_MAF_DESCR) + @Parameter(names = {"--maf", "--cohort-stats-maf"}, description = VariantQueryParams.STATS_MAF_DESCR) public String maf; } @@ -310,13 +310,13 @@ public static class GenericVariantQueryOptions extends BasicVariantQueryOptions // @Parameter(names = {"-s", "--study"}, description = "A comma separated list of studies to be used as filter") // public String study; - @Parameter(names = {"--gt", "--genotype"}, description = GENOTYPE_DESCR) + @Parameter(names = {"--gt", "--genotype"}, description = VariantQueryParams.GENOTYPE_DESCR) public String sampleGenotype; - @Parameter(names = {"--sample"}, description = SAMPLE_DESCR) + @Parameter(names = {"--sample"}, description = VariantQueryParams.SAMPLE_DESCR) public String samples; - @Parameter(names = {"--sample-data"}, description = SAMPLE_DATA_DESCR) + @Parameter(names = {"--sample-data"}, description = VariantQueryParams.SAMPLE_DATA_DESCR) public String sampleData; @Parameter(names = {"--format"}, hidden = true) @@ -324,10 +324,10 @@ public void setFormat(String format) { sampleData = format; } - @Parameter(names = {"-f", "--file"}, description = FILE_DESCR) + @Parameter(names = {"-f", "--file"}, description = VariantQueryParams.FILE_DESCR) public String file; - @Parameter(names = {"--file-data"}, description = FILE_DATA_DESCR) + @Parameter(names = {"--file-data"}, description = VariantQueryParams.FILE_DATA_DESCR) public String fileData; @Parameter(names = {"--info"}, hidden = true) @@ -335,16 +335,16 @@ public void setInfo(String info) { fileData = info; } - @Parameter(names = {"--filter"}, description = FILTER_DESCR) + @Parameter(names = {"--filter"}, description = VariantQueryParams.FILTER_DESCR) public String filter; - @Parameter(names = {"--qual"}, description = QUAL_DESCR) + @Parameter(names = {"--qual"}, description = VariantQueryParams.QUAL_DESCR) public String qual; - @Parameter(names = {"--score"}, description = SCORE_DESCR) + @Parameter(names = {"--score"}, description = VariantQueryParams.SCORE_DESCR) public String score; - @Parameter(names = {"--biotype"}, description = ANNOT_BIOTYPE_DESCR) + @Parameter(names = {"--biotype"}, description = VariantQueryParams.ANNOT_BIOTYPE_DESCR) public String geneBiotype; @Parameter(names = {"--population-maf"}, hidden = true, description = DEPRECATED + "use --pmaf or --population-frequency-maf") @@ -352,32 +352,32 @@ void setDeprecatedPopulationFreqMaf(String populationFreqMaf) { this.populationFreqMaf = populationFreqMaf; } - @Parameter(names = {"--pmaf", "--population-frequency-maf"}, description = ANNOT_POPULATION_MINOR_ALLELE_FREQUENCY_DESCR) + @Parameter(names = {"--pmaf", "--population-frequency-maf"}, description = VariantQueryParams.ANNOT_POPULATION_MINOR_ALLELE_FREQUENCY_DESCR) public String populationFreqMaf; - @Parameter(names = {"--population-frequency-ref"}, description = ANNOT_POPULATION_REFERENCE_FREQUENCY_DESCR) + @Parameter(names = {"--population-frequency-ref"}, description = VariantQueryParams.ANNOT_POPULATION_REFERENCE_FREQUENCY_DESCR) public String populationFreqRef; - @Parameter(names = {"--transcript-flag"}, description = ANNOT_TRANSCRIPT_FLAG_DESCR) + @Parameter(names = {"--transcript-flag"}, description = VariantQueryParams.ANNOT_TRANSCRIPT_FLAG_DESCR) public String flags; - @Parameter(names = {"--gene-trait-id"}, description = ANNOT_GENE_TRAIT_ID_DESCR) + @Parameter(names = {"--gene-trait-id"}, description = VariantQueryParams.ANNOT_GENE_TRAIT_ID_DESCR) public String geneTraitId; @Deprecated @Parameter(names = {"--gene-trait-name"}, hidden = true, description = DEPRECATED + "use --trait") public String geneTraitName; - @Parameter(names = {"--go", "--gene-ontology"}, description = ANNOT_GO_DESCR) + @Parameter(names = {"--go", "--gene-ontology"}, description = VariantQueryParams.ANNOT_GO_DESCR) public String go; - @Parameter(names = {"--expression"}, description = ANNOT_EXPRESSION_DESCR) + @Parameter(names = {"--expression"}, description = VariantQueryParams.ANNOT_EXPRESSION_DESCR) public String expression; - @Parameter(names = {"--protein-keywords"}, description = ANNOT_PROTEIN_KEYWORD_DESCR) + @Parameter(names = {"--protein-keywords"}, description = VariantQueryParams.ANNOT_PROTEIN_KEYWORD_DESCR) public String proteinKeywords; - @Parameter(names = {"--drug"}, description = ANNOT_DRUG_DESCR) + @Parameter(names = {"--drug"}, description = VariantQueryParams.ANNOT_DRUG_DESCR) public String drugs; @Deprecated @@ -392,23 +392,23 @@ void setClinvar(String clinvar) { setXref(clinvar); } - @Parameter(names = {"--trait"}, description = ANNOT_TRAIT_DESCR) + @Parameter(names = {"--trait"}, description = VariantQueryParams.ANNOT_TRAIT_DESCR) void setTrait(String trait) { this.trait = this.trait == null ? trait : this.trait + ',' + trait; } public String trait; - @Parameter(names = {"--mgf", "--cohort-stats-mgf"}, description = STATS_MGF_DESCR) + @Parameter(names = {"--mgf", "--cohort-stats-mgf"}, description = VariantQueryParams.STATS_MGF_DESCR) public String mgf; - @Parameter(names = {"--cohort-stats-pass"}, description = STATS_PASS_FREQ_DESCR) + @Parameter(names = {"--cohort-stats-pass"}, description = VariantQueryParams.STATS_PASS_FREQ_DESCR) public String cohortStatsPass; - @Parameter(names = {"--stats-missing-allele"}, description = MISSING_ALLELES_DESCR) + @Parameter(names = {"--stats-missing-allele"}, description = VariantQueryParams.MISSING_ALLELES_DESCR) public String missingAlleleCount; - @Parameter(names = {"--stats-missing-genotype"}, description = MISSING_GENOTYPES_DESCR) + @Parameter(names = {"--stats-missing-genotype"}, description = VariantQueryParams.MISSING_GENOTYPES_DESCR) public String missingGenotypeCount; // @Parameter(names = {"--dominant"}, description = "[PENDING] Take a family in the form of: FATHER,MOTHER,CHILD and specifies if is" + @@ -427,7 +427,7 @@ void setTrait(String trait) { // public String compoundHeterozygous; - @Parameter(names = {"--include-study"}, description = INCLUDE_STUDY_DESCR) + @Parameter(names = {"--include-study"}, description = VariantQueryParams.INCLUDE_STUDY_DESCR) public String includeStudy; @Deprecated @@ -436,7 +436,7 @@ void setOutputStudy(String outputStudy) { includeStudy = outputStudy; } - @Parameter(names = {"--include-file"}, description = INCLUDE_FILE_DESCR) + @Parameter(names = {"--include-file"}, description = VariantQueryParams.INCLUDE_FILE_DESCR) public String includeFile; @Deprecated @@ -445,7 +445,7 @@ void setOutputFile(String outputFile) { includeFile = outputFile; } - @Parameter(names = {"--include-sample"}, description = INCLUDE_SAMPLE_DESCR) + @Parameter(names = {"--include-sample"}, description = VariantQueryParams.INCLUDE_SAMPLE_DESCR) public String includeSample; @Deprecated @@ -454,7 +454,7 @@ void setOutputSample(String outputSample) { includeSample = outputSample; } - @Parameter(names = {"--include-sample-data"}, description = INCLUDE_SAMPLE_DATA_DESCR) + @Parameter(names = {"--include-sample-data"}, description = VariantQueryParams.INCLUDE_SAMPLE_DATA_DESCR) public String includeSampleData; @Parameter(names = {"--include-format"}, hidden = true) @@ -462,10 +462,10 @@ public void setIncludeFormat(String includeFormat) { includeSampleData = includeFormat; } - @Parameter(names = {"--include-genotype"}, description = INCLUDE_GENOTYPE_DESCR) + @Parameter(names = {"--include-genotype"}, description = VariantQueryParams.INCLUDE_GENOTYPE_DESCR) public boolean includeGenotype; - @Parameter(names = {"--include-sample-id"}, description = INCLUDE_SAMPLE_ID_DESCR) + @Parameter(names = {"--include-sample-id"}, description = VariantQueryParams.INCLUDE_SAMPLE_ID_DESCR) public boolean includeSampleId; @Parameter(names = {"--annotations", "--output-vcf-info"}, description = "Set variant annotation to return in the INFO column. " + @@ -478,7 +478,7 @@ void setOutputUnknownGenotype(String outputUnknownGenotype) { this.unknownGenotype = outputUnknownGenotype; } - @Parameter(names = {"--unknown-genotype"}, description = UNKNOWN_GENOTYPE_DESCR) + @Parameter(names = {"--unknown-genotype"}, description = VariantQueryParams.UNKNOWN_GENOTYPE_DESCR) public String unknownGenotype = "./."; @Deprecated @@ -493,29 +493,29 @@ void setAnnotXref(String annotXref) { setXref(annotXref); } - @Parameter(names = {"--xref"}, description = ANNOT_XREF_DESCR) + @Parameter(names = {"--xref"}, description = VariantQueryParams.ANNOT_XREF_DESCR) void setXref(String xref) { this.xref = this.xref == null ? xref : this.xref + ',' + xref; } public String xref; - @Parameter(names = {"--clinical"}, description = ANNOT_CLINICAL_DESCR) + @Parameter(names = {"--clinical"}, description = VariantQueryParams.ANNOT_CLINICAL_DESCR) public String clinical; - @Parameter(names = {"--clinical-significance"}, description = ANNOT_CLINICAL_SIGNIFICANCE_DESCR) + @Parameter(names = {"--clinical-significance"}, description = VariantQueryParams.ANNOT_CLINICAL_SIGNIFICANCE_DESCR) public String clinicalSignificance; - @Parameter(names = {"--clinical-confirmed-status"}, description = ANNOT_CLINICAL_CONFIRMED_STATUS_DESCR) + @Parameter(names = {"--clinical-confirmed-status"}, description = VariantQueryParams.ANNOT_CLINICAL_CONFIRMED_STATUS_DESCR) public boolean clinicalConfirmedStatus; - @Parameter(names = {"--sample-metadata"}, description = SAMPLE_METADATA_DESCR) + @Parameter(names = {"--sample-metadata"}, description = VariantQueryParams.SAMPLE_METADATA_DESCR) public boolean samplesMetadata; - @Parameter(names = {"--sample-limit"}, description = SAMPLE_LIMIT_DESCR) + @Parameter(names = {"--sample-limit"}, description = VariantQueryParams.SAMPLE_LIMIT_DESCR) public int sampleLimit; - @Parameter(names = {"--sample-skip"}, description = SAMPLE_SKIP_DESCR) + @Parameter(names = {"--sample-skip"}, description = VariantQueryParams.SAMPLE_SKIP_DESCR) public int sampleSkip; @Parameter(names = {"--summary"}, description = "Fast fetch of main variant parameters") @@ -534,7 +534,7 @@ public class VariantQueryCommandOptions extends GenericVariantQueryOptions { @ParametersDelegate public GeneralCliOptions.QueryCommandOptions commonQueryOptions = queryCommandOptions; - @Parameter(names = {"-s", "--study"}, description = STUDY_DESCR) + @Parameter(names = {"-s", "--study"}, description = VariantQueryParams.STUDY_DESCR) public String study; @Parameter(names = {"--of", "--output-format"}, description = "Output format: vcf, vcf.gz, json or json.gz", arity = 1) @@ -665,10 +665,10 @@ public static class GenericAnnotationQueryCommandOptions { @Parameter(names = ANNOTATION_ID_PARAM, description = ANNOTATION_ID_DESCRIPTION) public String annotationId = VariantAnnotationManager.CURRENT; - @Parameter(names = {"--id"}, description = ID_DESCR, variableArity = true) + @Parameter(names = {"--id"}, description = VariantQueryParams.ID_DESCR, variableArity = true) public List id; - @Parameter(names = {"-r", "--region"}, description = REGION_DESCR) + @Parameter(names = {"-r", "--region"}, description = VariantQueryParams.REGION_DESCR) public String region; } diff --git a/opencga-storage/opencga-storage-core/src/main/java/org/opencb/opencga/storage/core/variant/VariantStorageEngine.java b/opencga-storage/opencga-storage-core/src/main/java/org/opencb/opencga/storage/core/variant/VariantStorageEngine.java index b541b2f4ae4..f0c7e3fa76e 100644 --- a/opencga-storage/opencga-storage-core/src/main/java/org/opencb/opencga/storage/core/variant/VariantStorageEngine.java +++ b/opencga-storage/opencga-storage-core/src/main/java/org/opencb/opencga/storage/core/variant/VariantStorageEngine.java @@ -1348,7 +1348,7 @@ public VariantQueryExecutor getVariantQueryExecutor(Query query, QueryOptions op public VariantQueryExecutor getVariantQueryExecutor(ParsedVariantQuery variantQuery) { try { for (VariantQueryExecutor executor : getVariantQueryExecutors()) { - if (executor.canUseThisExecutor(variantQuery, variantQuery.getInputOptions())) { + if (executor.canUseThisExecutor(variantQuery)) { logger.info("Using VariantQueryExecutor : " + executor.getClass().getName()); logger.info(" Query : " + VariantQueryUtils.printQuery(variantQuery.getInputQuery())); logger.info(" Options : " + variantQuery.getInputOptions().toJson()); diff --git a/opencga-storage/opencga-storage-core/src/main/java/org/opencb/opencga/storage/core/variant/adaptors/VariantQuery.java b/opencga-storage/opencga-storage-core/src/main/java/org/opencb/opencga/storage/core/variant/adaptors/VariantQuery.java index 09b1867854e..72dcc35fea5 100644 --- a/opencga-storage/opencga-storage-core/src/main/java/org/opencb/opencga/storage/core/variant/adaptors/VariantQuery.java +++ b/opencga-storage/opencga-storage-core/src/main/java/org/opencb/opencga/storage/core/variant/adaptors/VariantQuery.java @@ -6,6 +6,7 @@ import org.opencb.commons.datastore.core.Query; import org.opencb.opencga.core.api.ParamConstants; import org.opencb.opencga.storage.core.variant.query.Values; +import org.opencb.opencga.storage.core.variant.query.VariantQuerySource; import org.opencb.opencga.storage.core.variant.query.VariantQueryUtils; import java.util.Arrays; @@ -649,6 +650,20 @@ public Integer release() { return getInt(VariantQueryParam.RELEASE.key()); } + public VariantQuery source(String value) { + put(VariantQueryParam.SOURCE.key(), value); + return this; + } + + public VariantQuery source(VariantQuerySource value) { + put(VariantQueryParam.SOURCE.key(), value); + return this; + } + + public String source() { + return getString(VariantQueryParam.SOURCE.key()); + } + @Override public VariantQuery append(String key, Object value) { return (VariantQuery) super.append(key, value); diff --git a/opencga-storage/opencga-storage-core/src/main/java/org/opencb/opencga/storage/core/variant/adaptors/VariantQueryParam.java b/opencga-storage/opencga-storage-core/src/main/java/org/opencb/opencga/storage/core/variant/adaptors/VariantQueryParam.java index 1973d7f383d..6abbbf35435 100644 --- a/opencga-storage/opencga-storage-core/src/main/java/org/opencb/opencga/storage/core/variant/adaptors/VariantQueryParam.java +++ b/opencga-storage/opencga-storage-core/src/main/java/org/opencb/opencga/storage/core/variant/adaptors/VariantQueryParam.java @@ -17,12 +17,11 @@ package org.opencb.opencga.storage.core.variant.adaptors; import org.opencb.commons.datastore.core.QueryParam; -import org.opencb.opencga.core.api.ParamConstants; import java.util.*; import static org.opencb.commons.datastore.core.QueryParam.Type.*; -import static org.opencb.opencga.storage.core.variant.query.VariantQueryUtils.*; +import static org.opencb.opencga.core.models.variant.VariantQueryParams.*; /** * Created on 30/03/17. @@ -37,339 +36,97 @@ public final class VariantQueryParam implements QueryParam { private static final List VALUES = new ArrayList<>(); private static final Map VALUES_MAP = new HashMap<>(); - private static final String ACCEPTS_ALL_NONE = "Accepts '" + ALL + "' and '" + NONE + "'."; - private static final String ACCEPTS_AND_OR = "Accepts AND (" + AND + ") and OR (" + OR + ") operators."; - public static final String ID_DESCR - = "List of variant IDs in the format chrom:start:ref:alt, e.g. 19:7177679:C:T"; public static final VariantQueryParam ID = new VariantQueryParam("id", TEXT_ARRAY, ID_DESCR); - - public static final String REGION_DESCR - = "List of regions, these can be just a single chromosome name or regions in the format chr:start-end, e.g.: 2,3:100000-200000"; public static final VariantQueryParam REGION = new VariantQueryParam("region", TEXT_ARRAY, REGION_DESCR); - - @Deprecated - public static final String CHROMOSOME_DESCR - = "List of chromosomes, this is an alias of 'region' parameter with just the chromosome names"; - - public static final String REFERENCE_DESCR - = "Reference allele"; public static final VariantQueryParam REFERENCE = new VariantQueryParam("reference", TEXT_ARRAY, REFERENCE_DESCR); - - public static final String ALTERNATE_DESCR - = "Main alternate allele"; public static final VariantQueryParam ALTERNATE = new VariantQueryParam("alternate", TEXT_ARRAY, ALTERNATE_DESCR); - - public static final String TYPE_DESCR - = "List of types, accepted values are SNV, MNV, INDEL, SV, COPY_NUMBER, COPY_NUMBER_LOSS, COPY_NUMBER_GAIN," - + " INSERTION, DELETION, DUPLICATION, TANDEM_DUPLICATION, BREAKEND, e.g. SNV,INDEL"; public static final VariantQueryParam TYPE = new VariantQueryParam("type", TEXT_ARRAY, TYPE_DESCR); - - - public static final String STUDY_DESCR - = "Filter variants from the given studies, these can be either the numeric ID or the alias with the format " - + "organization@project:study"; public static final VariantQueryParam STUDY = new VariantQueryParam("study", TEXT_ARRAY, STUDY_DESCR); - - public static final String INCLUDE_STUDY_DESCR - = "List of studies to include in the result. " - + ACCEPTS_ALL_NONE; public static final VariantQueryParam INCLUDE_STUDY = new VariantQueryParam("includeStudy", TEXT_ARRAY, INCLUDE_STUDY_DESCR); - - public static final String SAMPLE_DESCR - = "Filter variants by sample genotype. " - + "This will automatically set 'includeSample' parameter when not provided. " - + "This filter accepts multiple 3 forms: " - + "1) List of samples: Samples that contain the main variant. " + ACCEPTS_AND_OR + " " - + " e.g. HG0097,HG0098 . " - + "2) List of samples with genotypes: {sample}:{gt1},{gt2}. " + ACCEPTS_AND_OR + " " - + " e.g. HG0097:0/0;HG0098:0/1,1/1 . " - + "Unphased genotypes (e.g. 0/1, 1/1) will also include phased genotypes (e.g. 0|1, 1|0, 1|1), but not vice versa. " - + "When filtering by multi-allelic genotypes, any secondary allele will match, regardless of its position" - + " e.g. 1/2 will match with genotypes 1/2, 1/3, 1/4, .... " - + "Genotype aliases accepted: HOM_REF, HOM_ALT, HET, HET_REF, HET_ALT, HET_MISS and MISS " - + " e.g. HG0097:HOM_REF;HG0098:HET_REF,HOM_ALT . " - + "3) Sample with segregation mode: {sample}:{segregation}. Only one sample accepted." - + "Accepted segregation modes: " - + "[ autosomalDominant, autosomalRecessive, XLinkedDominant, XLinkedRecessive, YLinked, mitochondrial, " - + "deNovo, deNovoStrict, mendelianError, compoundHeterozygous ]. Value is case insensitive." - + " e.g. HG0097:DeNovo " - + "Sample must have parents defined and indexed. "; public static final VariantQueryParam SAMPLE = new VariantQueryParam("sample", TEXT_ARRAY, SAMPLE_DESCR); - - public static final String GENOTYPE_DESCR - = "Samples with a specific genotype: {samp_1}:{gt_1}(,{gt_n})*(;{samp_n}:{gt_1}(,{gt_n})*)*" - + " e.g. HG0097:0/0;HG0098:0/1,1/1. " - + "Unphased genotypes (e.g. 0/1, 1/1) will also include phased genotypes (e.g. 0|1, 1|0, 1|1), but not vice versa. " - + "When filtering by multi-allelic genotypes, any secondary allele will match, regardless of its position" - + " e.g. 1/2 will match with genotypes 1/2, 1/3, 1/4, .... " - + "Genotype aliases accepted: HOM_REF, HOM_ALT, HET, HET_REF, HET_ALT, HET_MISS and MISS " - + " e.g. HG0097:HOM_REF;HG0098:HET_REF,HOM_ALT. " - + "This will automatically set 'includeSample' parameter when not provided"; public static final VariantQueryParam GENOTYPE = new VariantQueryParam("genotype", TEXT_ARRAY, GENOTYPE_DESCR); - - public static final String SAMPLE_DATA_DESCR - = "Filter by any SampleData field from samples. [{sample}:]{key}{op}{value}[,;]* . " - + "If no sample is specified, will use all samples from \"sample\" or \"genotype\" filter. " - + "e.g. DP>200 or HG0097:DP>200,HG0098:DP<10 . " - + "Many FORMAT fields can be combined. e.g. HG0097:DP>200;GT=1/1,0/1,HG0098:DP<10"; public static final VariantQueryParam SAMPLE_DATA = new VariantQueryParam("sampleData", TEXT_ARRAY, SAMPLE_DATA_DESCR); - - public static final String INCLUDE_SAMPLE_DESCR - = "List of samples to be included in the result. " - + ACCEPTS_ALL_NONE + " If undefined, automatically includes samples used for filtering. If none, no sample is included."; public static final VariantQueryParam INCLUDE_SAMPLE = new VariantQueryParam("includeSample", TEXT_ARRAY, INCLUDE_SAMPLE_DESCR); - - public static final String INCLUDE_SAMPLE_ID_DESCR - = "Include sampleId on each result"; public static final VariantQueryParam INCLUDE_SAMPLE_ID = new VariantQueryParam("includeSampleId", BOOLEAN, INCLUDE_SAMPLE_ID_DESCR); - - public static final String SAMPLE_METADATA_DESCR - = "Return the samples metadata group by study. Sample names will appear in the same order as their corresponding genotypes."; public static final VariantQueryParam SAMPLE_METADATA = new VariantQueryParam("sampleMetadata", BOOLEAN, SAMPLE_METADATA_DESCR); - - public static final String INCLUDE_SAMPLE_DATA_DESCR - = "List of Sample Data keys (i.e. FORMAT column from VCF file) from Sample Data to include in the output. e.g: DP,AD. " - + ACCEPTS_ALL_NONE; public static final VariantQueryParam INCLUDE_SAMPLE_DATA = new VariantQueryParam("includeSampleData", TEXT_ARRAY, INCLUDE_SAMPLE_DATA_DESCR); - - public static final String INCLUDE_GENOTYPE_DESCR - = "Include genotypes, apart of other formats defined with includeFormat"; public static final VariantQueryParam INCLUDE_GENOTYPE = new VariantQueryParam("includeGenotype", BOOLEAN, INCLUDE_GENOTYPE_DESCR); - - public static final String SAMPLE_LIMIT_DESCR - = "Limit the number of samples to be included in the result"; public static final VariantQueryParam SAMPLE_LIMIT = new VariantQueryParam("sampleLimit", INTEGER, SAMPLE_LIMIT_DESCR); - - public static final String SAMPLE_SKIP_DESCR - = "Skip some samples from the result. Useful for sample pagination."; public static final VariantQueryParam SAMPLE_SKIP = new VariantQueryParam("sampleSkip", INTEGER, SAMPLE_SKIP_DESCR); - - public static final String FILE_DESCR - = "Filter variants from the files specified. This will set includeFile parameter when not provided"; public static final VariantQueryParam FILE = new VariantQueryParam("file", TEXT_ARRAY, FILE_DESCR); - - public static final String FILE_DATA_DESCR - = "Filter by file data (i.e. FILTER, QUAL and INFO columns from VCF file). [{file}:]{key}{op}{value}[,;]* . " - + "If no file is specified, will use all files from \"file\" filter. " - + "e.g. AN>200 or file_1.vcf:AN>200;file_2.vcf:AN<10 . " - + "Many fields can be combined. e.g. file_1.vcf:AN>200;DB=true;file_2.vcf:AN<10,FILTER=PASS,LowDP"; public static final VariantQueryParam FILE_DATA = new VariantQueryParam("fileData", TEXT_ARRAY, FILE_DATA_DESCR); - - public static final String FILTER_DESCR - = "Specify the FILTER for any of the files. If 'file' filter is provided, will match the file and the filter. " - + "e.g.: PASS,LowGQX"; public static final VariantQueryParam FILTER = new VariantQueryParam("filter", TEXT_ARRAY, FILTER_DESCR); - - public static final String QUAL_DESCR - = "Specify the QUAL for any of the files. If 'file' filter is provided, will match the file and the qual. " - + "e.g.: >123.4"; public static final VariantQueryParam QUAL = new VariantQueryParam("qual", DECIMAL_ARRAY, QUAL_DESCR); - - public static final String INCLUDE_FILE_DESCR - = "List of files to be returned. " - + ACCEPTS_ALL_NONE + " If undefined, automatically includes files used for filtering. If none, no file is included."; public static final VariantQueryParam INCLUDE_FILE = new VariantQueryParam("includeFile", TEXT_ARRAY, INCLUDE_FILE_DESCR); - - public static final String COHORT_DESCR - = "Select variants with calculated stats for the selected cohorts"; public static final VariantQueryParam COHORT = new VariantQueryParam("cohort", TEXT_ARRAY, COHORT_DESCR); - - public static final String STATS_REF_DESCR - = "Reference Allele Frequency: [{study:}]{cohort}[<|>|<=|>=]{number}. e.g. ALL<=0.4"; public static final VariantQueryParam STATS_REF = new VariantQueryParam("cohortStatsRef", TEXT_ARRAY, STATS_REF_DESCR); - - public static final String STATS_ALT_DESCR - = "Alternate Allele Frequency: [{study:}]{cohort}[<|>|<=|>=]{number}. e.g. ALL<=0.4"; public static final VariantQueryParam STATS_ALT = new VariantQueryParam("cohortStatsAlt", TEXT_ARRAY, STATS_ALT_DESCR); - - public static final String STATS_MAF_DESCR - = "Minor Allele Frequency: [{study:}]{cohort}[<|>|<=|>=]{number}. e.g. ALL<=0.4"; public static final VariantQueryParam STATS_MAF = new VariantQueryParam("cohortStatsMaf", TEXT_ARRAY, STATS_MAF_DESCR); - - public static final String STATS_MGF_DESCR - = "Minor Genotype Frequency: [{study:}]{cohort}[<|>|<=|>=]{number}. e.g. ALL<=0.4"; public static final VariantQueryParam STATS_MGF = new VariantQueryParam("cohortStatsMgf", TEXT_ARRAY, STATS_MGF_DESCR); - - public static final String STATS_PASS_FREQ_DESCR - = "Filter PASS frequency: [{study:}]{cohort}[<|>|<=|>=]{number}. e.g. ALL>0.8"; public static final VariantQueryParam STATS_PASS_FREQ = new VariantQueryParam("cohortStatsPass", TEXT_ARRAY, STATS_PASS_FREQ_DESCR); - - public static final String MISSING_ALLELES_DESCR - = "Number of missing alleles: [{study:}]{cohort}[<|>|<=|>=]{number}"; public static final VariantQueryParam MISSING_ALLELES = new VariantQueryParam("missingAlleles", TEXT_ARRAY, MISSING_ALLELES_DESCR); - - public static final String MISSING_GENOTYPES_DESCR - = "Number of missing genotypes: [{study:}]{cohort}[<|>|<=|>=]{number}"; public static final VariantQueryParam MISSING_GENOTYPES = new VariantQueryParam("missingGenotypes", TEXT_ARRAY, MISSING_GENOTYPES_DESCR); - - public static final String SCORE_DESCR - = "Filter by variant score: [{study:}]{score}[<|>|<=|>=]{number}"; public static final VariantQueryParam SCORE = new VariantQueryParam("score", TEXT_ARRAY, MISSING_GENOTYPES_DESCR); - - public static final String ANNOT_EXISTS_DESCR - = "Return only annotated variants"; public static final VariantQueryParam ANNOTATION_EXISTS = new VariantQueryParam("annotationExists", BOOLEAN, ANNOT_EXISTS_DESCR); - - public static final String ANNOT_XREF_DESCR - = "List of any external reference, these can be genes, proteins or variants. " - + "Accepted IDs include HGNC, Ensembl genes, dbSNP, ClinVar, HPO, Cosmic, HGVS ..."; public static final VariantQueryParam ANNOT_XREF = new VariantQueryParam("xref", TEXT_ARRAY, ANNOT_XREF_DESCR); - - public static final String GENE_DESCR - = "List of genes, most gene IDs are accepted (HGNC, Ensembl gene, ...). This is an alias to 'xref' parameter"; public static final VariantQueryParam GENE = new VariantQueryParam("gene", TEXT_ARRAY, GENE_DESCR); - - public static final String ANNOT_BIOTYPE_DESCR - = "List of biotypes, e.g. protein_coding"; public static final VariantQueryParam ANNOT_BIOTYPE = new VariantQueryParam("biotype", TEXT_ARRAY, ANNOT_BIOTYPE_DESCR); - - public static final String ANNOT_CONSEQUENCE_TYPE_DESCR - = "List of SO consequence types, e.g. missense_variant,stop_lost or SO:0001583,SO:0001578. " - + "Accepts aliases 'loss_of_function' and 'protein_altering'"; public static final VariantQueryParam ANNOT_CONSEQUENCE_TYPE = new VariantQueryParam("ct", TEXT_ARRAY, ANNOT_CONSEQUENCE_TYPE_DESCR); - - @Deprecated - public static final String ANNOT_POLYPHEN_DESCR - = "Polyphen, protein substitution score. [<|>|<=|>=]{number} or [~=|=|]{description} e.g. <=0.9 , =benign"; - @Deprecated - public static final VariantQueryParam ANNOT_POLYPHEN - = new VariantQueryParam("polyphen", TEXT_ARRAY, ANNOT_POLYPHEN_DESCR); - - @Deprecated - public static final String ANNOT_SIFT_DESCR - = "Sift, protein substitution score. [<|>|<=|>=]{number} or [~=|=|]{description} e.g. >0.1 , ~=tolerant"; - @Deprecated - public static final VariantQueryParam ANNOT_SIFT - = new VariantQueryParam("sift", TEXT_ARRAY, ANNOT_SIFT_DESCR); - - public static final String ANNOT_PROTEIN_SUBSTITUTION_DESCR - = "Protein substitution scores include SIFT and PolyPhen. You can query using the score {protein_score}[<|>|<=|>=]{number}" - + " or the description {protein_score}[~=|=]{description} e.g. polyphen>0.1,sift=tolerant"; public static final VariantQueryParam ANNOT_PROTEIN_SUBSTITUTION = new VariantQueryParam("proteinSubstitution", TEXT_ARRAY, ANNOT_PROTEIN_SUBSTITUTION_DESCR); - - public static final String ANNOT_CONSERVATION_DESCR - = "Filter by conservation score: {conservation_score}[<|>|<=|>=]{number} e.g. phastCons>0.5,phylop<0.1,gerp>0.1"; public static final VariantQueryParam ANNOT_CONSERVATION = new VariantQueryParam("conservation", TEXT_ARRAY, ANNOT_CONSERVATION_DESCR); - - public static final String ANNOT_POPULATION_ALTERNATE_FREQUENCY_DESCR - = "Alternate Population Frequency: {study}:{population}[<|>|<=|>=]{number}. e.g. " - + ParamConstants.POP_FREQ_1000G + ":ALL<0.01"; public static final VariantQueryParam ANNOT_POPULATION_ALTERNATE_FREQUENCY = new VariantQueryParam("populationFrequencyAlt", TEXT_ARRAY, ANNOT_POPULATION_ALTERNATE_FREQUENCY_DESCR); - - public static final String ANNOT_POPULATION_REFERENCE_FREQUENCY_DESCR - = "Reference Population Frequency: {study}:{population}[<|>|<=|>=]{number}. e.g. " - + ParamConstants.POP_FREQ_1000G + ":ALL<0.01"; public static final VariantQueryParam ANNOT_POPULATION_REFERENCE_FREQUENCY = new VariantQueryParam("populationFrequencyRef", TEXT_ARRAY, ANNOT_POPULATION_REFERENCE_FREQUENCY_DESCR); - - public static final String ANNOT_POPULATION_MINOR_ALLELE_FREQUENCY_DESCR - = "Population minor allele frequency: {study}:{population}[<|>|<=|>=]{number}. e.g. " - + ParamConstants.POP_FREQ_1000G + ":ALL<0.01"; public static final VariantQueryParam ANNOT_POPULATION_MINOR_ALLELE_FREQUENCY = new VariantQueryParam("populationFrequencyMaf", TEXT_ARRAY, ANNOT_POPULATION_MINOR_ALLELE_FREQUENCY_DESCR); - - public static final String ANNOT_TRANSCRIPT_FLAG_DESCR - = "List of transcript flags. e.g. canonical, CCDS, basic, LRG, MANE Select, MANE Plus Clinical, EGLH_HaemOnc, TSO500"; public static final VariantQueryParam ANNOT_TRANSCRIPT_FLAG = new VariantQueryParam("transcriptFlag", TEXT_ARRAY, ANNOT_TRANSCRIPT_FLAG_DESCR); - - public static final String ANNOT_GENE_TRAIT_ID_DESCR - = "List of gene trait association id. e.g. \"umls:C0007222\" , \"OMIM:269600\""; public static final VariantQueryParam ANNOT_GENE_TRAIT_ID = new VariantQueryParam("geneTraitId", TEXT_ARRAY, ANNOT_GENE_TRAIT_ID_DESCR); - - @Deprecated - public static final String ANNOT_GENE_TRAIT_NAME_DESCR - = "List of gene trait association names. e.g. Cardiovascular Diseases"; - @Deprecated - public static final VariantQueryParam ANNOT_GENE_TRAIT_NAME - = new VariantQueryParam("geneTraitName", TEXT_ARRAY, ANNOT_GENE_TRAIT_NAME_DESCR); - - public static final String ANNOT_TRAIT_DESCR - = "List of traits, based on ClinVar, HPO, COSMIC, i.e.: IDs, histologies, descriptions,..."; public static final VariantQueryParam ANNOT_TRAIT = new VariantQueryParam("trait", TEXT_ARRAY, ANNOT_TRAIT_DESCR); - - public static final String ANNOT_CLINICAL_DESCR - = "Clinical source: clinvar, cosmic"; public static final VariantQueryParam ANNOT_CLINICAL = new VariantQueryParam("clinical", TEXT_ARRAY, ANNOT_CLINICAL_DESCR); - - public static final String ANNOT_CLINICAL_SIGNIFICANCE_DESCR - = "Clinical significance: benign, likely_benign, likely_pathogenic, pathogenic"; public static final VariantQueryParam ANNOT_CLINICAL_SIGNIFICANCE = new VariantQueryParam("clinicalSignificance", TEXT_ARRAY, ANNOT_CLINICAL_SIGNIFICANCE_DESCR); - - public static final String ANNOT_CLINICAL_CONFIRMED_STATUS_DESCR - = "Clinical confirmed status"; public static final VariantQueryParam ANNOT_CLINICAL_CONFIRMED_STATUS = new VariantQueryParam("clinicalConfirmedStatus", BOOLEAN, ANNOT_CLINICAL_CONFIRMED_STATUS_DESCR); - - @Deprecated - public static final String ANNOT_CLINVAR_DESCR - = "List of ClinVar accessions"; - @Deprecated - public static final VariantQueryParam ANNOT_CLINVAR = new VariantQueryParam("clinvar", TEXT_ARRAY, ANNOT_CLINVAR_DESCR); - - @Deprecated - public static final String ANNOT_COSMIC_DESCR - = "List of COSMIC mutation IDs."; - @Deprecated - public static final VariantQueryParam ANNOT_COSMIC = new VariantQueryParam("cosmic", TEXT_ARRAY, ANNOT_COSMIC_DESCR); - - @Deprecated - public static final String ANNOT_HPO_DESCR - = "List of HPO terms. e.g. \"HP:0000545,HP:0002812\""; - @Deprecated - public static final VariantQueryParam ANNOT_HPO = new VariantQueryParam("hpo", TEXT_ARRAY, ANNOT_HPO_DESCR); - - public static final String ANNOT_GO_DESCR - = "List of GO (Gene Ontology) terms. e.g. \"GO:0002020\""; public static final VariantQueryParam ANNOT_GO = new VariantQueryParam("go", TEXT_ARRAY, ANNOT_GO_DESCR); - - public static final String ANNOT_EXPRESSION_DESCR - = "List of tissues of interest. e.g. \"lung\""; public static final VariantQueryParam ANNOT_EXPRESSION = new VariantQueryParam("expression", TEXT_ARRAY, ANNOT_EXPRESSION_DESCR); - - public static final String ANNOT_GENE_ROLE_IN_CANCER_DESCR - = ""; public static final VariantQueryParam ANNOT_GENE_ROLE_IN_CANCER = new VariantQueryParam("geneRoleInCancer", TEXT_ARRAY, ANNOT_GENE_ROLE_IN_CANCER_DESCR); - - public static final String ANNOT_PROTEIN_KEYWORD_DESCR - = "List of Uniprot protein variant annotation keywords"; public static final VariantQueryParam ANNOT_PROTEIN_KEYWORD = new VariantQueryParam("proteinKeyword", TEXT_ARRAY, ANNOT_PROTEIN_KEYWORD_DESCR); - - public static final String ANNOT_DRUG_DESCR - = "List of drug names"; public static final VariantQueryParam ANNOT_DRUG = new VariantQueryParam("drug", TEXT_ARRAY, ANNOT_DRUG_DESCR); - - public static final String ANNOT_FUNCTIONAL_SCORE_DESCR - = "Functional score: {functional_score}[<|>|<=|>=]{number} e.g. cadd_scaled>5.2 , cadd_raw<=0.3"; public static final VariantQueryParam ANNOT_FUNCTIONAL_SCORE = new VariantQueryParam("functionalScore", TEXT_ARRAY, ANNOT_FUNCTIONAL_SCORE_DESCR); - - public static final String CUSTOM_ANNOTATION_DESCR - = "Custom annotation: {key}[<|>|<=|>=]{number} or {key}[~=|=]{text}"; public static final VariantQueryParam CUSTOM_ANNOTATION = new VariantQueryParam("customAnnotation", TEXT_ARRAY, CUSTOM_ANNOTATION_DESCR); - - public static final String UNKNOWN_GENOTYPE_DESCR - = "Returned genotype for unknown genotypes. Common values: [0/0, 0|0, ./.]"; public static final VariantQueryParam UNKNOWN_GENOTYPE = new VariantQueryParam("unknownGenotype", TEXT, UNKNOWN_GENOTYPE_DESCR); + public static final VariantQueryParam RELEASE = new VariantQueryParam("release", INTEGER, RELEASE_DESCR); + public static final VariantQueryParam SOURCE = new VariantQueryParam("source", TEXT, SOURCE_DESCR); - - public static final String RELEASE_DESCR - = ""; - public static final VariantQueryParam RELEASE - = new VariantQueryParam("release", INTEGER, RELEASE_DESCR); + @Deprecated + public static final VariantQueryParam ANNOT_GENE_TRAIT_NAME + = new VariantQueryParam("geneTraitName", TEXT_ARRAY, ANNOT_GENE_TRAIT_NAME_DESCR); + @Deprecated + public static final VariantQueryParam ANNOT_POLYPHEN + = new VariantQueryParam("polyphen", TEXT_ARRAY, ANNOT_POLYPHEN_DESCR); + @Deprecated + public static final VariantQueryParam ANNOT_SIFT + = new VariantQueryParam("sift", TEXT_ARRAY, ANNOT_SIFT_DESCR); + @Deprecated + public static final VariantQueryParam ANNOT_CLINVAR = new VariantQueryParam("clinvar", TEXT_ARRAY, ANNOT_CLINVAR_DESCR); + @Deprecated + public static final VariantQueryParam ANNOT_COSMIC = new VariantQueryParam("cosmic", TEXT_ARRAY, ANNOT_COSMIC_DESCR); + @Deprecated + public static final VariantQueryParam ANNOT_HPO = new VariantQueryParam("hpo", TEXT_ARRAY, ANNOT_HPO_DESCR); private VariantQueryParam(String key, Type type, String description) { this.key = key; diff --git a/opencga-storage/opencga-storage-core/src/main/java/org/opencb/opencga/storage/core/variant/query/ParsedVariantQuery.java b/opencga-storage/opencga-storage-core/src/main/java/org/opencb/opencga/storage/core/variant/query/ParsedVariantQuery.java index 300f2e6b48a..8b835d99250 100644 --- a/opencga-storage/opencga-storage-core/src/main/java/org/opencb/opencga/storage/core/variant/query/ParsedVariantQuery.java +++ b/opencga-storage/opencga-storage-core/src/main/java/org/opencb/opencga/storage/core/variant/query/ParsedVariantQuery.java @@ -39,6 +39,7 @@ public class ParsedVariantQuery { private List regions; private List> clinicalCombination; private List clinicalCombinationList; + private VariantQuerySource source; // private VariantAnnotationQuery annotationQuery; @@ -71,6 +72,7 @@ public ParsedVariantQuery(ParsedVariantQuery other) { this.regions = new ArrayList<>(other.regions); this.clinicalCombination = new ArrayList<>(other.clinicalCombination); this.clinicalCombinationList = new ArrayList<>(other.clinicalCombinationList); + this.source = other.source; } public Query getInputQuery() { @@ -239,6 +241,15 @@ public ParsedVariantQuery setClinicalCombinationList(List clinicalCombin return this; } + public VariantQuerySource getSource() { + return source; + } + + public ParsedVariantQuery setSource(VariantQuerySource source) { + this.source = source; + return this; + } + public static class VariantStudyQuery { private ParsedQuery studies; private ParsedQuery>> genotypes; diff --git a/opencga-storage/opencga-storage-core/src/main/java/org/opencb/opencga/storage/core/variant/query/VariantQueryParser.java b/opencga-storage/opencga-storage-core/src/main/java/org/opencb/opencga/storage/core/variant/query/VariantQueryParser.java index bd02a6b4303..7f7febf2f63 100644 --- a/opencga-storage/opencga-storage-core/src/main/java/org/opencb/opencga/storage/core/variant/query/VariantQueryParser.java +++ b/opencga-storage/opencga-storage-core/src/main/java/org/opencb/opencga/storage/core/variant/query/VariantQueryParser.java @@ -166,6 +166,7 @@ public ParsedVariantQuery parseQuery(Query inputQuery, QueryOptions options, boo variantQuery.setApproximateCountSamplingSize(options.getInt( VariantStorageOptions.APPROXIMATE_COUNT_SAMPLING_SIZE.key(), VariantStorageOptions.APPROXIMATE_COUNT_SAMPLING_SIZE.defaultValue())); + variantQuery.setSource(VariantQuerySource.get(inputQuery)); VariantQuery query; if (!skipPreProcess) { diff --git a/opencga-storage/opencga-storage-core/src/main/java/org/opencb/opencga/storage/core/variant/query/VariantQuerySource.java b/opencga-storage/opencga-storage-core/src/main/java/org/opencb/opencga/storage/core/variant/query/VariantQuerySource.java new file mode 100644 index 00000000000..91d3d438e3f --- /dev/null +++ b/opencga-storage/opencga-storage-core/src/main/java/org/opencb/opencga/storage/core/variant/query/VariantQuerySource.java @@ -0,0 +1,39 @@ +package org.opencb.opencga.storage.core.variant.query; + +import org.opencb.commons.datastore.core.Query; + +import static org.opencb.opencga.storage.core.variant.adaptors.VariantQueryParam.SOURCE; + +public enum VariantQuerySource { +// SECONDARY_ANNOTATION_INDEX, + SECONDARY_SAMPLE_INDEX, + VARIANT_INDEX; + + + public boolean isSecondary() { + return this != VARIANT_INDEX; + } + + public static VariantQuerySource get(Query query) { + if (query == null) { + return VARIANT_INDEX; + } + return get(query.getString(SOURCE.key(), null)); + } + + public static VariantQuerySource get(String source) { + if (source == null) { + return VARIANT_INDEX; + } + switch (source.toLowerCase().replace("_", "").replace("-", "")){ + case "variantindex": + return VARIANT_INDEX; + case "secondarysampleindex": + return SECONDARY_SAMPLE_INDEX; +// case "secondaryannotationindex": +// return SECONDARY_ANNOTATION_INDEX; + default: + throw new IllegalArgumentException("Unknown VariantQuerySource " + source); + } + } +} diff --git a/opencga-storage/opencga-storage-core/src/main/java/org/opencb/opencga/storage/core/variant/query/VariantQueryUtils.java b/opencga-storage/opencga-storage-core/src/main/java/org/opencb/opencga/storage/core/variant/query/VariantQueryUtils.java index 9cf773d001f..e45d7e4dc73 100644 --- a/opencga-storage/opencga-storage-core/src/main/java/org/opencb/opencga/storage/core/variant/query/VariantQueryUtils.java +++ b/opencga-storage/opencga-storage-core/src/main/java/org/opencb/opencga/storage/core/variant/query/VariantQueryUtils.java @@ -166,7 +166,8 @@ public final class VariantQueryUtils { UNKNOWN_GENOTYPE, SAMPLE_METADATA, SAMPLE_LIMIT, - SAMPLE_SKIP + SAMPLE_SKIP, + SOURCE ))); public static final String SKIP_MISSING_GENES = "skipMissingGenes"; diff --git a/opencga-storage/opencga-storage-core/src/main/java/org/opencb/opencga/storage/core/variant/query/executors/VariantQueryExecutor.java b/opencga-storage/opencga-storage-core/src/main/java/org/opencb/opencga/storage/core/variant/query/executors/VariantQueryExecutor.java index 49ddc339658..c75fc3e4afa 100644 --- a/opencga-storage/opencga-storage-core/src/main/java/org/opencb/opencga/storage/core/variant/query/executors/VariantQueryExecutor.java +++ b/opencga-storage/opencga-storage-core/src/main/java/org/opencb/opencga/storage/core/variant/query/executors/VariantQueryExecutor.java @@ -9,6 +9,7 @@ import org.opencb.opencga.storage.core.variant.adaptors.iterators.VariantDBIterator; import org.opencb.opencga.storage.core.variant.query.ParsedVariantQuery; import org.opencb.opencga.storage.core.variant.query.VariantQueryResult; +import org.opencb.opencga.storage.core.variant.query.VariantQuerySource; import static org.opencb.opencga.storage.core.variant.VariantStorageOptions.QUERY_DEFAULT_TIMEOUT; import static org.opencb.opencga.storage.core.variant.VariantStorageOptions.QUERY_MAX_TIMEOUT; @@ -62,6 +63,19 @@ public static void setDefaultTimeout(QueryOptions queryOptions, ObjectMap config queryOptions.put(QueryOptions.TIMEOUT, timeout); } + public final boolean canUseThisExecutor(ParsedVariantQuery variantQuery) throws StorageEngineException { + boolean canUseThisExecutor = canUseThisExecutor(variantQuery, variantQuery.getInputOptions()); + if (canUseThisExecutor) { + if (variantQuery.getSource().isSecondary()) { + // Querying for a secondary index source. This executor can only be used if the source is the same + if (getSource() != variantQuery.getSource()) { + canUseThisExecutor = false; + } + } + } + return canUseThisExecutor; + } + /** * Determine if this VariantQueryExecutor can run the given query. * @param variantQuery Query to execute @@ -69,7 +83,7 @@ public static void setDefaultTimeout(QueryOptions queryOptions, ObjectMap config * @return True if this variant query executor is valid for the query * @throws StorageEngineException if there is an error */ - public abstract boolean canUseThisExecutor(ParsedVariantQuery variantQuery, QueryOptions options) throws StorageEngineException; + protected abstract boolean canUseThisExecutor(ParsedVariantQuery variantQuery, QueryOptions options) throws StorageEngineException; protected abstract Object getOrIterator(ParsedVariantQuery variantQuery, boolean iterator) throws StorageEngineException; @@ -81,6 +95,10 @@ protected String getStorageEngineId() { return storageEngineId; } + protected VariantQuerySource getSource() { + return VariantQuerySource.VARIANT_INDEX; + } + protected ObjectMap getOptions() { return options; } diff --git a/opencga-storage/opencga-storage-hadoop/opencga-storage-hadoop-core/src/main/java/org/opencb/opencga/storage/hadoop/variant/index/SampleIndexOnlyVariantQueryExecutor.java b/opencga-storage/opencga-storage-hadoop/opencga-storage-hadoop-core/src/main/java/org/opencb/opencga/storage/hadoop/variant/index/SampleIndexOnlyVariantQueryExecutor.java index 238da906e2c..183a7db0001 100644 --- a/opencga-storage/opencga-storage-hadoop/opencga-storage-hadoop-core/src/main/java/org/opencb/opencga/storage/hadoop/variant/index/SampleIndexOnlyVariantQueryExecutor.java +++ b/opencga-storage/opencga-storage-hadoop/opencga-storage-hadoop-core/src/main/java/org/opencb/opencga/storage/hadoop/variant/index/SampleIndexOnlyVariantQueryExecutor.java @@ -11,6 +11,7 @@ import org.opencb.biodata.models.variant.avro.OriginalCall; import org.opencb.biodata.models.variant.avro.SampleEntry; import org.opencb.biodata.tools.commons.Converter; +import org.opencb.commons.datastore.core.Event; import org.opencb.commons.datastore.core.ObjectMap; import org.opencb.commons.datastore.core.Query; import org.opencb.commons.datastore.core.QueryOptions; @@ -27,6 +28,7 @@ import org.opencb.opencga.storage.core.variant.adaptors.iterators.VariantDBIterator; import org.opencb.opencga.storage.core.variant.query.ParsedVariantQuery; import org.opencb.opencga.storage.core.variant.query.VariantQueryResult; +import org.opencb.opencga.storage.core.variant.query.VariantQuerySource; import org.opencb.opencga.storage.core.variant.query.VariantQueryUtils; import org.opencb.opencga.storage.core.variant.query.executors.VariantQueryExecutor; import org.opencb.opencga.storage.core.variant.query.projection.VariantQueryProjection; @@ -91,8 +93,14 @@ public SampleIndexOnlyVariantQueryExecutor(VariantHadoopDBAdaptor dbAdaptor, Sam @Override public boolean canUseThisExecutor(ParsedVariantQuery variantQuery, QueryOptions options) { VariantQuery query = variantQuery.getQuery(); + if (variantQuery.getSource() == VariantQuerySource.SECONDARY_SAMPLE_INDEX) { + if (SampleIndexQueryParser.validSampleIndexQuery(query) && isQueryCovered(query)) { + return true; + } else { + throw new VariantQueryException("Unable to apply given filter using only the secondary sample index."); + } + } if (SampleIndexQueryParser.validSampleIndexQuery(query)) { - if (isFullyCoveredQuery(query, options)) { return true; } @@ -114,6 +122,10 @@ protected Object getOrIterator(ParsedVariantQuery variantQuery, boolean iterator SampleIndexQuery sampleIndexQuery = sampleIndexDBAdaptor.parseSampleIndexQuery(query); logger.info("HBase SampleIndex, skip variants table"); + if (variantQuery.getSource() == VariantQuerySource.SECONDARY_SAMPLE_INDEX) { + variantQuery.getEvents().add(new Event(Event.Type.INFO, "Using only the secondary sample index. Skip main variants index." + + " Results might be partial.")); + } boolean count; Future asyncCountFuture; @@ -149,6 +161,11 @@ protected Object getOrIterator(ParsedVariantQuery variantQuery, boolean iterator } } + @Override + protected VariantQuerySource getSource() { + return VariantQuerySource.SECONDARY_SAMPLE_INDEX; + } + private VariantDBIterator getVariantDBIterator(SampleIndexQuery sampleIndexQuery, ParsedVariantQuery parsedQuery) { QueryOptions options = parsedQuery.getInputOptions(); VariantDBIterator variantIterator; @@ -164,7 +181,8 @@ private VariantDBIterator getVariantDBIterator(SampleIndexQuery sampleIndexQuery } catch (IOException e) { throw VariantQueryException.internalException(e).setQuery(parsedQuery.getInputQuery()); } - boolean includeAll = parsedQuery.getInputQuery().getBoolean("includeAllFromSampleIndex", false); + boolean includeAll = parsedQuery.getSource() == VariantQuerySource.SECONDARY_SAMPLE_INDEX + || parsedQuery.getInputQuery().getBoolean("includeAllFromSampleIndex", false); SampleVariantIndexEntryToVariantConverter converter = new SampleVariantIndexEntryToVariantConverter( parsedQuery, sampleIndexQuery, dbAdaptor.getMetadataManager(), includeAll); variantIterator = VariantDBIterator.wrapper(Iterators.transform(rawIterator, converter::convert)); @@ -183,14 +201,22 @@ protected boolean shouldGetCount(QueryOptions options, boolean iterator) { private boolean isFullyCoveredQuery(Query inputQuery, QueryOptions options) { Query query = new Query(inputQuery); -// ParsedVariantQuery parsedVariantQuery = variantQueryProjectionParser.parseQuery(query, options, true); SampleIndexQuery sampleIndexQuery = sampleIndexDBAdaptor.parseSampleIndexQuery(query); - return isQueryCovered(sampleIndexQuery.getUncoveredQuery()) + return isQueryCovered(sampleIndexQuery) && isIncludeCovered(sampleIndexQuery, inputQuery, options); } - private boolean isQueryCovered(Query query) { + private boolean isQueryCovered(Query inputQuery) { + Query query = new Query(inputQuery); + + SampleIndexQuery sampleIndexQuery = sampleIndexDBAdaptor.parseSampleIndexQuery(query); + + return isQueryCovered(sampleIndexQuery); + } + + private boolean isQueryCovered(SampleIndexQuery sampleIndexQuery) { + Query query = sampleIndexQuery.getUncoveredQuery(); if (VariantQueryUtils.isValidParam(query, VariantQueryUtils.SAMPLE_MENDELIAN_ERROR) || VariantQueryUtils.isValidParam(query, VariantQueryUtils.SAMPLE_DE_NOVO) || VariantQueryUtils.isValidParam(query, VariantQueryUtils.SAMPLE_DE_NOVO_STRICT)) { diff --git a/opencga-storage/opencga-storage-hadoop/opencga-storage-hadoop-core/src/test/java/org/opencb/opencga/storage/hadoop/variant/index/sample/SampleIndexTest.java b/opencga-storage/opencga-storage-hadoop/opencga-storage-hadoop-core/src/test/java/org/opencb/opencga/storage/hadoop/variant/index/sample/SampleIndexTest.java index 2ee70568412..8e6b8f87a6a 100644 --- a/opencga-storage/opencga-storage-hadoop/opencga-storage-hadoop-core/src/test/java/org/opencb/opencga/storage/hadoop/variant/index/sample/SampleIndexTest.java +++ b/opencga-storage/opencga-storage-hadoop/opencga-storage-hadoop-core/src/test/java/org/opencb/opencga/storage/hadoop/variant/index/sample/SampleIndexTest.java @@ -26,7 +26,6 @@ import org.opencb.opencga.core.config.storage.IndexFieldConfiguration; import org.opencb.opencga.core.config.storage.SampleIndexConfiguration; import org.opencb.opencga.core.models.variant.VariantAnnotationConstants; -import org.opencb.opencga.storage.core.variant.query.VariantQueryResult; import org.opencb.opencga.core.testclassification.duration.LongTests; import org.opencb.opencga.storage.core.exceptions.StorageEngineException; import org.opencb.opencga.storage.core.metadata.models.SampleMetadata; @@ -38,9 +37,7 @@ import org.opencb.opencga.storage.core.variant.adaptors.VariantField; import org.opencb.opencga.storage.core.variant.adaptors.VariantQuery; import org.opencb.opencga.storage.core.variant.adaptors.VariantQueryParam; -import org.opencb.opencga.storage.core.variant.query.ParsedVariantQuery; -import org.opencb.opencga.storage.core.variant.query.Values; -import org.opencb.opencga.storage.core.variant.query.VariantQueryUtils; +import org.opencb.opencga.storage.core.variant.query.*; import org.opencb.opencga.storage.core.variant.query.executors.VariantQueryExecutor; import org.opencb.opencga.storage.hadoop.variant.GenomeHelper; import org.opencb.opencga.storage.hadoop.variant.HadoopVariantStorageEngine; @@ -1210,6 +1207,30 @@ public void testSampleIndexOnlyVariantQueryExecutor() { } return v; }); + + testSampleIndexOnlyVariantQueryExecutor( + new VariantQuery() + .study(STUDY_NAME_6) + .sample("NA19600") + .includeGenotype(true) + .source(VariantQuerySource.SECONDARY_SAMPLE_INDEX), + new QueryOptions(), + SampleIndexOnlyVariantQueryExecutor.class, + av -> { + assertEquals(av.toString(), 1, av.getStudies().get(0).getFiles().size()); + for (FileEntry fe : av.getStudies().get(0).getFiles()) { + assertNotNull(fe.getData().get(StudyEntry.FILTER)); + fe.setData(Collections.emptyMap()); + } + return av; + }, + ev -> { + for (FileEntry fe : ev.getStudies().get(0).getFiles()) { + fe.setData(Collections.emptyMap()); + } + ev.setAnnotation(null); + return ev; + }); } private void testSampleIndexOnlyVariantQueryExecutor(VariantQuery query, QueryOptions options, Class expected) { @@ -1217,7 +1238,13 @@ private void testSampleIndexOnlyVariantQueryExecutor(VariantQuery query, QueryOp } private void testSampleIndexOnlyVariantQueryExecutor(VariantQuery query, QueryOptions options, Class expected, - Function mapper) { + Function expectedVariantMapper) { + testSampleIndexOnlyVariantQueryExecutor(query, options, expected, expectedVariantMapper, v -> v); + } + + private void testSampleIndexOnlyVariantQueryExecutor(VariantQuery query, QueryOptions options, Class expected, + Function actualVariantMapper, + Function expectedVariantMapper) { ParsedVariantQuery variantQuery = variantStorageEngine.parseQuery(query, options); VariantQueryExecutor variantQueryExecutor = variantStorageEngine.getVariantQueryExecutor(variantQuery); @@ -1251,7 +1278,8 @@ private void testSampleIndexOnlyVariantQueryExecutor(VariantQuery query, QueryOp for (int i = 0; i < actualVariants.size(); i++) { Variant av = actualVariants.get(i); Variant ev = expectedVariants.get(i); - mapper.apply(av); + actualVariantMapper.apply(av); + expectedVariantMapper.apply(ev); if (!ev.getStudies().isEmpty()) { if (av.getLengthAlternate() == 0 || av.getLengthReference() == 0) { // System.out.println("-------" + av + "----------"); @@ -1267,8 +1295,8 @@ private void testSampleIndexOnlyVariantQueryExecutor(VariantQuery query, QueryOp assertEquals(ev, av); } catch (AssertionError error) { System.out.println("-------" + av + "----------"); - System.out.println("DBAdaptor " + ev.toJson()); - System.out.println("Actual " + av.toJson()); + System.out.println("Expected (DBAdaptor) " + ev.toJson()); + System.out.println("Actual " + av.toJson()); throw error; } }