[Bioperl-l] failure of add_seqfeature

Hilmar Lapp hlapp at gmx.net
Thu Mar 6 15:26:52 UTC 2008


It seems you are adding subfeatures with a location that is not  
within their parent feature location. If that's indeed what you want  
to do, add the 'EXPAND' argument.

Excerpted from the POD of Bio::SeqFeature::Generic:

         Usage   : $feat->add_SeqFeature($subfeat);
                   $feat->add_SeqFeature($subfeat,'EXPAND')
         Function: adds a SeqFeature into the subSeqFeature array.
                   with no 'EXPAND' qualifer, subfeat will be tested
                   as to whether it lies inside the parent, and throw
                   an exception if not.

                   If EXPAND is used, the parent's start/end/strand will
                   be adjusted so that it grows to accommodate the new
                   subFeature


On Mar 6, 2008, at 7:06 AM, Masa Masa wrote:

> Dear experts,
>
> Would anybody know why the following codes generate an error of:
>
>
> ------------- EXCEPTION  -------------
> MSG: Bio::SeqFeature::Generic=HASH(0x94583c0) is not contained  
> within parent feature, and expansion is not valid
> STACK Bio::SeqFeature::Generic::add_SeqFeature /usr/lib/perl5/ 
> site_perl/5.8.0/Bio/SeqFeature/Generic.pm:767
> STACK toplevel test.pl:118
>
> --------------------------------------
> 15616 15693
> 79568 83016
>
> =================
>
>
> use Bio::Graphics;
> use Bio::SeqFeature::Generic;
> use Bio::SeqIO;
>
>
> my $bsg = 'Bio::SeqFeature::Generic';
>
> my $unseqfea = $bsg->new( -start=>$from[$i], -end=>$to[$i], - 
> display_name=>'U');
>
> for (my $i=0; $i < @from; $i++) {
> print "$from[$i] $to[$i]\n";
>     $unseqfea->add_SeqFeature($bsg->new(-start=>$from[$i],-end=>$to 
> [$i]));
>     if ($i > 10) {
>        exit;
>     }
> }
>
> -- 
> Want an e-mail address like mine?
> Get a free e-mail account today at www.mail.com!
>
>
> _______________________________________________
> 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 gmx dot net :
===========================================================






More information about the Bioperl-l mailing list