NAME
Bio::TreeIO::phyloxml - TreeIO implementation for parsing PhyloXML format.
SYNOPSIS
# do not use this module directlyuse Bio::TreeIO;my $treeio = Bio::TreeIO->new(-format => 'phyloxml',-file => 'tree.dnd');my $tree = $treeio->next_tree;
DESCRIPTION
This module handles parsing and writing of phyloXML format.
FEEDBACK
Mailing Lists
User feedback is an integral part of the evolution of this and other Bioperl modules. Send your comments and suggestions preferably to the Bioperl mailing list. Your participation is much appreciated.
[email protected] - General discussionhttp://bioperl.org/wiki/Mailing_lists - About the mailing lists
Support
Please direct usage questions or support issues to the mailing list:
rather than to the module maintainer directly. Many experienced and reponsive experts will be able look at the problem and quickly address it. Please include a thorough description of the problem with code and data examples if at all possible.
Reporting Bugs
Report bugs to the Bioperl bug tracking system to help us keep track of the bugs and their resolution. Bug reports can be submitted viax the web:
https://github.com/bioperl/bioperl-live/issues
AUTHOR - Mira Han
Email [email protected]
APPENDIX
The rest of the documentation details each of the object methods. Internal methods are usually preceded with a _
next_tree
Title : next_treeUsage : my $tree = $treeio->next_treeFunction: Gets the next tree in the streamReturns : Bio::Tree::TreeIArgs : none
add_attribute
Title : add_phyloXML_annotationUsage : my $node = $treeio->add_phyloXML_annotation(-obj=>$node, -attr=>"id_source = \"A\"")Function: add attributes to an objectReturns : the node that we added annotations toArgs : -obj => object that will have the Annotation. (Bio::Tree::AnnotatableNode)-attr => string in the form "A = B", where A is the attribute name and B is the attribute value
add_phyloXML_annotation
Title : add_phyloXML_annotationUsage : my $node = $treeio->add_phyloXML_annotation(-obj=>$node, -xml=>$xmlstring)my $tree = $treeio->add_phyloXML_annotation('-obj'=>$tree, '-xml'=>'<sequence_relation id_ref_0="A" id_ref_1="B" type="orthology"/>')Function: add annotations to a node in the phyloXML format stringReturns : the node that we added annotations toArgs : -obj => object that will have the Annotation. (Bio::Tree::AnnotatableNode)-xml => string in phyloXML format that describes the annotation for the node
write_tree
Title : write_treeUsage : $treeio->write_tree($tree);Function: Write a tree out to data stream in phyloxml formatReturns : noneArgs : Bio::Tree::TreeI object
_write_tree_Helper_annotatableNode
Title : _write_tree_Helper_annotatableNodeUsage : internal method used by write_tree, not to be used directlyFunction: recursive helper function of write_tree for the annotatableNodes.translates annotations into xml elements.Returns : string describing the nodeArgs : Bio::Node::AnnotatableNode object, string
_write_tree_Helper_generic
Title : _write_tree_Helper_genericUsage : internal method used by write_tree, not to be used directlyFunction: recursive helper function of write_tree for generic NodesI.all tags are translated into property elements.Returns : string describing the nodeArgs : Bio::Node::NodeI object, string
_relation_to_string
Title : _relation_to_stringUsage : internal method used by write_tree, not to be used directlyFunction: internal function used by write_tree to translate Annotation::Relation objects into xml elements.Returns : string describing the nodeArgs : Bio::Node::AnnotatableNode (or Bio::SeqI) object that contains the Annotation::Relation,the Annotation::Relation object,the string
read_annotation
Title : read_annotationUsage : $treeio->read_annotation(-obj=>$node, -path=>$path, -attr=>1);Function: read text value (or attribute value) of the annotations corresponding to the element pathReturns : list of text values of the annotations matching the pathArgs : -obj => object that contains the Annotation. (Bio::Tree::AnnotatableNode or Bio::SeqI)-path => path of the nested elements-attr => Boolean value to indicate whether to get the attribute of the element or the text value.(default is 0, meaning text value is returned)
Methods for parsing the XML document
processXMLNode
Title : processXMLNodeUsage : $treeio->processXMLNodeFunction: read the XML node and process according to the node typeReturns : noneArgs : none
processAttribute
Title : processAttributeUsage : $treeio->processAttribute(\%hash_for_attribute);Function: reads the attributes of the current element into a hashReturns : noneArgs : hash reference where the attributes will be stored.
element_phylogeny
Title : element_phylogenyUsage : $treeio->element_phylogenyFunction: initialize the parsing of a treeReturns : noneArgs : none
end_element_phylogeny
Title : end_element_phylogenyUsage : $treeio->end_element_phylogenyFunction: ends the parsing of a tree building a Tree::TreeI object.Returns : Tree::TreeIArgs : none
element_clade
Title : element_cladeUsage : $treeio->element_cladeFunction: initialize the parsing of a nodecreates a new AnnotatableNode with annotationsReturns : noneArgs : none
end_element_clade
Title : end_element_cladeUsage : $treeio->end_element_cladeFunction: ends the parsing of a nodeReturns : noneArgs : none
element_relation
Title : element_relationUsage : $treeio->element_relationFunction: starts the parsing of clade relation & sequence relationReturns : noneArgs : none
end_element_relation
Title : end_element_relationUsage : $treeio->end_element_relationFunction: ends the parsing of clade relation & sequence relationReturns : noneArgs : none
element_default
Title : element_defaultUsage : $treeio->element_defaultFunction: starts the parsing of all other elementsReturns : noneArgs : none
end_element_default
Title : end_element_defaultUsage : $treeio->end_element_defaultFunction: ends the parsing of all other elementsReturns : noneArgs : none
annotateNode
Title : annotateNodeUsage : $treeio->annotateNode($element, $ac)Function: adds text value and attributes to the AnnotationCollectionthat has element name as key. If there are nested elements,optional AnnotationCollections are added recursively,with the nested element name as key.The structure of each AnnotationCollection is'element' => AnnotationCollection {'_text' => SimpleValue (text value)'_attr' => AnnotationCollection {attribute1 => SimpleValue (attribute value 1)attribute2 => SimpleValue (attribute value 2)...}['nested element' => AnnotationCollection ]}Returns : noneArgs : none
Methods for exploring the document
current_attr
Title : current_attrUsage : $attr_hash = $treeio->current_attr;Function: returns the attribute hash for current itemReturns : reference of the attribute hashArgs : none
prev_attr
Title : prev_attrUsage : $hash_ref = $treeio->prev_attrFunction: returns the attribute hash for previous itemReturns : reference of the attribute hashArgs : none
current_element
Title : current_elementUsage : $element = $treeio->current_elementFunction: returns the name of the current elementReturns : string (element name)Args : none
prev_element
Title : prev_elementUsage : $element = $treeio->current_elementFunction: returns the name of the previous elementReturns : string (element name)Args : none
treetype
Title : treetypeUsage : $obj->treetype($newval)Function: returns the tree type (default is Bio::Tree::Tree)Returns : value of treetypeArgs : newvalue (optional)
nodetype
Title : nodetypeUsage : $obj->nodetype($newval)Function: returns the node type (default is Bio::Node::AnnotatableNode)Returns : value of nodetypeArgs : newvalue (optional)
Methods for implementing to_string callback for AnnotatableNode
node_to_string
Title : node_to_stringUsage : $annotatablenode->to_string_callback(\&node_to_string)Function: set as callback in AnnotatableNode, prints the node information in stringReturns : string of node informationArgs : none
print_annotation
Title : print_annotationUsage : $str = $annotatablenode->print_annotation($str, $annotationcollection)Function: prints the annotationCollection in a phyloXML format.Returns : string of annotation informationArgs : string to which the Annotation should be concatenated to,annotationCollection that holds the Annotations
print_attr
Title : print_attrUsage : $str = $annotatablenode->print_attr($str, $annotationcollection)Function: prints the annotationCollection in a phyloXML format.Returns : string of attributesArgs : string to which the Annotation should be concatenated to,AnnotationCollection that holds the attributes
print_sequence_annotation
Title : print_sequence_annotationUsage : $str = $node->print_seq_annotation( $str, $seq );Function: prints the Bio::Seq object associated with the nodein a phyloXML format.Returns : string that describes the sequenceArgs : string to which the Annotation should be concatenated to,Seq object to print in phyloXML