NAME

CracTools::GFF::Query - Query GFF files easily.

SYNOPSIS

Usage:

use CracTools::GFF::Query;

# Creating the reader
my $gffQuery = CracTools::GFF::Query->new('annotations.gff');

my @annotations = $gffQuery->fetchByLocation('1',298345,'+');

foreach my $gff_line (@annotations) {
  my $annotation = CracTools::GFF::Annotation->new($gff_line);
  print "Gene_id : ",$annotation->getAttribute('gene_id'),"\n";
}

DESCRIPTION

CracTools::GFF::Query is a tool to query GFF files without building a database. It is memory efficient and designed to run fast. You can easily retrives GFF data from a specific region of position. This tool can be use with CracTools::GFF::Annotation in order to parse GFF line into a nice usable Perl Object.

METHODS

new

Arg [1] : String - GFF file

Example     : my $gffQuery = CracTools::GFF::Query->new('annotations.gff');
Description : Create a new GFF Query object
ReturnType  : CracTools::GFF::Query
Exceptions  : none

fetchByRegion

Arg [1] : String $seq_region_name
          The name of the sequence region that the slice will be
          created on.
Arg [2] : int $start
          The start of the slice on the sequence region
Arg [3] : int $end
          The end of the slice on the sequence region
Arg [4] : int $strand
          The orientation of the slice on the sequence region

Example     : my @annotations = $gffQuery->fetchByRegion('1',298345,309209,'+');
Description : Retrives GFF lines that belong to the region.
ReturnType  : Reference to an Array of strings
Exceptions  : none

fetchByLocation

Arg [1] : String $seq_region_name
          The name of the sequence region that the slice will be
          created on.
Arg [2] : int $position
          Location to look for
Arg [3] : int $strand
          The orientation of the slice on the sequence region

Example     : my @annotations = $gffQuery->fetchByLocation('1',298345,'+');
Description : Retrives GFF lines that overlapped the given location.
ReturnType  : Reference to an Array of strings
Exceptions  : none

GETTERS AND SETTERS

gffFile

Description : Getter method for the attribute gff_file

PRIVATE METHODS

STATIC METHODS

convertStrand

Arg [1] : Character - strand using '+' and '-' signs

Description : Retrun the strand using the (1,-1) convention
              instead of the ('+','-') convention of GFF files.