[Bioperl-l] Bio::DB::SeqFeature to GFF mishandles attributes withmultiple values

Cook, Malcolm MEC at stowers-institute.org
Fri Feb 23 12:08:11 EST 2007


Oy,

I hit send too soon.  The patch I send had my new attribute encoder
commented out.  It should've been: 


*** NormalizedFeature.pm	2 Feb 2007 21:05:42 -0000	1.25
--- NormalizedFeature.pm	23 Feb 2007 17:06:37 -0000
***************
*** 481,494 ****
      next if $t eq 'load_id';
      next if $t eq 'parent_id';
      foreach (@values) { s/\s+$// } # get rid of trailing whitespace
! 
!     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;
  }
  
--- 481,497 ----
      next if $t eq 'load_id';
      next if $t eq 'parent_id';
      foreach (@values) { s/\s+$// } # get rid of trailing whitespace
!     # 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;
  }
  


Malcolm



More information about the Bioperl-l mailing list