Disease Ontology Annotation Framework

Our system provides a web service to search disease-gene mapping between Disease Ontology and Gene.

You have two ways to search the mapping. Retrieve Gene information from disease or Retrieve disease information from Gene info, by setting parameter "searchType".We give some examples written in Java, Perl and Rubby.

1.java example:
import java.io.IOException;
import org.apache.commons.httpclient.HttpClient;
import org.apache.commons.httpclient.HttpException;
import org.apache.commons.httpclient.methods.PostMethod;
import org.apache.commons.httpclient.params.HttpMethodParams;

public class MappingSearchClient {
	private static final String SEARCH_SERVICE_URL = "http://doa.nubic.northwestern.edu/batchservice.php";

	public static void main(String[] args) {
		try {
			HttpClient client = new HttpClient();
                        // Set this string for your application
			client.getParams().setParameter(HttpMethodParams.USER_AGENT, "DOAF Client Example");
			
			PostMethod method = new PostMethod(SEARCH_SERVICE_URL);
			
			// Configure the form parameters
			// searchType defines the method to search. 
			// "d2g" searches Gene information from disease 
			// and "g2d" searches disease information from Gene.
			// searchWord defines the key word to search.
			method.setParameter("searchType", "d2g");
			method.setParameter("searchWord", "primary breast cancer");
			
			int statusCode = client.executeMethod(method);
			if (statusCode != -1){
				try {
					String contents = method.getResponseBodyAsString();
					method.releaseConnection();
					System.out.println(contents);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		} catch (HttpException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
}
                
2.perl example:
use LWP::UserAgent;
my $ua = LWP::UserAgent->new;
my $req = HTTP::Request->new('POST' => 'http://doa.nubic.northwestern.edu/batchservice.php');
$req->content_type('application/x-www-form-urlencoded');
$req->content("searchType=d2g&searchWord=primary breast cancer");
my $res = $ua->request($req);
 print $res->content();
                
3.ruby example:
require "open-uri"
require 'net/http'
params = {}
params["searchType"] = 'd2g'
params["searchWord"] = 'primary breast cancer'
uri = URI.parse("http://doa.nubic.northwestern.edu/batchservice.php")
res = Net::HTTP.post_form(uri, params)
puts res.body