[Bioperl-l] Bio::SeqFeature->feature_seq

Ewan Birney birney@ebi.ac.uk
Tue, 10 Sep 2002 19:08:31 +0100 (BST)


Here is the proposed spec for a new function on SeqFeatureI,
to provide more "magic" for the users.

the main use case is to be able to get out the "cdna" from a join'd
embl/genbank record without too much horsing around.


Notice it does not throw on remote locations with no db. Thoughts?


  Title   : feature_seq

  Usage   : $seq = $feature->feature_seq()
            $seq = $feature_with_remote_locations->feature_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 Bio::DB::RandomAccessI compliant object
  Returns : A Bio::Seq