3 # OBDA Registry compliant sequence retrieval script
5 # Copyright Heikki Lehvaslaiho <heikki-at-bioperl-dot-org>
6 # You may distribute this program under the same terms as perl itself
15 my ($help, $format, $namespace, $dbname) = ('', 'embl', 'acc', 'embl');
16 GetOptions
("help" => \
$help, "format=s" => \
$format,
17 "namespace=s" => \
$namespace, "dbname=s" => \
$dbname );
18 if ($help || !@ARGV) {
23 my $get_function = 'get_Seq_by_'. $namespace;
25 my $registry = new Bio
::DB
::Registry
();
26 while (my $id = shift) {
27 my $db = $registry->get_database($dbname);
28 my $seq = $db->$get_function($id);
31 my $out = new Bio
::SeqIO
('-format' => $format);
32 $out->write_seq($seq);
34 print STDERR
"Could not find sequence with identifier [$id]\n";
40 bp_biogetseq - sequence retrieval using OBDA registry
44 This script retrieves sequences from the source defined by users
45 registry setup. The current alternatives are from a local indexed
46 file, sql database or over the web.
50 Usage: bp_biogetseq --dbname embl --format embl
51 --namespace acc id [ ids... ]
52 * dbname defaults to embl
53 * format defaults to embl
54 * namespace defaults to 'acc' ['id', 'acc', 'version']
55 * unnamed arguments are ids in the given namespace