import jalview.datamodel.AlignmentI;
import jalview.datamodel.DBRefSource;
import jalview.datamodel.GeneLociI;
+import jalview.util.JSONUtils;
import jalview.util.MapList;
+import java.io.BufferedReader;
import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;
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";
{
Iterator<Object> rvals = (Iterator<Object>) getJSON(url, null, -1, MODE_ITERATOR, MAPPINGS);
if (rvals == null)
- {
- return null;
- }
+ return null;
while (rvals.hasNext())
{
// todo check for "mapped"
URL url = null;
try
{
- String domain = EnsemblInfo.getDomain(division);
+ String domain = new EnsemblInfo().getDomain(division);
if (domain != null)
{
url = getIdMapUrl(domain, accession, start, end, cdsOrCdna);
{
Iterator<Object> rvals = (Iterator<Object>) getJSON(url, null, -1, MODE_ITERATOR, MAPPINGS);
if (rvals == null)
- {
- return null;
- }
+ return null;
String assembly = null;
String chromosome = null;
int fromEnd = 0;