NAME
Bio::DB::SeqFeature::Store::DBI::SQLite -- SQLite implementation of Bio::DB::SeqFeature::Store
SYNOPSIS
use Bio::DB::SeqFeature::Store;# Open the sequence databasemy $db = Bio::DB::SeqFeature::Store->new(-adaptor => 'DBI::SQLite',-dsn => '/path/to/database.db');# get a feature from somewheremy $feature = Bio::SeqFeature::Generic->new(...);# store it$db->store($feature) or die "Couldn't store!";# primary ID of the feature is changed to indicate its primary ID# in the database...my $id = $feature->primary_id;# get the feature back outmy $f = $db->fetch($id);# change the feature and update it$f->start(100);$db->update($f) or die "Couldn't update!";# searching...# ...by idmy @features = $db->fetch_many(@list_of_ids);# ...by name@features = $db->get_features_by_name('ZK909');# ...by alias@features = $db->get_features_by_alias('sma-3');# ...by type@features = $db->get_features_by_name('gene');# ...by location@features = $db->get_features_by_location(-seq_id=>'Chr1',-start=>4000,-end=>600000);# ...by attribute@features = $db->get_features_by_attribute({description => 'protein kinase'})# ...by the GFF "Note" field@result_list = $db->search_notes('kinase');# ...by arbitrary combinations of selectors@features = $db->features(-name => $name,-type => $types,-seq_id => $seqid,-start => $start,-end => $end,-attributes => $attributes);# ...using an iteratormy $iterator = $db->get_seq_stream(-name => $name,-type => $types,-seq_id => $seqid,-start => $start,-end => $end,-attributes => $attributes);while (my $feature = $iterator->next_seq) {# do something with the feature}# ...limiting the search to a particular regionmy $segment = $db->segment('Chr1',5000=>6000);my @features = $segment->features(-type=>['mRNA','match']);# getting & storing sequence information# Warning: this returns a string, and not a PrimarySeq object$db->insert_sequence('Chr1','GATCCCCCGGGATTCCAAAA...');my $sequence = $db->fetch_sequence('Chr1',5000=>6000);# what feature types are defined in the database?my @types = $db->types;# create a new feature in the databasemy $feature = $db->new_feature(-primary_tag => 'mRNA',-seq_id => 'chr3',-start => 10000,-end => 11000);
DESCRIPTION
Bio::DB::SeqFeature::Store::SQLite is the SQLite adaptor for Bio::DB::SeqFeature::Store. You will not create it directly, but instead use Bio::DB::SeqFeature::Store->new() to do so.
See Bio::DB::SeqFeature::Store for complete usage instructions.
Using the SQLite adaptor
To establish a connection to the database, call Bio::DB::SeqFeature::Store->new(-adaptor=>'DBI::SQLite',@more_args). The additional arguments are as follows:
Argument name Description------------- ------------dsn The path to the SQLite database file.-namespace A prefix to attach to each table. This allows youto have several virtual databases in the samephysical database.-temp Boolean flag. If true, a temporary databasewill be created and destroyed as soon asthe Store object goes out of scope. (synonym -temporary)-autoindex Boolean flag. If true, features in the database will bereindexed every time they change. This is the default.-fts Boolean flag. If true, when the -create flag is true, theattribute table will be created and indexed index forfull-text search using the most recent FTS extensionsupported by DBD::SQLite.-tmpdir Directory in which to place temporary files during "fast" loading.Defaults to File::Spec->tmpdir(). (synonyms -dump_dir, -dumpdir, -tmp)-dbi_options A hashref to pass to DBI->connect's 4th argument, the "attributes."(synonyms -options, -dbi_attr)-write Pass true to open database for writing or updating.
If successful, a new instance of Bio::DB::SeqFeature::Store::DBI::SQLite will be returned.
In addition to the standard methods supported by all well-behaved Bio::DB::SeqFeature::Store databases, several following adaptor-specific methods are provided. These are described in the next sections.
toplevel_types
Title : toplevel_typesUsage : @type_list = $db->toplevel_typesFunction: Get the toplevel types in the databaseReturns : array of Bio::DB::GFF::Typename objectsArgs : noneStatus : public
This is similar to types() but only returns the types of INDEXED (toplevel) features.
AUTHOR
Nathan Weeks - [email protected]
Copyright (c) 2009 Nathan Weeks
Modified 2010 to support cumulative statistics by Lincoln Stein <[email protected]>.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See the Bioperl license for more details.