[Bioperl-guts-l] [Bug 1825] bug in parsing gene names for swissprot entry in module Bio::SeqIO:swiss

bugzilla-daemon at portal.open-bio.org bugzilla-daemon at portal.open-bio.org
Wed Feb 20 13:41:26 EST 2008


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





------- Comment #6 from cjfields at uiuc.edu  2008-02-20 13:41 EST -------
I think that would work; I assume we would indicate GN annotation is in a
subCollection in the POD.  

If we don't want to nest Collections, I found this also works (but is less
intuitive as it abuses the tagname somewhat):

my $annotation = Bio::Annotation::Collection->new();
my $s1 = Bio::Annotation::StructuredValue->new(-tagname => 'gene_name');
$annotation->add_Annotation('gene_name', $s1);
my $s2 = Bio::Annotation::StructuredValue->new(-tagname => 'synonymns');
$annotation->add_Annotation('gene_name', $s2);
my $s3 = Bio::Annotation::StructuredValue->new(-tagname => 'ORFnames');
$annotation->add_Annotation('gene_name', $s3);

print Dumper $annotation;

(In reply to comment #5)
> This should work. Bio::Annotation::Collection already implements both
> Bio::AnnotationI and Bio::AnnotationCollectionI, so the following works without
> any changes to the Bio::Annotation classes: 
> 
> -------------------------------------------------------------
> use strict;
> use warnings;
> use Data::Dumper;
> 
> use Bio::Annotation::Collection;
> use Bio::Annotation::SimpleValue;
> use Bio::Annotation::StructuredValue;
> 
> my $annotation = Bio::Annotation::Collection->new();
> my $gn = Bio::Annotation::Collection->new();
> my $name = Bio::Annotation::SimpleValue->new();
> my $synonyms = Bio::Annotation::StructuredValue->new();
> 
> 
> $annotation->add_Annotation('gene_name', $gn);
> $gn->add_Annotation('name', $name);
> $gn->add_Annotation('synonyms', $synonyms);
> 
> print Dumper $annotation;
> -------------------------------------------------------------
> 
> Question remains, is there any reason NOT to follow this path?
> 


-- 
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