NAME
GO::IO::ObanOwl - dump GO terms as xml
SYNOPSIS
my $apph = GO::AppHandle->connect(-d=>$go, -dbhost=>$dbhost);my $term = $apph->get_term({acc=>00003677});#### ">-" is STDOUTmy $out = new FileHandle(">-");my $xml_out = GO::IO::XML->new(-output=>$out);$xml_out->start_document();$xml_out->draw_term($term);$xml_out->end_document();
OR:
my $apph = GO::AppHandle->connect(-d=>$go, -dbhost=>$dbhost);my $term = $apph->get_node_graph(-acc=>00003677, -depth=>2);my $out = new FileHandle(">-");my $xml_out = GO::IO::XML(-output=>$out);$xml_out->start_document();$xml_out->draw_node_graph($term, 3677);$xml_out->end_document();
DESCRIPTION
Utility class to dump GO terms as xml. Currently you just call start_ducument, then draw_term for each term, then end_document.
If there's a need I'll add draw_node_graph, draw_node_list, etc.
new
Usage - my $xml_out = GO::IO::XML->new(-output=>$out);Returns - NoneArgs - Output FileHandle
Initializes the writer object. To write to standard out, do:
my $out = new FileHandle(">-"); my $xml_out = new GO::IO::XML(-output=>$out);
xml_header
Usage - $xml_out->xml_header;Returns - NoneArgs - None
start_document prints the "Content-type: text/xml" statement. If creating a cgi script, you should call this before start_document.
start_document
Usage - $xml_out->start_document(-timestamp=>$time);Returns - NoneArgs - optional: timestamp string, pre-formatted
start_ducument takes care of the fiddly bits like xml declarations, namespaces, etc. It draws the initial tags and leaves the document ready to add go:term nodes.
end_document
Usage - $xml_out->end_document();
Call this when done.
draw_node_graph
Usage - $xml_out->draw_node_graph(-graph=>$graph);Returns - NoneArgs -graph=>$node_graph,-focus=>$acc, ## optional-show_associations=>"yes" or "no" ## optional
draw_term
Usage - $xml_out->draw_term();Returns - NoneArgs -term=>$term,-graph=>$graph,-is_focus=>"yes" or "no", ## optional-show_associations=>"yes" or "no", ## optional-show_terms=>"yes" or "no", ## optional, just draws associations
sub characters
This is simply a wrapper to XML::Writer->characterswhich strips out any non-ascii characters.
sub dataElement
This is simply a wrapper to XML::Writer->dataElementwhich strips out any non-ascii characters.