[Bioperl-l] Adapt source method in Bio::SeqFeature::Annotated

Steffen Grossmann grossman at molgen.mpg.de
Tue Nov 2 03:42:18 EST 2004


I am not. Still waiting for someone to make the final step...

Steffen

Allen Day wrote:

>are you a cvs user now?  if so, you can commit this in directly.
>
>-allen
>
>
>On Mon, 1 Nov 2004, Steffen Grossmann wrote:
>
>  
>
>>Dear all,
>>
>>as a follow up to my last message (http://bioperl.org/pipermail/bioperl-l/2004-October/017178.html), I propose to adapt the 'source' method 
>>in Bio::SeqFeature:.Annotated on order to make it use the annotation system. This is merely for convenience, but also helps avoiding trouble 
>>by using different places to store a 'source' annotation.
>>
>>I provide a patch below.
>>
>>Steffen
>>
>>
>>
>>Bio_SeqFeature_Annotated.diff
>>---8<---8<---8<---8<---8<---8<---8<---8<---cut here
>>*** bioperl-live/Bio/SeqFeature/Annotated.pm    Mon Oct 25 11:08:25 2004
>>--- modified_bioperl-live/Bio/SeqFeature/Annotated.pm   Mon Nov  1 09:06:09 2004
>>***************
>>*** 347,355 ****
>>
>>   sub source {
>>     my $self = shift;
>>
>>!   return $self->{'source'} = shift if @_;
>>!   return $self->{'source'};
>>   }
>>
>>
>>--- 347,367 ----
>>
>>   sub source {
>>     my $self = shift;
>>+   my $source = shift;
>>
>>!   if ($source) {
>>!       $self->annotation->remove_Annotations('source');
>>!       $self->annotation->add_Annotation(Bio::Annotation::SimpleValue->new(-value => $source,
>>!                                                                         -tagname => 'source')
>>!                                      );
>>!   } else {
>>!       if (my ($sa) = $self->annotation->get_Annotations('source')) {
>>!         $source = $sa->value;
>>!       } else {
>>!         $source = "";
>>!       }
>>!   }
>>!   return $source;
>>   }
>>
>>
>>---8<---8<---8<---8<---8<---8<---8<---8<---cut here
>>
>>
>>
>>    
>>
>
>  
>

-- 
%---------------------------------------------%
%            Steffen Grossmann                %
%                                             %
% Max Planck Institute for Molecular Genetics %
%      Computational Molecular Biology        %
%---------------------------------------------%
%              Ihnestrasse 73                 %
%               14195 Berlin                  %
%                 Germany                     %
%---------------------------------------------%
%         Tel: (++49 +30) 8413-1167           %
%         Fax: (++49 +30) 8413-1152           %
%---------------------------------------------%




More information about the Bioperl-l mailing list