| Bio-Phylo documentation | view source | Contained in the Bio-Phylo distribution. |
Bio::Phylo::Project - Container for related data
use Bio::Phylo::Factory; my $fac = Bio::Phylo::Factory->new; my $proj = $fac->create_project; my $taxa = $fac->create_taxa; $proj->insert($taxa); $proj->insert($fac->create_matrix->set_taxa($taxa)); $proj->insert($fac->create_forest->set_taxa($taxa)); print $proj->to_xml;
The project module is used to collect taxa blocks, tree blocks and matrices.
Project constructor.
Type : Constructor Title : set_datasource Usage : $project->set_datasource( -file => $file, -format => 'nexus' ) Function: Populates a Bio::Phylo::Project object from a data source Returns : A Bio::Phylo::Project object. Args : Arguments as must be passed to Bio::Phylo::IO::parse
Getter for taxa objects
Type : Constructor Title : get_taxa Usage : my $taxa = $proj->get_taxa; Function: Getter for taxa objects Returns : An array reference of taxa objects Args : NONE.
Getter for forest objects
Type : Constructor Title : get_forests Usage : my $forest = $proj->get_forests; Function: Getter for forest objects Returns : An array reference of forest objects Args : NONE.
Getter for matrix objects
Type : Constructor Title : get_matrices Usage : my $matrix = $proj->get_matrices; Function: Getter for matrix objects Returns : An array reference of matrix objects Args : NONE.
Type : Serializer
Title : doc
Usage : $proj->get_document()
Function: Creates a DOM Document object, containing the
present state of the project by default
Returns : a Document object
Args : a DOM factory object
Optional: pass 1 to obtain a document node without
content
Retrieves attributes for the element.
Type : Accessor
Title : get_attributes
Usage : my %attrs = %{ $obj->get_attributes };
Function: Gets the xml attributes for the object;
Returns : A hash reference
Args : None.
Comments: throws ObjectMismatch if no linked taxa object
can be found
By default, all XMLWritable objects are identifiable when serialized, i.e. they have a unique id attribute. However, in some cases a serialized object may not have an id attribute (governed by the nexml schema). This method indicates whether that is the case.
Type : Test
Title : is_identifiable
Usage : if ( $obj->is_identifiable ) { ... }
Function: Indicates whether IDs are generated
Returns : BOOLEAN
Args : NONE
Serializes invocant to XML.
Type : XML serializer Title : to_xml Usage : my $xml = $obj->to_xml; Function: Serializes $obj to xml Returns : An xml string Args : Same arguments as can be passed to individual contained objects
Serializes invocant to NEXUS.
Type : NEXUS serializer Title : to_nexus Usage : my $nexus = $obj->to_nexus; Function: Serializes $obj to nexus Returns : An nexus string Args : Same arguments as can be passed to individual contained objects
Type : Serializer
Title : to_dom
Usage : $node->to_dom
Function: Generates a DOM subtree from the invocant
and its contained objects
Returns : an XML::LibXML::Element object
Args : a DOM factory object
The Bio::Phylo::Project object inherits from the Bio::Phylo::Listable object. Look there for more methods applicable to the project object.
Also see the manual: Bio::Phylo::Manual and http://rutgervos.blogspot.com.
If you use Bio::Phylo in published research, please cite it:
Rutger A Vos, Jason Caravas, Klaas Hartmann, Mark A Jensen and Chase Miller, 2011. Bio::Phylo - phyloinformatic analysis using Perl. BMC Bioinformatics 12:63. http://dx.doi.org/10.1186/1471-2105-12-63
$Id: Project.pm 1660 2011-04-02 18:29:40Z rvos $
| Bio-Phylo documentation | view source | Contained in the Bio-Phylo distribution. |