Florent Angly > Bio-Community-0.001000 > Bio::Community::IO::FormatGuesser

Download:
Bio-Community-0.001000.tar.gz

Dependencies

Annotate this POD

Website

View/Report Bugs
Source   Latest Release: Bio-Community-0.001007

NAME ^

Bio::Community::IO::FormatGuesser - Determine the format used by a community file

SYNOPSIS ^

  use Bio::Community::IO::FormatGuesser;

  my $guesser = Bio::Community::IO::FormatGuesser->new(
     -file => 'file.txt',
  );
  my $format = $guesser->guess;

DESCRIPTION ^

Given a file containing one or several communities, try to guess the file format used by examining the file content (not by looking at the file name).

The guess() method will examine the data, line by line, until it finds a line that is specific to a format. If no conclusive guess can be made, undef is returned.

If the Bio::Community::IO::FormatGuesser object is given a filehandle which is seekable, it will be restored to its original position on return from the guess() method.

Formats

The following formats are currently supported:

See the documentation for the corresponding IO drivers to read and write these formats in the Bio::Community::IO::* namespace.

AUTHOR ^

Florent Angly florent.angly@gmail.com

This module was inspired and based on the Bio::IO::GuessSeqFormat module written by Andreas Kähäri <andreas.kahari@ebi.ac.uk> and contributors. Thanks to them!

SUPPORT AND BUGS ^

User feedback is an integral part of the evolution of this and other Bioperl modules. Please direct usage questions or support issues to the mailing list, bioperl-l@bioperl.org, rather than to the module maintainer directly. Many experienced and reponsive experts will be able look at the problem and quickly address it. Please include a thorough description of the problem with code and data examples if at all possible.

If you have found a bug, please report it on the BioPerl bug tracking system to help us keep track the bugs and their resolution: https://redmine.open-bio.org/projects/bioperl/

COPYRIGHT ^

Copyright 2011,2012,2013 by the BioPerl Team bioperl-l@bioperl.org

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.10.1 or, at your option, any later version of Perl 5 you may have available.

APPENDIX ^

The rest of the documentation details each of the object methods. Internal methods are usually preceded with a _

new

 Function: Create a new Bio::Community::IO::FormatGuesser object
 Usage   : my $guesser = Bio::Community::IO::FormatGuesser->new( );
 Args    : -text, -file or -fh. If more than one of these arguments was
           provided, only one is used: -text has precendence over -file, which
           has precedence over -fh.
 Returns : a new Bio::Community::IO::FormatGuesser object

file

 Usage   : my $file = $guesser->file;
 Function: Get or set the file from which to guess the format
 Args    : file path (string)
 Returns : file path (string)

fh

 Usage   : my $fh = $guesser->fh;
 Function: Get or set the file handle from which to guess the format. 
 Args    : file handle
 Returns : file handle

text

 Usage   : my $text = $guesser->text;
 Function: Get or set the text from which to guess the format. In most, if not
           all cases, the first few lines of a text string should be enough to
           determine the format.
 Args    : text string
 Returns : text string

guess

 Function: Guess the file format
 Usage   : my $format = $guesser->guess;
 Args    : format string (e.g. generic, qiime, etc)
 Returns : format string (e.g. generic, qiime, etc)
syntax highlighting: