/**
* Parse OBO file into {@link HpoOntology} object.
*
* @return {@link HpoOntology} from parsing OBO file.
* @throws IOException In case of problems with file I/O.
*/
@SuppressWarnings("unchecked")
public GoOntology parse() throws IOException {
final OboImmutableOntologyLoader<GoTerm, GoTermRelation> loader =
new OboImmutableOntologyLoader<>(oboFile, debug);
final GoOboFactory factory = new GoOboFactory();
final ImmutableOntology<GoTerm, GoTermRelation> o = loader.load(factory);
// Convert ImmutableOntology into GoOntology. The casts here are ugly and require the
// @SuppressWarnings above but this saves us one factory layer of indirection.
return new GoOntology((ImmutableSortedMap<String, String>) o.getMetaInfo(),
(ImmutableDirectedGraph<TermId, ImmutableEdge<TermId>>) o.getGraph(), o.getRootTermId(),
o.getNonObsoleteTermIds(), o.getObsoleteTermIds(),
(ImmutableMap<TermId, GoTerm>) o.getTermMap(),
(ImmutableMap<Integer, GoTermRelation>) o.getRelationMap());
}
GoOboParser.java 文件源码
java
阅读 43
收藏 0
点赞 0
评论 0
项目:ontolib
作者:
评论列表
文章目录