use of uk.ac.ebi.spot.goci.model.EnsemblGenomeBuildVersionJson in project goci by EBISPOT.
the class EnsemblGenomeBuildVersion method getGenomeBuildVersion.
/**
* Getter for the genome build version
*
* @return the genome build version
*/
public String getGenomeBuildVersion() throws EnsemblRestIOException {
RestTemplate restTemplate = new RestTemplate();
String url = getServer() + getEndpoint();
String assemblyName = "";
try {
EnsemblGenomeBuildVersionJson ensemblGenomeBuildVersionJson = restTemplate.getForObject(url, EnsemblGenomeBuildVersionJson.class);
getLog().info("Querying " + url);
assemblyName = ensemblGenomeBuildVersionJson.getAssembly_name();
if (assemblyName.isEmpty()) {
throw new EnsemblRestIOException("Unable to determine Ensembl genome build version");
}
} catch (Exception e) {
throw new EnsemblRestIOException("Problem querying Ensembl API for genome build version");
}
return assemblyName;
}
Aggregations