Class OboParser


  • public class OboParser
    extends Object
    Parses an OBO file.
    Since:
    1.7

    Example

     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();
                    }
     
    Author:
    Andreas Prlic