Skip to content

Commit

Permalink
parse extra params, e.g. excludes, sort if needed. replace more text …
Browse files Browse the repository at this point in the history
…with constants. #522
  • Loading branch information
julie-sullivan committed Feb 3, 2020
1 parent 8ce23ae commit 4a2a1b5
Show file tree
Hide file tree
Showing 10 changed files with 85 additions and 372 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,7 @@ public ClinicalWSServer(@PathParam("version")
value = "Comma separated list of database sources of the documents to be returned. Possible values "
+ " are clinvar,cosmic or iarctp53. E.g.: clinvar,cosmic",
required = false, dataType = "java.util.List", paramType = "query"),
@ApiImplicitParam(name = "region",
value = "Comma separated list of genomic regions to be queried, e.g.: 1:6635137-6635325",
@ApiImplicitParam(name = "region", value = ParamConstants.REGION_DESCRIPTION,
required = false, dataType = "java.util.List", paramType = "query"),
@ApiImplicitParam(name = "so",
value = "Comma separated list of sequence ontology term names, e.g.: missense_variant. Exact text "
Expand Down Expand Up @@ -116,15 +115,15 @@ public ClinicalWSServer(@PathParam("version")
required = false, dataType = "java.util.List", paramType = "query")
})
public Response getAll(@QueryParam("exclude")
@ApiParam(value = "Set which fields are excluded in the response, e.g.: transcripts.exons.") String exclude,
@ApiParam(value = ParamConstants.EXCLUDE_DESCRIPTION) String exclude,
@QueryParam("include")
@ApiParam(value = "Set which fields are include in the response, e.g.: transcripts.exons.") String include,
@ApiParam(value = ParamConstants.INCLUDE_DESCRIPTION) String include,
@QueryParam("sort")
@ApiParam(value = "Sort returned results by a certain data model attribute.") String sort,
@ApiParam(value = ParamConstants.SORT_DESCRIPTION) String sort,
@QueryParam("limit") @DefaultValue("10")
@ApiParam(value = "Max number of results to be returned. Cannot exceed 5,000.") Integer limit,
@ApiParam(value = ParamConstants.LIMIT_DESCRIPTION) Integer limit,
@QueryParam("skip") @DefaultValue("0")
@ApiParam(value = "Number of results to be skipped.") Integer skip) {
@ApiParam(value = ParamConstants.SKIP_DESCRIPTION) Integer skip) {
try {
parseIncludesAndExcludes(exclude, include, sort);
parseLimitAndSkip(limit, skip);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -432,6 +432,8 @@ public Response getTranscriptsByGeneId(@PathParam("geneId") @ApiParam(name = "ge
@QueryParam("limit") @DefaultValue("10") @ApiParam(value = ParamConstants.LIMIT_DESCRIPTION) Integer limit,
@QueryParam("skip") @DefaultValue("0") @ApiParam(value = ParamConstants.SKIP_DESCRIPTION) Integer skip) {
try {
parseIncludesAndExcludes(exclude, include, sort);
parseLimitAndSkip(limit, skip);
parseQueryParams();
TranscriptDBAdaptor transcriptDBAdaptor = dbAdaptorFactory.getTranscriptDBAdaptor(this.species, this.assembly);
List<Query> queries = createQueries(geneId, TranscriptDBAdaptor.QueryParams.XREFS.key());
Expand Down Expand Up @@ -523,6 +525,8 @@ public Response getSNPByGeneId(@PathParam("geneId")
@QueryParam("limit") @DefaultValue("10") @ApiParam(value = ParamConstants.LIMIT_DESCRIPTION) Integer limit,
@QueryParam("skip") @DefaultValue("0") @ApiParam(value = ParamConstants.SKIP_DESCRIPTION) Integer skip) {
try {
parseIncludesAndExcludes(exclude, include, sort);
parseLimitAndSkip(limit, skip);
parseQueryParams();
VariantDBAdaptor variationDBAdaptor = dbAdaptorFactory.getVariationDBAdaptor(this.species, this.assembly);
if (merge) {
Expand Down Expand Up @@ -615,6 +619,8 @@ public Response getAllTfbs(@PathParam("geneId") @ApiParam(name = "geneId", value
@QueryParam("limit") @DefaultValue("10") @ApiParam(value = ParamConstants.LIMIT_DESCRIPTION) Integer limit,
@QueryParam("skip") @DefaultValue("0") @ApiParam(value = ParamConstants.SKIP_DESCRIPTION) Integer skip) {
try {
parseIncludesAndExcludes(exclude, include, sort);
parseLimitAndSkip(limit, skip);
parseQueryParams();
GeneDBAdaptor geneDBAdaptor = dbAdaptorFactory.getGeneDBAdaptor(this.species, this.assembly);
if (merge) {
Expand Down Expand Up @@ -656,6 +662,8 @@ public Response getProteinById(@PathParam("geneId") @ApiParam(name = "geneId", v
@QueryParam("limit") @DefaultValue("10") @ApiParam(value = ParamConstants.LIMIT_DESCRIPTION) Integer limit,
@QueryParam("skip") @DefaultValue("0") @ApiParam(value = ParamConstants.SKIP_DESCRIPTION) Integer skip) {
try {
parseIncludesAndExcludes(exclude, include, sort);
parseLimitAndSkip(limit, skip);
parseQueryParams();
ProteinDBAdaptor proteinDBAdaptor = dbAdaptorFactory.getProteinDBAdaptor(this.species, this.assembly);
List<Query> queries = createQueries(geneId, ProteinDBAdaptor.QueryParams.XREFS.key());
Expand Down

This file was deleted.

Loading

0 comments on commit 4a2a1b5

Please sign in to comment.