-
Notifications
You must be signed in to change notification settings - Fork 26
eamonnmag edited this page May 22, 2012
·
15 revisions
The first step to using the ISAcreator API is to either include the ISAcreator jar in your class path or to import ISAcreator as a dependency.
<dependency>
<groupId>org.isatools</groupId>
<artifactId>ISAcreator</artifactId>
<version>1.6.0</version>
</dependency>
You should also include the ISA tools repository, which can be done through insertion of this fragment of XML.
<repositories>
<repository>
<id>oerc</id>
<url>http://frog.oerc.ox.ac.uk:8080/artifactory/repo/</url>
</repository>
</repositories>
###Searching for publications from ISAcreator
Publication searching is provided by CiteXplore from the EBI. To call the publication searcher from ISAcreator, the following code will get you there.
public List<CiteExploreResult> searchForPublicationByTitle(SearchOption searchOption, String query) {
CiteExploreClient publicationSearcher = new CiteExploreClient();
try {
return publicationSearcher.searchForPublication(searchOption, query);
} catch (QueryException_Exception qex) {
System.out.printf("Caught QueryException_Exception: %s\n", qex.getFaultInfo().getMessage());
} catch (NoPublicationFoundException e) {
System.out.println("No publication found");
}
return new ArrayList<CiteExploreResult>();
}
Get all ontologies from BioPortal
public List<Ontology> getAllOntologies() {
BioPortalClient client = new BioPortalClient();
return client.getAllOntologies(true);
}
###Using the NCBO Annotator from ISAcreator
The following fragment of code will take a Set of Strings and find the ontology equivalents in BioPortal. The returned Map is a map from the free text term to it's equivalents.
public Map<String, Map<String, AnnotatorResult>> searchForMatches(Set<String> freeText) {
AnnotatorSearchClient sc = new AnnotatorSearchClient();
Map<String, Map<String, AnnotatorResult>> result = sc.searchForTerms(freeText, "", true);
int termsWithMatches = 0;
for (String key : result.keySet()) {
if(result.get(key).size() > 0) {
termsWithMatches++;
}
}
System.out.println(termsWithMatches+ "/" + freeText.size() + " terms have matches.");
return result;
}
Created by the ISA-tools team.