[Bioperl-guts-l] bioperl-live/Bio/Graphics FeatureBase.pm, 1.26, 1.27

Malcom Cook mcook at dev.open-bio.org
Fri Feb 23 16:54:00 EST 2007


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

Modified Files:
	FeatureBase.pm 
Log Message:
handle Multiple attributes of the same type in GFF output correctly


Index: FeatureBase.pm
===================================================================
RCS file: /home/repository/bioperl/bioperl-live/Bio/Graphics/FeatureBase.pm,v
retrieving revision 1.26
retrieving revision 1.27
diff -C2 -d -r1.26 -r1.27
*** FeatureBase.pm	20 Feb 2007 17:26:08 -0000	1.26
--- FeatureBase.pm	23 Feb 2007 21:53:57 -0000	1.27
***************
*** 613,616 ****
--- 613,617 ----
  
  sub format_attributes {
+   die;
    my $self   = shift;
    my $parent = shift;
***************
*** 619,629 ****
    for my $t (@tags) {
      my @values = $self->each_tag_value($t);
!     push @result,join '=',$self->escape($t),$self->escape($_) foreach @values;
    }
    my $id   = $self->primary_id;
    my $name = $self->display_name;
!   push @result,"ID=".$self->escape($id)                     if defined $id;
!   push @result,"Parent=".$self->escape($parent->primary_id) if defined $parent;
!   push @result,"Name=".$self->escape($name)                 if defined $name;
    return join ';', at result;
  }
--- 620,634 ----
    for my $t (@tags) {
      my @values = $self->each_tag_value($t);
!     #push @result,join '=',$self->escape($t),$self->escape($_) foreach @values;
!     # NO! Multiple attributes of the same type are indicated by
!     # separating the values with the comma "," character - per
!     # http://www.sequenceontology.org/gff3.shtml.  Do it this way:
!     push @result,join '=',$self->escape($t),join(',', map {$self->escape($_)} @values);
    }
    my $id   = $self->primary_id;
    my $name = $self->display_name;
!   unshift @result,"ID=".$self->escape($id)                     if defined $id;
!   unshift @result,"Parent=".$self->escape($parent->primary_id) if defined $parent;
!   unshift @result,"Name=".$self->escape($name)                 if defined $name;
    return join ';', at result;
  }



More information about the Bioperl-guts-l mailing list