Bio::DB::SeqFeature::Store::memory3pm
Usage
use Bio::DB::SeqFeature::Store;# Open the sequence databasemy $db = Bio::DB::SeqFeature::Store->new( -adaptor => 'memory',-dsn => '/var/databases/test');# search... 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_type('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);
Overview
Bio::DB::SeqFeature::Store::memory is the in-memory 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 memory adaptor
Before using the memory adaptor, populate a readable-directory on the file system with annotation and/or sequence files. The annotation files must be in GFF3 format, and sholud end in the extension .gff or .gff3. They may be compressed with "compress", "gzip" or "bzip2" (in which case the appropriate compression extension must be present as well.)
You may include sequence data inline in the GFF3 files, or put the sequence data in one or more separate FASTA-format files. These files must end with .fa or .fasta and may be compressed. Because of the way the adaptor works, you will get much better performance if you keep the sequence data in separate FASTA files.
Initialize the database using the -dsn option. This should point to the directory creating the annotation and sequence files, or to a single GFF3 file. Examples:
# load all GFF3 and FASTA files located in /var/databases/test directory$db = Bio::DB::SeqFeature::Store->new( -adaptor => 'memory',-dsn => '/var/databases/test');# load the data in a single compressed GFF3 file located at# /usr/annotations/worm.gf33.gz$db = Bio::DB::SeqFeature::Store->new( -adaptor => 'memory',-dsn => '/usr/annotations/worm.gff3.gz');
For compatibility with the Bio::DB::GFF memory adaptor, -gff is recognized as an alias for -dsn.
See Bio::DB::SeqFeature::Store for all the access methods supported by this adaptor. The various methods for storing and updating features and sequences into the database are supported, including GFF3 loading support, but since this is an in-memory adaptor all changes you make will be lost when the script exits.
types
Title : typesUsage : @type_list = $db->typesFunction: Get all the types in the databaseReturns : array of Bio::DB::GFF::Typename objects (arrayref in scalar context)Args : noneStatus : public
Releases
9 releases since Debian 5.0 (Lenny); the text changed 8 times.