diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/cli/main/OpenCgaCompleter.java b/opencga-app/src/main/java/org/opencb/opencga/app/cli/main/OpenCgaCompleter.java index 7d8f592638..efa60539cb 100644 --- a/opencga-app/src/main/java/org/opencb/opencga/app/cli/main/OpenCgaCompleter.java +++ b/opencga-app/src/main/java/org/opencb/opencga/app/cli/main/OpenCgaCompleter.java @@ -44,7 +44,7 @@ public abstract class OpenCgaCompleter implements Completer { .map(Candidate::new) .collect(toList()); - private List clinicalList = asList( "acl-update","annotation-sets-load","clinical-configuration-update","create","distinct","interpretation-distinct","interpretation-search","interpretation-info","interpreter-cancer-tiering-run","interpreter-exomiser-run","interpreter-team-run","interpreter-tiering-run","interpreter-zetta-run","load","rga-aggregation-stats","rga-gene-query","rga-gene-summary","rga-index-run","rga-individual-query","rga-individual-summary","rga-variant-query","rga-variant-summary","search","variant-query","acl","delete","update","annotation-sets-annotations-update","info","interpretation-create","interpretation-clear","interpretation-delete","interpretation-revert","interpretation-update","report-update") + private List clinicalList = asList( "acl-update","aggregationstats","annotation-sets-load","clinical-configuration-update","create","distinct","interpretation-aggregation-stats","interpretation-distinct","interpretation-search","interpretation-info","interpreter-cancer-tiering-run","interpreter-exomiser-run","interpreter-team-run","interpreter-tiering-run","interpreter-zetta-run","load","rga-aggregation-stats","rga-gene-query","rga-gene-summary","rga-index-run","rga-individual-query","rga-individual-summary","rga-variant-query","rga-variant-summary","search","variant-query","acl","delete","update","annotation-sets-annotations-update","info","interpretation-create","interpretation-clear","interpretation-delete","interpretation-revert","interpretation-update","report-update") .stream() .map(Candidate::new) .collect(toList()); diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/cli/main/OpencgaCliOptionsParser.java b/opencga-app/src/main/java/org/opencb/opencga/app/cli/main/OpencgaCliOptionsParser.java index fa36aea2db..ec5f2e3186 100644 --- a/opencga-app/src/main/java/org/opencb/opencga/app/cli/main/OpencgaCliOptionsParser.java +++ b/opencga-app/src/main/java/org/opencb/opencga/app/cli/main/OpencgaCliOptionsParser.java @@ -113,10 +113,12 @@ public OpencgaCliOptionsParser() { jCommander.addCommand("clinical", analysisClinicalCommandOptions); JCommander analysisClinicalSubCommands = jCommander.getCommands().get("clinical"); analysisClinicalSubCommands.addCommand("acl-update", analysisClinicalCommandOptions.updateAclCommandOptions); + analysisClinicalSubCommands.addCommand("aggregationstats", analysisClinicalCommandOptions.aggregationStatsCommandOptions); analysisClinicalSubCommands.addCommand("annotation-sets-load", analysisClinicalCommandOptions.loadAnnotationSetsCommandOptions); analysisClinicalSubCommands.addCommand("clinical-configuration-update", analysisClinicalCommandOptions.updateClinicalConfigurationCommandOptions); analysisClinicalSubCommands.addCommand("create", analysisClinicalCommandOptions.createCommandOptions); analysisClinicalSubCommands.addCommand("distinct", analysisClinicalCommandOptions.distinctCommandOptions); + analysisClinicalSubCommands.addCommand("interpretation-aggregation-stats", analysisClinicalCommandOptions.aggregationStatsInterpretationCommandOptions); analysisClinicalSubCommands.addCommand("interpretation-distinct", analysisClinicalCommandOptions.distinctInterpretationCommandOptions); analysisClinicalSubCommands.addCommand("interpretation-search", analysisClinicalCommandOptions.searchInterpretationCommandOptions); analysisClinicalSubCommands.addCommand("interpretation-info", analysisClinicalCommandOptions.infoInterpretationCommandOptions); 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 07dbf9230f..e34d42207f 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 @@ -103,6 +103,9 @@ public void execute() throws Exception { case "acl-update": queryResponse = updateAcl(); break; + case "aggregationstats": + queryResponse = aggregationStats(); + break; case "annotation-sets-load": queryResponse = loadAnnotationSets(); break; @@ -115,6 +118,9 @@ public void execute() throws Exception { case "distinct": queryResponse = distinct(); break; + case "interpretation-aggregation-stats": + queryResponse = aggregationStatsInterpretation(); + break; case "interpretation-distinct": queryResponse = distinctInterpretation(); break; @@ -248,6 +254,48 @@ private RestResponse updateAcl() throws Exception return openCGAClient.getClinicalAnalysisClient().updateAcl(commandOptions.members, commandOptions.action, clinicalAnalysisAclUpdateParams, queryParams); } + private RestResponse aggregationStats() throws Exception { + logger.debug("Executing aggregationStats in Analysis - Clinical command line"); + + AnalysisClinicalCommandOptions.AggregationStatsCommandOptions commandOptions = analysisClinicalCommandOptions.aggregationStatsCommandOptions; + + ObjectMap queryParams = new ObjectMap(); + queryParams.putIfNotEmpty("study", commandOptions.study); + queryParams.putIfNotEmpty("id", commandOptions.id); + queryParams.putIfNotEmpty("uuid", commandOptions.uuid); + queryParams.putIfNotEmpty("type", commandOptions.type); + queryParams.putIfNotEmpty("disorder", commandOptions.disorder); + queryParams.putIfNotEmpty("files", commandOptions.files); + queryParams.putIfNotEmpty("sample", commandOptions.sample); + queryParams.putIfNotEmpty("individual", commandOptions.individual); + queryParams.putIfNotEmpty("proband", commandOptions.proband); + queryParams.putIfNotEmpty("probandSamples", commandOptions.probandSamples); + queryParams.putIfNotEmpty("family", commandOptions.family); + queryParams.putIfNotEmpty("familyMembers", commandOptions.familyMembers); + queryParams.putIfNotEmpty("familyMemberSamples", commandOptions.familyMemberSamples); + queryParams.putIfNotEmpty("panels", commandOptions.panels); + queryParams.putIfNotNull("locked", commandOptions.locked); + queryParams.putIfNotEmpty("analystId", commandOptions.analystId); + queryParams.putIfNotEmpty("priority", commandOptions.priority); + queryParams.putIfNotEmpty("flags", commandOptions.flags); + queryParams.putIfNotEmpty("creationDate", commandOptions.creationDate); + queryParams.putIfNotEmpty("modificationDate", commandOptions.modificationDate); + queryParams.putIfNotEmpty("dueDate", commandOptions.dueDate); + queryParams.putIfNotEmpty("qualityControlSummary", commandOptions.qualityControlSummary); + queryParams.putIfNotEmpty("release", commandOptions.release); + queryParams.putIfNotNull("snapshot", commandOptions.snapshot); + queryParams.putIfNotEmpty("status", commandOptions.status); + queryParams.putIfNotEmpty("internalStatus", commandOptions.internalStatus); + queryParams.putIfNotEmpty("annotation", commandOptions.annotation); + queryParams.putIfNotNull("deleted", commandOptions.deleted); + queryParams.putIfNotEmpty("field", commandOptions.field); + if (queryParams.get("study") == null && OpencgaMain.isShellMode()) { + queryParams.putIfNotEmpty("study", sessionManager.getSession().getCurrentStudy()); + } + + return openCGAClient.getClinicalAnalysisClient().aggregationStats(queryParams); + } + private RestResponse loadAnnotationSets() throws Exception { logger.debug("Executing loadAnnotationSets in Analysis - Clinical command line"); @@ -432,6 +480,35 @@ private RestResponse distinct() throws Exception { return openCGAClient.getClinicalAnalysisClient().distinct(commandOptions.field, queryParams); } + private RestResponse aggregationStatsInterpretation() throws Exception { + logger.debug("Executing aggregationStatsInterpretation in Analysis - Clinical command line"); + + AnalysisClinicalCommandOptions.AggregationStatsInterpretationCommandOptions commandOptions = analysisClinicalCommandOptions.aggregationStatsInterpretationCommandOptions; + + ObjectMap queryParams = new ObjectMap(); + queryParams.putIfNotEmpty("study", commandOptions.study); + queryParams.putIfNotEmpty("id", commandOptions.id); + queryParams.putIfNotEmpty("uuid", commandOptions.uuid); + queryParams.putIfNotEmpty("name", commandOptions.name); + queryParams.putIfNotEmpty("clinicalAnalysisId", commandOptions.clinicalAnalysisId); + queryParams.putIfNotEmpty("analystId", commandOptions.analystId); + queryParams.putIfNotEmpty("methodName", commandOptions.methodName); + queryParams.putIfNotEmpty("panels", commandOptions.panels); + queryParams.putIfNotEmpty("primaryFindings", commandOptions.primaryFindings); + queryParams.putIfNotEmpty("secondaryFindings", commandOptions.secondaryFindings); + queryParams.putIfNotEmpty("creationDate", commandOptions.creationDate); + queryParams.putIfNotEmpty("modificationDate", commandOptions.modificationDate); + queryParams.putIfNotEmpty("status", commandOptions.status); + queryParams.putIfNotEmpty("internalStatus", commandOptions.internalStatus); + queryParams.putIfNotEmpty("release", commandOptions.release); + queryParams.putIfNotEmpty("field", commandOptions.field); + if (queryParams.get("study") == null && OpencgaMain.isShellMode()) { + queryParams.putIfNotEmpty("study", sessionManager.getSession().getCurrentStudy()); + } + + return openCGAClient.getClinicalAnalysisClient().aggregationStatsInterpretation(queryParams); + } + private RestResponse distinctInterpretation() throws Exception { logger.debug("Executing distinctInterpretation in Analysis - Clinical command line"); 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 b9dc5e1956..e932b48498 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 @@ -34,10 +34,12 @@ public class AnalysisClinicalCommandOptions { public CommonCommandOptions commonCommandOptions; public UpdateAclCommandOptions updateAclCommandOptions; + public AggregationStatsCommandOptions aggregationStatsCommandOptions; public LoadAnnotationSetsCommandOptions loadAnnotationSetsCommandOptions; public UpdateClinicalConfigurationCommandOptions updateClinicalConfigurationCommandOptions; public CreateCommandOptions createCommandOptions; public DistinctCommandOptions distinctCommandOptions; + public AggregationStatsInterpretationCommandOptions aggregationStatsInterpretationCommandOptions; public DistinctInterpretationCommandOptions distinctInterpretationCommandOptions; public SearchInterpretationCommandOptions searchInterpretationCommandOptions; public InfoInterpretationCommandOptions infoInterpretationCommandOptions; @@ -75,10 +77,12 @@ public AnalysisClinicalCommandOptions(CommonCommandOptions commonCommandOptions, this.jCommander = jCommander; this.commonCommandOptions = commonCommandOptions; this.updateAclCommandOptions = new UpdateAclCommandOptions(); + this.aggregationStatsCommandOptions = new AggregationStatsCommandOptions(); this.loadAnnotationSetsCommandOptions = new LoadAnnotationSetsCommandOptions(); this.updateClinicalConfigurationCommandOptions = new UpdateClinicalConfigurationCommandOptions(); this.createCommandOptions = new CreateCommandOptions(); this.distinctCommandOptions = new DistinctCommandOptions(); + this.aggregationStatsInterpretationCommandOptions = new AggregationStatsInterpretationCommandOptions(); this.distinctInterpretationCommandOptions = new DistinctInterpretationCommandOptions(); this.searchInterpretationCommandOptions = new SearchInterpretationCommandOptions(); this.infoInterpretationCommandOptions = new InfoInterpretationCommandOptions(); @@ -144,6 +148,101 @@ public class UpdateAclCommandOptions { } + @Parameters(commandNames = {"aggregationstats"}, commandDescription ="Fetch catalog clinical analysis aggregation stats") + public class AggregationStatsCommandOptions { + + @ParametersDelegate + public CommonCommandOptions commonOptions = commonCommandOptions; + + @Parameter(names = {"--study", "-s"}, description = "Study [[organization@]project:]study where study and project can be either the ID or UUID", required = false, arity = 1) + public String study; + + @Parameter(names = {"--id"}, description = "Comma separated list of Clinical Analysis IDs up to a maximum of 100. Also admits basic regular expressions using the operator '~', i.e. '~{perl-regex}' e.g. '~value' for case sensitive, '~/value/i' for case insensitive search.", required = false, arity = 1) + public String id; + + @Parameter(names = {"--uuid"}, description = "Comma separated list of Clinical Analysis UUIDs up to a maximum of 100", required = false, arity = 1) + public String uuid; + + @Parameter(names = {"--type"}, description = "Clinical Analysis type", required = false, arity = 1) + public String type; + + @Parameter(names = {"--disorder"}, description = "Clinical Analysis disorder. Also admits basic regular expressions using the operator '~', i.e. '~{perl-regex}' e.g. '~value' for case sensitive, '~/value/i' for case insensitive search.", required = false, arity = 1) + public String disorder; + + @Parameter(names = {"--files"}, description = "Clinical Analysis files", required = false, arity = 1) + public String files; + + @Parameter(names = {"--sample"}, description = "Sample associated to the proband or any member of a family", required = false, arity = 1) + public String sample; + + @Parameter(names = {"--individual"}, description = "Proband or any member of a family", required = false, arity = 1) + public String individual; + + @Parameter(names = {"--proband"}, description = "Clinical Analysis proband", required = false, arity = 1) + public String proband; + + @Parameter(names = {"--proband-samples"}, description = "Clinical Analysis proband samples", required = false, arity = 1) + public String probandSamples; + + @Parameter(names = {"--family"}, description = "Clinical Analysis family", required = false, arity = 1) + public String family; + + @Parameter(names = {"--family-members"}, description = "Clinical Analysis family members", required = false, arity = 1) + public String familyMembers; + + @Parameter(names = {"--family-member-samples"}, description = "Clinical Analysis family members samples", required = false, arity = 1) + public String familyMemberSamples; + + @Parameter(names = {"--panels"}, description = "Clinical Analysis panels", required = false, arity = 1) + public String panels; + + @Parameter(names = {"--locked"}, description = "Locked Clinical Analyses", required = false, arity = 1) + public Boolean locked; + + @Parameter(names = {"--analyst-id"}, description = "Clinical Analysis analyst id", required = false, arity = 1) + public String analystId; + + @Parameter(names = {"--priority"}, description = "Clinical Analysis priority", required = false, arity = 1) + public String priority; + + @Parameter(names = {"--flags"}, description = "Clinical Analysis flags", required = false, arity = 1) + public String flags; + + @Parameter(names = {"--creation-date", "--cd"}, description = "Clinical Analysis Creation date. Format: yyyyMMddHHmmss. Examples: >2018, 2017-2018, <201805", required = false, arity = 1) + public String creationDate; + + @Parameter(names = {"--modification-date", "--md"}, description = "Clinical Analysis Modification date. Format: yyyyMMddHHmmss. Examples: >2018, 2017-2018, <201805", required = false, arity = 1) + public String modificationDate; + + @Parameter(names = {"--due-date"}, description = "Clinical Analysis due date. Format: yyyyMMddHHmmss. Examples: >2018, 2017-2018, <201805", required = false, arity = 1) + public String dueDate; + + @Parameter(names = {"--quality-control-summary"}, description = "Clinical Analysis quality control summary", required = false, arity = 1) + public String qualityControlSummary; + + @Parameter(names = {"--release"}, description = "Release when it was created", required = false, arity = 1) + public String release; + + @Parameter(names = {"--snapshot"}, description = "Snapshot value (Latest version of the entry in the specified release)", required = false, arity = 1) + public Integer snapshot; + + @Parameter(names = {"--status"}, description = "Filter by status", required = false, arity = 1) + public String status; + + @Parameter(names = {"--internal-status"}, description = "Filter by internal status", required = false, arity = 1) + public String internalStatus; + + @Parameter(names = {"--annotation"}, description = "Annotation filters. Example: age>30;gender=FEMALE. For more information, please visit http://docs.opencb.org/display/opencga/AnnotationSets+1.4.0", required = false, arity = 1) + public String annotation; + + @Parameter(names = {"--deleted"}, description = "Boolean to retrieve deleted entries", required = false, help = true, arity = 0) + public boolean deleted = false; + + @Parameter(names = {"--field"}, description = "List of fields separated by semicolons, e.g.: studies;type;numSamples[0..10]:1", required = false, arity = 1) + public String field; + + } + @Parameters(commandNames = {"annotation-sets-load"}, commandDescription ="Load annotation sets from a TSV file") public class LoadAnnotationSetsCommandOptions { @@ -446,6 +545,62 @@ public class DistinctCommandOptions { } + @Parameters(commandNames = {"interpretation-aggregation-stats"}, commandDescription ="Fetch catalog interpretation aggregation stats") + public class AggregationStatsInterpretationCommandOptions { + + @ParametersDelegate + public CommonCommandOptions commonOptions = commonCommandOptions; + + @Parameter(names = {"--study", "-s"}, description = "Study [[organization@]project:]study where study and project can be either the ID or UUID", required = false, arity = 1) + public String study; + + @Parameter(names = {"--id"}, description = "Comma separated list of Interpretation IDs up to a maximum of 100. Also admits basic regular expressions using the operator '~', i.e. '~{perl-regex}' e.g. '~value' for case sensitive, '~/value/i' for case insensitive search.", required = false, arity = 1) + public String id; + + @Parameter(names = {"--uuid"}, description = "Comma separated list of Interpretation UUIDs up to a maximum of 100", required = false, arity = 1) + public String uuid; + + @Parameter(names = {"--name", "-n"}, description = "Comma separated list of Interpretation names up to a maximum of 100", required = false, arity = 1) + public String name; + + @Parameter(names = {"--clinical-analysis-id"}, description = "Clinical Analysis id", required = false, arity = 1) + public String clinicalAnalysisId; + + @Parameter(names = {"--analyst-id"}, description = "Analyst ID", required = false, arity = 1) + public String analystId; + + @Parameter(names = {"--method-name"}, description = "Interpretation method name. Also admits basic regular expressions using the operator '~', i.e. '~{perl-regex}' e.g. '~value' for case sensitive, '~/value/i' for case insensitive search.", required = false, arity = 1) + public String methodName; + + @Parameter(names = {"--panels"}, description = "Interpretation panels", required = false, arity = 1) + public String panels; + + @Parameter(names = {"--primary-findings"}, description = "Interpretation primary findings", required = false, arity = 1) + public String primaryFindings; + + @Parameter(names = {"--secondary-findings"}, description = "Interpretation secondary findings", required = false, arity = 1) + public String secondaryFindings; + + @Parameter(names = {"--creation-date", "--cd"}, description = "Interpretation Creation date. Format: yyyyMMddHHmmss. Examples: >2018, 2017-2018, <201805", required = false, arity = 1) + public String creationDate; + + @Parameter(names = {"--modification-date", "--md"}, description = "Interpretation Modification date. Format: yyyyMMddHHmmss. Examples: >2018, 2017-2018, <201805", required = false, arity = 1) + public String modificationDate; + + @Parameter(names = {"--status"}, description = "Filter by status", required = false, arity = 1) + public String status; + + @Parameter(names = {"--internal-status"}, description = "Filter by internal status", required = false, arity = 1) + public String internalStatus; + + @Parameter(names = {"--release"}, description = "Release when it was created", required = false, arity = 1) + public String release; + + @Parameter(names = {"--field"}, description = "List of fields separated by semicolons, e.g.: studies;type;numSamples[0..10]:1", required = false, arity = 1) + public String field; + + } + @Parameters(commandNames = {"interpretation-distinct"}, commandDescription ="Interpretation distinct method") public class DistinctInterpretationCommandOptions { diff --git a/opencga-client/src/main/R/R/Clinical-methods.R b/opencga-client/src/main/R/R/Clinical-methods.R index a45c200d12..80041b0ecd 100644 --- a/opencga-client/src/main/R/R/Clinical-methods.R +++ b/opencga-client/src/main/R/R/Clinical-methods.R @@ -20,10 +20,12 @@ #' | endpointName | Endpoint WS | parameters accepted | #' | -- | :-- | --: | #' | updateAcl | /{apiVersion}/analysis/clinical/acl/{members}/update | study, members[*], action[*], propagate, body[*] | +#' | aggregationStats | /{apiVersion}/analysis/clinical/aggregationStats | 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, field | #' | loadAnnotationSets | /{apiVersion}/analysis/clinical/annotationSets/load | study, variableSetId[*], path[*], parents, annotationSetId, body | #' | updateClinicalConfiguration | /{apiVersion}/analysis/clinical/clinical/configuration/update | study, body | #' | create | /{apiVersion}/analysis/clinical/create | include, exclude, study, skipCreateDefaultInterpretation, includeResult, body[*] | #' | distinct | /{apiVersion}/analysis/clinical/distinct | 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, field[*] | +#' | aggregationStatsInterpretation | /{apiVersion}/analysis/clinical/interpretation/aggregationStats | study, id, uuid, name, clinicalAnalysisId, analystId, methodName, panels, primaryFindings, secondaryFindings, creationDate, modificationDate, status, internalStatus, release, field | #' | distinctInterpretation | /{apiVersion}/analysis/clinical/interpretation/distinct | study, id, uuid, name, clinicalAnalysisId, analystId, methodName, panels, primaryFindings, secondaryFindings, creationDate, modificationDate, status, internalStatus, release, field[*] | #' | searchInterpretation | /{apiVersion}/analysis/clinical/interpretation/search | include, exclude, limit, skip, sort, study, id, uuid, name, clinicalAnalysisId, analystId, methodName, panels, primaryFindings, secondaryFindings, creationDate, modificationDate, status, internalStatus, release | #' | infoInterpretation | /{apiVersion}/analysis/clinical/interpretation/{interpretations}/info | include, exclude, interpretations[*], study, version, deleted | @@ -75,6 +77,41 @@ setMethod("clinicalClient", "OpencgaR", function(OpencgaR, annotationSet, clinic subcategoryId=members, action="update", params=params, httpMethod="POST", as.queryParam=c("action"), ...), + #' @section Endpoint /{apiVersion}/analysis/clinical/aggregationStats: + #' Fetch catalog clinical analysis aggregation stats. + #' @param study Study [[organization@]project:]study where study and project can be either the ID or UUID. + #' @param id Comma separated list of Clinical Analysis IDs up to a maximum of 100. Also admits basic regular expressions using the operator '~', i.e. '~{perl-regex}' e.g. '~value' for case sensitive, '~/value/i' for case insensitive search. + #' @param uuid Comma separated list of Clinical Analysis UUIDs up to a maximum of 100. + #' @param type Clinical Analysis type. + #' @param disorder Clinical Analysis disorder. Also admits basic regular expressions using the operator '~', i.e. '~{perl-regex}' e.g. '~value' for case sensitive, '~/value/i' for case insensitive search. + #' @param files Clinical Analysis files. + #' @param sample Sample associated to the proband or any member of a family. + #' @param individual Proband or any member of a family. + #' @param proband Clinical Analysis proband. + #' @param probandSamples Clinical Analysis proband samples. + #' @param family Clinical Analysis family. + #' @param familyMembers Clinical Analysis family members. + #' @param familyMemberSamples Clinical Analysis family members samples. + #' @param panels Clinical Analysis panels. + #' @param locked Locked Clinical Analyses. + #' @param analystId Clinical Analysis analyst id. + #' @param priority Clinical Analysis priority. + #' @param flags Clinical Analysis flags. + #' @param creationDate Clinical Analysis Creation date. Format: yyyyMMddHHmmss. Examples: >2018, 2017-2018, <201805. + #' @param modificationDate Clinical Analysis Modification date. Format: yyyyMMddHHmmss. Examples: >2018, 2017-2018, <201805. + #' @param dueDate Clinical Analysis due date. Format: yyyyMMddHHmmss. Examples: >2018, 2017-2018, <201805. + #' @param qualityControlSummary Clinical Analysis quality control summary. + #' @param release Release when it was created. + #' @param snapshot Snapshot value (Latest version of the entry in the specified release). + #' @param status Filter by status. + #' @param internalStatus Filter by internal status. + #' @param annotation Annotation filters. Example: age>30;gender=FEMALE. For more information, please visit http://docs.opencb.org/display/opencga/AnnotationSets+1.4.0. + #' @param deleted Boolean to retrieve deleted entries. + #' @param field List of fields separated by semicolons, e.g.: studies;type;numSamples[0..10]:1. + aggregationStats=fetchOpenCGA(object=OpencgaR, category="analysis", categoryId=NULL, subcategory="clinical", + subcategoryId=NULL, action="aggregationStats", params=params, httpMethod="GET", as.queryParam=NULL, + ...), + #' @section Endpoint /{apiVersion}/analysis/clinical/annotationSets/load: #' Load annotation sets from a TSV file. #' @param study Study [[organization@]project:]study where study and project can be either the ID or UUID. @@ -140,6 +177,28 @@ setMethod("clinicalClient", "OpencgaR", function(OpencgaR, annotationSet, clinic distinct=fetchOpenCGA(object=OpencgaR, category="analysis", categoryId=NULL, subcategory="clinical", subcategoryId=NULL, action="distinct", params=params, httpMethod="GET", as.queryParam=c("field"), ...), + #' @section Endpoint /{apiVersion}/analysis/clinical/interpretation/aggregationStats: + #' Fetch catalog interpretation aggregation stats. + #' @param study Study [[organization@]project:]study where study and project can be either the ID or UUID. + #' @param id Comma separated list of Interpretation IDs up to a maximum of 100. Also admits basic regular expressions using the operator '~', i.e. '~{perl-regex}' e.g. '~value' for case sensitive, '~/value/i' for case insensitive search. + #' @param uuid Comma separated list of Interpretation UUIDs up to a maximum of 100. + #' @param name Comma separated list of Interpretation names up to a maximum of 100. + #' @param clinicalAnalysisId Clinical Analysis id. + #' @param analystId Analyst ID. + #' @param methodName Interpretation method name. Also admits basic regular expressions using the operator '~', i.e. '~{perl-regex}' e.g. '~value' for case sensitive, '~/value/i' for case insensitive search. + #' @param panels Interpretation panels. + #' @param primaryFindings Interpretation primary findings. + #' @param secondaryFindings Interpretation secondary findings. + #' @param creationDate Interpretation Creation date. Format: yyyyMMddHHmmss. Examples: >2018, 2017-2018, <201805. + #' @param modificationDate Interpretation Modification date. Format: yyyyMMddHHmmss. Examples: >2018, 2017-2018, <201805. + #' @param status Filter by status. + #' @param internalStatus Filter by internal status. + #' @param release Release when it was created. + #' @param field List of fields separated by semicolons, e.g.: studies;type;numSamples[0..10]:1. + aggregationStatsInterpretation=fetchOpenCGA(object=OpencgaR, category="analysis", categoryId=NULL, + subcategory="clinical/interpretation", subcategoryId=NULL, action="aggregationStats", params=params, + httpMethod="GET", as.queryParam=NULL, ...), + #' @section Endpoint /{apiVersion}/analysis/clinical/interpretation/distinct: #' Interpretation distinct method. #' @param study Study [[organization@]project:]study where study and project can be either the ID or UUID. 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 7e94ff8272..8d4eea71b9 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 @@ -90,6 +90,49 @@ public RestResponse updateAcl(String members, Stri return execute("analysis", null, "clinical/acl", members, "update", params, POST, ClinicalAnalysisAclEntryList.class); } + /** + * Fetch catalog clinical analysis aggregation stats. + * @param params Map containing any of the following optional parameters. + * study: Study [[organization@]project:]study where study and project can be either the ID or UUID. + * id: Comma separated list of Clinical Analysis IDs up to a maximum of 100. Also admits basic regular expressions using the + * operator '~', i.e. '~{perl-regex}' e.g. '~value' for case sensitive, '~/value/i' for case insensitive search. + * uuid: Comma separated list of Clinical Analysis UUIDs up to a maximum of 100. + * type: Clinical Analysis type. + * disorder: Clinical Analysis disorder. Also admits basic regular expressions using the operator '~', i.e. '~{perl-regex}' e.g. + * '~value' for case sensitive, '~/value/i' for case insensitive search. + * files: Clinical Analysis files. + * sample: Sample associated to the proband or any member of a family. + * individual: Proband or any member of a family. + * proband: Clinical Analysis proband. + * probandSamples: Clinical Analysis proband samples. + * family: Clinical Analysis family. + * familyMembers: Clinical Analysis family members. + * familyMemberSamples: Clinical Analysis family members samples. + * panels: Clinical Analysis panels. + * locked: Locked Clinical Analyses. + * analystId: Clinical Analysis analyst id. + * priority: Clinical Analysis priority. + * flags: Clinical Analysis flags. + * creationDate: Clinical Analysis Creation date. Format: yyyyMMddHHmmss. Examples: >2018, 2017-2018, <201805. + * modificationDate: Clinical Analysis Modification date. Format: yyyyMMddHHmmss. Examples: >2018, 2017-2018, <201805. + * dueDate: Clinical Analysis due date. Format: yyyyMMddHHmmss. Examples: >2018, 2017-2018, <201805. + * qualityControlSummary: Clinical Analysis quality control summary. + * release: Release when it was created. + * snapshot: Snapshot value (Latest version of the entry in the specified release). + * status: Filter by status. + * internalStatus: Filter by internal status. + * annotation: Annotation filters. Example: age>30;gender=FEMALE. For more information, please visit + * http://docs.opencb.org/display/opencga/AnnotationSets+1.4.0. + * deleted: Boolean to retrieve deleted entries. + * field: List of fields separated by semicolons, e.g.: studies;type;numSamples[0..10]:1. + * @return a RestResponse object. + * @throws ClientException ClientException if there is any server error. + */ + public RestResponse aggregationStats(ObjectMap params) throws ClientException { + params = params != null ? params : new ObjectMap(); + return execute("analysis", null, "clinical", null, "aggregationStats", params, GET, FacetField.class); + } + /** * Load annotation sets from a TSV file. * @param variableSetId Variable set ID or name. @@ -190,6 +233,35 @@ public RestResponse distinct(String field, ObjectMap params) throws C return execute("analysis", null, "clinical", null, "distinct", params, GET, ObjectMap.class); } + /** + * Fetch catalog interpretation aggregation stats. + * @param params Map containing any of the following optional parameters. + * study: Study [[organization@]project:]study where study and project can be either the ID or UUID. + * id: Comma separated list of Interpretation IDs up to a maximum of 100. Also admits basic regular expressions using the + * operator '~', i.e. '~{perl-regex}' e.g. '~value' for case sensitive, '~/value/i' for case insensitive search. + * uuid: Comma separated list of Interpretation UUIDs up to a maximum of 100. + * name: Comma separated list of Interpretation names up to a maximum of 100. + * clinicalAnalysisId: Clinical Analysis id. + * analystId: Analyst ID. + * methodName: Interpretation method name. Also admits basic regular expressions using the operator '~', i.e. '~{perl-regex}' + * e.g. '~value' for case sensitive, '~/value/i' for case insensitive search. + * panels: Interpretation panels. + * primaryFindings: Interpretation primary findings. + * secondaryFindings: Interpretation secondary findings. + * creationDate: Interpretation Creation date. Format: yyyyMMddHHmmss. Examples: >2018, 2017-2018, <201805. + * modificationDate: Interpretation Modification date. Format: yyyyMMddHHmmss. Examples: >2018, 2017-2018, <201805. + * status: Filter by status. + * internalStatus: Filter by internal status. + * release: Release when it was created. + * field: List of fields separated by semicolons, e.g.: studies;type;numSamples[0..10]:1. + * @return a RestResponse object. + * @throws ClientException ClientException if there is any server error. + */ + public RestResponse aggregationStatsInterpretation(ObjectMap params) throws ClientException { + params = params != null ? params : new ObjectMap(); + return execute("analysis", null, "clinical/interpretation", null, "aggregationStats", params, GET, FacetField.class); + } + /** * Interpretation distinct method. * @param field Comma separated list of fields for which to obtain the distinct values. diff --git a/opencga-client/src/main/javascript/ClinicalAnalysis.js b/opencga-client/src/main/javascript/ClinicalAnalysis.js index 931d5fe01c..d7bb1b30b3 100644 --- a/opencga-client/src/main/javascript/ClinicalAnalysis.js +++ b/opencga-client/src/main/javascript/ClinicalAnalysis.js @@ -48,6 +48,47 @@ export default class ClinicalAnalysis extends OpenCGAParentClass { return this._post("analysis", null, "clinical/acl", members, "update", data, {action, ...params}); } + /** Fetch catalog clinical analysis aggregation stats + * @param {Object} [params] - The Object containing the following optional parameters: + * @param {String} [params.study] - Study [[organization@]project:]study where study and project can be either the ID or UUID. + * @param {String} [params.id] - Comma separated list of Clinical Analysis IDs up to a maximum of 100. Also admits basic regular + * expressions using the operator '~', i.e. '~{perl-regex}' e.g. '~value' for case sensitive, '~/value/i' for case insensitive search. + * @param {String} [params.uuid] - Comma separated list of Clinical Analysis UUIDs up to a maximum of 100. + * @param {String} [params.type] - Clinical Analysis type. + * @param {String} [params.disorder] - Clinical Analysis disorder. Also admits basic regular expressions using the operator '~', i.e. + * '~{perl-regex}' e.g. '~value' for case sensitive, '~/value/i' for case insensitive search. + * @param {String} [params.files] - Clinical Analysis files. + * @param {String} [params.sample] - Sample associated to the proband or any member of a family. + * @param {String} [params.individual] - Proband or any member of a family. + * @param {String} [params.proband] - Clinical Analysis proband. + * @param {String} [params.probandSamples] - Clinical Analysis proband samples. + * @param {String} [params.family] - Clinical Analysis family. + * @param {String} [params.familyMembers] - Clinical Analysis family members. + * @param {String} [params.familyMemberSamples] - Clinical Analysis family members samples. + * @param {String} [params.panels] - Clinical Analysis panels. + * @param {Boolean} [params.locked] - Locked Clinical Analyses. + * @param {String} [params.analystId] - Clinical Analysis analyst id. + * @param {String} [params.priority] - Clinical Analysis priority. + * @param {String} [params.flags] - Clinical Analysis flags. + * @param {String} [params.creationDate] - Clinical Analysis Creation date. Format: yyyyMMddHHmmss. Examples: >2018, 2017-2018, <201805. + * @param {String} [params.modificationDate] - Clinical Analysis Modification date. Format: yyyyMMddHHmmss. Examples: >2018, 2017-2018, + * <201805. + * @param {String} [params.dueDate] - Clinical Analysis due date. Format: yyyyMMddHHmmss. Examples: >2018, 2017-2018, <201805. + * @param {String} [params.qualityControlSummary] - Clinical Analysis quality control summary. + * @param {String} [params.release] - Release when it was created. + * @param {Number} [params.snapshot] - Snapshot value (Latest version of the entry in the specified release). + * @param {String} [params.status] - Filter by status. + * @param {String} [params.internalStatus] - Filter by internal status. + * @param {String} [params.annotation] - Annotation filters. Example: age>30;gender=FEMALE. For more information, please visit + * http://docs.opencb.org/display/opencga/AnnotationSets+1.4.0. + * @param {Boolean} [params.deleted] - Boolean to retrieve deleted entries. + * @param {String} [params.field] - List of fields separated by semicolons, e.g.: studies;type;numSamples[0..10]:1. + * @returns {Promise} Promise object in the form of RestResponse instance. + */ + aggregationStats(params) { + return this._get("analysis", null, "clinical", null, "aggregationStats", params); + } + /** Load annotation sets from a TSV file * @param {Object} [data] - JSON containing the 'content' of the TSV file if this has not yet been registered into OpenCGA. * @param {String} variableSetId - Variable set ID or name. @@ -130,6 +171,33 @@ export default class ClinicalAnalysis extends OpenCGAParentClass { return this._get("analysis", null, "clinical", null, "distinct", {field, ...params}); } + /** Fetch catalog interpretation aggregation stats + * @param {Object} [params] - The Object containing the following optional parameters: + * @param {String} [params.study] - Study [[organization@]project:]study where study and project can be either the ID or UUID. + * @param {String} [params.id] - Comma separated list of Interpretation IDs up to a maximum of 100. Also admits basic regular expressions + * using the operator '~', i.e. '~{perl-regex}' e.g. '~value' for case sensitive, '~/value/i' for case insensitive search. + * @param {String} [params.uuid] - Comma separated list of Interpretation UUIDs up to a maximum of 100. + * @param {String} [params.name] - Comma separated list of Interpretation names up to a maximum of 100. + * @param {String} [params.clinicalAnalysisId] - Clinical Analysis id. + * @param {String} [params.analystId] - Analyst ID. + * @param {String} [params.methodName] - Interpretation method name. Also admits basic regular expressions using the operator '~', i.e. + * '~{perl-regex}' e.g. '~value' for case sensitive, '~/value/i' for case insensitive search. + * @param {String} [params.panels] - Interpretation panels. + * @param {String} [params.primaryFindings] - Interpretation primary findings. + * @param {String} [params.secondaryFindings] - Interpretation secondary findings. + * @param {String} [params.creationDate] - Interpretation Creation date. Format: yyyyMMddHHmmss. Examples: >2018, 2017-2018, <201805. + * @param {String} [params.modificationDate] - Interpretation Modification date. Format: yyyyMMddHHmmss. Examples: >2018, 2017-2018, + * <201805. + * @param {String} [params.status] - Filter by status. + * @param {String} [params.internalStatus] - Filter by internal status. + * @param {String} [params.release] - Release when it was created. + * @param {String} [params.field] - List of fields separated by semicolons, e.g.: studies;type;numSamples[0..10]:1. + * @returns {Promise} Promise object in the form of RestResponse instance. + */ + aggregationStatsInterpretation(params) { + return this._get("analysis", null, "clinical/interpretation", null, "aggregationStats", params); + } + /** Interpretation distinct method * @param {String} field - Comma separated list of fields for which to obtain the distinct values. * @param {Object} [params] - The Object containing the following optional parameters: 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 0a53151521..3101c975bb 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 @@ -39,6 +39,62 @@ def update_acl(self, members, action, data=None, **options): options['action'] = action return self._post(category='analysis', resource='update', subcategory='clinical/acl', second_query_id=members, data=data, **options) + def aggregation_stats(self, **options): + """ + Fetch catalog clinical analysis aggregation stats. + PATH: /{apiVersion}/analysis/clinical/aggregationStats + + :param str study: Study [[organization@]project:]study where study and + project can be either the ID or UUID. + :param str id: Comma separated list of Clinical Analysis IDs up to a + maximum of 100. Also admits basic regular expressions using the + operator '~', i.e. '~{perl-regex}' e.g. '~value' for case + sensitive, '~/value/i' for case insensitive search. + :param str uuid: Comma separated list of Clinical Analysis UUIDs up to + a maximum of 100. + :param str type: Clinical Analysis type. + :param str disorder: Clinical Analysis disorder. Also admits basic + regular expressions using the operator '~', i.e. '~{perl-regex}' + e.g. '~value' for case sensitive, '~/value/i' for case insensitive + search. + :param str files: Clinical Analysis files. + :param str sample: Sample associated to the proband or any member of a + family. + :param str individual: Proband or any member of a family. + :param str proband: Clinical Analysis proband. + :param str proband_samples: Clinical Analysis proband samples. + :param str family: Clinical Analysis family. + :param str family_members: Clinical Analysis family members. + :param str family_member_samples: Clinical Analysis family members + samples. + :param str panels: Clinical Analysis panels. + :param bool locked: Locked Clinical Analyses. + :param str analyst_id: Clinical Analysis analyst id. + :param str priority: Clinical Analysis priority. + :param str flags: Clinical Analysis flags. + :param str creation_date: Clinical Analysis Creation date. Format: + yyyyMMddHHmmss. Examples: >2018, 2017-2018, <201805. + :param str modification_date: Clinical Analysis Modification date. + Format: yyyyMMddHHmmss. Examples: >2018, 2017-2018, <201805. + :param str due_date: Clinical Analysis due date. Format: + yyyyMMddHHmmss. Examples: >2018, 2017-2018, <201805. + :param str quality_control_summary: Clinical Analysis quality control + summary. + :param str release: Release when it was created. + :param int snapshot: Snapshot value (Latest version of the entry in + the specified release). + :param str status: Filter by status. + :param str internal_status: Filter by internal status. + :param str annotation: Annotation filters. Example: + age>30;gender=FEMALE. For more information, please visit + http://docs.opencb.org/display/opencga/AnnotationSets+1.4.0. + :param bool deleted: Boolean to retrieve deleted entries. + :param str field: List of fields separated by semicolons, e.g.: + studies;type;numSamples[0..10]:1. + """ + + return self._get(category='analysis', resource='aggregationStats', subcategory='clinical', **options) + def load_annotation_sets(self, variable_set_id, path, data=None, **options): """ Load annotation sets from a TSV file. @@ -154,6 +210,43 @@ def distinct(self, field, **options): options['field'] = field return self._get(category='analysis', resource='distinct', subcategory='clinical', **options) + def aggregation_stats_interpretation(self, **options): + """ + Fetch catalog interpretation aggregation stats. + PATH: /{apiVersion}/analysis/clinical/interpretation/aggregationStats + + :param str study: Study [[organization@]project:]study where study and + project can be either the ID or UUID. + :param str id: Comma separated list of Interpretation IDs up to a + maximum of 100. Also admits basic regular expressions using the + operator '~', i.e. '~{perl-regex}' e.g. '~value' for case + sensitive, '~/value/i' for case insensitive search. + :param str uuid: Comma separated list of Interpretation UUIDs up to a + maximum of 100. + :param str name: Comma separated list of Interpretation names up to a + maximum of 100. + :param str clinical_analysis_id: Clinical Analysis id. + :param str analyst_id: Analyst ID. + :param str method_name: Interpretation method name. Also admits basic + regular expressions using the operator '~', i.e. '~{perl-regex}' + e.g. '~value' for case sensitive, '~/value/i' for case insensitive + search. + :param str panels: Interpretation panels. + :param str primary_findings: Interpretation primary findings. + :param str secondary_findings: Interpretation secondary findings. + :param str creation_date: Interpretation Creation date. Format: + yyyyMMddHHmmss. Examples: >2018, 2017-2018, <201805. + :param str modification_date: Interpretation Modification date. + Format: yyyyMMddHHmmss. Examples: >2018, 2017-2018, <201805. + :param str status: Filter by status. + :param str internal_status: Filter by internal status. + :param str release: Release when it was created. + :param str field: List of fields separated by semicolons, e.g.: + studies;type;numSamples[0..10]:1. + """ + + return self._get(category='analysis', resource='aggregationStats', subcategory='clinical/interpretation', **options) + def distinct_interpretation(self, field, **options): """ Interpretation distinct method. diff --git a/opencga-server/src/main/java/org/opencb/opencga/server/rest/FileWSServer.java b/opencga-server/src/main/java/org/opencb/opencga/server/rest/FileWSServer.java index 5d5e5c8bcb..5fa402b565 100644 --- a/opencga-server/src/main/java/org/opencb/opencga/server/rest/FileWSServer.java +++ b/opencga-server/src/main/java/org/opencb/opencga/server/rest/FileWSServer.java @@ -1051,7 +1051,7 @@ public Response getAggregationStats( return run(() -> { query.remove(ParamConstants.STUDY_PARAM); query.remove("field"); - return catalogManager.getSampleManager().facet(studyStr, query, facet, token); + return catalogManager.getFileManager().facet(studyStr, query, facet, token); }); } } 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 3dd6fa53aa..a434eaaf47 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 @@ -508,6 +508,46 @@ public Response distinct( } } + @GET + @Path("/aggregationStats") + @ApiOperation(value = "Fetch catalog clinical analysis aggregation stats", response = FacetField.class) + public Response aggregationStats( + @ApiParam(value = ParamConstants.STUDY_DESCRIPTION) @QueryParam(ParamConstants.STUDY_PARAM) String studyStr, + @ApiParam(value = ParamConstants.CLINICAL_ID_DESCRIPTION) @QueryParam(ParamConstants.CLINICAL_ID_PARAM) String id, + @ApiParam(value = ParamConstants.CLINICAL_UUID_DESCRIPTION) @QueryParam(ParamConstants.CLINICAL_UUID_PARAM) String uuid, + @ApiParam(value = ParamConstants.CLINICAL_TYPE_DESCRIPTION) @QueryParam(ParamConstants.CLINICAL_TYPE_PARAM) String type, + @ApiParam(value = ParamConstants.CLINICAL_DISORDER_DESCRIPTION) @QueryParam(ParamConstants.CLINICAL_DISORDER_PARAM) String disorder, + @ApiParam(value = ParamConstants.CLINICAL_FILES_DESCRIPTION) @QueryParam(ParamConstants.CLINICAL_FILES_PARAM) String files, + @ApiParam(value = ParamConstants.CLINICAL_SAMPLE_DESCRIPTION) @QueryParam(ParamConstants.CLINICAL_SAMPLE_PARAM) String sample, + @ApiParam(value = ParamConstants.CLINICAL_INDIVIDUAL_DESCRIPTION) @QueryParam(ParamConstants.CLINICAL_INDIVIDUAL_PARAM) String individual, + @ApiParam(value = ParamConstants.CLINICAL_PROBAND_DESCRIPTION) @QueryParam(ParamConstants.CLINICAL_PROBAND_PARAM) String proband, + @ApiParam(value = ParamConstants.CLINICAL_PROBAND_SAMPLES_DESCRIPTION) @QueryParam(ParamConstants.CLINICAL_PROBAND_SAMPLES_PARAM) String probandSamples, + @ApiParam(value = ParamConstants.CLINICAL_FAMILY_DESCRIPTION) @QueryParam(ParamConstants.CLINICAL_FAMILY_PARAM) String family, + @ApiParam(value = ParamConstants.CLINICAL_FAMILY_MEMBERS_DESCRIPTION) @QueryParam(ParamConstants.CLINICAL_FAMILY_MEMBERS_PARAM) String familyMembers, + @ApiParam(value = ParamConstants.CLINICAL_FAMILY_MEMBERS_SAMPLES_DESCRIPTION) @QueryParam(ParamConstants.CLINICAL_FAMILY_MEMBERS_SAMPLES_PARAM) String familyMembersSamples, + @ApiParam(value = ParamConstants.CLINICAL_PANELS_DESCRIPTION) @QueryParam(ParamConstants.CLINICAL_PANELS_PARAM) String panels, + @ApiParam(value = ParamConstants.CLINICAL_LOCKED_DESCRIPTION) @QueryParam(ParamConstants.CLINICAL_LOCKED_PARAM) Boolean locked, + @ApiParam(value = ParamConstants.CLINICAL_ANALYST_ID_DESCRIPTION) @QueryParam(ParamConstants.CLINICAL_ANALYST_ID_PARAM) String clinicalAnalystId, + @ApiParam(value = ParamConstants.CLINICAL_PRIORITY_DESCRIPTION) @QueryParam(ParamConstants.CLINICAL_PRIORITY_PARAM) String priority, + @ApiParam(value = ParamConstants.CLINICAL_FLAGS_DESCRIPTION) @QueryParam(ParamConstants.CLINICAL_FLAGS_PARAM) String flags, + @ApiParam(value = ParamConstants.CLINICAL_CREATION_DATE_DESCRIPTION) @QueryParam(ParamConstants.CLINICAL_CREATION_DATE_PARAM) String creationDate, + @ApiParam(value = ParamConstants.CLINICAL_MODIFICATION_DATE_DESCRIPTION) @QueryParam(ParamConstants.CLINICAL_MODIFICATION_DATE_PARAM) String modificationDate, + @ApiParam(value = ParamConstants.CLINICAL_DUE_DATE_DESCRIPTION) @QueryParam(ParamConstants.CLINICAL_DUE_DATE_PARAM) String dueDate, + @ApiParam(value = ParamConstants.CLINICAL_QUALITY_CONTROL_SUMMARY_DESCRIPTION) @QueryParam(ParamConstants.CLINICAL_QUALITY_CONTROL_SUMMARY_PARAM) String qualityControl, + @ApiParam(value = ParamConstants.CLINICAL_RELEASE_DESCRIPTION) @QueryParam(ParamConstants.CLINICAL_RELEASE_PARAM) String release, + @ApiParam(value = ParamConstants.SNAPSHOT_DESCRIPTION) @QueryParam(ParamConstants.SNAPSHOT_PARAM) int snapshot, + @ApiParam(value = ParamConstants.CLINICAL_STATUS_DESCRIPTION) @QueryParam(ParamConstants.CLINICAL_STATUS_PARAM) String status, + @ApiParam(value = ParamConstants.CLINICAL_INTERNAL_STATUS_DESCRIPTION) @QueryParam(ParamConstants.CLINICAL_INTERNAL_STATUS_PARAM) String internalStatus, + @ApiParam(value = ParamConstants.ANNOTATION_DESCRIPTION) @QueryParam(Constants.ANNOTATION) String annotation, + @ApiParam(value = ParamConstants.DELETED_DESCRIPTION) @QueryParam(ParamConstants.DELETED_PARAM) boolean deleted, + @ApiParam(value = "List of fields separated by semicolons, e.g.: studies;type;numSamples[0..10]:1") @QueryParam("field") String facet) { + return run(() -> { + query.remove(ParamConstants.STUDY_PARAM); + query.remove("field"); + return catalogManager.getClinicalAnalysisManager().facet(studyStr, query, facet, token); + }); + } + @GET @Path("/{clinicalAnalyses}/acl") @ApiOperation(value = "Returns the acl of the clinical analyses. If member is provided, it will only return the acl for the member.", @@ -836,6 +876,36 @@ public Response interpretationDistinct( } } + @GET + @Path("/interpretation/aggregationStats") + @ApiOperation(value = "Fetch catalog interpretation aggregation stats", response = FacetField.class) + public Response interpretationAggregationStats( + @ApiParam(value = ParamConstants.STUDY_DESCRIPTION) @QueryParam(ParamConstants.STUDY_PARAM) String studyStr, + @ApiParam(value = ParamConstants.INTERPRETATION_ID_DESCRIPTION) @QueryParam(ParamConstants.INTERPRETATION_ID_PARAM) String id, + @ApiParam(value = ParamConstants.INTERPRETATION_UUID_DESCRIPTION) @QueryParam(ParamConstants.INTERPRETATION_UUID_PARAM) String uuid, + @ApiParam(value = ParamConstants.INTERPRETATION_NAME_DESCRIPTION) @QueryParam(ParamConstants.INTERPRETATION_NAME_PARAM) String name, + @ApiParam(value = ParamConstants.INTERPRETATION_CLINICAL_ANALYSIS_ID_DESCRIPTION) @QueryParam(ParamConstants.INTERPRETATION_CLINICAL_ANALYSIS_ID_PARAM) String clinicalAnalysisId, + @ApiParam(value = ParamConstants.INTERPRETATION_ANALYST_ID_DESCRIPTION) @QueryParam(ParamConstants.INTERPRETATION_ANALYST_ID_PARAM) String analystId, + @ApiParam(value = ParamConstants.INTERPRETATION_METHOD_NAME_DESCRIPTION) @QueryParam(ParamConstants.INTERPRETATION_METHOD_NAME_PARAM) String methodsName, + @ApiParam(value = ParamConstants.INTERPRETATION_PANELS_DESCRIPTION) @QueryParam(ParamConstants.INTERPRETATION_PANELS_PARAM) String panels, + @ApiParam(value = ParamConstants.INTERPRETATION_PRIMARY_FINDINGS_IDS_DESCRIPTION) @QueryParam(ParamConstants.INTERPRETATION_PRIMARY_FINDINGS_IDS_PARAM) String primaryFindings, + @ApiParam(value = ParamConstants.INTERPRETATION_SECONDARY_FINDINGS_IDS_DESCRIPTION) @QueryParam(ParamConstants.INTERPRETATION_SECONDARY_FINDINGS_IDS_PARAM) String secondaryFindings, + @ApiParam(value = ParamConstants.INTERPRETATION_CREATION_DATE_DESCRIPTION) @QueryParam(ParamConstants.INTERPRETATION_CREATION_DATE_PARAM) String creationDate, + @ApiParam(value = ParamConstants.INTERPRETATION_MODIFICATION_DATE_DESCRIPTION) @QueryParam(ParamConstants.INTERPRETATION_MODIFICATION_DATE_PARAM) String modificationDate, + @ApiParam(value = ParamConstants.INTERPRETATION_STATUS_DESCRIPTION) @QueryParam(ParamConstants.INTERPRETATION_STATUS_PARAM) String status, + @ApiParam(value = ParamConstants.INTERPRETATION_INTERNAL_STATUS_DESCRIPTION) @QueryParam(ParamConstants.INTERPRETATION_INTERNAL_STATUS_PARAM) String internalStatus, + @ApiParam(value = ParamConstants.INTERPRETATION_RELEASE_DESCRIPTION) @QueryParam(ParamConstants.INTERPRETATION_RELEASE_PARAM) String release, + // The following variables were hid on version 2.1.0 + @ApiParam(value = "Clinical analyst ID", hidden = true) @QueryParam("analyst") String clinicalAnalyst, + @ApiParam(value = "Interpretation method name", hidden = true) @QueryParam("methods") String methods, + @ApiParam(value = "List of fields separated by semicolons, e.g.: studies;type;numSamples[0..10]:1") @QueryParam("field") String facet) { + return run(() -> { + query.remove(ParamConstants.STUDY_PARAM); + query.remove("field"); + return catalogManager.getInterpretationManager().facet(studyStr, query, facet, token); + }); + } + //------------------------------------------------------------------------- // R E C E S S I V E G E N E A N A L Y S I S //-------------------------------------------------------------------------