---
name: "Bio::DB::GFF::Adaptor::memory"
section: "3pm"
platform: "linux"
package: "libbio-db-gff-perl"
version: "1.7.4-1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/Bio::DB::GFF::Adaptor::memory"
---

# Bio::DB::GFF::Adaptor::memory(3pm)

## NAME

Bio::DB::GFF::Adaptor::memory -- Bio::DB::GFF database adaptor for in-memory databases

## SYNOPSIS

```
  use Bio::DB::GFF;
  my $db = Bio::DB::GFF->new(-adaptor=> 'memory',
                             -gff    => 'my_features.gff',
                             -fasta  => 'my_dna.fa'
                            );
```

or

```
  my $db = Bio::DB::GFF->new(-adaptor=>'memory');
  $db->load_gff_file('my_features.gff');
  $db->load_fasta_file('my_dna.fa');
```

See Bio::DB::GFF for other methods.

## DESCRIPTION

This adaptor implements an in-memory version of Bio::DB::GFF.  It can be used to store and retrieve SHORT GFF files. It inherits from Bio::DB::GFF.

## CONSTRUCTOR

Use Bio::DB::GFF-\>**new()** to construct new instances of this class. Three named arguments are recommended:

```
   Argument         Description
   -adaptor         Set to "memory" to create an instance of this class.
   -gff             Read the indicated file or directory of .gff file.
   -fasta           Read the indicated file or directory of fasta files.
   -dir             Indicates a directory containing .gff and .fa files
```

If you use the -dir option and the indicated directory is writable by the current process, then this library will create a FASTA file index that greatly diminishes the memory usage of this module.

Alternatively you may create an empty in-memory object using just the -adaptor=\>'memory' argument and then call the **load\_gff\_file()** and **load\_fasta\_file()** methods to load GFF and/or sequence information. This is recommended in CGI/mod\_perl/fastCGI environments because these methods do not modify STDIN, unlike the constructor.

## METHODS

See Bio::DB::GFF for inherited methods.

## BUGS

none ;-)

## SEE ALSO

Bio::DB::GFF, bioperl

## AUTHOR

Shuly Avraham \<avraham@cshl.org\>.

Copyright (c) 2002 Cold Spring Harbor Laboratory.

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

### \_feature\_by\_name

```
 Title   : _feature_by_name
 Usage   : $db->get_features_by_name($name,$class,$callback)
 Function: get a list of features by name and class
 Returns : count of number of features retrieved
 Args    : name of feature, class of feature, and a callback
 Status  : protected
```

This method is used internally.  The callback arguments are those used by **make\_feature()**.
