Skip to content

Commit

Permalink
replace text in gene end point with constants. remove output format. #…
Browse files Browse the repository at this point in the history
  • Loading branch information
julie-sullivan committed Feb 3, 2020
1 parent b8a580b commit 8ce23ae
Show file tree
Hide file tree
Showing 10 changed files with 414 additions and 589 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
/*
* Copyright 2015-2020 OpenCB
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.opencb.cellbase.core;

public class ParamConstants {

public static final String VERSION_DESCRIPTION = "Possible values: v4, v5";
public static final String DEFAULT_VERSION = "v5";

public static final String SPECIES_DESCRIPTION = "Name of the species, e.g. hsapiens. For a full list "
+ "of potentially available species ids, please refer to: "
+ "https://bioinfo.hpc.cam.ac.uk/cellbase/webservices/rest/v4/meta/species";
public static final String DATA_MODEL_DESCRIPTION = "Get JSON specification of the data model";

public static final String REGION_DESCRIPTION = "Comma separated list of genomic regions to be queried, "
+ "e.g. 1:6635137-6635325";

public static final String GENE_IDS = "Comma separated list of gene ids, e.g. ENSG00000268020,BRCA2"
+ " Exact text matches will be returned";

public static final String GENE_ENSEMBL_IDS = "Comma separated list of ENSEMBL gene ids, "
+ "e.g. ENST00000380152,ENSG00000155657. Exact text matches will be returned";

public static final String GENE_XREF_IDS = "Comma separated list gene/transcript xrefs ids, e.g. "
+ " ENSG00000145113,35912_at,GO:0002020. Exact text matches will be returned";

public static final String GENE_NAMES = "Comma separated list of gene HGNC names, e.g.: BRCA2,TTN,MUC4."
+ " Exact text matches will be returned";

public static final String GENE_BIOTYPES = "Comma separated list of gene gencode biotypes,"
+ " e.g. protein_coding,miRNA,lincRNA. Exact text matches will be returned";

public static final String TRANSCRIPT_BIOTYPES = "Comma separated list of transcript gencode biotypes, "
+ "e.g. protein_coding,miRNA,lincRNA. Exact text matches will be returned";

public static final String TRANSCRIPT_XREFS = "Comma separated list transcript xrefs ids, "
+ "e.g. ENSG00000145113,35912_at,GO:0002020. Exact text matches will be returned";

public static final String TRANSCRIPT_IDS = "Comma separated list of ENSEMBL transcript ids, "
+ "e.g. ENST00000342992,ENST00000380152,ENST00000544455. Exact text matches will be returned";

public static final String TRANSCRIPT_NAMES = "Comma separated list of transcript names, e.g. BRCA2-201,TTN-003."
+ " Exact text matches will be returned";

public static final String TRANSCRIPT_ANNOTATION_FLAGS = "Comma separated list of annotation flags that must be "
+ "present in the transcripts returned within the gene model, e.g. basic,CCDS. Exact text matches will "
+ "be returned";

public static final String TRANSCRIPT_TFBS_NAMES = "Comma separated list of TFBS names, e.g. CTCF,Gabp."
+ " Exact text matches will be returned";

public static final String ANNOTATION_DISEASES_IDS = "Comma separated list of phenotype ids (OMIM, UMLS), "
+ "e.g. umls:C0030297,OMIM:613390,OMIM:613390. Exact text matches will be returned";

public static final String ANNOTATION_DISEASES_NAMES = "Comma separated list of phenotypes, "
+ "e.g. Cryptorchidism,Absent thumb,Stage 5 chronic kidney disease. Exact text matches will be returned";

public static final String ANNOTATION_EXPRESSION_GENE = "Comma separated list of ENSEMBL gene ids for which "
+ "expression values are available, e.g. ENSG00000139618,ENSG00000155657. "
+ "Exact text matches will be returned";

public static final String ANNOTATION_EXPRESSION_TISSUE = "Comma separated list of tissues for which "
+ "expression values are available, e.g. adipose tissue,heart atrium,tongue. "
+ "Exact text matches will be returned";

public static final String ANNOTATION_EXPRESSION_VALUE = "Must be used together with annotation.expression.tissue -"
+ "value of interest, either UP or DOWN";

public static final String ANNOTATION_DRUGS_NAME = "Comma separated list of drug names, "
+ "e.g. BMN673,OLAPARIB,VELIPARIB. Exact text matches will be returned";

public static final String ANNOTATION_DRUGS_GENE = "Comma separated list of gene names for which "
+ "drug data is available, e.g. BRCA2,TTN. Exact text matches will be returned";

public static final String COUNT_DESCRIPTION = "Get the total number of results matching the query. ";

public static final String INCLUDE_DESCRIPTION = "Fields included in the response, whole JSON path must be provided";
public static final String EXCLUDE_DESCRIPTION = "Fields excluded in the response, whole JSON path must be provided";
public static final String LIMIT_DESCRIPTION = "Number of results to be returned";
public static final String SKIP_DESCRIPTION = "Number of results to skip";
public static final String SORT_DESCRIPTION = "Sort returned results by a certain data model attribute";

public static final String SNP_REFERENCE = "Comma separated list of possible reference to be queried, e.g. A,T";
public static final String SNP_ALTERNATE = "Comma separated list of possible alternate to be queried, e.g. A,T";
public static final String SNP_CONSEQUENCE_TYPE = "Comma separated list of possible SO names describing consequence"
+ " types to be queried, e.g. missense_variant,downstream_variant. Exact text matches will be retrieved.";
public static final String SNP_MERGE = "Return variants for a gene per CellBaseDataResult or all of them merged"
+ " into the same CellBaseDataResult object.";

public static final String TFBS_MERGE = "Return one TFBs per CellBaseDataResult or all of them merged"
+ " into the same CellBaseDataResult object.";

public static final String PROTEIN_KEYWORD = "Comma separated list of keywords that may be associated with the"
+ " protein(s), e.g. Transcription,Zinc. Exact text matches will be returned";

public static final String GROUP_BY_FIELDS = "Comma separated list of field(s) to group by, e.g.: biotype.";
}
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,6 @@ public class GenericRestWSServer implements IWSServer {
@QueryParam("assembly")
protected String assembly;

@DefaultValue("json")
@QueryParam("of")
@ApiParam(name = "Output format", value = "Output format, Protobuf is not yet implemented", defaultValue = "json",
allowableValues = "json,pb (Not implemented yet)")
protected String outputFormat;
protected Query query;
protected QueryOptions queryOptions;
protected ObjectMap params;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.opencb.biodata.models.core.Chromosome;
import org.opencb.cellbase.core.ParamConstants;
import org.opencb.cellbase.core.api.GenomeDBAdaptor;
import org.opencb.cellbase.core.exception.CellbaseException;
import org.opencb.cellbase.core.result.CellBaseDataResult;
Expand All @@ -44,12 +45,10 @@
public class SpeciesWSServer extends GenericRestWSServer {

public SpeciesWSServer(@PathParam("version")
@ApiParam(name = "version", value = "Possible values: v4, v5",
defaultValue = "v5") String version,
@ApiParam(name = "version", value = ParamConstants.VERSION_DESCRIPTION,
defaultValue = ParamConstants.DEFAULT_VERSION) String version,
@PathParam("species")
@ApiParam(name = "species", value = "Name of the species, e.g.: hsapiens. For a full list "
+ "of potentially available species ids, please refer to: "
+ "https://bioinfo.hpc.cam.ac.uk/cellbase/webservices/rest/v4/meta/species") String species,
@ApiParam(name = "species", value = ParamConstants.SPECIES_DESCRIPTION) String species,
@Context UriInfo uriInfo,
@Context HttpServletRequest hsr) throws VersionException, SpeciesException, IOException,
CellbaseException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

import io.swagger.annotations.*;
import org.opencb.biodata.models.variant.Variant;
import org.opencb.cellbase.core.ParamConstants;
import org.opencb.cellbase.core.api.ClinicalDBAdaptor;
import org.opencb.cellbase.core.exception.CellbaseException;
import org.opencb.cellbase.server.exception.SpeciesException;
Expand All @@ -41,13 +42,11 @@
public class ClinicalWSServer extends GenericRestWSServer {

public ClinicalWSServer(@PathParam("version")
@ApiParam(name = "version", value = "Possible values: v4, v5",
defaultValue = "v5") String version,
@PathParam("species")
@ApiParam(name = "species", value = "Name of the species, e.g.: hsapiens. For a full list "
+ "of potentially available species ids, please refer to: "
+ "https://bioinfo.hpc.cam.ac.uk/cellbase/webservices/rest/v4/meta/species") String species,
@Context UriInfo uriInfo, @Context HttpServletRequest hsr)
@ApiParam(name = "version", value = ParamConstants.VERSION_DESCRIPTION,
defaultValue = ParamConstants.DEFAULT_VERSION) String version,
@PathParam("species")
@ApiParam(name = "species", value = ParamConstants.SPECIES_DESCRIPTION) String species,
@Context UriInfo uriInfo, @Context HttpServletRequest hsr)
throws VersionException, SpeciesException, IOException, CellbaseException {
super(version, species, uriInfo, hsr);
}
Expand All @@ -57,8 +56,7 @@ public ClinicalWSServer(@PathParam("version")
@ApiOperation(httpMethod = "GET", notes = "No more than 1000 objects are allowed to be returned at a time. ",
value = "Retrieves all clinical variants", response = Variant.class, responseContainer = "QueryResponse")
@ApiImplicitParams({
@ApiImplicitParam(name = "count",
value = "Get a count of the number of results obtained.",
@ApiImplicitParam(name = "count", value = ParamConstants.COUNT_DESCRIPTION,
required = false, dataType = "boolean", paramType = "query", defaultValue = "false",
allowableValues = "false,true"),
@ApiImplicitParam(name = "source",
Expand Down
Loading

0 comments on commit 8ce23ae

Please sign in to comment.