2
# $Id: bp_seqfeature_gff3.PLS 15088 2008-12-04 02:49:09Z bosborne $
3
# AUTHOR: malcolm.cook@stowers-institute.org
9
use Bio::DB::SeqFeature::Store;
22
'adaptor=s' => \$ADAPTOR,
24
'password=s' => \$PASS,
25
'gff3opt=i{,}' => \@gff3opt,
27
Usage: $0 [options] -- [WHICH FEATURES]
28
output GFF3 for selected database features
30
-d --dsn The database name ($DSN)
31
-a --adaptor The storage adaptor to use ($ADAPTOR)
32
-u --user User to connect to database as
33
-p --password Password to use to connect to database
34
-g --gff3opt flag options to gff3_string (i.e.: pass -gffopt 1 to recurse)
36
WHICH FEATURES: any remaining options after '--' will select
37
a subset of features. The arguments are identical to those
38
accepted by Bio::DB::SeqFeature::Store->features().
42
$ADAPTOR ||= 'DBI::mysql';
43
$DSN ||= $ADAPTOR eq 'DBI::mysql' ? "mysql_read_default_file=$ENV{HOME}/.my.cnf" : '';
45
my $store = Bio::DB::SeqFeature::Store->new(
51
or die "Couldn't create connection to the database";
53
# on signals, give objects a chance to call their DESTROY methods
54
$SIG{TERM} = $SIG{INT} = sub { undef $store; die "Aborted..."; };
56
my $seq_stream = $store->get_seq_stream(@ARGV) or die "failed to get_seq_stream(@ARGV)";
57
while (my $seq = $seq_stream->next_seq) {
58
print $seq->gff3_string(@gff3opt) . "\n";