[Bioperl-l] SeqFetcherI (fwd)

Elia Stupka elia@ebi.ac.uk
Thu, 17 May 2001 15:57:09 +0100 (BST)


I am forwarding an e-mail from Val Curwen over here at EnsEMBL about our
new SeqFetcherI interface. Basically a tiny tiny interface with one method
called fetch_Seq_by_dbname_accession, which we are going to use to fetch
sequences from a bioperl-db database as well as using efetch,getz,etc.
within the EnsEMBL Pipeline. 

One could envisage simple implementantions in bioperl-db such as a
Bio::SeqIO loop that return a Seq when it finds the right one, and we
already have one over here using the bioperl indexer. 

Is everybody cool with this complex and clever piece of code? ;)

Elia

**************************
tel:    +44 1223 49 44 31
mobile: +44 7971 59 03 69
fax:    +44 1223 49 44 68
**************************



---------- Forwarded message ----------
Date: Thu, 17 May 2001 15:53:09 +0100
From: Val Curwen <vac@sanger.ac.uk>
To: Elia Stupka <elia@ebi.ac.uk>, Samuel Aparicio <saparici@hgmp.mrc.ac.uk>
Subject: SeqFetcherI

OK,  so after chatting to Elia we have come up with this:

Bio::SeqFetcherI has one (count 'em!) method:

fetch_Seq_by_dbname_accession

Anyone who wants to implement a SeqFetcher needs to implement this
method :-)

Ha! That wasn't so hard! If only the rest of genebuilding was as
straightforward ...

For the moment I have a dummy class Bio:EnsEMBL::Pipeline:SeqFetcherI
that my various SeqFetchers inherit from, but that can be replaced by
Bio::SeqFetcherI once it's in bioperl and we migrate to whatever version
it is in. My exciting interface is given below - it's up to you guys
what to do with the implementations for bioperl-db :-)

Val

#!/usr/local/bin/perl

#
#
# Cared for by EnsEMBL  <ensembl-dev@ebi.ac.uk>
#
# Copyright GRL & EBI
#
# You may distribute this module under the same terms as perl itself
#
# POD documentation - main docs before the code

=pod 

=head1 NAME

Bio::EnsEMBL::Pipeline::SeqFetcherI

=head1 SYNOPSIS

Will be replaced by Bio::SeqFetcherI when its written ...

=head1 DESCRIPTION

Object to retrieve a single Bio::Seq given a single ID and the database
from which to fetch it. 
Bio::EnsEMBL::Pipeline::SeqFetcher contains various modules that
implement SeqFetcherI for different sequence fetching methods.

=head1 CONTACT

Describe contact details here

=head1 APPENDIX

The rest of the documentation details each of the object methods. 
Internal methods are usually preceded with a _

=head1 ABSTRACT METHODS

These methods need to be implemented in any module which implements
C<Bio::EnsEMBL::Pipeline::SeqFetcherI>.

=head2 fetch_Seq_by_dbname_accession

      $seqfetcher->fetch_Seq_by_dbname_accession('swiss','Z83307');

Fetches a Bio::Seq given the db to fetch from and the accession number
of the sequence.

=cut

# Let the code begin...
package Bio::EnsEMBL::Pipeline::SeqFetcherI;

use strict;
use Bio::Root::RootI;
use Bio::Seq;

use vars qw(@ISA);

@ISA = qw(Bio::Root::RootI);

sub new {
  my ($class, @args) = @_;
  my $self = bless {}, $class;

  return $self; # success - we hope!
}

=head2 fetch_Seq_by_dbname_accession

  Title   : id
  Usage   :
$seqfetcher->fetch_Seq_by_dbname_accession('swiss','Z83307');
  Function: Fetches a Bio::Seq given the db to fetch from and the
accession number of the sequence.
  Returns : Bio::Seq
  Args    : 

=cut


sub fetch_Seq_by_dbname_accession {
  my ($self) = @_;
  $self->throw("fetch_Seq_by_dbname_accession is not implemented\n");  
}

1;