Bio::Phylo::Parsers::Taxlist - Parser used by Bio::Phylo::IO, no serviceable parts inside


Bio-Phylo documentation Contained in the Bio-Phylo distribution.

Index


Code Index:

NAME

Top

Bio::Phylo::Parsers::Taxlist - Parser used by Bio::Phylo::IO, no serviceable parts inside

DESCRIPTION

Top

This module is used for importing sets of taxa from plain text files, one taxon on each line. It is called by the Bio::Phylo::IO object, so look there for usage examples. If you want to parse from a string, you may need to indicate the field separator (default is '\n') to the Bio::Phylo::IO->parse call:

 -fieldsep => '\n',

SEE ALSO

Top

Bio::Phylo::IO

The taxon list parser is called by the Bio::Phylo::IO object. Look there for examples.

Bio::Phylo::Manual

Also see the manual: Bio::Phylo::Manual and http://rutgervos.blogspot.com.

CITATION

Top

If you use Bio::Phylo in published research, please cite it:

Rutger A Vos, Jason Caravas, Klaas Hartmann, Mark A Jensen and Chase Miller, 2011. Bio::Phylo - phyloinformatic analysis using Perl. BMC Bioinformatics 12:63. http://dx.doi.org/10.1186/1471-2105-12-63

REVISION

Top

 $Id: Taxlist.pm 1660 2011-04-02 18:29:40Z rvos $


Bio-Phylo documentation Contained in the Bio-Phylo distribution.
# $Id: Taxlist.pm 1660 2011-04-02 18:29:40Z rvos $
package Bio::Phylo::Parsers::Taxlist;
use strict;
use base 'Bio::Phylo::Parsers::Abstract';

sub _parse {
    my $self = shift;
    my $fh   = $self->_handle;
    my $fac  = $self->_factory;
    my $taxa = $fac->create_taxa;
    local $/ = $self->_args->{'-fieldsep'} || "\n";
    while (<$fh>) {
        chomp;
        $taxa->insert( $fac->create_taxon( '-name' => $_ ) );
    }
    return $taxa;
}

# podinherit_insert_token

1;