[Bioperl-l] getting remote sequence features with spliced_seq

Jason Stajich jason.stajich at duke.edu
Fri Jan 7 16:45:24 EST 2005


Pass in Bio::DB::GenBank handle to achieve this magic.

my $dbh = Bio::DB::GenBank->new();
$feature->spliced_seq($dbh);

 From Bio::SeqFeatureI

        spliced_seq

          Title   : spliced_seq

          Usage   : $seq = $feature->spliced_seq()
                    $seq = 
$feature_with_remote_locations->spliced_seq($db_for_seqs)

          Function: Provides a sequence of the feature which is the most
                    semantically "relevant" feature for this sequence. A 
default
                    implementation is provided which for simple cases 
returns just
                    the sequence, but for split cases, loops over the 
split location
                    to return the sequence. In the case of split 
locations with
                    remote locations, eg

                    join(AB000123:5567-5589,80..1144)

                    in the case when a database object is passed in, it 
will attempt
                    to retrieve the sequence from the database object, 
and "Do the right thing",
                    however if no database object is provided, it will 
generate the correct
                    number of N's (DNA) or X's (protein, though this is 
unlikely).

                    This function is deliberately "magical" attempting 
to second guess
                    what a user wants as "the" sequence for this feature.

                    Implementing classes are free to override this 
method with their
                    own magic if they have a better idea what the user 
wants.

          Args    : [optional] A L<Bio::DB::RandomAccessI> compliant 
object if
                               one needs to retrieve remote seqs.
                    [optional] boolean if the locations should not be 
sorted
                               by start location.
          Returns : A L<Bio::PrimarySeqI> object


On Jan 7, 2005, at 4:39 PM, Ryan Golhar wrote:

> Hi all,
>
> I have a bunch of protein ids, and I'm attempting to obtain the cds 
> that
> corresponds to the id.  I can locate the sequence feature in the 
> genbank
> file, however, when I make a call to  $feature->spliced_seq, I can an
> error 'cannot get remote location for ... without a valid
> Bio::DB::RandomAccessI database handle'.  Its line 546 of
> Bio::SeqFeatureI.pm.
>
> I suspect the problem is because in the genbank file, this particular
> entry reads:
>
> Join(AF072550.1:61..103,AF072550.1:5359..5524)
>
> I'm wondering if the accession number is throwing the parser off.  Does
> anyone have any experience with this?
>
> Ryan
>
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at portal.open-bio.org
> http://portal.open-bio.org/mailman/listinfo/bioperl-l
>
>
--
Jason Stajich
jason.stajich at duke.edu
http://www.duke.edu/~jes12/



More information about the Bioperl-l mailing list