Bio-RNA-Treekin

 view release on metacpan or  search on metacpan

lib/Bio/RNA/Treekin/MultiRecord.pm  view on Meta::CPAN

# Bio/RNA/Treekin/MultiRecord.pm
package Bio::RNA::Treekin::MultiRecord;
our $VERSION = '0.05';

use 5.006;
use strict;
use warnings;

use Moose;
use MooseX::StrictConstructor;
use namespace::autoclean;

use autodie qw(:all);

extends 'IO::File::RecordStream';

has '+_record_factory' => (     # + means overwrite inherited attribute
    is       => 'ro',
    init_arg => undef,
    default  => sub { return sub { Bio::RNA::Treekin::Record->new(@_); } },
);

has '+match_separator' => (     # + means overwrite inherited attribute
    is       => 'ro',
    init_arg => undef,
    default  => sub {
                     qr{ ^ & $ }x  # match a line consisting of single '&'
                },
);

__PACKAGE__->meta->make_immutable;

1; # End of Bio::RNA::Treekin::MultiRecord


__END__


=pod

=encoding UTF-8

=head1 NAME

Bio::RNA::Treekin::MultiRecord - Stream records from a multi-record I<Treekin>
file.

=head1 SYNOPSIS

    use Bio::RNA::Treekin;

    # Open the multi-record Treekin file.
    my $record_stream = Bio::RNA::Treekin::MultiRecord->new(
                            'multi_treekin.out');

    # Iterate over the individual records.
    while (defined (my $record = $record_stream->next)) {
        ...         # do something with the Treekin record
    }

=head1 DESCRIPTION

This class provides a stream to read individual records from multi-record
I<Treekin> files as generated by the RNA folding simulation tool I<BarMap>.

=head1 METHODS

This class extends L<IO::File::RecordStream> and offers the same methods.
Below, only the differences are described.

=head2 Bio::RNA::Treekin::MultiRecord->new($treekin_file)



( run in 2.192 seconds using v1.01-cache-2.11-cpan-39bf76dae61 )