Bio::Das::ProServer::SourceAdaptor::Transport::file


NAME

Bio::Das::ProServer::SourceAdaptor::Transport::file

Back to Top


VERSION

$Revision: 688 $

Back to Top


SYNOPSIS

Back to Top


DESCRIPTION

A simple data transport for tab-separated files. Access is via the 'query' method. Expects a file with no header line. By default, fields are expected to be separated with tab characters.

Can optionally cache the file contents upon first usage. This may improve subsequence response speed at the expense of memory footprint.

Back to Top


SUBROUTINES/METHODS

query - Execute a basic query against a text file

 Queries are of the form:
 $filetransport->query(qq(field1 = 'value')); # =, == and eq operators all do the same thing
 $filetransport->query(qq(field1 lceq 'value'));
 $filetransport->query(qq(field3 like '%value%'));
 $filetransport->query(qq(field0 = 'value' && field1 = 'value'));
 $filetransport->query(qq(field0 = 'value' and field1 = 'value'));
 $filetransport->query(qq(field0 = 'value' and field1 = 'value' and field2 = 'value'));
 "OR" compound queries not (yet) supported

last_modified - machine time of last data change

  $dbitransport->last_modified();

DESTROY - object destructor - disconnect filehandle

  Generally not directly invoked, but if you really want to -
  $filetransport->DESTROY();

Back to Top


DIAGNOSTICS

Run ProServer with the -debug flag.

Back to Top


CONFIGURATION AND ENVIRONMENT

Configured as part of each source's ProServer 2 INI file:

  [myfile]
  ... source configuration ...
  transport = file
  filename  = /data/features.tsv
  ; optional values:
  unique    = 1
  cache     = 1
  comment   = ^#
  separator = \t
  If specified, query results can be treated as unique, preventing a full file
  parse when the first match is found. The default is to find all matches.
  If specified, file contents may be pre-cached in memory. The default is to
  re-read the file for every query.
  The field separator may be specified as a regular expression. The default is
  /\t/.
  Comments can be detected and ignored by providing a regular expression. There
  is no default.

Back to Top


DEPENDENCIES

File::stat
Bio::Das::ProServer::SourceAdaptor::Transport::generic

Back to Top


INCOMPATIBILITIES

Back to Top


BUGS AND LIMITATIONS

Only AND compound queries are supported.

Back to Top


AUTHOR

Roger Pettett <rmp@sanger.ac.uk> and Andy Jenkinson <aj@ebi.ac.uk>

Back to Top


LICENSE AND COPYRIGHT

Copyright (c) 2008 The Sanger Institute and EMBL-EBI

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See DISCLAIMER.txt for disclaimers of warranty.

Back to Top

 Bio::Das::ProServer::SourceAdaptor::Transport::file