Skip to content

Instantly share code, notes, and snippets.

@jhannah
Created July 19, 2010 21:49
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save jhannah/482081 to your computer and use it in GitHub Desktop.
jhannah@jaysnet-MacBook:~/src/bioperl-live/t/SeqFeature$ cat Store-SQLite.t
use Test::More tests => 2;
use strict;
use Bio::SeqIO;
use Bio::DB::SeqFeature::Store;
my $db = Bio::DB::SeqFeature::Store->new(
-adaptor => 'DBI::SQLite',
-dsn => 'test.sqlite',
-write => 1,
-create => 1,
);
my $in = Bio::SeqIO->new(-format=>'embl', -file=>"../data/test.embl");
my $seq = $in->next_seq;
my $count;
foreach my $feat ($seq->get_SeqFeatures()) {
$db->store($feat);
last if (++$count == 3);
}
is($db->seq_ids, 1, "1 sequence loaded into test.sqlite");
is($db->features, 3, "3 features loaded into test.sqlite");
my $cmd = "perl ~/src/bioperl-live/scripts/Bio-SeqFeature-Store/bp_seqfeature_gff3.PLS --adaptor=DBI::SQLite --dsn=test.sqlite";
print "$cmd\n";
# system ($cmd);
$ perl Store-SQLite.t
1..2
ok 1 - 1 sequence loaded into test.sqlite
ok 2 - 3 features loaded into test.sqlite
$ perl ~/src/bioperl-live/scripts/Bio-SeqFeature-Store/bp_seqfeature_gff3.PLS --adaptor=DBI::SQLite --dsn=test.sqlite
Can't locate object method "gff3_string" via package "Bio::SeqFeature::Generic" at /Users/jhannah/src/bioperl-live/scripts/Bio-SeqFeature-Store/bp_seqfeature_gff3.PLS line 58.
jhannah@jaysnet-MacBook:~/src/bioperl-live/t/SeqFeature$
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment