3 # BioPerl module for Bio::DB::Ace
5 # Please direct questions and support issues to <bioperl-l@bioperl.org>
7 # Cared for by Ewan Birney <birney@ebi.ac.uk>
9 # Copyright Ewan Birney
11 # You may distribute this module under the same terms as perl itself
13 # POD documentation - main docs before the code
17 Bio::DB::Ace - Database object interface to ACeDB servers
21 $db = Bio::DB::Ace->new( -server => 'myace.server.com', port => '120000');
23 $seq = $db->get_Seq_by_id('J00522'); # Unique ID
27 $seq = $db->get_Seq_by_acc('J00522'); # Accession Number
31 This provides a standard BioPerl database access to Ace, using Lincoln Steins
32 excellent AcePerl module. You need to download and install the aceperl module from
34 http://stein.cshl.org/AcePerl/
36 before this interface will work.
38 This interface is designed at the moment to work through a aceclient/aceserver
41 =head1 INSTALLING ACEPERL
43 Download the latest aceperl tar file, gunzip/untar and cd into the directory.
44 This is a standard CPAN-style directory, so if you go
51 Then you will have installed Aceperl. Use the PREFIX mechanism to install elsewhere.
57 User feedback is an integral part of the evolution of this
58 and other Bioperl modules. Send your comments and suggestions preferably
59 to one of the Bioperl mailing lists.
60 Your participation is much appreciated.
62 bioperl-l@bioperl.org - General discussion
63 http://bioperl.org/wiki/Mailing_lists - About the mailing lists
67 Please direct usage questions or support issues to the mailing list:
69 I<bioperl-l@bioperl.org>
71 rather than to the module maintainer directly. Many experienced and
72 reponsive experts will be able look at the problem and quickly
73 address it. Please include a thorough description of the problem
74 with code and data examples if at all possible.
78 Report bugs to the Bioperl bug tracking system to help us keep track
79 the bugs and their resolution. Bug reports can be submitted via the
82 https://redmine.open-bio.org/projects/bioperl/
84 =head1 AUTHOR - Ewan Birney
86 Email birney@ebi.ac.uk
90 The rest of the documentation details each of the object methods. Internal methods are usually preceded with a _
94 # Let the code begin...
99 # Object preamble - inherits from Bio::DB::RandomAccessI
106 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 $@";
111 use base
qw(Bio::DB::RandomAccessI);
113 # new() is inherited from Bio::DB::Abstract
115 # _initialize is where the heavy stuff will happen when new is called
118 my($class,@args) = @_;
119 my $self = $class->SUPER::new
(@args);
120 my ($host,$port) = $self->_rearrange([qw(
127 if( !$host || !$port ) {
128 $self->throw("Must have a host and port for an acedb server to work");
131 my $aceobj = Ace
->connect(-host
=> $host,
133 $self->throw("Could not make acedb object to $host:$port");
135 $self->_aceobj($aceobj);
143 Title : get_Seq_by_id
144 Usage : $seq = $db->get_Seq_by_id($uid);
145 Function: Gets a Bio::Seq object by its unique identifier/name
146 Returns : a Bio::Seq object
147 Args : $id : the id (as a string) of the desired sequence entry
153 my $id = shift or $self->throw("Must supply an identifier!\n");
154 my $ace = $self->_aceobj();
157 $seq = $ace->fetch( 'Sequence' , $id);
159 # get out the sequence somehow!
161 $dna = $seq->asDNA();
166 $out = Bio
::Seq
->new( -id
=> $id, -alphabet
=> 'Dna', -seq
=> $dna, -name
=> "Sequence from Bio::DB::Ace $id");
171 =head2 get_Seq_by_acc
173 Title : get_Seq_by_acc
174 Usage : $seq = $db->get_Seq_by_acc($acc);
175 Function: Gets a Bio::Seq object by its accession number
176 Returns : a Bio::Seq object
177 Args : $acc : the accession number of the desired sequence entry
185 my $acc = shift or $self->throw("Must supply an accession number!\n");
187 return $self->get_Seq_by_id($acc);
193 Usage : $ace = $db->_aceobj();
194 Function: Get/Set on the acedb object
196 Args : New value of the ace object
201 my ($self,$arg) = @_;
204 $self->{'_aceobj'} = $arg;
207 return $self->{'_aceobj'};