Tie-File-AnyData-Bio-Fasta

NAME

	Tie::File::AnyData::Bio::Fasta - Accessing fasta records in a file via a Perl array.


SYNOPSIS
	
	    use Tie::File::AnyData::Bio::Fasta;

	    ## Process the fasta records in a file 1 by 1:
	    my $fastafile = "seqs.fa"; ## File containing some fasta sequences
	    tie my @fa_array, 'Tie::File::AnyData::Bio::Fasta', $fastafile or die $!;
	    for my $fa_rec (@fa_array){
	       ## Process the record
	    }
	    untie @fa_array;

	    ## Take randomly 10 fasta sequences from a file and put them in another one:
	    use Fcntl qw/O_RDONLY O_RDWR O_CREAT/;
	    use List::Util qw/shuffle/;
	    tie my @in,  'Tie::File::AnyData::Bio::Fasta', $in_fasta, mode => O_RDONLY or die $!;
	    tie my @out, 'Tie::File::AnyData::Bio::Fasta', $out_fasta, mode => O_RDWR | O_CREAT or die $!;
	    @out = (shuffle @in)[0..10];
	    untie @in;
	    untie @out;

	    ## All the array operations are allowed:
	    push @fa_array, $fasta_rec; ## Append a fasta record at the end of the file
	    unshift @fa_array, $fasta_red; ## Put a fasta record at the beginning of the file
	    my $fasta_rec = pop  @fa_array; ## Remove the last record of the file (assigned to $fasta_rec)
	    my $fasta_rec = shift @fa_array; ## Remove the first record of the file (assigned to $fasta_rec)


DESCRIPTION

	Tie::File::AnyData::Bio::Fasta allows the management of fasta files via a Perl array through
	Tie::File::AnyData, so read the documentation of this module for further details on its internals.


PARAMETERS

	This module accepts the same parameters as C<Tie::File> except C<recsep>,
	that is always assigned to C<\r\n> if it is run on a Windows machine or C<\n> otherwise.


INSTALLATION

	To install this module, run the following commands:

	    perl Makefile.PL
	    make
	    make test
	    make install


AUTHOR

	Miguel Pignatelli

	Please send any comment to: motif@pause.org

	The most recent version of this module, should be available at CPAN.




SUPPORT AND DOCUMENTATION

	After installing, you can find documentation for this module with the perldoc command.

	    perldoc Tie::File::AnyData::Bio::Fasta

	You can also look for information at:

	    Search CPAN
	        http://search.cpan.org/dist/Tie-File-AnyData-Bio-Fasta

	    CPAN Request Tracker:
	        http://rt.cpan.org/NoAuth/Bugs.html?Dist=Tie-File-AnyData-Bio-Fasta

	    AnnoCPAN, annotated CPAN documentation:
	        http://annocpan.org/dist/Tie-File-AnyData-Bio-Fasta

	    CPAN Ratings:
	        http://cpanratings.perl.org/d/Tie-File-AnyData-Bio-Fasta


COPYRIGHT AND LICENCE

	Copyright (C) 2007 Miguel Pignatelli

	This program is free software; you can redistribute it and/or modify it
	under the same terms as Perl itself.

WARRANTY

	This module comes with ABSOLUTELY NO WARRANTY.

