@Test public void checkGeneSymbolIsValid() throws Exception { }
public String checkGeneSymbolIsValid(String gene, String eRelease) { String error = null; try { RestResponseResult geneDataApiResult = ensemblRestcallHistoryService.getEnsemblRestCallByTypeAndParamAndVersion( "lookup_symbol", gene, eRelease); if (geneDataApiResult == null ) { geneDataApiResult = ensemblRestTemplateService.getRestCall(getEndpoint(), gene, ""); ensemblRestcallHistoryService.create(geneDataApiResult, "lookup_symbol", gene, eRelease); } if (geneDataApiResult.hasErorr()) { error = geneDataApiResult.getError(); } else { if (geneDataApiResult.getRestResult().getObject().has("object_type")) { String objectType = geneDataApiResult.getRestResult().getObject().get("object_type").toString(); if (!(objectType.compareToIgnoreCase("gene") == 0)) { error = "Gene symbol ".concat(gene).concat(" is not valid"); } } } } catch (Exception e) { error = "Gene symbol ".concat(gene).concat(" was not retrieved by Ensembl Mapping. Contact Admin."); getLog().error("Gene Symbol".concat(gene).concat(" : was not retrieved. (exception)"), e); } return error; }
GeneCheckingRestService { public String checkGeneSymbolIsValid(String gene, String eRelease) { String error = null; try { RestResponseResult geneDataApiResult = ensemblRestcallHistoryService.getEnsemblRestCallByTypeAndParamAndVersion( "lookup_symbol", gene, eRelease); if (geneDataApiResult == null ) { geneDataApiResult = ensemblRestTemplateService.getRestCall(getEndpoint(), gene, ""); ensemblRestcallHistoryService.create(geneDataApiResult, "lookup_symbol", gene, eRelease); } if (geneDataApiResult.hasErorr()) { error = geneDataApiResult.getError(); } else { if (geneDataApiResult.getRestResult().getObject().has("object_type")) { String objectType = geneDataApiResult.getRestResult().getObject().get("object_type").toString(); if (!(objectType.compareToIgnoreCase("gene") == 0)) { error = "Gene symbol ".concat(gene).concat(" is not valid"); } } } } catch (Exception e) { error = "Gene symbol ".concat(gene).concat(" was not retrieved by Ensembl Mapping. Contact Admin."); getLog().error("Gene Symbol".concat(gene).concat(" : was not retrieved. (exception)"), e); } return error; } }
GeneCheckingRestService { public String checkGeneSymbolIsValid(String gene, String eRelease) { String error = null; try { RestResponseResult geneDataApiResult = ensemblRestcallHistoryService.getEnsemblRestCallByTypeAndParamAndVersion( "lookup_symbol", gene, eRelease); if (geneDataApiResult == null ) { geneDataApiResult = ensemblRestTemplateService.getRestCall(getEndpoint(), gene, ""); ensemblRestcallHistoryService.create(geneDataApiResult, "lookup_symbol", gene, eRelease); } if (geneDataApiResult.hasErorr()) { error = geneDataApiResult.getError(); } else { if (geneDataApiResult.getRestResult().getObject().has("object_type")) { String objectType = geneDataApiResult.getRestResult().getObject().get("object_type").toString(); if (!(objectType.compareToIgnoreCase("gene") == 0)) { error = "Gene symbol ".concat(gene).concat(" is not valid"); } } } } catch (Exception e) { error = "Gene symbol ".concat(gene).concat(" was not retrieved by Ensembl Mapping. Contact Admin."); getLog().error("Gene Symbol".concat(gene).concat(" : was not retrieved. (exception)"), e); } return error; } @Autowired  GeneCheckingRestService(EnsemblRestTemplateService ensemblRestTemplateService,
                                   EnsemblRestcallHistoryService ensemblRestcallHistoryService); }
GeneCheckingRestService { public String checkGeneSymbolIsValid(String gene, String eRelease) { String error = null; try { RestResponseResult geneDataApiResult = ensemblRestcallHistoryService.getEnsemblRestCallByTypeAndParamAndVersion( "lookup_symbol", gene, eRelease); if (geneDataApiResult == null ) { geneDataApiResult = ensemblRestTemplateService.getRestCall(getEndpoint(), gene, ""); ensemblRestcallHistoryService.create(geneDataApiResult, "lookup_symbol", gene, eRelease); } if (geneDataApiResult.hasErorr()) { error = geneDataApiResult.getError(); } else { if (geneDataApiResult.getRestResult().getObject().has("object_type")) { String objectType = geneDataApiResult.getRestResult().getObject().get("object_type").toString(); if (!(objectType.compareToIgnoreCase("gene") == 0)) { error = "Gene symbol ".concat(gene).concat(" is not valid"); } } } } catch (Exception e) { error = "Gene symbol ".concat(gene).concat(" was not retrieved by Ensembl Mapping. Contact Admin."); getLog().error("Gene Symbol".concat(gene).concat(" : was not retrieved. (exception)"), e); } return error; } @Autowired  GeneCheckingRestService(EnsemblRestTemplateService ensemblRestTemplateService,
                                   EnsemblRestcallHistoryService ensemblRestcallHistoryService); String checkGeneSymbolIsValid(String gene, String eRelease); String getGeneLocation(String gene, String eRelease); String getEndpoint(); void setEndpoint(String endpoint); }
GeneCheckingRestService { public String checkGeneSymbolIsValid(String gene, String eRelease) { String error = null; try { RestResponseResult geneDataApiResult = ensemblRestcallHistoryService.getEnsemblRestCallByTypeAndParamAndVersion( "lookup_symbol", gene, eRelease); if (geneDataApiResult == null ) { geneDataApiResult = ensemblRestTemplateService.getRestCall(getEndpoint(), gene, ""); ensemblRestcallHistoryService.create(geneDataApiResult, "lookup_symbol", gene, eRelease); } if (geneDataApiResult.hasErorr()) { error = geneDataApiResult.getError(); } else { if (geneDataApiResult.getRestResult().getObject().has("object_type")) { String objectType = geneDataApiResult.getRestResult().getObject().get("object_type").toString(); if (!(objectType.compareToIgnoreCase("gene") == 0)) { error = "Gene symbol ".concat(gene).concat(" is not valid"); } } } } catch (Exception e) { error = "Gene symbol ".concat(gene).concat(" was not retrieved by Ensembl Mapping. Contact Admin."); getLog().error("Gene Symbol".concat(gene).concat(" : was not retrieved. (exception)"), e); } return error; } @Autowired  GeneCheckingRestService(EnsemblRestTemplateService ensemblRestTemplateService,
                                   EnsemblRestcallHistoryService ensemblRestcallHistoryService); String checkGeneSymbolIsValid(String gene, String eRelease); String getGeneLocation(String gene, String eRelease); String getEndpoint(); void setEndpoint(String endpoint);  }