[Bioperl-guts-l] [Bug 2442] SeqFeature::Annotated constructor -feature arg breaks with another BSFA

bugzilla-daemon at portal.open-bio.org bugzilla-daemon at portal.open-bio.org
Mon Feb 4 20:47:44 EST 2008


http://bugzilla.open-bio.org/show_bug.cgi?id=2442





------- Comment #3 from rmb32 at cornell.edu  2008-02-04 20:47 EST -------
(In reply to comment #2)

I've already done some looking, and I think the problem lies in the
BSF::Annotated::from_feature() method where the AnnotationAdaptor is used to
copy over all the annotations.  Some of the BSFA accessors (qw/seq_id source
type frame phase score/) store their values as Annotations, and these get sort
of copied over twice, with this code.

Try this code for the copying part, it works pretty well, if you make sure
OntologyTerm is listed properly as the type for 'type' in the
Bio::Annotation::TypeManager:

# now pick up the annotations/tags of the other feature
# We'll use AnnotationAdaptor to convert everything over
my %no_copy = map {$_ => 1} qw/seq_id source type frame phase score/;
my $adaptor = Bio::SeqFeature::AnnotationAdaptor->new(-feature => $feat);
for my $key ( $adaptor->get_all_annotation_keys() ) {
  next if $no_copy{$key};
  my @values = $adaptor->get_Annotations($key);
  @values = _aggregate_scalar_annotations(\%opts,$key, at values);
  foreach my $val (@values) {
    $self->add_Annotation($key,$val)
  }
}


With this, it just skips copying the annotations with 'reserved' names.

But yes, the BSFA stuff really needs a big cleaning-out.


-- 
Configure bugmail: http://bugzilla.open-bio.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.


More information about the Bioperl-guts-l mailing list