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(); }
Constructor and Description |
---|
OboParser() |
Modifier and Type | Method and Description |
---|---|
Ontology |
parseOBO(BufferedReader oboFile,
String ontoName,
String ontoDescription)
Parse a OBO file and return its content as a BioJava Ontology object
|
public OboParser()
public Ontology parseOBO(BufferedReader oboFile, String ontoName, String ontoDescription) throws ParseException, IOException
oboFile
- the file to be parsedontoName
- ontoDescription
- ParseException
IOException
Copyright © 2000–2019 BioJava. All rights reserved.