~ubuntu-branches/ubuntu/saucy/bioperl/saucy-proposed

« back to all changes in this revision

Viewing changes to Bio/Tools/GuessSeqFormat.pm

  • Committer: Bazaar Package Importer
  • Author(s): Charles Plessy
  • Date: 2009-03-10 07:19:11 UTC
  • mfrom: (1.2.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20090310071911-fukqzw54pyb1f0bd
Tags: 1.6.0-2
* Removed patch system (not used):
  - removed instuctions in debian/rules;
  - removed quilt from Build-Depends in debian/control.
* Re-enabled tests:
  - uncommented test command in debian/rules;
  - uncommented previously missing build-dependencies in debian/control.
  - Re-enabled tests and uncommented build-dependencies accordingly.
* Removed libmodule-build-perl and libtest-harness-perl from
  Build-Depends-Indep (provided by perl-modules).
* Better cleaning of empty directories using find -type d -empty -delete
  instead of rmdir in debian/rules (LP: #324001).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# $Id: GuessSeqFormat.pm,v 1.15.4.1 2006/10/02 23:10:32 sendu Exp $
 
1
# $Id: GuessSeqFormat.pm 11480 2007-06-14 14:16:21Z sendu $
2
2
#------------------------------------------------------------------
3
3
#
4
4
# BioPerl module Bio::Tools::GuessSeqFormat
17
17
=head1 SYNOPSIS
18
18
 
19
19
    # To guess the format of a flat file, given a filename:
20
 
    my $guesser = new Bio::Tools::GuessSeqFormat( -file => $filename );
 
20
    my $guesser = Bio::Tools::GuessSeqFormat->new( -file => $filename );
21
21
    my $format  = $guesser->guess;
22
22
 
23
23
    # To guess the format from an already open filehandle:
24
 
    my $guesser = new Bio::Tools::GuessSeqFormat( -fh => $filehandle );
 
24
    my $guesser = Bio::Tools::GuessSeqFormat->new( -fh => $filehandle );
25
25
    my $format  = $guesser->guess;
26
26
    # If the filehandle is seekable (STDIN isn't), it will be
27
27
    # returned to its original position.
28
28
 
29
29
    # To guess the format of one or several lines of text (with
30
30
    # embedded newlines):
31
 
    my $guesser = new Bio::Tools::GuessSeqFormat( -text => $linesoftext );
 
31
    my $guesser = Bio::Tools::GuessSeqFormat->new( -text => $linesoftext );
32
32
    my $format = $guesser->guess;
33
33
 
34
34
    # To create a Bio::Tools::GuessSeqFormat object and set the
35
35
    # filename, filehandle, or line to parse afterwards:
36
 
    my $guesser = new Bio::Tools::GuessSeqFormat;
 
36
    my $guesser = Bio::Tools::GuessSeqFormat->new();
37
37
    $guesser->file($filename);
38
38
    $guesser->fh($filehandle);
39
39
    $guesser->text($linesoftext);
40
40
 
41
41
    # To guess in one go, given e.g. a filename:
42
 
    my $format = new Bio::Tools::GuessSeqFormat( -file => $filename )->guess;
 
42
    my $format = Bio::Tools::GuessSeqFormat->new( -file => $filename )->guess;
43
43
 
44
44
=head1 DESCRIPTION
45
45
 
238
238
=head2 new
239
239
 
240
240
 Title      : new
241
 
 Usage      : $guesser = new Bio::Tools::GuessSeqFormat( ... );
 
241
 Usage      : $guesser = Bio::Tools::GuessSeqFormat->new( ... );
242
242
 Function   : Creates a new object.
243
243
 Example    : See SYNOPSIS.
244
244
 Returns    : A new object.
478
478
            if ($fmt->{test}($line, $lineno)) {
479
479
                ++$match;
480
480
                $fmt_string = $fmt->{fmt_string};
481
 
                # Debugging:
482
 
                #FIXME#printf STDERR "%s: %s\n", $fmt_string, $line;
483
 
                    #FIXME#if $self->verbose > 0;
484
481
            }
485
482
        }
486
483