Author image Rutger Vos
and 1 contributors


Bio::BioVeL::Service::NeXMLExtractor - extracts and converts data from a NeXML document


 use Bio::BioVeL::Service::NeXMLExtractor;

 # arguments can either be passed in from the command line argument array or as 
 # HTTP request parameters, e.g. from $QUERY_STRING
 @ARGV = (
     '-nexml'      => $nexml,
     '-object'     => 'Trees',
     '-treeformat' => 'newick',
     '-dataformat' => 'nexus'

 my $extractor = Bio::BioVeL::Service::NeXMLExtractor->new;
 my $data = $extractor->response_body;


This package extracts phylogenetic data from a NeXML document. Although it can be used inside scripts that receive command line arguments, it is intended to be used as a RESTful web service that clients can be written against, e.g. in for inclusion in workflows.



The constructor typically receives no arguments.


Returns the MIME-type HTTP header. Note: at present this isn't really used, it needs refactoring to play nice with the way mod_perl constructs response headers. This would probably be done by only returning the MIME-type itself, which is then included in the header by the superclass.


Generates the requested response. It does this by reading a NeXML document and collecting objects of the type specified by the object() property (i.e. 'Matrices', 'Trees' or 'Taxa'). It then serializes these to the requested format.