REST service. The
* REST call is to either ensembl or ensemblgenomes, as determined from the
* division, e.g. Ensembl or EnsemblProtists.
*
* @param domain
* @param accession
* @param start
* @param end
* @param cdsOrCdna
* @return
* @throws MalformedURLException
*/
URL getIdMapUrl(String domain, String accession, int start, int end,
String cdsOrCdna) throws MalformedURLException
{
String url = String
.format("%s/map/%s/%s/%d..%d?include_original_region=1&content-type=application/json",
domain, cdsOrCdna, accession, start, end);
return new URL(url);
}
/**
* Parses the JSON response from the /map/cds/ or /map/cdna REST service. The
* format is
*
*
* {"mappings":
* [
* {"assembly_name":"TAIR10","end":2501311,"seq_region_name":"1","gap":0,
* "strand":-1,"coord_system":"chromosome","rank":0,"start":2501114},
* {"assembly_name":"TAIR10","end":2500815,"seq_region_name":"1","gap":0,
* "strand":-1,"coord_system":"chromosome","rank":0,"start":2500714}
* ]
* }
*
*
* @param br
* @param accession
* @param domain
* @return
*/
@SuppressWarnings("unchecked")
GeneLociI parseIdMappingResponse(URL url, String accession,
String domain)
{
try
{
Iterator