2 # BioPerl module for Bio::TreeIO::nhx
4 # Please direct questions and support issues to <bioperl-l@bioperl.org>
6 # Cared for by Aaron Mackey <amackey@virginia.edu>
8 # Copyright Aaron Mackey
10 # You may distribute this module under the same terms as perl itself
12 # POD documentation - main docs before the code
16 Bio::TreeIO::nhx - TreeIO implementation for parsing
17 Newick/New Hampshire eXtendend (NHX) format.
21 # do not use this module directly
23 my $treeio = Bio::TreeIO->new(-format => 'nhx', -file => 'tree.dnd');
24 my $tree = $treeio->next_tree;
28 This module handles parsing and writing of Newick/New Hampshire eXtended (NHX) format.
34 User feedback is an integral part of the evolution of this and other
35 Bioperl modules. Send your comments and suggestions preferably to the
36 Bioperl mailing list. Your participation is much appreciated.
38 bioperl-l@bioperl.org - General discussion
39 http://bioperl.org/wiki/Mailing_lists - About the mailing lists
43 Please direct usage questions or support issues to the mailing list:
45 I<bioperl-l@bioperl.org>
47 rather than to the module maintainer directly. Many experienced and
48 reponsive experts will be able look at the problem and quickly
49 address it. Please include a thorough description of the problem
50 with code and data examples if at all possible.
54 Report bugs to the Bioperl bug tracking system to help us keep track
55 of the bugs and their resolution. Bug reports can be submitted viax the
58 https://github.com/bioperl/bioperl-live/issues
60 =head1 AUTHOR - Aaron Mackey
62 Email amackey-at-virginia.edu
66 Email jason-at-bioperl-dot-org
70 The rest of the documentation details each of the object methods.
71 Internal methods are usually preceded with a _
76 # Let the code begin...
79 package Bio
::TreeIO
::nhx
;
83 # Object preamble - inherits from Bio::Root::Root
85 use Bio
::Tree
::NodeNHX
;
86 use Bio
::Event
::EventGeneratorI
;
87 #use XML::Handler::Subs;
89 use base
qw(Bio::TreeIO::newick);
92 my($self, %args) = @_;
93 $args{-nodetype
} ||= 'Bio::Tree::NodeNHX';
94 $self->SUPER::_initialize
(%args);
102 my $label_stringbuffer = $self->SUPER::_node_as_string
($node,$params);
104 my @tags = $node->get_all_tags;
105 if( scalar(@tags) > 0 ) {
107 $label_stringbuffer .= '[' .
109 map { "$_=" .join(',',$node->get_tag_values($_)) }
112 return $label_stringbuffer;