4 # Fetch sequence data via OBDA registry system
6 # usage: rfetch -i <file_with_accession_list> -a -v -d embl -s start -e end
14 my $database = 'embl_biosql';
23 'd|database:s' => \
$database,
24 's|start:i' => \
$start,
26 'f|format:s' => \
$format,
27 'i|input:s' => \
$file,
29 'v|verbose' => \
$verbose,
33 my $registry = Bio
::DB
::Registry
->new();
35 my $db = $registry->get_database($database);
37 my $seqout = Bio
::SeqIO
->new( '-format' => $format, '-fh' => \
*STDOUT
);
42 open my $F, '<', $file or die "Could not read file '$file': $!\n";
52 foreach my $id ( @ids ) {
55 print STDERR
"fetching $id\n";
59 $seq = $db->get_Seq_by_acc($id);
61 $seq = $db->get_Seq_by_id($id);
64 if( defined $start && defined $end ) {
65 $seq = $seq->trunc($start,$end);
68 $seqout->write_seq($seq);