NeXML and RDF API for BioRuby

From Phyloinformatics
Revision as of 22:43, 27 May 2010 by Yeban (talk) (Reader)
Jump to: navigation, search

Preface

The following document discusses the implementation of an NeXML parser and serializer and an RDF API for BioRuby. Note that this document is not final yet.

Parsing

The parsed document is abstracted with Bio::NeXML::Parser class. A file, i/o object, URL or string is parsed transparently while instantiating Bio::NeXML::Parser or with the shortcut, Bio::NeXML.parse method.

nexml = Bio::NeXML.parse( "trees.xml" )

otus can be iterated over by calling the each_otus iterator on nexml.

nexml.each_otus{ |otus| puts otus.id }

OTUS and OTU

An otus is modeled by Bio::NeXML::Otus and an otu by Bio::NeXML::Otu. With an otus object all the otu nested in it can be iterated over, with the each_otu iterator.

otus.each_otu{ |otu| puts otu.id }

Bio::NeXML::Otu, inherits from Bio::Taxonomy.