[Bioperl-l] sub-locations vs sub-features

Hilmar Lapp hilmarl@yahoo.com
Thu, 22 Mar 2001 10:03:29 -0800


A CDS as any other feature with a compound location is supposed to
end up as a single feature with a location that has sublocations
(Simon, you might want to check the POD of Bio::Location::Split).
That's what the entity relationships really are.

This behaviour may be insufficiently documented. A point to be
added to bptutorial I guess.

	Hilmar
-- 
-----------------------------------------------------------------
Hilmar Lapp                              email: hilmarl@yahoo.com
GNF, San Diego, Ca. 92122                phone: +1 858 812 1757
-----------------------------------------------------------------

bioperl-bugs@bioperl.org wrote:
> 
> JitterBug notification
> 
> jason changed notes
> 
> Message summary for PR#932
>         From: simon_cawley@affymetrix.com
>         Subject: sub_SeqFeature bug
>         Date: Wed, 21 Mar 2001 13:51:08 -0500
>         0 replies       0 followups
>         Notes: Do we need to make changes to FTHelper - I'm not sure of the properties of the
> SubFeature here.  They should be linked to sub_Locations because we don't want
> duplication.  Help with the object model? --Jason Stajich 03-21-2001
> 
> This is just a case of not rolling the location object back into the SeqFeature
> methods the way we should.
> 
> However there is a way you can make this work because technically you
> don't have sub SeqFeatures, but sub_locations here.
> #!/usr/local/bin/perl -w
> use Bio::SeqIO;
> use strict;
> 
> my $seqio = new Bio::SeqIO(-format => 'genbank', -file => 'AF183172.gb');
> while( my $seq = $seqio->next_seq ) {
>     foreach  my $feat ( $seq->top_SeqFeatures ) {
>         if( $feat->primary_tag =~ /cds/i) {
>             if( ref $feat->location &&
>                 $feat->location->isa('Bio::Location::SplitLocationI') ) {
>                 my @sublocs = $feat->location->sub_Location();
>                 printf("Found a CDS from %d to %d with %d  sub-features.\n",
>                        $feat->start,$feat->end,scalar(@sublocs));
>             } else {
>                 # hope that someone implemented this
>                 my @subFeats = $feat->sub_SeqFeature();
>                 printf("Found a CDS from %d to %d with %d  sub-features.\n",
>                        $feat->start,$feat->end,scalar(@subFeats));
>             }
>         }
>     }
> }
> 
> ====> ORIGINAL MESSAGE FOLLOWS <====
> 
> >From simon_cawley@affymetrix.com Wed Mar 21 13:51:08 2001
> Received: from localhost (localhost [127.0.0.1])
>         by pw600a.bioperl.org (8.11.2/8.11.2) with ESMTP id f2LIp8202238
>         for <bioperl-bugs@pw600a.bioperl.org>; Wed, 21 Mar 2001 13:51:08 -0500
> Date: Wed, 21 Mar 2001 13:51:08 -0500
> Message-Id: <200103211851.f2LIp8202238@pw600a.bioperl.org>
> From: simon_cawley@affymetrix.com
> To: bioperl-bugs@bioperl.org
> Subject: sub_SeqFeature bug
> 
> Full_Name: Simon Cawley
> Module: Bio::SeqFeature::Generic.pm (I think)
> Version: 0.7.0
> PerlVer: 5.6.0
> OS: Linux RedHat 6.2
> Submission from: firewall.neomorphic.com (205.217.46.68)
> 
> I'm running into a problem where I can't access
> the sub features of a CDS feature.  To reproduce,
> I'm working with a sequence of accession id
> AB000381 (saved as AB000381.seq) which has a CDS
> of 3 exons:
> 
> $ grep CDS AB000381.seq
>      CDS             join(28199..28271,28881..28988,34291..34586)
> 
> I run the following script:
> 
> use Bio::SeqIO;
> $in = Bio::SeqIO->new(-file => 'AB000381.seq', -format => 'GenBank');
> $seq = $in->next_seq();
> foreach $feat ($seq->top_SeqFeatures() ) {
>   if($feat->primary_tag =~ /cds/i) {
>     @subFeats = $feat->sub_SeqFeature();
>     printf("Found a CDS from %d to %d with %d sub-features.\n",
>       $feat->start,$feat->end,scalar(@subFeats));
>   }
> }
> 
> Which gives the following output:
>   Found a CDS from 28199 to 34586 with 0 sub-features.
> 
> Thanks for looking at this,
> 
> Simon
> 
> _______________________________________________
> Bioperl-guts-l mailing list
> Bioperl-guts-l@bioperl.org
> http://bioperl.org/mailman/listinfo/bioperl-guts-l