2
# $Id: Ace.pm,v 1.9 2001/06/18 15:53:42 dag Exp $
4
# BioPerl module for Bio::DB::Ace
6
# Cared for by Ewan Birney <birney@sanger.ac.uk>
8
# Copyright Ewan Birney
10
# You may distribute this module under the same terms as perl itself
12
# POD documentation - main docs before the code
16
Bio::DB::Ace - Database object interface to ACeDB servers
20
$db = Bio::DB::Ace->new( -server => 'myace.server.com', port => '120000');
22
$seq = $db->get_Seq_by_id('MUSIGHBA1'); # Unique ID
26
$seq = $db->get_Seq_by_acc('J00522'); # Accession Number
30
This provides a standard BioPerl database access to Ace, using Lincoln Steins
31
excellent AcePerl module. You need to download and install the aceperl module from
33
http://stein.cshl.org/AcePerl/
35
before this interface will work.
37
This interface is designed at the moment to work through a aceclient/aceserver
40
=head1 INSTALLING ACEPERL
42
Download the latest aceperl tar file, gunzip/untar and cd into the directory.
43
This is a standard CPAN-style directory, so if you go
50
Then you will have installed Aceperl. Use the PREFIX mechanism to install elsewhere.
56
User feedback is an integral part of the evolution of this
57
and other Bioperl modules. Send your comments and suggestions preferably
58
to one of the Bioperl mailing lists.
59
Your participation is much appreciated.
61
bioperl-l@bioperl.org - General discussion
62
http://bioperl.org/MailList.shtml - About the mailing lists
66
Report bugs to the Bioperl bug tracking system to help us keep track
67
the bugs and their resolution.
68
Bug reports can be submitted via email or the web:
70
bioperl-bugs@bio.perl.org
71
http://bio.perl.org/bioperl-bugs/
73
=head1 AUTHOR - Ewan Birney
75
Email birney@sanger.ac.uk
79
The rest of the documentation details each of the object methods. Internal methods are usually preceded with a _
83
# Let the code begin...
89
# Object preamble - inherits from Bio::DB::RandomAccessI
91
use Bio::DB::RandomAccessI;
99
print STDERR "You have not installed Ace.pm.\n Read the docs in Bio::DB::Ace for more information about how to do this.\n It is very easy\n\nError message $@";
104
@ISA = qw(Bio::DB::RandomAccessI);
106
# new() is inherited from Bio::DB::Abstract
108
# _initialize is where the heavy stuff will happen when new is called
111
my($class,@args) = @_;
112
my $self = $class->SUPER::new(@args);
113
my ($host,$port) = $self->_rearrange([qw(
120
if( !$host || !$port ) {
121
$self->throw("Must have a host and port for an acedb server to work");
124
my $aceobj = Ace->connect(-host => $host,
126
$self->throw("Could not make acedb object to $host:$port");
128
$self->_aceobj($aceobj);
136
Title : get_Seq_by_id
137
Usage : $seq = $db->get_Seq_by_id($uid);
138
Function: Gets a Bio::Seq object by its unique identifier/name
139
Returns : a Bio::Seq object
140
Args : $id : the id (as a string) of the desired sequence entry
146
my $id = shift or $self->throw("Must supply an identifier!\n");
147
my $ace = $self->_aceobj();
150
$seq = $ace->fetch( 'Sequence' , $id);
152
# get out the sequence somehow!
154
$dna = $seq->asDNA();
159
$out = Bio::Seq->new( -id => $id, -type => 'Dna', -seq => $dna, -name => "Sequence from Bio::DB::Ace $id");
164
=head2 get_Seq_by_acc
166
Title : get_Seq_by_acc
167
Usage : $seq = $db->get_Seq_by_acc($acc);
168
Function: Gets a Bio::Seq object by its accession number
169
Returns : a Bio::Seq object
170
Args : $acc : the accession number of the desired sequence entry
178
my $acc = shift or $self->throw("Must supply an accesion number!\n");
180
return $self->get_Seq_by_id($acc);
186
Usage : $ace = $db->_aceobj();
187
Function: Get/Set on the acedb object
189
Args : New value of the ace object
194
my ($self,$arg) = @_;
197
$self->{'_aceobj'} = $arg;
200
return $self->{'_aceobj'};