public class OboParser extends Object
OboParser parser = new OboParser(); InputStream inStream = this.getClass().getResourceAsStream("/files/ontology/biosapiens.obo"); BufferedReader oboFile = new BufferedReader ( new InputStreamReader ( inStream ) ); try { Ontology ontology = parser.parseOBO(oboFile, "BioSapiens", "the BioSapiens ontology"); Set keys = ontology.getTerms(); Iterator iter = keys.iterator(); while (iter.hasNext()){ System.out.println(iter.next()); } } catch (Exception e){ e.printStackTrace(); }
public OboParser()
public Ontology parseOBO(BufferedReader oboFile, String ontoName, String ontoDescription) throws ParseException, IOException
oboFile
- the file to be parsedontoName
- ontoDescription
- ParseException
IOException
Copyright © 2014 BioJava. All rights reserved.