4 # BioPerl module for Bio::DB::Ace
6 # Please direct questions and support issues to <bioperl-l@bioperl.org>
8 # Cared for by Ewan Birney <birney@ebi.ac.uk>
10 # Copyright Ewan Birney
12 # You may distribute this module under the same terms as perl itself
14 # POD documentation - main docs before the code
18 Bio::DB::Ace - Database object interface to ACeDB servers
22 $db = Bio::DB::Ace->new( -server => 'myace.server.com', port => '120000');
24 $seq = $db->get_Seq_by_id('MUSIGHBA1'); # Unique ID
28 $seq = $db->get_Seq_by_acc('J00522'); # Accession Number
32 This provides a standard BioPerl database access to Ace, using Lincoln Steins
33 excellent AcePerl module. You need to download and install the aceperl module from
35 http://stein.cshl.org/AcePerl/
37 before this interface will work.
39 This interface is designed at the moment to work through a aceclient/aceserver
42 =head1 INSTALLING ACEPERL
44 Download the latest aceperl tar file, gunzip/untar and cd into the directory.
45 This is a standard CPAN-style directory, so if you go
52 Then you will have installed Aceperl. Use the PREFIX mechanism to install elsewhere.
58 User feedback is an integral part of the evolution of this
59 and other Bioperl modules. Send your comments and suggestions preferably
60 to one of the Bioperl mailing lists.
61 Your participation is much appreciated.
63 bioperl-l@bioperl.org - General discussion
64 http://bioperl.org/wiki/Mailing_lists - About the mailing lists
68 Please direct usage questions or support issues to the mailing list:
70 I<bioperl-l@bioperl.org>
72 rather than to the module maintainer directly. Many experienced and
73 reponsive experts will be able look at the problem and quickly
74 address it. Please include a thorough description of the problem
75 with code and data examples if at all possible.
79 Report bugs to the Bioperl bug tracking system to help us keep track
80 the bugs and their resolution. Bug reports can be submitted via the
83 http://bugzilla.open-bio.org/
85 =head1 AUTHOR - Ewan Birney
87 Email birney@ebi.ac.uk
91 The rest of the documentation details each of the object methods. Internal methods are usually preceded with a _
95 # Let the code begin...
100 # Object preamble - inherits from Bio::DB::RandomAccessI
107 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 $@";
112 use base
qw(Bio::DB::RandomAccessI);
114 # new() is inherited from Bio::DB::Abstract
116 # _initialize is where the heavy stuff will happen when new is called
119 my($class,@args) = @_;
120 my $self = $class->SUPER::new
(@args);
121 my ($host,$port) = $self->_rearrange([qw(
128 if( !$host || !$port ) {
129 $self->throw("Must have a host and port for an acedb server to work");
132 my $aceobj = Ace
->connect(-host
=> $host,
134 $self->throw("Could not make acedb object to $host:$port");
136 $self->_aceobj($aceobj);
144 Title : get_Seq_by_id
145 Usage : $seq = $db->get_Seq_by_id($uid);
146 Function: Gets a Bio::Seq object by its unique identifier/name
147 Returns : a Bio::Seq object
148 Args : $id : the id (as a string) of the desired sequence entry
154 my $id = shift or $self->throw("Must supply an identifier!\n");
155 my $ace = $self->_aceobj();
158 $seq = $ace->fetch( 'Sequence' , $id);
160 # get out the sequence somehow!
162 $dna = $seq->asDNA();
167 $out = Bio
::Seq
->new( -id
=> $id, -alphabet
=> 'Dna', -seq
=> $dna, -name
=> "Sequence from Bio::DB::Ace $id");
172 =head2 get_Seq_by_acc
174 Title : get_Seq_by_acc
175 Usage : $seq = $db->get_Seq_by_acc($acc);
176 Function: Gets a Bio::Seq object by its accession number
177 Returns : a Bio::Seq object
178 Args : $acc : the accession number of the desired sequence entry
186 my $acc = shift or $self->throw("Must supply an accesion number!\n");
188 return $self->get_Seq_by_id($acc);
194 Usage : $ace = $db->_aceobj();
195 Function: Get/Set on the acedb object
197 Args : New value of the ace object
202 my ($self,$arg) = @_;
205 $self->{'_aceobj'} = $arg;
208 return $self->{'_aceobj'};