in reply to Re: Refomating a large fasta file...
in thread Refomating a large fasta file...

This is a great suggestion. However, I have attempted to use the various bioperl modules, but to no avail. Again, I'm still new to computer programming in general, and the lack of good documentation for bioperl modules has left me with little more than headaches :-). I'm working on using your suggestion currently, and also intend to join the mailing list. Thanks!!
Bioinformatics
  • Comment on Re: Re: Refomating a large fasta file...

Replies are listed 'Best First'.
Re: Re: Re: Refomating a large fasta file...
by Itatsumaki (Friar) on Nov 19, 2003 at 18:19 UTC

    As I reread your initial post, I suspect you want to split nt into smaller chunks and write those to file. Here is a script I've been using to do that

    ### USAGE # perl -w splitter.pl <filename> <seq-per-file> # e.g. perl -w splitter.pl nt 20000 ### INCLUDES use strict; use Bio::SeqIO; ### LOCALS my $infile = $ARGV[0]; my $size = $ARGV[1]; my $i = 0; my $j = 1; ### OBJECT INSTANTIATION my $in = Bio::SeqIO->new( -file => $infile, -format => 'Fasta', ); my $out = Bio::SeqIO->new( -file => ">$infile"."_$j.fasta", -format => 'Fasta', ); ### PROCESS FILES while ( my $seq = $in->next_seq() ) { $i++; if ($i == $size) { $j++; $out = Bio::SeqIO->new( -file => ">$infile"."_$j.fasta", -format => 'Fasta'); $i = 0; } $out->write_seq($seq); }