import org.json.simple.parser.JSONParser;
import org.json.simple.parser.ParseException;
+/**
+ * A client for the Ensembl REST service /map endpoint, to convert from
+ * coordinates of one genome assembly to another.
+ * <p>
+ * Note that species and assembly identifiers passed to this class must be valid
+ * in Ensembl. They are not case sensitive.
+ *
+ * @author gmcarstairs
+ * @see https://rest.ensembl.org/documentation/info/assembly_map
+ * @see https://rest.ensembl.org/info/assembly/human?content-type=text/xml
+ * @see https://rest.ensembl.org/info/species?content-type=text/xml
+ */
public class EnsemblMap extends EnsemblRestClient
{
private static final String MAPPED = "mapped";
}
@Override
- protected String getRequestMimeType(boolean multipleIds)
- {
- return "application/json";
- }
-
- @Override
- protected String getResponseMimeType()
- {
- return "application/json";
- }
-
- @Override
protected URL getUrl(List<String> ids) throws MalformedURLException
{
return null; // not used
{
url = getIdMapUrl(domain, accession, start, end, cdsOrCdna);
br = getHttpResponse(url, null);
- return (parseIdMappingResponse(br, accession, domain));
+ if (br != null)
+ {
+ return (parseIdMappingResponse(br, accession, domain));
+ }
}
return null;
} catch (Throwable t)