[Bioperl-guts-l] bioperl-live/Bio/TreeIO nhx.pm,1.20,1.21

Jason Stajich jason at dev.open-bio.org
Fri Jun 22 21:19:36 EDT 2007


Update of /home/repository/bioperl/bioperl-live/Bio/TreeIO
In directory dev.open-bio.org:/tmp/cvs-serv5803

Modified Files:
	nhx.pm 
Log Message:
deal with empty NHX fields as seen in NJTREE

Index: nhx.pm
===================================================================
RCS file: /home/repository/bioperl/bioperl-live/Bio/TreeIO/nhx.pm,v
retrieving revision 1.20
retrieving revision 1.21
diff -C2 -d -r1.20 -r1.21
*** nhx.pm	14 Jun 2007 14:16:19 -0000	1.20
--- nhx.pm	23 Jun 2007 01:19:34 -0000	1.21
***************
*** 179,183 ****
  		    $lastevent = $prev_event;
  		} else { 
! 		    $self->debug("id with no branchlength is $chars\n");
  		    $self->_eventHandler->start_element( { 'Name' => 'node' } );
  		    $self->_eventHandler->start_element( { 'Name' => 'id' } );
--- 179,183 ----
  		    $lastevent = $prev_event;
  		} else { 
! 		    $self->debug("id with no branchlength is $chars, last event was $lastevent\n");
  		    $self->_eventHandler->start_element( { 'Name' => 'node' } );
  		    $self->_eventHandler->start_element( { 'Name' => 'id' } );
***************
*** 223,230 ****
  	    }
  	} elsif ( $ch eq ']' ) {
! 	    if ($self->_eventHandler->within_element('nhx_tag') && $lastevent eq '=') {
! 		$self->_eventHandler->start_element( { Name => 'tag_value' } );
! 		$self->_eventHandler->characters($chars);
! 		$self->_eventHandler->end_element( { Name => 'tag_value' } );
  		$chars = '';
  		$self->_eventHandler->end_element( { Name => 'nhx_tag' } );
--- 223,233 ----
  	    }
  	} elsif ( $ch eq ']' ) {
! 	    if ($self->_eventHandler->within_element('nhx_tag') && 
! 		($lastevent eq '=' || $lastevent eq '[') ) {
! 		if( $self->_eventHandler->within_element('tag_name') ) {
! 		    $self->_eventHandler->start_element( { Name => 'tag_value' } );
! 		    $self->_eventHandler->characters($chars);
! 		    $self->_eventHandler->end_element( { Name => 'tag_value' } );
! 		}
  		$chars = '';
  		$self->_eventHandler->end_element( { Name => 'nhx_tag' } );



More information about the Bioperl-guts-l mailing list