{
HttpClient httpclient = new DefaultHttpClient();
HttpGet httpget = new HttpGet(getUrl);
- // httpget.setParams(params);
+ String responseString = "";
HttpResponse response = httpclient.execute(httpget);
HttpEntity resEntity = response.getEntity();
-
if (resEntity != null)
{
BufferedReader r = new BufferedReader(new InputStreamReader(
{
responseBuilder.append(aux);
}
- return responseBuilder.toString();
- }
- else
- {
- return null;
+ responseString = responseBuilder.toString();
}
+ return responseString;
}
public static BufferedReader doHttpMpartFilePost(String postUrl,
protected String baseUrl = "";
- protected String testQuery = "";
+ protected String testQuery = "seqRef:start-end";
@Override
public String getDbSource()
@SuppressWarnings("unchecked")
public Alignment getAlignmentData(String baseUrl, String query,
- String domain, int seqStart, int seqEnd)
+ String domain)
{
StringTokenizer queries = new StringTokenizer(query, ";");
{
String uniquequery = queries.nextToken();
String seqRef = uniquequery;
- // StringTokenizer queryParam = new StringTokenizer(uniquequery, ":");
String[] queryParam = uniquequery.split(":");
if (queryParam.length > 1)
{
seqRef, domain,
seqStart, seqEnd, true);
String rawAnnotationData = fetchData(baseUrl,
- uniquequery, domain, seqStart, seqEnd, false);
+ seqRef, domain,
+ seqStart, seqEnd, false);
stopQuery();
String sequenceString = "";
- // System.out.println("Sequence data: " + rawSequenceData);
- // System.out.println("Annotation data : " + rawAnnotationData);
+ System.out.println("Sequence data: " + rawSequenceData);
+ System.out.println("Annotation data : " + rawAnnotationData);
JSONParser jsonParser = new JSONParser();
JSONObject rawSeqJson = (JSONObject) jsonParser
.parse(rawSequenceData);
int start = Integer.valueOf(feature.get("start").toString());
int end = Integer.valueOf(feature.get("end").toString());
- retrievedSeq[count++] = new Sequence(uniquequery, sequenceString,
+ retrievedSeq[count++] = new Sequence(seqRef, sequenceString,
start,
end);
}
{
String resourceUrl = baseUrl + "/service/jbrowse/" + domain
+ "/features/" + seqRef + "?start=" + start + "&end=" + end
- + "&reference=" + fetchRef;
+ + ((fetchRef) ? "&reference=true" : "");
+ System.out.println("resource url : " + resourceUrl);
return HttpClientUtils.doHttpUrlGet(resourceUrl);
}
this.name = "ModMine";
this.baseUrl = "http://intermine.modencode.org/modminetest";
this.domain = "7227";
- this.testQuery = "2L";
+ this.testQuery = "2L:1-500";
}
@Override
public AlignmentI getSequenceRecords(String queries) throws Exception
{
- return getAlignmentData(baseUrl, queries, domain, seqStart, seqEnd);
+ return getAlignmentData(baseUrl, queries, domain);
}
}
this.name = "YeastMine";
this.baseUrl = "http://yeastmine.yeastgenome.org/yeastmine";
this.domain = "4932";
- this.testQuery = "chrI";
+ this.testQuery = "chrI:1-500";
}
@Override
public AlignmentI getSequenceRecords(String queries) throws Exception
{
- return getAlignmentData(baseUrl, queries, domain, seqStart, seqEnd);
+ return getAlignmentData(baseUrl, queries, domain);
}