Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
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
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 musing on the Monastery: (5)
As of 2014-10-25 21:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (149 votes), past polls