Bio::D...:SQLite(3pm)

πŸ“¦
version 1.7.5 Β· 4 versions
, in ubuntu resolute, ubuntu stonking

πŸŽ€ Bio::DB::SeqFeature::Store::DBI::SQLite πŸŽ€

okay bestie, so this is the manual page for Bio::DB::SeqFeature::Store::DBI::SQLite β€” the SQLite adaptor situation. buckle up, it's giving database but make it cute ✨


✨ NAME ✨

Bio::DB::SeqFeature::Store::DBI::SQLite β€” it's the SQLite implementation of Bio::DB::SeqFeature::Store. no cap, that's literally it πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

here's the whole vibe, copy-paste ready:

  use Bio::DB::SeqFeature::Store;

  # Open the sequence database
  my $db = Bio::DB::SeqFeature::Store->new(-adaptor => 'DBI::SQLite',
                                           -dsn     => '/path/to/database.db');

  # get a feature from somewhere
  my $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 out
  my $f  = $db->fetch($id);

  # change the feature and update it
  $f->start(100);
  $db->update($f) or die "Couldn't update!";

  # searching...
  # ...by id
  my @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 iterator
  my $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 region
  my $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 database
  my $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. bestie, do not try to build it yourself directly β€” you go through Bio::DB::SeqFeature::Store->new() and let it do the work. that's the whole point 🫢

for the complete usage instructions, go read Bio::DB::SeqFeature::Store. it's the main character, this one's the supporting role.

🌸 Using the SQLite adaptor 🌸

to connect to the database, you call:

Bio::DB::SeqFeature::Store->new(-adaptor=>'DBI::SQLite',@more_args)

and then the extra arguments are these cuties right here:

  • -dsn β€” the path to the SQLite database file. that's your whole location, periodt.
  • -namespace β€” a prefix that gets attached to each table. this is how you get several virtual databases living inside the same physical database. iconic, honestly ✨
  • -temp β€” boolean flag. if it's true, a temporary database gets created and then destroyed as soon as the Store object goes out of scope. (also goes by -temporary, iykyk)
  • -autoindex β€” boolean flag. if it's true, features in the database get reindexed every single time they change. and yes, this is the default. it's just like that πŸ’…
  • -fts β€” boolean flag. if it's true, and when the -create flag is true, the attribute table will be created and indexed index for full-text search using the most recent FTS extension supported by DBD::SQLite. πŸ”₯
  • -tmpdir β€” the directory where temporary files go during "fast" loading. it defaults to File::Spec->tmpdir(). (synonyms: -dump_dir, -dumpdir, -tmp)
  • -dbi_options β€” a hashref that gets passed to DBI->connect's 4th argument, the "attributes." (synonyms: -options, -dbi_attr)
  • -write β€” pass true to open the database for writing or updating. πŸ–ŠοΈ

if it all works out, you get back a brand new instance of Bio::DB::SeqFeature::Store::DBI::SQLite. slay.

and on top of all the standard methods that every well-behaved Bio::DB::SeqFeature::Store database supports, there are also several adaptor-specific methods, described in the next sections. yes, more content, we love to see it πŸŽ€

🧚 toplevel_types 🧚

  Title   : toplevel_types
  Usage   : @type_list = $db->toplevel_types
  Function: Get the toplevel types in the database
  Returns : array of Bio::DB::GFF::Typename objects
  Args    : none
  Status  : public

this one is similar to types() but it only returns the types of INDEXED (toplevel) features. lowkey a glow-up of the original, no cap ⭐


πŸ‘‘ AUTHOR πŸ‘‘

Nathan Weeks β€” Nathan.Weeks@ars.usda.gov

Copyright (c) 2009 Nathan Weeks

Modified 2010 to support cumulative statistics by Lincoln Stein <lincoln.stein@gmail.com>.

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.


and that's the whole page, bestie πŸ’– this was perl v5.40.0, dated 2024-10-11, and it's the Bio::DB::SeqFeature::Store::DBI::SQLite manual β€” ate and left no crumbs πŸŒˆπŸ¦‹πŸ“

πŸ“¦ where this page comes from