Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re^3: splitting fasta file into individual fasta files

by citromatik (Curate)
on May 07, 2009 at 09:13 UTC ( #762534=note: print w/ replies, xml ) Need Help??


in reply to Re^2: splitting fasta file into individual fasta files
in thread splitting fasta file into individual fasta files

You can use Tie::File::AnyData::Bio::Fasta to facilitate this task. This script reads a multi-fasta file and splits it in multiple single-fasta files:

use strict; use warnings; use Tie::File::AnyData::Bio::Fasta; tie my @in,'Tie::File::AnyData::Bio::Fasta', shift @ARGV, or die $!; my $n = 0; for my $seq (@in){ tie my @out, 'Tie::File::AnyData::Bio::Fasta', "$n.fa" or die $!; $n++; @out = ($seq); untie @out; } untie @in;

citromatik


Comment on Re^3: splitting fasta file into individual fasta files
Download Code
Replies are listed 'Best First'.
Re^4: splitting fasta file into individual fasta files
by lomSpace (Scribe) on May 07, 2009 at 16:06 UTC
    citromatik,
    Thanks. I have installed the files into 'C:\Perl\site\lib' and
    'C:\Perl\lib' on my windows system, but the error keeps stating that
    it 'Can't locate Tie/File/AnyData/Bio/Fasta.pm in @INC (@INC contains: C:/Perl/site/lib C:/Perl/lib .)'
    What could I be doing wrong?

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://762534]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (10)
As of 2015-07-30 10:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (271 votes), past polls