[Bioperl-l] Data missing into Annotation object using Bio::SeqIO (Genbank)

Hilmar Lapp hlapp at drycafe.net
Thu Jan 7 16:55:00 UTC 2010


I don't know to what extent this was followed up on further and I  
guess it's too long ago to be of much help, but if it hasn't been  
mentioned before I wanted to point out  
Bio::SeqFeature::AnnotationAdaptor which integrates tag/value  
annotation and Bio::Annotation annotation into one  
AnnotationCollection, so it doesn't matter whether something is  
attached as a tag or as an annotation object.

	-hilmar

On Dec 16, 2009, at 10:09 AM, Chris Fields wrote:

> Emmanuel,
>
> The previous behavior in the 1.5.x series was to store feature tags  
> as Bio::Annotation.  The problem had been the way this was  
> implemented was considered unsatisfactory for various reasons, so we  
> reverted back to using simple tag-value pairs as the default.  You  
> can get at the data this way (from the Feature/Annotation HOWTO):
>
> for my $feat_object ($seq_object->get_SeqFeatures) {
>    print "primary tag: ", $feat_object->primary_tag, "\n";
>    for my $tag ($feat_object->get_all_tags) {
>        print "  tag: ", $tag, "\n";
>        for my $value ($feat_object->get_tag_values($tag)) {
>            print "    value: ", $value, "\n";
>        }
>    }
> }
>
> You can also convert all the tag-value data into a  
> Bio::Annotation::Collection using the  
> Bio::SeqFeature::AnnotationAdaptor, but this is completely optional.
>
> chris
>
> On Dec 16, 2009, at 8:14 AM, Emmanuel Quevillon wrote:
>
>> Hi,
>>
>> I've wrote a small Genbank parser few months ago before BioPerl  
>> release 1.6.0.
>> I tried to use my code once again but now the output of my parser  
>> is empty.
>> It looks like Annotation from seqfeatures is not filled anymore.
>>
>> Here is the code I used previously:
>>
>> while(my $seq = $streamer->next_seq()){
>>
>>   #We only want to retrieve CDS features...
>>   foreach my $feat (grep { $_->primary_tag() eq 'CDS' } $seq- 
>> >get_SeqFeatures()){
>>       print $ofh join("#",
>>                       $feat->annotation()- 
>> >get_Annotations('locus_tag'),    # Acc num
>>                       $feat->annotation()->get_Annotations('gene')
>>                         ? $feat->annotation()- 
>> >get_Annotations('gene')      # Gene name
>>                         : $feat->annotation()- 
>> >get_Annotations('locus_tag'),
>>                       $feat->annotation()- 
>> >get_Annotations('product'),      # Description
>>                      ),"\n";
>>   }
>> }
>>
>> $feat is a Bio::SeqFeature::Generic object
>>
>> If I print Dumper($feat->annotation()) here is the output :
>>
>> $VAR1 = bless( {
>>                '_typemap' => bless( {
>>                                       '_type' => {
>>                                                    'comment' =>  
>> 'Bio::Annotation::Comment',
>>                                                    'reference' =>  
>> 'Bio::Annotation::Reference',
>>                                                    'dblink' =>  
>> 'Bio::Annotation::DBLink'
>>                                                  }
>>                                     },  
>> 'Bio::Annotation::TypeManager' ),
>>                '_annotation' => {}
>>              }, 'Bio::Annotation::Collection' );
>>
>> Have some changes been made into the way annotation object is  
>> populated?
>>
>> Thanks for any clue and sorry if my question look stupid
>>
>> Regards
>>
>> Emmanuel
>>
>> -- 
>> -------------------------
>> Emmanuel Quevillon
>> Biological Software and Databases Group
>> Institut Pasteur
>> +33 1 44 38 95 98
>> tuco at_ pasteur dot fr
>> -------------------------
>>
>> _______________________________________________
>> Bioperl-l mailing list
>> Bioperl-l at lists.open-bio.org
>> http://lists.open-bio.org/mailman/listinfo/bioperl-l
>
>
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at lists.open-bio.org
> http://lists.open-bio.org/mailman/listinfo/bioperl-l

-- 
===========================================================
: Hilmar Lapp -:- Durham, NC -:- hlapp at drycafe dot net :
===========================================================







More information about the Bioperl-l mailing list